Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Private Member Functions | Private Attributes | List of all members
PolynomialOver< T > Class Template Reference

represents single-variable polynomials over arbitrary rings More...

#include <polynomi.h>

Inheritance diagram for PolynomialOver< T >:
[legend]

Classes

class  DivideByZero
 division by zero exception More...
 
class  RandomizationParameter
 specify the distribution for randomization functions More...
 

Private Member Functions

void FromStr (const char *str, const Ring &ring)
 

Private Attributes

std::vector< CoefficientTypem_coefficients
 

ENUMS, EXCEPTIONS, and TYPEDEFS

typedef T Ring
 
typedef T::Element CoefficientType
 

CREATORS

 PolynomialOver ()
 creates the zero polynomial More...
 
 PolynomialOver (const Ring &ring, unsigned int count)
 
 PolynomialOver (const PolynomialOver< Ring > &t)
 copy constructor More...
 
 PolynomialOver (const CoefficientType &element)
 construct constant polynomial More...
 
template<typename Iterator >
 PolynomialOver (Iterator begin, Iterator end)
 construct polynomial with specified coefficients, starting from coefficient of x^0 More...
 
 PolynomialOver (const char *str, const Ring &ring)
 convert from string More...
 
 PolynomialOver (const byte *encodedPolynomialOver, unsigned int byteCount)
 convert from big-endian byte array More...
 
 PolynomialOver (const byte *BEREncodedPolynomialOver)
 convert from Basic Encoding Rules encoded byte array More...
 
 PolynomialOver (BufferedTransformation &bt)
 convert from BER encoded byte array stored in a BufferedTransformation object More...
 
 PolynomialOver (RandomNumberGenerator &rng, const RandomizationParameter &parameter, const Ring &ring)
 create a random PolynomialOver<T> More...
 

ACCESSORS

int Degree (const Ring &ring) const
 the zero polynomial will return a degree of -1 More...
 
unsigned int CoefficientCount (const Ring &ring) const
 
CoefficientType GetCoefficient (unsigned int i, const Ring &ring) const
 return coefficient for x^i More...
 

MANIPULATORS

PolynomialOver< Ring > & operator= (const PolynomialOver< Ring > &t)
 
void Randomize (RandomNumberGenerator &rng, const RandomizationParameter &parameter, const Ring &ring)
 
void SetCoefficient (unsigned int i, const CoefficientType &value, const Ring &ring)
 set the coefficient for x^i to value More...
 
void Negate (const Ring &ring)
 
void swap (PolynomialOver< Ring > &t)
 

BASIC ARITHMETIC ON POLYNOMIALS

bool Equals (const PolynomialOver< Ring > &t, const Ring &ring) const
 
bool IsZero (const Ring &ring) const
 
PolynomialOver< RingPlus (const PolynomialOver< Ring > &t, const Ring &ring) const
 
PolynomialOver< RingMinus (const PolynomialOver< Ring > &t, const Ring &ring) const
 
PolynomialOver< RingInverse (const Ring &ring) const
 
PolynomialOver< RingTimes (const PolynomialOver< Ring > &t, const Ring &ring) const
 
PolynomialOver< RingDividedBy (const PolynomialOver< Ring > &t, const Ring &ring) const
 
PolynomialOver< RingModulo (const PolynomialOver< Ring > &t, const Ring &ring) const
 
PolynomialOver< RingMultiplicativeInverse (const Ring &ring) const
 
bool IsUnit (const Ring &ring) const
 
PolynomialOver< Ring > & Accumulate (const PolynomialOver< Ring > &t, const Ring &ring)
 
PolynomialOver< Ring > & Reduce (const PolynomialOver< Ring > &t, const Ring &ring)
 
PolynomialOver< RingDoubled (const Ring &ring) const
 
PolynomialOver< RingSquared (const Ring &ring) const
 
CoefficientType EvaluateAt (const CoefficientType &x, const Ring &ring) const
 
