|
linbox
|
#include <gf2.h>
Public Types | |
| typedef bool | Element |
| Element type. | |
| typedef BitVector::pointer | Element_ptr |
| typedef BitVector::const_pointer | ConstElement_ptr |
| typedef bool | Residu_t |
| typedef GF2RandIter | RandIter |
| Random iterator generator type. | |
Public Member Functions | |
Object Management | |
| GF2 () | |
| Default constructor. | |
| GF2 (int p, int exp=1) | |
| Default constructor. | |
| GF2 (const GF2 &F) | |
| Copy constructor. | |
| GF2 & | operator= (const GF2 &F) |
| Assignment operator. | |
| Element & | init (Element &x, const int64_t &y) const |
| Initialization of field base element from an integer. | |
| Element & | init (Element &x, const uint64_t &y) const |
| Default constructor. | |
| Element & | init (Element &x, const bool &y) const |
| Default constructor. | |
| Element & | init (Element &x, const double &y) const |
| Default constructor. | |
| Element & | init (Element &x, const integer &y) const |
| Default constructor. | |
| Element & | init (Element &x) const |
| Default constructor. | |
| BitVector::reference | init (BitVector::reference x, const integer &y=0) const |
| Default constructor. | |
| std::vector< bool >::reference | init (std::vector< bool >::reference x, const integer &y=0) const |
| Default constructor. | |
| integer & | convert (integer &x, Element y) const |
| Conversion of field base element to a template class T. | |
| std::vector< bool >::reference | convert (std::vector< bool >::reference x, Element y) const |
| Default constructor. | |
| template<class XXX> | |
| XXX & | convert (XXX &x, Element y) const |
| Default constructor. | |
| Element & | assign (Element &x, Element y) const |
| Assignment of one field base element to another. | |
| BitVector::reference | assign (BitVector::reference x, Element y) const |
| Default constructor. | |
| std::vector< bool >::reference | assign (std::vector< bool >::reference x, Element y) const |
| Default constructor. | |
| integer & | cardinality (integer &c) const |
| Cardinality. | |
| integer & | characteristic (integer &c) const |
| Characteristic. | |
Arithmetic Operations | |
x <- y op z; x <- op y These operations require all elements, including x, to be initialized before the operation is called. Uninitialized field base elements will give undefined results. | |
| bool | areEqual (Element x, Element y) const |
| Equality of two elements. | |
| bool | isZero (Element x) const |
| Zero equality. | |
| bool | isOne (Element x) const |
| One equality. | |
| bool | isMOne (Element x) const |
| MOne equality. | |
| bool | isUnit (Element x) const |
| Invertibility. | |
| Element & | add (Element &x, Element y, Element z) const |
| Addition. | |
| BitVector::reference | add (BitVector::reference x, Element y, Element z) const |
| Addition. | |
| std::vector< bool >::reference | add (std::vector< bool >::reference x, Element y, Element z) const |
| Addition. | |
| Element & | sub (Element &x, Element y, Element z) const |
| Subtraction. | |
| BitVector::reference | sub (BitVector::reference x, Element y, Element z) const |
| Subtraction. | |
| std::vector< bool >::reference | sub (std::vector< bool >::reference x, Element y, Element z) const |
| Subtraction. | |
| Element & | mul (Element &x, Element y, Element z) const |
| Multiplication. | |
| BitVector::reference | mul (BitVector::reference x, Element y, Element z) const |
| Multiplication. | |
| std::vector< bool >::reference | mul (std::vector< bool >::reference x, Element y, Element z) const |
| Multiplication. | |
| Element & | div (Element &x, Element y, Element z) const |
| Division. | |
| BitVector::reference | div (BitVector::reference x, Element y, Element z) const |
| Division. | |
| std::vector< bool >::reference | div (std::vector< bool >::reference x, Element y, Element z) const |
| Division. | |
| Element & | neg (Element &x, Element y) const |
| Additive Inverse (Negation). | |
| BitVector::reference | neg (BitVector::reference x, Element y) const |
| Additive Inverse (Negation). | |
| std::vector< bool >::reference | neg (std::vector< bool >::reference x, Element y) const |
| Additive Inverse (Negation). | |
| Element & | inv (Element &x, Element y) const |
| Multiplicative Inverse. | |
| BitVector::reference | inv (BitVector::reference x, Element y) const |
| Multiplicative Inverse. | |
| std::vector< bool >::reference | inv (std::vector< bool >::reference x, Element y) const |
| Multiplicative Inverse. | |
| BitVector::reference | axpy (BitVector::reference r, Element a, Element x, Element y) const |
| Natural AXPY. | |
| std::vector< bool >::reference | axpy (std::vector< bool >::reference r, Element a, Element x, Element y) const |
| Natural AXPY. | |
| Element & | axpy (Element &r, Element a, Element x, Element y) const |
| Natural AXPY. | |
Input/Output Operations | |
| std::ostream & | write (std::ostream &os) const |
| Print field. | |
| std::istream & | read (std::istream &is) |
| Read field. | |
| std::ostream & | write (std::ostream &os, Element x) const |
| Print field base element. | |
| std::istream & | read (std::istream &is, Element &x) const |
| Read field base element. | |
| std::istream & | read (std::istream &is, BitVector::reference x) const |
| Read field base element. | |
| std::istream & | read (std::istream &is, std::vector< bool >::reference x) const |
| Read field base element. | |
Data Fields | |
| const bool | zero |
| const bool | one |
| const bool | mOne |
Inplace Arithmetic Operations | |
x <- x op y; x <- op x | |
| Element & | addin (Element &x, Element y) const |
| Inplace Addition. | |
| BitVector::reference | addin (BitVector::reference x, Element y) const |
| Inplace Addition. | |
| std::vector< bool >::reference | addin (std::vector< bool >::reference x, Element y) const |
| Inplace Addition. | |
| Element & | subin (Element &x, Element y) const |
| Inplace Subtraction. | |
| BitVector::reference | subin (BitVector::reference x, Element y) const |
| Inplace Subtraction. | |
| std::vector< bool >::reference | subin (std::vector< bool >::reference x, Element y) const |
| Inplace Subtraction. | |
| Element & | mulin (Element &x, Element y) const |
| Inplace Multiplication. | |
| BitVector::reference | mulin (BitVector::reference x, Element y) const |
| Inplace Multiplication. | |
| std::vector< bool >::reference | mulin (std::vector< bool >::reference x, Element y) const |
| Inplace Multiplication. | |
| Element & | divin (Element &x, Element y) const |
| Inplace Division. | |
| BitVector::reference | divin (BitVector::reference x, Element y) const |
| Inplace Division. | |
| std::vector< bool >::reference | divin (std::vector< bool >::reference x, Element y) const |
| Inplace Division. | |
| Element & | negin (Element &x) const |
| Inplace Additive Inverse (Inplace Negation). | |
| BitVector::reference | negin (BitVector::reference x) const |
| Inplace Additive Inplace (Inplace Negation). | |
| std::vector< bool >::reference | negin (std::vector< bool >::reference x) const |
| Inplace Additive Inplace (Inplace Negation). | |
| Element & | invin (Element &x) const |
| Inplace Multiplicative Inverse. | |
| BitVector::reference | invin (BitVector::reference x) const |
| Inplace Multiplicative Inverse. | |
| std::vector< bool >::reference | invin (std::vector< bool >::reference x) const |
| Inplace Multiplicative Inverse. | |
| Element & | axpyin (Element &r, Element a, Element x) const |
| Inplace AXPY. | |
| BitVector::reference | axpyin (BitVector::reference r, Element a, Element x) const |
| Inplace AXPY. | |
| std::vector< bool >::reference | axpyin (std::vector< bool >::reference r, Element a, Element x) const |
| Inplace AXPY. | |
| Element & | axpyin (Element &r, const std::vector< bool >::reference a, Element x) const |
| Inplace AXPY. | |
| std::vector< bool >::reference | axpyin (std::vector< bool >::reference r, const std::vector< bool >::reference a, Element x) const |
| Inplace AXPY. | |
| Element & | axpyin (Element &r, Element a, const std::vector< bool >::reference x) const |
| Inplace AXPY. | |
| std::vector< bool >::reference | axpyin (std::vector< bool >::reference r, Element a, const std::vector< bool >::reference x) const |
| Inplace AXPY. | |
| Element & | axpyin (Element &r, const std::vector< bool >::reference a, const std::vector< bool >::reference x) const |
| Inplace AXPY. | |
| std::vector< bool >::reference | axpyin (std::vector< bool >::reference r, const std::vector< bool >::reference a, const std::vector< bool >::reference x) const |
| Inplace AXPY. | |
| static int | maxCardinality () |
| Inplace Addition. | |
| typedef BitVector::pointer Element_ptr |
| typedef bool Residu_t |
| typedef GF2RandIter RandIter |
Random iterator generator type.
It must meet the common object interface of random element generators as given in the the archetype RandIterArchetype.
|
inline |
Default constructor.
|
inline |
Default constructor.
Copy constructor.
Constructs Givaro::Modular object by copying the field. This is required to allow field objects to be passed by value into functions.
| F | Givaro::Modular object. |
Assignment operator.
Required by the archetype
| F | constant reference to Givaro::Modular object |
Initialization of field base element from an integer.
Behaves like C++ allocator construct. This function assumes the output field base element x has already been constructed, but that it is not already initialized. This is not a specialization of the template function because such a specialization is not allowed inside the class declaration.
| x | field base element to contain output (reference returned). |
| y | integer. |
|
inline |
Default constructor.
|
inline |
Default constructor.
Conversion of field base element to a template class T.
This function assumes the output field base element x has already been constructed, but that it is not already initialized.
| x | template class T to contain output (reference returned). |
| y | constant field base element. |
|
inline |
Default constructor.
|
inline |
Default constructor.
Assignment of one field base element to another.
This function assumes both field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
|
inline |
Default constructor.
|
inline |
Default constructor.
Cardinality.
Return integer representing cardinality of the domain. Returns a non-negative integer for all domains with finite cardinality, and returns -1 to signify a domain of infinite cardinality.
Characteristic.
Return integer representing characteristic of the domain. Returns a positive integer to all domains with finite characteristic, and returns 0 to signify a domain of infinite characteristic.
Equality of two elements.
This function assumes both field base elements have already been constructed and initialized.
| x | field base element |
| y | field base element |
|
inline |
Zero equality.
Test if field base element is equal to zero. This function assumes the field base element has already been constructed and initialized.
| x | field base element. |
|
inline |
One equality.
Test if field base element is equal to one. This function assumes the field base element has already been constructed and initialized.
| x | field base element. |
|
inline |
MOne equality.
Test if field base element is equal to one. This function assumes the field base element has already been constructed and initialized.
| x | field base element. |
|
inline |
Invertibility.
Test if field base element is a unit. This function assumes the field base element has already been constructed and initialized.
| x | field base element. |
|
inline |
Print field.
| os | output stream to which field is written. |
|
inline |
Read field.
| is | input stream from which field is read. |
|
inline |
Print field base element.
This function assumes the field base element has already been constructed and initialized.
| os | output stream to which field base element is written. |
| x | field base element. |
|
inline |
Read field base element.
| is | input stream from which field base element is read. |
| x | field base element. |
|
inline |
Read field base element.
| is | input stream |
| x |
is
|
inline |
Read field base element.
| is | input stream |
| x |
is Addition.
x = y + z This function assumes all the field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
| z | field base element. |
|
inline |
Addition.
| x | |
| y | |
| z |
|
inline |
Addition.
| x | |
| y | |
| z |
Subtraction.
x = y - z This function assumes all the field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
| z | field base element. |
|
inline |
Subtraction.
| x | |
| y | |
| z |
|
inline |
Subtraction.
| x | |
| y | |
| z |
Multiplication.
x = y * z This function assumes all the field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
| z | field base element. |
|
inline |
Multiplication.
| x | |
| y | |
| z |
|
inline |
Multiplication.
| x | |
| y | |
| z |
Division.
x = y / z This function assumes all the field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
| z | field base element. |
|
inline |
Division.
| x | |
| y | |
| z |
|
inline |
Division.
| x | |
| y | |
| z |
Additive Inverse (Negation).
x = - y This function assumes both field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
|
inline |
|
inline |
Multiplicative Inverse.
x = 1 / y This function assumes both field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
|
inline |
|
inline |
|
inline |
Natural AXPY.
r = a * x + y This function assumes all field elements have already been constructed and initialized.
| r | field element (reference returned). |
| a | field element. |
| x | field element. |
| y | field element. |
|
inline |
Natural AXPY.
| r | |
| a | |
| x | |
| y |
Natural AXPY.
| r | |
| a | |
| x | |
| y |
Inplace Addition.
x += y This function assumes both field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
|
inline |
Inplace Addition.
| x | |
| y |
|
inline |
Inplace Addition.
| x | |
| y |
Inplace Subtraction.
x -= y This function assumes both field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
|
inline |
Inplace Subtraction.
| x | |
| y |
|
inline |
Inplace Subtraction.
| x | |
| y |
Inplace Multiplication.
x *= y This function assumes both field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
|
inline |
Inplace Multiplication.
| x | |
| y |
|
inline |
Inplace Multiplication.
| x | |
| y |
Inplace Division.
x /= y This function assumes both field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
|
inline |
|
inline |
Inplace Additive Inverse (Inplace Negation).
x = - x This function assumes the field base element has already been constructed and initialized.
| x | field base element (reference returned). |
|
inline |
|
inline |
Inplace Multiplicative Inverse.
x = 1 / x This function assumes the field base elementhas already been constructed and initialized.
| x | field base element (reference returned). |
|
inline |
|
inline |
Inplace AXPY.
r += a * x This function assumes all field elements have already been constructed and initialized. Purely virtual
| r | field element (reference returned). |
| a | field element. |
| x | field element. |
|
inline |
Inplace AXPY.
| r | |
| a | |
| x |
|
inline |
Inplace AXPY.
| r | |
| a | |
| x |
Inplace AXPY.
| r | |
| a | |
| x |
|
inline |
Inplace AXPY.
| r | |
| a | |
| x |
Inplace AXPY.
| r | |
| a | |
| x |
|
inline |
Inplace AXPY.
| r | |
| a | |
| x |
|
inline |
Inplace AXPY.
| r | |
| a | |
| x |
|
inline |
Inplace AXPY.
| r | |
| a | |
| x |
|
inlinestatic |
Inplace Addition.
x += y This function assumes both field base elements have already been constructed and initialized.
| x | field base element (reference returned). |
| y | field base element. |
| const bool zero |
| const bool one |
| const bool mOne |