 |
My Project
debian-1:4.1.1-p2+ds-4build1
|
Go to the source code of this file.
|
int | Mults () |
|
static void | degsplit (poly p, int n, poly &p1, poly &p2, int vn, ring r) |
|
static void | div_by_x_power_n (poly p, int n, int vn, ring r) |
|
static poly | do_unifastmult (poly f, int df, poly g, int dg, int vn, fastmultrec rec, ring r) |
|
static int | max (int a, int b) |
|
static int | min (int a, int b) |
|
poly | unifastmult (poly f, poly g, ring r) |
|
poly | multifastmult (poly f, poly g, ring r) |
|
poly | pFastPower (poly f, int n, ring r) |
|
static void | p_MonMultMB (poly p, poly q, ring r) |
|
static poly | p_MonMultCMB (poly p, poly q, ring r) |
|
static void | buildTermAndAdd (int, number *, poly *, int *exp, int f_len, kBucket_pt, ring r, number coef, poly &zw, poly, poly **term_pot) |
|
static void | MC_iterate (poly f, int n, ring r, int f_len, number *facult, int *exp, poly *f_terms, kBucket_pt erg_bucket, int pos, int sum, number coef, poly &zw, poly tmp, poly **term_pot) |
|
poly | pFastPowerMC (poly f, int n, ring r) |
|
◆ fastmultrec
typedef poly fastmultrec(poly f, poly g, ring r) |
◆ buildTermAndAdd()
static void buildTermAndAdd |
( |
int |
, |
|
|
number * |
, |
|
|
poly * |
, |
|
|
int * |
exp, |
|
|
int |
f_len, |
|
|
kBucket_pt |
, |
|
|
ring |
r, |
|
|
number |
coef, |
|
|
poly & |
zw, |
|
|
poly |
, |
|
|
poly ** |
term_pot |
|
) |
| |
|
static |
poly term=p_Copy(f_terms[i],r);
Definition at line 487 of file fast_mult.cc.
507 for(
i=0;
i<f_len;
i++){
◆ degsplit()
static void degsplit |
( |
poly |
p, |
|
|
int |
n, |
|
|
poly & |
p1, |
|
|
poly & |
p2, |
|
|
int |
vn, |
|
|
ring |
r |
|
) |
| |
|
static |
◆ div_by_x_power_n()
static void div_by_x_power_n |
( |
poly |
p, |
|
|
int |
n, |
|
|
int |
vn, |
|
|
ring |
r |
|
) |
| |
|
static |
◆ do_unifastmult()
static poly do_unifastmult |
( |
poly |
f, |
|
|
int |
df, |
|
|
poly |
g, |
|
|
int |
dg, |
|
|
int |
vn, |
|
|
fastmultrec |
rec, |
|
|
ring |
r |
|
) |
| |
|
static |
Definition at line 72 of file fast_mult.cc.
113 poly p00=rec(f0,g0,r);
114 poly p11=rec(f1,g1,r);
134 poly pbig=rec(s1,s2,r);
159 poly s1=rec(f0,g1,r);
160 poly s2=rec(g0,f1,r);
◆ max()
static int max |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
|
inlinestatic |
◆ MC_iterate()
static void MC_iterate |
( |
poly |
f, |
|
|
int |
n, |
|
|
ring |
r, |
|
|
int |
f_len, |
|
|
number * |
facult, |
|
|
int * |
exp, |
|
|
poly * |
f_terms, |
|
|
kBucket_pt |
erg_bucket, |
|
|
int |
pos, |
|
|
int |
sum, |
|
|
number |
coef, |
|
|
poly & |
zw, |
|
|
poly |
tmp, |
|
|
poly ** |
term_pot |
|
) |
| |
|
static |
Definition at line 528 of file fast_mult.cc.
535 for(
i=0;
i<=n-sum;
i++)
540 new_coef=
n_Copy(coef,r->cf);
545 number old_rest=
n_Init(n-sum-(
i-1),r->cf);
546 new_coef=
n_Mult(new_coef,old_rest,r->cf);
549 number i_number=
n_Init(
i,r->cf);
551 new_coef=
n_Div(new_coef,i_number,r->cf);
560 MC_iterate(
f, n, r, f_len,facult,
exp,f_terms,erg_bucket,pos+1,sum+
i,new_coef,zw_real,tmp,term_pot);
582 number new_coef=
n_Copy(coef,r->cf);
583 buildTermAndAdd(n,facult,f_terms,
exp,f_len,erg_bucket,r, new_coef,zw, tmp,term_pot);
◆ min()
static int min |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
|
inlinestatic |
◆ multifastmult()
poly multifastmult |
( |
poly |
f, |
|
|
poly |
g, |
|
|
ring |
r |
|
) |
| |
◆ Mults()
◆ p_MonMultCMB()
static poly p_MonMultCMB |
( |
poly |
p, |
|
|
poly |
q, |
|
|
ring |
r |
|
) |
| |
|
static |
◆ p_MonMultMB()
static void p_MonMultMB |
( |
poly |
p, |
|
|
poly |
q, |
|
|
ring |
r |
|
) |
| |
|
static |
◆ pFastPower()
poly pFastPower |
( |
poly |
f, |
|
|
int |
n, |
|
|
ring |
r |
|
) |
| |
Definition at line 342 of file fast_mult.cc.
345 if (n==0)
return p_ISet(1,r);
354 int field_size=pot_max+1;
355 int* int_pot_array=(
int*)
omAlloc(field_size*
sizeof(
int));
356 poly* pot_array=(poly*)
omAlloc(field_size*
sizeof(poly));
360 for(
i=0;
i<field_size;
i++)
362 int_pot_array[
i]=pot;
367 for(
i=1;
i<field_size;
i++)
369 poly
p=pot_array[
i-1];
379 assume(work_n>=int_pot_array[field_size-1]);
398 for(
i=field_size-1;
i>=0;
i--)
401 assume(work_n<2*int_pot_array[
i]);
402 if(int_pot_array[
i]<=work_n)
404 work_n-=int_pot_array[
i];
407 else int_pot_array[
i]=0;
410 for(
i=0;
i<field_size;
i++)
412 if(int_pot_array[
i]==1)
◆ pFastPowerMC()
poly pFastPowerMC |
( |
poly |
f, |
|
|
int |
n, |
|
|
ring |
r |
|
) |
| |
Definition at line 588 of file fast_mult.cc.
593 WerrorS(
"Char not 0, pFastPowerMC not implemented for this case");
595 WerrorS(
"not implemented for so small n, recursion fails");
597 WerrorS(
"not implemented for so small length of f, recursion fails");
599 number* facult=(number*)
omAlloc((n+1)*
sizeof(number));
600 facult[0]=
n_Init(1,r->cf);
605 facult[
i]=
n_Mult(this_n,facult[
i-1],r->cf);
616 poly* f_terms=(poly*)
omAlloc(f_len*
sizeof(poly));
617 poly** term_potences=(poly**)
omAlloc(f_len*
sizeof(poly*));
623 f_iter=
pNext(f_iter);
627 term_potences[
i]=(poly*)
omAlloc((n+1)*
sizeof(poly));
628 term_potences[
i][0]=
p_ISet(1,r);
637 number one=
n_Init(1,r->cf);
638 MC_iterate(
f,n,r,f_len,&facult[0], &
exp[0], &f_terms[0],erg_bucket,0,0,one,zw,tmp, term_potences);
653 for (
i=0;
i<f_len;
i++)
◆ unifastmult()
poly unifastmult |
( |
poly |
f, |
|
|
poly |
g, |
|
|
ring |
r |
|
) |
| |
◆ lm_bin
◆ mults
◆ pass_option
poly multifastmult(poly f, poly g, ring r)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
#define p_SetCoeff0(p, n, r)
void p_Normalize(poly p, const ring r)
const CanonicalForm int const CFList const Variable & y
static poly p_MonMultCMB(poly p, poly q, ring r)
#define omGetSpecBin(size)
static poly p_Mult_mm(poly p, poly m, const ring r)
static poly p_Neg(poly p, const ring r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static poly pp_Mult_mm(poly p, poly m, const ring r)
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static unsigned pLength(poly a)
static poly p_Copy(poly p, const ring r)
returns a copy of p
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static short rVar(const ring r)
#define rVar(r) (r->N)
static void p_ExpVectorAdd(poly p1, poly p2, const ring r)
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
void kBucketDestroy(kBucket_pt *bucket_pt)
static void degsplit(poly p, int n, poly &p1, poly &p2, int vn, ring r)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static int max(int a, int b)
static poly pp_Mult_qq(poly p, poly q, const ring r)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static poly p_Init(const ring r, omBin bin)
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
gmp_float exp(const gmp_float &a)
static void buildTermAndAdd(int, number *, poly *, int *exp, int f_len, kBucket_pt, ring r, number coef, poly &zw, poly, poly **term_pot)
static void p_Delete(poly *p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static int min(int a, int b)
static void p_MonMultMB(poly p, poly q, ring r)
static poly do_unifastmult(poly f, int df, poly g, int dg, int vn, fastmultrec rec, ring r)
#define omUnGetSpecBin(bin_ptr)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
void WerrorS(const char *s)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
poly unifastmult(poly f, poly g, ring r)
static void div_by_x_power_n(poly p, int n, int vn, ring r)
static void MC_iterate(poly f, int n, ring r, int f_len, number *facult, int *exp, poly *f_terms, kBucket_pt erg_bucket, int pos, int sum, number coef, poly &zw, poly tmp, poly **term_pot)