 |
My Project
debian-1:4.1.2-p1+ds-2
|
Go to the documentation of this file.
13 #include <flint/flint.h>
14 #include <flint/nmod_poly.h>
15 #include "factory/factory.h"
29 static const char*
Eati(
const char *
s,
int *
i)
32 if (((*
s) >=
'0') && ((*
s) <=
'9'))
40 while (((*
s) >=
'0') && ((*
s) <=
'9'));
49 Print(
"flint:Z/%d[%s]",r->ch,r->pParameterNames[0]);
55 return (r->type==n) &&(r->ch==
pp->ch)
56 &&(r->pParameterNames!=
NULL)
57 &&(strcmp(r->pParameterNames[0],
pp->name)==0);
136 nmod_poly_set_coeff_ui(
res,0,
i);
145 slong ii=mpz_mod_ui(tmp,
i,r->ch);
147 nmod_poly_set_coeff_ui(
res,0,ii);
250 static const char*
Read(
const char * st, number * a,
const coeffs r)
255 *a=(number)
omAlloc(
sizeof(nmod_poly_t));
258 if (*
s==
'-') { neg=
TRUE;
s++;}
265 else if(strncmp(
s,r->pParameterNames[0],strlen(r->pParameterNames[0]))==0)
268 s+=strlen(r->pParameterNames[0]);
297 if (ac>bc)
return TRUE;
298 else if (ac<bc)
return FALSE;
386 ii=mpz_mod_ui(tmp,
i->z,dst->ch);
389 if (ii<0) ii+=dst->ch;
390 nmod_poly_set_coeff_ui(
res,0,ii);
399 WerrorS(
"not yet: ChineseRemainder");
409 nmod_poly_set_coeff_ui(
res,1,1);
419 WerrorS(
"not yet: ConvSingNFactoryN");
424 sprintf(CoeffName_flint_Zn,
"flint:Z/%d[%s]",r->ch,r->pParameterNames[0]);
425 return (
char*)CoeffName_flint_Zn;
429 char *
buf=(
char*)
omAlloc(12+10 +strlen(r->pParameterNames[0]));
430 sprintf(
buf,
"flintZn(%d,\"%s\")",r->ch,r->pParameterNames[0]);
435 const char start[]=
"flint:Z/";
436 const int start_len=strlen(start);
437 if (strncmp(
s,start,start_len)==0)
442 int l=sscanf(
s,
"%d[%s",&
p,st);
447 while (st[strlen(st)-1]==
']') st[strlen(st)-1]=
'\0';
458 int l=nmod_poly_length(aa);
460 for(
int i=
l;
i>=0;
i--)
462 ulong ul=nmod_poly_get_coeff_ui(aa,
i);
463 fprintf(d->
f_write,
"%lu ", ul);
474 for (
int i=
l;
i>=0;
i--)
477 nmod_poly_set_coeff_ui(aa,
i,ul);
554 cf->iNumberOfParameters = 1;
555 char **pn=(
char**)
omAlloc0(
sizeof(
char*));
557 cf->pParameterNames = (
const char **)pn;
static const char * Read(const char *st, number *a, const coeffs r)
static BOOLEAN IsOne(number a, const coeffs r)
static void WriteShort(number a, const coeffs r)
static number Copy(number a, const coeffs r)
void StringAppendS(const char *st)
static number ReadFd(const ssiInfo *d, const coeffs r)
static void WriteFd(number a, const ssiInfo *d, const coeffs)
static void Power(number a, int i, number *result, const coeffs r)
static void CoeffWrite(const coeffs r, BOOLEAN details)
static BOOLEAN IsMOne(number k, const coeffs r)
nmod_poly_clear(FLINTmipo)
static BOOLEAN Greater(number a, number b, const coeffs r)
static number Gcd(number a, number b, const coeffs r)
static number Mult(number a, number b, const coeffs c)
static number Init(long i, const coeffs r)
static number Farey(number p, number n, const coeffs)
static number ExtGcd(number a, number b, number *s, number *t, const coeffs r)
static number Init_bigint(number i, const coeffs dummy, const coeffs dst)
static number ChineseRemainder(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs)
static long Int(number &n, const coeffs r)
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
number nvInvers(number c, const coeffs r)
static void Normalize(number &a, const coeffs r)
static number Lcm(number a, number b, const coeffs r)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
int status int void * buf
const char *const nDivBy0
#define omFreeSize(addr, size)
static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void *parameter)
static BOOLEAN Equal(number a, number b, const coeffs r)
nmod_poly_init(FLINTmipo, getCharacteristic())
static BOOLEAN GreaterZero(number k, const coeffs r)
static void SetChar(const coeffs r)
static number IntMod(number a, number b, const coeffs c)
static number InitMPZ(mpz_t i, const coeffs r)
static int Size(number n, const coeffs r)
long s_readlong(s_buff F)
static number ConvFactoryNSingN(const CanonicalForm n, const coeffs r)
BOOLEAN flintZn_InitChar(coeffs cf, void *infoStruct)
static void Delete(number *a, const coeffs r)
static char * CoeffString(const coeffs r)
static int ParDeg(number x, const coeffs r)
static nMapFunc SetMap(const coeffs src, const coeffs dst)
static number Div(number a, number b, const coeffs c)
static number Add(number a, number b, const coeffs c)
nmod_poly_struct * nmod_poly_ptr
static void MPZ(mpz_t result, number &n, const coeffs r)
void WerrorS(const char *s)
static number Invers(number a, const coeffs r)
static number Parameter(const int i, const coeffs r)
static number Sub(number a, number b, const coeffs c)
static number Neg(number a, const coeffs r)
static char * CoeffName(const coeffs r)
static BOOLEAN DBTest(number a, const char *f, const int l, const coeffs r)
static CanonicalForm ConvSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
const CanonicalForm int s
static number ExactDiv(number a, number b, const coeffs c)
static const char * Eati(const char *s, int *i)
const ExtensionInfo & info
< [in] sqrfree poly
static BOOLEAN IsZero(number a, const coeffs r)
static void KillChar(coeffs cf)
coeffs flintZnInitCfByName(char *s, n_coeffType n)