1 8 package org.lsmp.djep.groupJep.values; 9 10 import org.lsmp.djep.groupJep.groups.AlgebraicExtension; 11 12 21 public class AlgebraicExtensionElement extends FreeGroupElement { 22 23 AlgebraicExtension ae; 24 25 35 public AlgebraicExtensionElement(AlgebraicExtension K, Number coeffs[]) 36 { 37 super(K,coeffs); 38 this.ae = K; 39 int deg_p = ae.getPoly().getDegree(); 40 while(this.getCoeffs().length > deg_p) 41 { 42 Polynomial poly2 = ae.getSubsPoly(); 43 int deg_c = this.getCoeffs().length-1; 44 Number p1Coeffs[] = new Number [deg_c-deg_p+1]; 48 Number p2Coeffs[] = new Number [deg_p]; 49 System.arraycopy(this.getCoeffs(),deg_p,p1Coeffs,0,deg_c-deg_p+1); 50 System.arraycopy(this.getCoeffs(),0,p2Coeffs,0,deg_p); 51 Polynomial p1 = new Polynomial(ae.getBaseRing(),ae.getPoly().getSymbol(),p1Coeffs); 52 Polynomial p2 = new Polynomial(ae.getBaseRing(),ae.getPoly().getSymbol(),p2Coeffs); 53 Polynomial p3 = p1.mul(poly2); 54 Polynomial p4 = p3.add(p2); 55 super.setCoeffs(p4.getCoeffs()); 56 } 57 } 58 59 60 protected Polynomial valueOf(Number lcoeffs[]) 61 { 62 AlgebraicExtensionElement g = new AlgebraicExtensionElement(ae,lcoeffs); 63 return g; 64 } 65 } 66 | Popular Tags |