#include <polynomials.h>
Inheritance diagram for atlas::polynomials::Polynomial< C >:

Public Member Functions | |
| Polynomial () | |
| Polynomial (Degree d) | |
| Constructs x^d. | |
| void | swap (Polynomial &other) |
| C | operator[] (Degree j) const |
| bool | operator== (const Polynomial &q) const |
| bool | operator!= (const Polynomial &q) const |
| bool | operator< (const Polynomial &q) const |
| Operator < is the default from the standard library < on vector. | |
| Degree | degree () const |
| bool | isZero () const |
| C & | operator[] (Degree j) |
| Polynomial & | operator+= (const Polynomial &q) |
| Polynomial & | operator-= (const Polynomial &q) |
| Polynomial & | subtract_from (const Polynomial &p) |
| Polynomial & | operator *= (C) |
| Polynomial | operator * (const Polynomial &q) const |
| void | safeAdd (const Polynomial &p, Degree d, C c) |
| Adds x^d.c.q, to *this, watching for overflow. | |
| void | safeAdd (const Polynomial &p, Degree d=0) |
| void | safeSubtract (const Polynomial &p, Degree d, C c) |
| Subtracts x^d.c.q from *this, watching for underflow. | |
| void | safeSubtract (const Polynomial &p, Degree d=0) |
Private Member Functions | |
| void | adjustSize () |
| Adjusts the size of d_data so that it corresponds to the degree + 1. | |
Private Attributes | |
| std::vector< C > | d_data |
The coefficient type C must support addition (+, +=), multiplication (*, *=), subtraction (unary and binary -, -=), and std::numeric_limits<C> (used to test for overflow in the safeAdd operation); moreover comparisons (<, ==, !=) should be defined, although < need not have any particular mathematical sense
Definition at line 63 of file polynomials.h.
|
|||||||||
|
Definition at line 74 of file polynomials.h. Referenced by atlas::polynomials::Polynomial< C >::operator *(), and atlas::polynomials::Polynomial< C >::operator *=(). |
|
||||||||||
|
Constructs x^d. We construct x^d, and not the zero polynomial, so that our basic assumption about the degree is satisfied. Definition at line 60 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::d_data. |
|
|||||||||
|
Adjusts the size of d_data so that it corresponds to the degree + 1. Steps down through the coefficients of the polynomial, beginning with the top coefficient, until it finds a non-zero coefficient (or reaches zero). Then resizes d_data so that this non-zero coefficient is the top one (or to have size zero if the polynomial is zero). Definition at line 88 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::d_data. Referenced by atlas::polynomials::Polynomial< C >::operator+=(), atlas::polynomials::Polynomial< C >::operator-=(), atlas::polynomials::Polynomial< C >::safeSubtract(), and atlas::polynomials::Polynomial< C >::subtract_from(). |
|
|||||||||
|
|||||||||
|
||||||||||
|
Definition at line 153 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::d_data, atlas::polynomials::Polynomial< C >::degree(), atlas::polynomials::Polynomial< C >::isZero(), and atlas::polynomials::Polynomial< C >::Polynomial(). |
|
||||||||||
|
Definition at line 143 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::d_data, and atlas::polynomials::Polynomial< C >::Polynomial(). |
|
||||||||||
|
Definition at line 92 of file polynomials.h. |
|
||||||||||
|
Definition at line 98 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::adjustSize(), atlas::polynomials::Polynomial< C >::d_data, and atlas::polynomials::Polynomial< C >::isZero(). |
|
||||||||||
|
Definition at line 115 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::adjustSize(), atlas::polynomials::Polynomial< C >::d_data, and atlas::polynomials::Polynomial< C >::isZero(). |
|
||||||||||
|
Operator < is the default from the standard library < on vector. The comparison operation below is only defined in order to allow ordered data types containing polynomials, such as |stdset<Polynomial<int> >|. Currently no such types are used in the Atlas (but initially they were). Definition at line 104 of file polynomials.h. |
|
||||||||||
|
Definition at line 88 of file polynomials.h. |
|
||||||||||
|
Definition at line 111 of file polynomials.h. |
|
||||||||||
|
Definition at line 84 of file polynomials.h. |
|
||||||||||||||||
|
Definition at line 203 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::d_data, atlas::polynomials::Polynomial< C >::degree(), atlas::polynomials::Degree, atlas::polynomials::Polynomial< C >::isZero(), and atlas::polynomials::safeAdd(). |
|
||||||||||||||||||||
|
Adds x^d.c.q, to *this, watching for overflow. NOTE: may forward a NumericOverflow exception. NOTE: we need to be careful in the case where q = *this, but we can avoid making a copy, by doing the addition top-to-bottom. Definition at line 180 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::d_data, atlas::polynomials::Polynomial< C >::degree(), atlas::polynomials::Degree, atlas::polynomials::Polynomial< C >::isZero(), atlas::polynomials::safeAdd(), and atlas::polynomials::safeProd(). Referenced by atlas::kl::helper::Thicket::ascentCompute(), and atlas::kl::helper::Helper::writeRow(). |
|
||||||||||||||||
|
||||||||||||||||||||
|
Subtracts x^d.c.q from *this, watching for underflow. NOTE: may forward a NumericUnderflow exception. NOTE: q = *this is possible only for d = 0; still, we do the prudent thing and subtract backwards. Definition at line 231 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::adjustSize(), atlas::polynomials::Polynomial< C >::d_data, atlas::polynomials::Polynomial< C >::degree(), atlas::polynomials::Degree, atlas::polynomials::Polynomial< C >::isZero(), atlas::polynomials::safeProd(), and atlas::polynomials::safeSubtract(). Referenced by atlas::kl::helper::Thicket::edgeCompute(). |
|
||||||||||
|
Definition at line 127 of file polynomials_def.h. References atlas::polynomials::Polynomial< C >::adjustSize(), and atlas::polynomials::Polynomial< C >::d_data. Referenced by atlas::kltest::dualityVerify(). |
|
||||||||||
|
Definition at line 79 of file polynomials.h. |
|
|||||
1.3.9.1