My Project  UNKNOWN_GIT_VERSION
Data Structures | Functions
flintcf_Zn.h File Reference
#include "singularconfig.h"
#include "misc/auxiliary.h"

Go to the source code of this file.

Data Structures

struct  flintZn_struct
 

Functions

BOOLEAN flintZn_InitChar (coeffs cf, void *infoStruct)
 
coeffs flintZnInitCfByName (char *s, n_coeffType n)
 

Data Structure Documentation

◆ flintZn_struct

struct flintZn_struct

Definition at line 15 of file flintcf_Zn.h.

Data Fields
int ch
char * name

Function Documentation

◆ flintZn_InitChar()

BOOLEAN flintZn_InitChar ( coeffs  cf,
void *  infoStruct 
)

Definition at line 488 of file flintcf_Zn.cc.

489 {
490  flintZn_struct *pp=(flintZn_struct*)infoStruct;
491  cf->ch=pp->ch;
492 
493  cf->cfCoeffString = CoeffString;
494  cf->cfCoeffName = CoeffName;
495  cf->cfCoeffWrite = CoeffWrite;
496  cf->nCoeffIsEqual = CoeffIsEqual;
497  cf->cfKillChar = KillChar;
498  cf->cfSetChar = SetChar;
499  cf->cfMult = Mult;
500  cf->cfSub = Sub;
501  cf->cfAdd = Add;
502  cf->cfDiv = Div;
503  cf->cfExactDiv = ExactDiv; // ???
504  cf->cfInit = Init;
505  cf->cfInitMPZ = InitMPZ;
506  cf->cfSize = Size;
507  cf->cfInt = Int;
508  cf->cfMPZ = MPZ;
509  cf->cfInpNeg = Neg;
510  cf->cfInvers = Invers;
511  cf->cfCopy = Copy;
512  cf->cfRePart = Copy;
513  // default: cf->cfImPart = ndReturn0;
514  cf->cfWriteLong = WriteShort; //WriteLong;
515  cf->cfWriteShort = WriteShort;
516  cf->cfRead = Read;
517  cf->cfNormalize = Normalize;
518 
519  //cf->cfDivComp=
520  //cf->cfIsUnit=
521  //cf->cfGetUnit=
522  //cf->cfDivBy=
523 
524  cf->cfGreater=Greater;
525  cf->cfEqual =Equal;
526  cf->cfIsZero =IsZero;
527  cf->cfIsOne =IsOne;
528  cf->cfIsMOne =IsMOne;
529  cf->cfGreaterZero=GreaterZero;
530 
531  cf->cfPower = Power;
532  //default: cf->cfGetDenom = GetDenom;
533  //default: cf->cfGetNumerator = GetNumerator;
534  cf->cfGcd = Gcd;
535  cf->cfExtGcd = ExtGcd;
536  cf->cfLcm = Lcm;
537  cf->cfDelete = Delete;
538  cf->cfSetMap = SetMap;
539  // default: cf->cfInpMult
540  // default: cf->cfInpAdd
541  cf->cfFarey =Farey;
542  cf->cfChineseRemainder=ChineseRemainder;
543  cf->cfParDeg = ParDeg;
544  cf->cfParameter = Parameter;
545  // cf->cfClearContent = ClearContent;
546  // cf->cfClearDenominators = ClearDenominators;
547  cf->convFactoryNSingN=ConvFactoryNSingN;
548  cf->convSingNFactoryN=ConvSingNFactoryN;
549  cf->cfWriteFd = WriteFd;
550  cf->cfReadFd = ReadFd;
551 #ifdef LDEBUG
552  cf->cfDBTest = DBTest;
553 #endif
554 
555  cf->iNumberOfParameters = 1;
556  char **pn=(char**)omAlloc0(sizeof(char*));
557  pn[0]=(char*)omStrDup(pp->name);
558  cf->pParameterNames = (const char **)pn;
559  cf->has_simple_Inverse= FALSE;
560  cf->has_simple_Alloc= FALSE;
561  cf->is_field=FALSE;
562 
563  return FALSE;
564 }

◆ flintZnInitCfByName()

coeffs flintZnInitCfByName ( char *  s,
n_coeffType  n 
)

Definition at line 434 of file flintcf_Zn.cc.