PolynomialOver< Ring > & ShiftLeft (unsigned int n, const Ring &ring)
 
PolynomialOver< Ring > & ShiftRight (unsigned int n, const Ring &ring)
 
static void Divide (PolynomialOver< Ring > &r, PolynomialOver< Ring > &q, const PolynomialOver< Ring > &a, const PolynomialOver< Ring > &d, const Ring &ring)
 calculate r and q such that (a == d*q + r) && (0 <= degree of r < degree of d) More...
 

INPUT/OUTPUT

std::istream & Input (std::istream &in, const Ring &ring)
 
std::ostream & Output (std::ostream &out, const Ring &ring) const
 

Detailed Description

template<class T>
class PolynomialOver< T >

represents single-variable polynomials over arbitrary rings

Definition at line 25 of file polynomi.h.

Member Typedef Documentation

template<class T>
typedef T::Element PolynomialOver< T >::CoefficientType

Definition at line 51 of file polynomi.h.

template<class T>
typedef T PolynomialOver< T >::Ring

Definition at line 50 of file polynomi.h.

Constructor & Destructor Documentation

template<class T>
PolynomialOver< T >::PolynomialOver ( )
inline

creates the zero polynomial

Definition at line 57 of file polynomi.h.

Here is the caller graph for this function:

template<class T>
PolynomialOver< T >::PolynomialOver ( const Ring ring,
unsigned int  count 
)
inline

Definition at line 60 of file polynomi.h.

template<class T>
PolynomialOver< T >::PolynomialOver ( const PolynomialOver< Ring > &  t)
inline

copy constructor

Definition at line 64 of file polynomi.h.

template<class T>
PolynomialOver< T >::PolynomialOver ( const CoefficientType element)
inline

construct constant polynomial

Definition at line 68 of file polynomi.h.

template<class T>
template<typename Iterator >
PolynomialOver< T >::PolynomialOver ( Iterator  begin,
Iterator  end 
)
inline

construct polynomial with specified coefficients, starting from coefficient of x^0

Definition at line 72 of file polynomi.h.

template<class T>
PolynomialOver< T >::PolynomialOver ( const char *  str,
const Ring ring 
)
inline

convert from string

Definition at line 76 of file polynomi.h.

Here is the call graph for this function:

template<class T>
PolynomialOver< T >::PolynomialOver ( const byte encodedPolynomialOver,
unsigned int  byteCount 
)

convert from big-endian byte array

template<class T>
PolynomialOver< T >::PolynomialOver ( const byte BEREncodedPolynomialOver)
explicit

convert from Basic Encoding Rules encoded byte array

template<class T>
PolynomialOver< T >::PolynomialOver ( BufferedTransformation bt)
explicit

convert from BER encoded byte array stored in a BufferedTransformation object

template<class T>
PolynomialOver< T >::PolynomialOver ( RandomNumberGenerator rng,
const RandomizationParameter parameter,
const Ring ring 
)
inline

create a random PolynomialOver<T>

Definition at line 88 of file polynomi.h.

Here is the call graph for this function:

Member Function Documentation

template<class T >
PolynomialOver< T > & PolynomialOver< T >::Accumulate ( const PolynomialOver< Ring > &  t,
const Ring ring 
)

Definition at line 104 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
unsigned int PolynomialOver< T >::CoefficientCount ( const Ring ring) const

Definition at line 76 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T>
int PolynomialOver< T >::Degree ( const Ring ring) const
inline

the zero polynomial will return a degree of -1

Definition at line 95 of file polynomi.h.

Here is the caller graph for this function:

template<class T >
void PolynomialOver< T >::Divide ( PolynomialOver< Ring > &  r,
PolynomialOver< Ring > &  q,
const PolynomialOver< Ring > &  a,
const PolynomialOver< Ring > &  d,
const Ring ring 
)
static

