My Project
Loading...
Searching...
No Matches
Functions | Variables
cf_char.cc File Reference

getting and setting the characteristic of a finite field More...

#include "config.h"
#include "cf_assert.h"
#include "cf_defs.h"
#include "canonicalform.h"
#include "imm.h"
#include "cf_primes.h"
#include "cf_util.h"
#include "int_pp.h"
#include "FLINTconvert.h"

Go to the source code of this file.

Functions

void setCharacteristic (int c)
 
void setCharacteristic (int c, int n, char name)
 
int getCharacteristic ()
 
int getGFDegree ()
 
CanonicalForm getGFGenerator ()
 

Variables

STATIC_VAR int theCharacteristic = 0
 
STATIC_VAR int theDegree = 1
 

Detailed Description

getting and setting the characteristic of a finite field

Definition in file cf_char.cc.

Function Documentation

◆ getCharacteristic()

int getCharacteristic ( )

Definition at line 70 of file cf_char.cc.

71{
72 return theCharacteristic;
73}
STATIC_VAR int theCharacteristic
Definition: cf_char.cc:25

◆ getGFDegree()

int getGFDegree ( )

Definition at line 75 of file cf_char.cc.

76{
77 //ASSERT( theDegree > 0, "not in GF(q)" );
78 return theDegree;
79}
STATIC_VAR int theDegree
Definition: cf_char.cc:26

◆ getGFGenerator()

CanonicalForm getGFGenerator ( )

Definition at line 81 of file cf_char.cc.

82{
83 ASSERT( theDegree > 1, "not in GF(q)" );
84 return int2imm_gf( 1 );
85}
#define ASSERT(expression, message)
Definition: cf_assert.h:99
InternalCF * int2imm_gf(long i)
Definition: imm.h:106

◆ setCharacteristic() [1/2]

void setCharacteristic ( int  c)

Definition at line 28 of file cf_char.cc.

29{
30 if ( c == 0 )
31 {
32 theDegree = 0;
35 }
36 else
37 {
38 theDegree = 1;
41 if (c!=theCharacteristic)
42 {
43 if (c > 536870909) factoryError("characteristic is too large(max is 2^29)");
44 ff_setprime( c );
45 }
47 }
48}
#define FiniteFieldDomain
Definition: cf_defs.h:19
#define IntegerDomain
Definition: cf_defs.h:21
int cf_getNumSmallPrimes()
Definition: cf_primes.cc:34
int cf_getSmallPrime(int i)
Definition: cf_primes.cc:28
VAR void(* factoryError)(const char *s)
Definition: cf_util.cc:80
static void settype(int type)
Definition: cf_factory.h:29
VAR bool ff_big
Definition: ffops.cc:16
void ff_setprime(const int p)
Definition: ffops.cc:19

◆ setCharacteristic() [2/2]

void setCharacteristic ( int  c,
int  n,
char  name 
)

Definition at line 61 of file cf_char.cc.

62{
63 ASSERT( c != 0 && n > 1, "illegal GF(q)" );
66 theDegree = n;
68}
void setCharacteristic(int c)
Definition: cf_char.cc:28
#define GaloisFieldDomain
Definition: cf_defs.h:18
void gf_setcharacteristic(int p, int n, char name)
Definition: gfops.cc:202
int name
New type name for int.
Definition: templateForC.h:21

Variable Documentation

◆ theCharacteristic

STATIC_VAR int theCharacteristic = 0

Definition at line 25 of file cf_char.cc.

◆ theDegree

STATIC_VAR int theDegree = 1

Definition at line 26 of file cf_char.cc.