All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.jas.gb.ExtendedGB Maven / Gradle / Ivy

The newest version!
/*
 * $Id: ExtendedGB.java 3445 2010-12-25 17:24:04Z kredel $
 */

package edu.jas.gb;

import java.util.List;

import edu.jas.structure.RingElem;
import edu.jas.poly.GenPolynomial;
import edu.jas.poly.GenPolynomialRing;
import edu.jas.poly.ModuleList;
import edu.jas.poly.PolynomialList;



/**
  * Container for a GB and transformation matrices.
  * A container for F, G, calG and calF.
  * Immutable objects.
  * @param  coefficient type
  * @param F an ideal base.
  * @param G a Groebner base of F.
  * @param F2G a transformation matrix from F to G.
  * @param G2F a transformation matrix from G to F.
  */
public class ExtendedGB> {

       public final List> F;
       public final List> G;
       public final List>> F2G;
       public final List>> G2F;
       public final GenPolynomialRing ring;


       public ExtendedGB( List> F,
                          List> G,
                          List>> F2G,
                          List>> G2F) {
            this.F = F;
            this.G = G;
            this.F2G = F2G;
            this.G2F = G2F;
            GenPolynomialRing r = null;
         if ( G != null ) {
               for ( GenPolynomial p : G ) {
                   if ( p != null ) {
                      r = p.ring;
                      break;
                   }
               }
               if ( r != null && r.getVars() == null ) {
                  r.setVars( r.newVars("y") );
               }
         }
            this.ring = r;
        }


        /** Get the String representation.
         * @see java.lang.Object#toString()
         */
        @Override
          public String toString() {
            PolynomialList P;
            ModuleList M;
            StringBuffer s = new StringBuffer("ExtendedGB: \n\n");
            P = new PolynomialList( ring, F );
            s.append("F = " + P + "\n\n");
            P = new PolynomialList( ring, G );
            s.append("G = " + P + "\n\n");
            M = new ModuleList( ring, F2G );
            s.append("F2G = " + M + "\n\n");
            M = new ModuleList( ring, G2F );
            s.append("G2F = " + M + "\n");
            return s.toString();
        }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy