Fabcoin Core
0.16.2
P2P Digital Currency
|
Polynomials over a fixed ring. More...
#include <polynomi.h>
Classes | |
struct | NewOnePolynomial |
Public Types | |
typedef T | Ring |
typedef T::Element | CoefficientType |
typedef B::DivideByZero | DivideByZero |
typedef B::RandomizationParameter | RandomizationParameter |
Public Member Functions | |
ACCESSORS | |
int | Degree () const |
the zero polynomial will return a degree of -1 More... | |
unsigned int | CoefficientCount () const |
degree + 1 More... | |
CoefficientType | GetCoefficient (unsigned int i) const |
return coefficient for x^i More... | |
CoefficientType | operator[] (unsigned int i) const |
return coefficient for x^i More... | |
MANIPULATORS | |
ThisType & | operator= (const ThisType &t) |
ThisType & | operator+= (const ThisType &t) |
ThisType & | operator-= (const ThisType &t) |
ThisType & | operator*= (const ThisType &t) |
ThisType & | operator/= (const ThisType &t) |
ThisType & | operator%= (const ThisType &t) |
ThisType & | operator<<= (unsigned int n) |
ThisType & | operator>>= (unsigned int n) |
void | SetCoefficient (unsigned int i, const CoefficientType &value) |
set the coefficient for x^i to value More... | |
void | Randomize (RandomNumberGenerator &rng, const RandomizationParameter ¶meter) |
void | Negate () |
void | swap (ThisType &t) |
UNARY OPERATORS | |
bool | operator! () const |
ThisType | operator+ () const |
ThisType | operator- () const |
Private Types | |
typedef PolynomialOver< T > | B |
typedef PolynomialOverFixedRing< T, instance > | ThisType |
Private Types inherited from PolynomialOver< T > | |
typedef T | Ring |
typedef T::Element | CoefficientType |
Static Private Attributes | |
static const Ring | ms_fixedRing |
Friends | |
BINARY OPERATORS | |
ThisType | operator>> (ThisType a, unsigned int n) |
ThisType | operator<< (ThisType a, unsigned int n) |
INPUT/OUTPUT | |
std::istream & | operator>> (std::istream &in, ThisType &a) |
std::ostream & | operator<< (std::ostream &out, const ThisType &a) |
CREATORS | |
PolynomialOverFixedRing (unsigned int count=0) | |
creates the zero polynomial More... | |
PolynomialOverFixedRing (const ThisType &t) | |
copy constructor More... | |
PolynomialOverFixedRing (const B &t) | |
PolynomialOverFixedRing (const CoefficientType &element) | |
construct constant polynomial More... | |
template<typename Iterator > | |
PolynomialOverFixedRing (Iterator first, Iterator last) | |
construct polynomial with specified coefficients, starting from coefficient of x^0 More... | |
PolynomialOverFixedRing (const char *str) | |
convert from string More... | |
PolynomialOverFixedRing (const byte *encodedPoly, unsigned int byteCount) | |
convert from big-endian byte array More... | |
PolynomialOverFixedRing (const byte *BEREncodedPoly) | |
convert from Basic Encoding Rules encoded byte array More... | |
PolynomialOverFixedRing (BufferedTransformation &bt) | |
convert from BER encoded byte array stored in a BufferedTransformation object More... | |
PolynomialOverFixedRing (RandomNumberGenerator &rng, const RandomizationParameter ¶meter) | |
create a random PolynomialOverFixedRing More... | |
static const ThisType & | Zero () |
static const ThisType & | One () |
OTHER ARITHMETIC FUNCTIONS | |
ThisType | MultiplicativeInverse () const |
bool | IsUnit () const |
ThisType | Doubled () const |
ThisType | Squared () const |
CoefficientType | EvaluateAt (const CoefficientType &x) const |
static void | Divide (ThisType &r, ThisType &q, const ThisType &a, const ThisType &d) |
calculate r and q such that (a == d*q + r) && (0 <= r < abs(d)) More... | |
Additional Inherited Members | |
Private Member Functions inherited from PolynomialOver< T > | |
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 ¶meter, const Ring &ring) | |
create a random PolynomialOver<T> More... | |
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... | |
PolynomialOver< Ring > & | operator= (const PolynomialOver< Ring > &t) |
void | Randomize (RandomNumberGenerator &rng, const RandomizationParameter ¶meter, 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) |
bool | Equals (const PolynomialOver< Ring > &t, const Ring &ring) const |
bool | IsZero (const Ring &ring) const |
PolynomialOver< Ring > | Plus (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Minus (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Inverse (const Ring &ring) const |
PolynomialOver< Ring > | Times (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | DividedBy (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | Modulo (const PolynomialOver< Ring > &t, const Ring &ring) const |
PolynomialOver< Ring > | MultiplicativeInverse (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< Ring > | Doubled (const Ring &ring) const |
PolynomialOver< Ring > | Squared (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) |
std::istream & | Input (std::istream &in, const Ring &ring) |
std::ostream & | Output (std::ostream &out, const Ring &ring) const |
Static Private Member Functions inherited from PolynomialOver< T > | |
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... | |
Polynomials over a fixed ring.
Having a fixed ring allows overloaded operators
Definition at line 167 of file polynomi.h.
|
private |
Definition at line 169 of file polynomi.h.
typedef T::Element PolynomialOverFixedRing< T, instance >::CoefficientType |
Definition at line 174 of file polynomi.h.
typedef B::DivideByZero PolynomialOverFixedRing< T, instance >::DivideByZero |
Definition at line 175 of file polynomi.h.
typedef B::RandomizationParameter PolynomialOverFixedRing< T, instance >::RandomizationParameter |
Definition at line 176 of file polynomi.h.
typedef T PolynomialOverFixedRing< T, instance >::Ring |
Definition at line 173 of file polynomi.h.
|
private |
Definition at line 170 of file polynomi.h.
|
inline |
creates the zero polynomial
Definition at line 181 of file polynomi.h.
|
inline |
copy constructor
Definition at line 184 of file polynomi.h.
|
inlineexplicit |
Definition at line 186 of file polynomi.h.
|
inline |
construct constant polynomial
Definition at line 189 of file polynomi.h.
|
inline |
construct polynomial with specified coefficients, starting from coefficient of x^0
Definition at line 192 of file polynomi.h.
|
inlineexplicit |
convert from string
Definition at line 196 of file polynomi.h.
|
inline |
convert from big-endian byte array
Definition at line 199 of file polynomi.h.
|
inlineexplicit |
convert from Basic Encoding Rules encoded byte array
Definition at line 202 of file polynomi.h.
|
inlineexplicit |
convert from BER encoded byte array stored in a BufferedTransformation object
Definition at line 205 of file polynomi.h.
|
inline |
create a random PolynomialOverFixedRing
Definition at line 208 of file polynomi.h.
|
inline |
degree + 1
Definition at line 219 of file polynomi.h.
|
inline |
the zero polynomial will return a degree of -1
Definition at line 217 of file polynomi.h.
|
inlinestatic |
calculate r and q such that (a == d*q + r) && (0 <= r < abs(d))
Definition at line 291 of file polynomi.h.
|
inline |
Definition at line 284 of file polynomi.h.
|
inline |
Definition at line 288 of file polynomi.h.
|
inline |
return coefficient for x^i
Definition at line 221 of file polynomi.h.
|
inline |
Definition at line 281 of file polynomi.h.
|
inline |
Definition at line 279 of file polynomi.h.
|
inline |
Definition at line 253 of file polynomi.h.
|
static |
Definition at line 572 of file polynomi.cpp.
|
inline |
Definition at line 261 of file polynomi.h.
|
inline |
Definition at line 239 of file polynomi.h.
|
inline |
Definition at line 235 of file polynomi.h.
|
inline |
Definition at line 263 of file polynomi.h.
|
inline |
Definition at line 231 of file polynomi.h.
|
inline |
|
inline |
Definition at line 233 of file polynomi.h.
|
inline |
Definition at line 237 of file polynomi.h.
|
inline |
Definition at line 242 of file polynomi.h.
|
inline |
Definition at line 229 of file polynomi.h.
|
inline |
Definition at line 244 of file polynomi.h.
|
inline |
return coefficient for x^i
Definition at line 223 of file polynomi.h.
|
inline |
Definition at line 250 of file polynomi.h.
|
inline |
set the coefficient for x^i to value
Definition at line 247 of file polynomi.h.
|
inline |
Definition at line 286 of file polynomi.h.
|
inline |
|
static |
Definition at line 566 of file polynomi.cpp.
Definition at line 273 of file polynomi.h.
|
friend |
Definition at line 301 of file polynomi.h.
Definition at line 271 of file polynomi.h.
|
friend |
Definition at line 298 of file polynomi.h.
|
staticprivate |
Definition at line 314 of file polynomi.h.