435 {
436  const char start[]="flint:Z/";
437  const int start_len=strlen(start);
438  if (strncmp(s,start,start_len)==0)
439  {
440  s+=start_len;
441  int p;
442  char st[10];
443  int l=sscanf(s,"%d[%s",&p,st);
444  if (l==2)
445  {
447  info.ch=p;
448  while (st[strlen(st)-1]==']') st[strlen(st)-1]='\0';
449  info.name=st;
450  return nInitChar(n,(void*)&info);
451  }
452  }
453  return NULL;
454 }
FALSE
#define FALSE
Definition: auxiliary.h:94
Read
static const char * Read(const char *st, number *a, const coeffs r)
Definition: flintcf_Zn.cc:251
IsOne
static BOOLEAN IsOne(number a, const coeffs r)
Definition: flintcf_Zn.cc:311
WriteShort
static void WriteShort(number a, const coeffs r)
Definition: flintcf_Zn.cc:221
Copy
static number Copy(number a, const coeffs r)
Definition: flintcf_Zn.cc:203
ReadFd
static number ReadFd(const ssiInfo *d, const coeffs r)
Definition: flintcf_Zn.cc:468
WriteFd
static void WriteFd(number a, const ssiInfo *d, const coeffs)
Definition: flintcf_Zn.cc:455
Power
static void Power(number a, int i, number *result, const coeffs r)
Definition: flintcf_Zn.cc:327
CoeffWrite
static void CoeffWrite(const coeffs r, BOOLEAN details)
Definition: flintcf_Zn.cc:48
IsMOne
static BOOLEAN IsMOne(number k, const coeffs r)
Definition: flintcf_Zn.cc:315
Greater
static BOOLEAN Greater(number a, number b, const coeffs r)
Definition: flintcf_Zn.cc:288
Gcd
static number Gcd(number a, number b, const coeffs r)
Definition: flintcf_Zn.cc:334
Mult
static number Mult(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:69
Init
static number Init(long i, const coeffs r)
Definition: flintcf_Zn.cc:131
Farey
static number Farey(number p, number n, const coeffs)
Definition: flintcf_Zn.cc:394
cf
CanonicalForm cf
Definition: cfModGcd.cc:4024
ExtGcd
static number ExtGcd(number a, number b, number *s, number *t, const coeffs r)
Definition: flintcf_Zn.cc:341
ChineseRemainder
static number ChineseRemainder(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs)
Definition: flintcf_Zn.cc:398
omStrDup
#define omStrDup(s)
Definition: omAllocDecl.h:261
Int
static long Int(number &n, const coeffs r)
Definition: flintcf_Zn.cc:155
nInitChar
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:350
Normalize
static void Normalize(number &a, const coeffs r)
Definition: flintcf_Zn.cc:285
Lcm
static number Lcm(number a, number b, const coeffs r)
Definition: flintcf_Zn.cc:350
CoeffIsEqual
static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void *parameter)
Definition: flintcf_Zn.cc:53
flintZn_struct
Definition: flintcf_Zn.h:15
Equal
static BOOLEAN Equal(number a, number b, const coeffs r)
Definition: flintcf_Zn.cc:303
GreaterZero
static BOOLEAN GreaterZero(number k, const coeffs r)
Definition: flintcf_Zn.cc:321
SetChar
static void SetChar(const coeffs r)
Definition: flintcf_Zn.cc:65
InitMPZ
static number InitMPZ(mpz_t i, const coeffs r)
Definition: flintcf_Zn.cc:140
Size
static int Size(number n, const coeffs r)
Definition: flintcf_Zn.cc:151
ConvFactoryNSingN
static number ConvFactoryNSingN(const CanonicalForm n, const coeffs r)
Definition: flintcf_Zn.cc:415
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
Delete
static void Delete(number *a, const coeffs r)
Definition: flintcf_Zn.cc:354
CoeffString
static char * CoeffString(const coeffs r)
Definition: flintcf_Zn.cc:428
ParDeg
static int ParDeg(number x, const coeffs r)
Definition: flintcf_Zn.cc:402
SetMap
static nMapFunc SetMap(const coeffs src, const coeffs dst)
Definition: flintcf_Zn.cc:363
Div
static number Div(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:90
Add
static number Add(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:83
MPZ
static void MPZ(mpz_t result, number &n, const coeffs r)
Definition: flintcf_Zn.cc:165
Invers
static number Invers(number a, const coeffs r)
Definition: flintcf_Zn.cc:180
Parameter
static number Parameter(const int i, const coeffs r)
Definition: flintcf_Zn.cc:406
Sub
static number Sub(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:76
NULL
#define NULL
Definition: omList.c:9
l
int l
Definition: cfEzgcd.cc:93
Neg
static number Neg(number a, const coeffs r)
Definition: flintcf_Zn.cc:175
CoeffName
static char * CoeffName(const coeffs r)
Definition: flintcf_Zn.cc:422
DBTest
static BOOLEAN DBTest(number a, const char *f, const int l, const coeffs r)
Definition: flintcf_Zn.cc:483
p
int p
Definition: cfModGcd.cc:4019
ConvSingNFactoryN
static CanonicalForm ConvSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
Definition: flintcf_Zn.cc:418
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
ExactDiv
static number ExactDiv(number a, number b, const coeffs c)
Definition: flintcf_Zn.cc:112
info
const ExtensionInfo & info
< [in] sqrfree poly
Definition: facFqFactorize.h:38
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209
IsZero
static BOOLEAN IsZero(number a, const coeffs r)
Definition: flintcf_Zn.cc:307
KillChar
static void KillChar(coeffs cf)
Definition: flintcf_Zn.cc:60