calculate r and q such that (a == d*q + r) && (0 <= degree of r < degree of d)

Definition at line 430 of file polynomi.cpp.

Here is the call graph for this function:

template<class T >
PolynomialOver< T > PolynomialOver< T >::DividedBy ( const PolynomialOver< Ring > &  t,
const Ring ring 
) const

Definition at line 309 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T>
PolynomialOver<Ring> PolynomialOver< T >::Doubled ( const Ring ring) const
inline

Definition at line 140 of file polynomi.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
bool PolynomialOver< T >::Equals ( const PolynomialOver< Ring > &  t,
const Ring ring 
) const

Definition at line 204 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
PolynomialOver< T >::CoefficientType PolynomialOver< T >::EvaluateAt ( const CoefficientType x,
const Ring ring 
) const

Definition at line 132 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
void PolynomialOver< T >::FromStr ( const char *  str,
const Ring ring 
)
private

Definition at line 24 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
PolynomialOver< T >::CoefficientType PolynomialOver< T >::GetCoefficient ( unsigned int  i,
const Ring ring 
) const

return coefficient for x^i

Definition at line 86 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
std::istream & PolynomialOver< T >::Input ( std::istream &  in,
const Ring ring 
)

Definition at line 337 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > PolynomialOver< T >::Inverse ( const Ring ring) const

Definition at line 281 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
bool PolynomialOver< T >::IsUnit ( const Ring ring) const

Definition at line 331 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T>
bool PolynomialOver< T >::IsZero ( const Ring ring) const
inline

Definition at line 124 of file polynomi.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > PolynomialOver< T >::Minus ( const PolynomialOver< Ring > &  t,
const Ring ring 
) const

Definition at line 250 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > PolynomialOver< T >::Modulo ( const PolynomialOver< Ring > &  t,
const Ring ring 
) const

Definition at line 317 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > PolynomialOver< T >::MultiplicativeInverse ( const Ring ring) const

Definition at line 325 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
void PolynomialOver< T >::Negate ( const Ring ring)

Definition at line 190 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > & PolynomialOver< T >::operator= ( const PolynomialOver< Ring > &  t)

Definition at line 92 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
std::ostream & PolynomialOver< T >::Output ( std::ostream &  out,
const Ring ring 
) const

Definition at line 370 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > PolynomialOver< T >::Plus ( const PolynomialOver< Ring > &  t,
const Ring ring 
) const

Definition at line 219 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
void PolynomialOver< T >::Randomize ( RandomNumberGenerator rng,
const RandomizationParameter parameter,
const Ring ring 
)

Definition at line 16 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > & PolynomialOver< T >::Reduce ( const PolynomialOver< Ring > &  t,
const Ring ring 
)

Definition at line 118 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
void PolynomialOver< T >::SetCoefficient ( unsigned int  i,
const CoefficientType value,
const Ring ring 
)

set the coefficient for x^i to value

Definition at line 182 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > & PolynomialOver< T >::ShiftLeft ( unsigned int  n,
const Ring ring 
)

Definition at line 149 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T >
PolynomialOver< T > & PolynomialOver< T >::ShiftRight ( unsigned int  n,
const Ring ring 
)

Definition at line 167 of file polynomi.cpp.

Here is the caller graph for this function:

template<class T>
PolynomialOver<Ring> PolynomialOver< T >::Squared ( const Ring ring) const
inline

Definition at line 142 of file polynomi.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
void PolynomialOver< T >::swap ( PolynomialOver< Ring > &  t)

Definition at line 198 of file polynomi.cpp.

template<class T >
PolynomialOver< T > PolynomialOver< T >::Times ( const PolynomialOver< Ring > &  t,
const Ring ring 
) const

Definition at line 293 of file polynomi.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

template<class T>
std::vector<CoefficientType> PolynomialOver< T >::m_coefficients
private

Definition at line 162 of file polynomi.h.


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