 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
Go to the documentation of this file.
164 if (this->
isZero())
return true;
170 int cdeg = -2, dummy;
171 for (
i = *
this;
i.hasTerms();
i++ )
173 if (!(
i.coeff().isHomogeneous()))
return false;
176 if (cdeg == -2) cdeg = dummy;
186 for (
i=termlist;
i.hasItem();
i++ )
232 ASSERT( 0,
"illegal domain" );
442 coeffdeg =
i.coeff().degree(
v );
612 else if ( what ==
GFMARK )
654 else if ( what ==
GFMARK )
696 else if ( what ==
GFMARK )
708 #if (HAVE_NTL && HAVE_FLINT && __FLINT_RELEASE >= 20400)
750 else if ( what ==
GFMARK )
762 #if (HAVE_NTL && HAVE_FLINT && __FLINT_RELEASE >= 20400)
804 else if ( what ==
GFMARK )
850 else if ( what ==
GFMARK )
890 else if ( what ==
GFMARK )
932 else if ( what ==
GFMARK )
975 else if ( what ==
GFMARK )
981 g.value->divremcoeff(
f.value, qq, rr,
true );
982 else if ( (what=
is_imm(
g.value )) )
983 f.value->divremcoeff(
g.value, qq, rr,
false );
984 else if (
f.value->level() ==
g.value->level() )
985 if (
f.value->levelcoeff() ==
g.value->levelcoeff() )
986 f.value->divremsame(
g.value, qq, rr );
987 else if (
f.value->levelcoeff() >
g.value->levelcoeff() )
988 f.value->divremcoeff(
g.value, qq, rr,
false );
990 g.value->divremcoeff(
f.value, qq, rr,
true );
991 else if (
f.value->level() >
g.value->level() )
992 f.value->divremcoeff(
g.value, qq, rr,
false );
994 g.value->divremcoeff(
f.value, qq, rr,
true );
995 ASSERT( qq != 0 && rr != 0,
"error in divrem" );
1010 else if ( what ==
GFMARK )
1016 result =
g.value->divremcoefft(
f.value, qq, rr,
true );
1017 else if ( (what=
is_imm(
g.value )) )
1018 result =
f.value->divremcoefft(
g.value, qq, rr,
false );
1019 else if (
f.value->level() ==
g.value->level() )
1020 if (
f.value->levelcoeff() ==
g.value->levelcoeff() )
1021 result =
f.value->divremsamet(
g.value, qq, rr );
1022 else if (
f.value->levelcoeff() >
g.value->levelcoeff() )
1023 result =
f.value->divremcoefft(
g.value, qq, rr,
false );
1025 result =
g.value->divremcoefft(
f.value, qq, rr,
true );
1026 else if (
f.value->level() >
g.value->level() )
1027 result =
f.value->divremcoefft(
g.value, qq, rr,
false );
1029 result =
g.value->divremcoefft(
f.value, qq, rr,
true );
1031 ASSERT( qq != 0 && rr != 0,
"error in divrem" );
1055 else if ( what ==
GFMARK )
1059 result =
g.value->tryDivremcoefft(
f.value, qq, rr,
true,
M, fail );
1060 else if ( (what=
is_imm(
g.value )) )
1061 result =
f.value->tryDivremcoefft(
g.value, qq, rr,
false,
M, fail );
1062 else if (
f.value->level() ==
g.value->level() )
1063 if (
f.value->levelcoeff() ==
g.value->levelcoeff() )
1064 result =
f.value->tryDivremsamet(
g.value, qq, rr,
M, fail );
1065 else if (
f.value->levelcoeff() >
g.value->levelcoeff() )
1066 result =
f.value->tryDivremcoefft(
g.value, qq, rr,
false,
M, fail );
1068 result =
g.value->tryDivremcoefft(
f.value, qq, rr,
true,
M, fail );
1069 else if (
f.value->level() >
g.value->level() )
1070 result =
f.value->tryDivremcoefft(
g.value, qq, rr,
false,
M, fail );
1072 result =
g.value->tryDivremcoefft(
f.value, qq, rr,
true,
M, fail );
1080 ASSERT( qq != 0 && rr != 0,
"error in divrem" );
1111 int lastExp =
i.exp();
1114 while (
i.hasTerms() ) {
1115 if ( (lastExp -
i.exp()) == 1 )
1127 int lastExp =
i.exp();
1130 while (
i.hasTerms() )
1133 if ( (lastExp - i_exp ) == 1 )
1165 return (*
this)(
f );
1214 ASSERT(
i >= 0,
"index to operator [] less than zero" );
1257 ASSERT(
x.
level() > 0,
"cannot derive with respect to algebraic variables" );
1323 ASSERT( n >= 0,
"arg to sqrt() less than zero" );
1324 if ( n == 0 || n == 1 )
1332 y = (
unsigned long)(
x + n/
x)/2;
1358 ASSERT( a > 0,
"arg to ilog2() less or equal zero" );
1416 "incompatible operands" );
1441 "incompatible operands" );
1505 else if ( what ==
FFMARK )
1536 else if ( what ==
FFMARK )
1595 ASSERT( ! what || (what ==
is_imm(
f.value )),
"incompatible operands" );
1597 return g.value->bgcdcoeff(
f.value );
1605 if ( fInt < 0 ) fInt = -fInt;
1619 long r = fInt %
gInt;
1632 return f.value->bgcdcoeff(
g.value );
1634 int fLevel =
f.value->level();
1635 int gLevel =
g.value->level();
1638 if ( fLevel == gLevel )
1640 fLevel =
f.value->levelcoeff();
1641 gLevel =
g.value->levelcoeff();
1644 if ( fLevel == gLevel )
1645 return f.value->bgcdsame(
g.value );
1646 else if ( fLevel < gLevel )
1647 return g.value->bgcdcoeff(
f.value );
1649 return f.value->bgcdcoeff(
g.value );
1651 else if ( fLevel < gLevel )
1652 return g.value->bgcdcoeff(
f.value );
1654 return f.value->bgcdcoeff(
g.value );
1668 ASSERT( ! what || (what ==
is_imm(
f.value )),
"incompatible operands" );
1670 return g.value->bextgcdcoeff(
f.value,
b, a );
1680 if ( fInt < 0 ) fInt = -fInt;
1683 if (
gInt > fInt ) {
1689 long u = 1;
long v = 0;
1690 long uNext = 0;
long vNext = 1;
1698 long r = fInt %
gInt;
1699 long q = fInt /
gInt;
1700 long uSwap = u - q * uNext;
1701 long vSwap =
v - q * vNext;
1706 u = uNext;
v = vNext;
1707 uNext = uSwap; vNext = vSwap;
1713 if ( gTest > fTest ) {
1718 if ( fTest < 0 ) a = -a;
1719 if ( gTest < 0 )
b = -
b;
1723 if ( !
f.isZero() ) {
1725 }
else if ( !
g.isZero() ) {
1732 return f.value->bextgcdcoeff(
g.value, a,
b );
1734 int fLevel =
f.value->level();
1735 int gLevel =
g.value->level();
1738 if ( fLevel == gLevel ) {
1739 fLevel =
f.value->levelcoeff();
1740 gLevel =
g.value->levelcoeff();
1743 if ( fLevel == gLevel )
1744 return f.value->bextgcdsame(
g.value, a,
b );
1745 else if ( fLevel < gLevel )
1746 return g.value->bextgcdcoeff(
f.value,
b, a );
1748 return f.value->bextgcdcoeff(
g.value, a,
b );
1750 else if ( fLevel < gLevel )
1751 return g.value->bextgcdcoeff(
f.value,
b, a );
1753 return f.value->bextgcdcoeff(
g.value, a,
b );
1759 if (
f.isZero() ||
g.isZero() )
1813 else if ( what ==
GFMARK )
1827 else if ( what ==
GFMARK )
1839 ASSERT( n >= 0,
"illegal exponent" );
1842 else if (
f.isOne() )
bool hasMipo(const Variable &alpha)
virtual long intval() const
virtual int degree()
int InternalCF::degree ()
virtual InternalCF * mulsame(InternalCF *) PVIRT_INTCF("mulsame")
InternalCF * imm_add_p(const InternalCF *const lhs, const InternalCF *const rhs)
static const int SW_RATIONAL
set to 1 for computations over Q
InternalCF * imm_mod(const InternalCF *const lhs, const InternalCF *const rhs)
InternalCF * imm_mul(InternalCF *lhs, InternalCF *rhs)
void imm_print(OSTREAM &os, const InternalCF *const op, const char *const str)
virtual bool inBaseDomain() const
void getmpi(InternalCF *value, mpz_t mpi)
class to iterate through CanonicalForm's
void Off(int s)
switch 's' off
const CanonicalForm int const CFList const Variable & y
InternalCF * imm_mul_gf(const InternalCF *const lhs, const InternalCF *const rhs)
virtual InternalCF * modulosame(InternalCF *) PVIRT_INTCF("modulosame")
virtual InternalCF * divsame(InternalCF *) PVIRT_INTCF("divsame")
void imm_divrem_gf(const InternalCF *const lhs, const InternalCF *const rhs, InternalCF *&q, InternalCF *&r)
virtual CanonicalForm tailcoeff()
CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree ()
virtual InternalCF * subsame(InternalCF *) PVIRT_INTCF("subsame")
virtual class for internal CanonicalForm's
virtual InternalCF * addsame(InternalCF *) PVIRT_INTCF("addsame")
virtual int intmod(int) const
virtual int comparesame(InternalCF *) PVIRT_INT("comparesame")
virtual InternalCF * genZero() PVIRT_INTCF("genZero")
int ff_symmetric(const int a)
virtual InternalCF * subcoeff(InternalCF *, bool) PVIRT_INTCF("subcoeff")
virtual void print(OSTREAM &, char *) PVIRT_VOID("print")
InternalCF * copyObject()
virtual int level() const
#define GaloisFieldDomain
InternalCF * imm_div_p(const InternalCF *const lhs, const InternalCF *const rhs)
virtual int levelcoeff() const
CanonicalForm mulNTL(const CanonicalForm &F, const CanonicalForm &G, const modpk &b)
multiplication of univariate polys using FLINT/NTL over F_p, F_q, Z/p^k, Z/p^k[t]/(f),...
#define ASSERT(expression, message)
static InternalCF * int2imm(long i)
virtual bool isUnivariate() const
virtual InternalCF * addcoeff(InternalCF *) PVIRT_INTCF("addcoeff")
int imm_sign(const InternalCF *const op)
imm_sign() - return sign of immediate object.
void imm_divrem(const InternalCF *const lhs, const InternalCF *const rhs, InternalCF *&q, InternalCF *&r)
virtual CanonicalForm LC()
int imm_cmp_gf(const InternalCF *const lhs, const InternalCF *const rhs)
static InternalCF * basic(long value)
static long gInt(number &a, const coeffs)
virtual bool inCoeffDomain() const
virtual CanonicalForm coeff(int i)
CanonicalForm InternalCF::coeff ( int i )
virtual InternalCF * sqrt()
InternalCF * InternalCF::sqrt ()
virtual InternalCF * modcoeff(InternalCF *, bool) PVIRT_INTCF("modcoeff")
InternalCF * imm_sub_p(const InternalCF *const lhs, const InternalCF *const rhs)
CanonicalForm divNTL(const CanonicalForm &F, const CanonicalForm &G, const modpk &b)
division of univariate polys using FLINT/NTL over F_p, F_q, Z/p^k, Z/p^k[t]/(f), Z,...
InternalCF * imm_add(const InternalCF *const lhs, const InternalCF *const rhs)
virtual InternalCF * genOne() PVIRT_INTCF("genOne")
#define FiniteFieldDomain
int imm_cmp(const InternalCF *const lhs, const InternalCF *const rhs)
imm_cmp(), imm_cmp_p(), imm_cmp_gf() - compare immediate objects.
InternalCF * imm_mod_gf(const InternalCF *const, const InternalCF *const)
virtual CanonicalForm Lc()
virtual InternalCF * tryDivcoeff(InternalCF *, bool, const CanonicalForm &, bool &)
int imm_iszero_p(const InternalCF *const ptr)
virtual Variable variable() const
void imm_divrem_p(const InternalCF *const lhs, const InternalCF *const rhs, InternalCF *&q, InternalCF *&r)
InternalCF * imm_sub_gf(const InternalCF *const lhs, const InternalCF *const rhs)
virtual InternalCF * dividecoeff(InternalCF *, bool) PVIRT_INTCF("dividecoeff")
virtual int comparecoeff(InternalCF *) PVIRT_INT("comparecoeff")
virtual InternalCF * den()
CFList get_Terms(const CanonicalForm &f)
int imm_iszero_gf(const InternalCF *const ptr)
InternalCF * imm_mul_p(const InternalCF *const lhs, const InternalCF *const rhs)
virtual InternalCF * dividesame(InternalCF *) PVIRT_INTCF("dividesame")
int imm_cmp_p(const InternalCF *const lhs, const InternalCF *const rhs)
InternalCF * imm_divrat(const InternalCF *const lhs, const InternalCF *const rhs)
virtual InternalCF * tryDivsame(InternalCF *, const CanonicalForm &, bool &)
static long imm2int(const InternalCF *const imm)
factory's class for variables
int imm_iszero(const InternalCF *const ptr)
virtual bool inQuotDomain() const
virtual InternalCF * modulocoeff(InternalCF *, bool) PVIRT_INTCF("dividecoeff")
virtual bool inExtension() const
virtual InternalCF * divcoeff(InternalCF *, bool) PVIRT_INTCF("divcoeff")
CFSwitches cf_glob_switches
CFSwitches cf_glob_switches;.
InternalCF * int2imm_p(long i)
InternalCF * imm_add_gf(const InternalCF *const lhs, const InternalCF *const rhs)
InternalCF * imm_div(const InternalCF *const lhs, const InternalCF *const rhs)
virtual bool inPolyDomain() const
virtual int ilog2()
int InternalCF::ilog2 ()
virtual InternalCF * num()
InternalCF * InternalCF::num (), den ()
virtual InternalCF * mulcoeff(InternalCF *) PVIRT_INTCF("mulcoeff")
const Variable & v
< [in] a sqrfree bivariate poly
InternalCF * int2imm_gf(long i)
bool getReduce(const Variable &alpha)
void On(int s)
switch 's' on
InternalCF * imm_div_gf(const InternalCF *const lhs, const InternalCF *const rhs)
virtual InternalCF * deepCopyObject() const PVIRT_INTCF("deepCopyObject")
virtual InternalCF * modsame(InternalCF *) PVIRT_INTCF("modsame")
InternalCF * imm_sub(const InternalCF *const lhs, const InternalCF *const rhs)
InternalCF * imm_mod_p(const InternalCF *const, const InternalCF *const)
long imm_intval(const InternalCF *const op)
bool isOn(int s) const
check if 's' is on
virtual int sign() const PVIRT_INT("sign")
virtual CanonicalForm lc()
CanonicalForm InternalCF::lc (), Lc (), LC ()