My Project
Public Member Functions | Private Attributes
CFSwitches Class Reference

class CFSwitches More...

#include <cf_switches.h>

Public Member Functions

 CFSwitches ()
 CFSwitches::CFSwitches () More...
 
 ~CFSwitches ()
 
void On (int s)
 switch 's' on More...
 
void Off (int s)
 switch 's' off More...
 
bool isOn (int s) const
 check if 's' is on More...
 
bool isOff (int s) const
 check if 's' is off More...
 

Private Attributes

bool switches [CFSwitchesMax]
 

Detailed Description

class CFSwitches

class CFSwitches - manages boolean switches.

An object of class ‘CFSwitches’ is simply an array of booleans with some comfortable access methods (‘On()’, ‘isOn()’, etc.). Each object may contain ‘CFSwitchesMax’ switches. When a new object of type ‘CFSwitches’ is created, all its switches are turned off.

Note: No range checking is done when accessing switches.

switches: the switches

Definition at line 39 of file cf_switches.h.

Constructor & Destructor Documentation

◆ CFSwitches()

CFSwitches::CFSwitches ( )

CFSwitches::CFSwitches ()

CFSwitches::CFSwitches() - default constructor.

Turns all switches off.

Definition at line 31 of file cf_switches.cc.

32{
33 for ( int i = 0; i < CFSwitchesMax; i++ )
34 switches[i] = false;
35// and set the default (recommended) On-values:
36#if defined(HAVE_NTL) || defined(HAVE_FLINT)
38#endif
40#ifdef HAVE_FLINT
43#if (__FLINT_RELEASE >= 20700)
45#endif
46#endif
51 //On(SW_USE_FL_FAC_0A);
52}
int i
Definition: cfEzgcd.cc:132
static const int SW_USE_QGCD
set to 1 to use Encarnacion GCD over Q(a)
Definition: cf_defs.h:43
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
Definition: cf_defs.h:41
static const int SW_USE_FL_GCD_P
set to 1 to use Flints gcd over F_p
Definition: cf_defs.h:47
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
Definition: cf_defs.h:37
static const int SW_USE_NTL_SORT
set to 1 to sort factors in a factorization
Definition: cf_defs.h:39
static const int SW_USE_FL_FAC_0
set to 1 to prefer flints multivariate factorization over Z/p
Definition: cf_defs.h:57
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
Definition: cf_defs.h:35
static const int SW_USE_FL_GCD_0
set to 1 to use Flints gcd over Q/Z
Definition: cf_defs.h:49
static const int SW_USE_FL_FAC_P
set to 1 to prefer flints multivariate factorization over Z/p
Definition: cf_defs.h:55
const int CFSwitchesMax
const int CFSwitchesMax
Definition: cf_switches.h:22
void On(int s)
switch 's' on
Definition: cf_switches.h:51
bool switches[CFSwitchesMax]
Definition: cf_switches.h:42

◆ ~CFSwitches()

CFSwitches::~CFSwitches ( )
inline

Definition at line 47 of file cf_switches.h.

47{}

Member Function Documentation

◆ isOff()

bool CFSwitches::isOff ( int  s) const
inline

check if 's' is off

Definition at line 57 of file cf_switches.h.

57{ return ! switches[s]; }
const CanonicalForm int s
Definition: facAbsFact.cc:51

◆ isOn()

bool CFSwitches::isOn ( int  s) const
inline

check if 's' is on

Definition at line 55 of file cf_switches.h.

55{ return switches[s]; }

◆ Off()

void CFSwitches::Off ( int  s)
inline

switch 's' off

Definition at line 53 of file cf_switches.h.

53{ switches[s] = false; }

◆ On()

void CFSwitches::On ( int  s)
inline

switch 's' on

Definition at line 51 of file cf_switches.h.

51{ switches[s] = true; }

Field Documentation

◆ switches

bool CFSwitches::switches[CFSwitchesMax]
private

Definition at line 42 of file cf_switches.h.


The documentation for this class was generated from the following files: