本文整理汇总了Java中edu.jas.poly.ExpVector.signum方法的典型用法代码示例。如果您正苦于以下问题:Java ExpVector.signum方法的具体用法?Java ExpVector.signum怎么用?Java ExpVector.signum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.jas.poly.ExpVector
的用法示例。
在下文中一共展示了ExpVector.signum方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepend
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* Prepend a new leading coefficient.
* @param r variable for the direction.
* @param h new coefficient.
* @return new power series.
*/
public MultiVarPowerSeries<C> prepend(final C h, final int r) {
if (r < 0 || ring.nvar < r) {
throw new IllegalArgumentException("variable index out of bound");
}
return new MultiVarPowerSeries<C>(ring, new MultiVarCoefficients<C>(ring) {
@Override
public C generate(ExpVector i) {
if (i.isZERO()) {
return h;
}
ExpVector e = i.subst(r, i.getVal(r) - 1);
if (e.signum() < 0) {
return pfac.coFac.getZERO();
}
return coefficient(e);
}
});
}
示例2: shift
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* Shift coefficients. Multiply by exponent vector.
* @param k shift ExpVector.
* @return new power series with coefficient(i) = old.coefficient(i-k).
*/
public MultiVarPowerSeries<C> shift(final ExpVector k) {
if (k == null) {
throw new IllegalArgumentException("null ExpVector not allowed");
}
if (k.signum() == 0) {
return this;
}
int nt = Math.min(truncate + (int) k.totalDeg(), ring.truncate);
return new MultiVarPowerSeries<C>(ring, new MultiVarCoefficients<C>(ring) {
@Override
public C generate(ExpVector i) {
ExpVector d = i.subtract(k);
if (d.signum() < 0) {
return ring.coFac.getZERO();
}
return coefficient(d);
}
}, nt);
}
示例3: criterion4
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* GB criterion 4. Use only for commutative power series rings.
* @param A power series.
* @param B power series.
* @param e = lcm(ht(A),ht(B))
* @return true if the S-power-series(i,j) is required, else false.
*/
public boolean criterion4(MultiVarPowerSeries<C> A, MultiVarPowerSeries<C> B, ExpVector e) {
if (logger.isInfoEnabled()) {
if (!A.ring.equals(B.ring)) {
logger.error("rings not equal " + A.ring + ", " + B.ring);
}
if (!A.ring.isCommutative()) {
logger.error("GBCriterion4 not applicabable to non-commutative power series");
return true;
}
}
ExpVector ei = A.orderExpVector();
ExpVector ej = B.orderExpVector();
ExpVector g = ei.sum(ej);
// boolean t = g == e ;
ExpVector h = g.subtract(e);
int s = h.signum();
return !(s == 0);
}
示例4: deriviative
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* Multi-partial deriviative.
* @param i exponent vector.
* @return partial deriviative of this with respect to all variables.
*/
public TaylorFunction<C> deriviative(ExpVector i) {
GenPolynomial<C> p = pol;
long f = 1L;
if (i.signum() == 0 || pol.isZERO()) {
return new PolynomialTaylorFunction<C>(p, f);
}
for (int j = 0; j < i.length(); j++) {
long e = i.getVal(j);
if (e == 0) {
continue;
}
int jl = i.length() - 1 - j;
for (long k = 0; k < e; k++) {
p = PolyUtil.<C> baseDeriviative(p, jl);
f *= (k + 1);
if (p.isZERO()) {
return new PolynomialTaylorFunction<C>(p, f);
}
}
}
//System.out.println("i = " + i + ", f = " + f + ", der = " + p);
return new PolynomialTaylorFunction<C>(p, f);
}
示例5: criterion4
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* GB criterium 4. Use only for commutative polynomial rings. <b>Note:</b>
* Experimental version for r-Groebner bases.
* @param A polynomial.
* @param B polynomial.
* @return true if the S-polynomial(i,j) is required, else false.
*/
@Override
public boolean criterion4(GenPolynomial<C> A, GenPolynomial<C> B) {
if (logger.isInfoEnabled()) {
if (A instanceof GenSolvablePolynomial || B instanceof GenSolvablePolynomial) {
logger.error("GBCriterion4 not applicabable to SolvablePolynomials");
return true;
}
}
ExpVector ei = A.leadingExpVector();
ExpVector ej = B.leadingExpVector();
ExpVector g = ei.sum(ej);
ExpVector e = ei.lcm(ej);
// boolean t = g == e ;
ExpVector h = g.subtract(e);
int s = h.signum();
if (s == 0) { // disjoint ht
C a = A.leadingBaseCoefficient();
C b = B.leadingBaseCoefficient();
C d = a.multiply(b);
if (d.isZERO()) { // a guess
return false; // can skip pair
}
}
return true; //! ( s == 0 );
}
示例6: criterion4
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* GB criterium 4. Use only for commutative polynomial rings. This version
* works also for d-Groebner bases.
* @param A polynomial.
* @param B polynomial.
* @return true if the S-polynomial(i,j) is required, else false.
*/
@Override
public boolean criterion4(GenPolynomial<C> A, GenPolynomial<C> B) {
if (logger.isInfoEnabled()) {
if (A instanceof GenSolvablePolynomial || B instanceof GenSolvablePolynomial) {
logger.error("GBCriterion4 not applicabable to SolvablePolynomials");
return true;
}
}
ExpVector ei = A.leadingExpVector();
ExpVector ej = B.leadingExpVector();
ExpVector g = ei.sum(ej);
ExpVector e = ei.lcm(ej);
// boolean t = g == e ;
ExpVector h = g.subtract(e);
int s = h.signum();
if (s == 0) { // disjoint ht
C a = A.leadingBaseCoefficient();
C b = B.leadingBaseCoefficient();
C d = a.gcd(b);
if (d.isONE()) { // disjoint hc
return false; // can skip pair
}
}
return true; //! ( s == 0 );
}
示例7: multiply
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* Multiply by exponent vector and coefficient.
* @param k shift ExpVector.
* @param c coefficient multiplier.
* @return new power series with coefficient(i) = old.coefficient(i-k)*c.
*/
public MultiVarPowerSeries<C> multiply(final C c, final ExpVector k) {
if (k == null) {
throw new IllegalArgumentException("null ExpVector not allowed");
}
if (k.signum() == 0) {
return this.multiply(c);
}
if (c.signum() == 0) {
return ring.getZERO();
}
int nt = Math.min(ring.truncate, truncate + (int) k.totalDeg());
return new MultiVarPowerSeries<C>(ring, new MultiVarCoefficients<C>(ring) {
@Override
public C generate(ExpVector i) {
ExpVector d = i.subtract(k);
if (d.signum() < 0) {
return ring.coFac.getZERO();
}
long tdegd = d.totalDeg();
if (lazyCoeffs.homCheck.get((int) tdegd)) {
GenPolynomial<C> p = homogeneousPart(tdegd).multiply(c, k);
long tdegi = i.totalDeg();
coeffCache.put(tdegi, p); // overwrite
homCheck.set((int) tdegi);
C b = p.coefficient(i);
//System.out.println("b = " + b + ", i = " + i + ", tdegi = " + tdegi+ ", tdegd = " + tdegd);
//System.out.println("p = " + p + ", i = " + i);
return b;
}
return coefficient(d).multiply(c);
}
}, nt);
}
示例8: shiftSelect
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* Shift select coefficients. Not selected coefficients are removed from the
* result series.
* @param sel selector functor.
* @return new power series with shifted selected coefficients.
*/
public MultiVarPowerSeries<C> shiftSelect(final Selector<? super C> sel) {
return new MultiVarPowerSeries<C>(ring, new MultiVarCoefficients<C>(ring) {
ExpVectorIterable ib = new ExpVectorIterable(ring.nvar, true, truncate);
Iterator<ExpVector> pos = ib.iterator();
@Override
public C generate(ExpVector i) {
C c;
if (i.signum() > 0) {
int[] deps = i.dependencyOnVariables();
ExpVector x = i.subst(deps[0], i.getVal(deps[0]) - 1L);
c = get(x); // ensure all coefficients are generated
}
do {
c = null;
if (pos.hasNext()) {
ExpVector e = pos.next();
c = coefficient(e);
} else {
break;
}
} while (!sel.select(c));
if (c == null) { // not correct because not known
c = ring.coFac.getZERO();
}
return c;
}
});
}
示例9: criterion4
import edu.jas.poly.ExpVector; //导入方法依赖的package包/类
/**
* GB criterium 4. Use only for commutative polynomial rings.
* @param ei exponent vector.
* @param ej exponent vector.
* @param e = lcm(ei,ej)
* @return true if the S-polynomial(i,j) is required, else false.
*/
public boolean criterion4(ExpVector ei, ExpVector ej, ExpVector e) {
ExpVector g = ei.sum(ej);
ExpVector h = g.subtract(e);
int s = h.signum();
return s != 0;
}