|
5.1.8 chinrem
Syntax:
chinrem ( list, intvec )
chinrem ( list, list )
chinrem ( intvec, intvec )
Type:
- the same type as the elements of the first argument
If the elements of the first argument are lists again, chinrem is applied recursively.
Purpose:
- applies chinese remainder theorem to the first argument w.r.t. the moduli given in the second.
The elements in the first list must be of same type which can be
bigint /int ,
poly , ideal , module , smatrix or matrix .
The moduli, if given by a list, must be of type bigint or int .
If data depending on a ring are involved, the coeffcient field must be Q .
Example:
| chinrem(intvec(2,-3),intvec(7,11));
==> 30
chinrem(list(2,-3),list(7,11));
==> 30
ring r=0,(x,y),dp;
ideal i1=5x+2y,x2+3y2+xy;
ideal i2=2x-3y,2x2+4y2+5xy;
chinrem(list(i1,i2),intvec(7,11));
==> _[1]=-9x+30y
==> _[2]=-20x2-6xy-18y2
chinrem(list(i1,i2),list(bigint(7),bigint(11)));
==> _[1]=-9x+30y
==> _[2]=-20x2-6xy-18y2
chinrem(list(list(i1,i2),list(i1,i2)),list(bigint(7),bigint(11)));
==> [1]:
==> _[1]=-9x+30y
==> _[2]=-20x2-6xy-18y2
==> [2]:
==> _[1]=-9x+30y
==> _[2]=-20x2-6xy-18y2
|
See
modstd_lib.
|