26 #ifndef __POLYNOM_HH__
27 #define __POLYNOM_HH__
29 #include "Base/Common/BIASpragmaStart.hh"
32 #include "Base/Debug/Debug.hh"
33 #include "Base/Debug/Error.hh"
49 Polynom(
double d=0.0):std::vector<double>(1,0.0){
72 this->resize(i+1,0.0);
81 while ((*
this)[deg]==0) {
88 std::vector<double> tmp(deg+1);
89 for (
int i=0; i<=deg; i++) {
93 for (
int i=0; i<=deg; i++) {
101 for (
unsigned int i=0; i<=
order_; i++) {
102 res += (*this)[i]*xx;
131 for(
unsigned int i=0;i<=
order_; i++){
147 for(
unsigned int i=0; i<=a.
order_; i++){
161 for(
unsigned int i=0;i<=a.
order_;i++){
174 for(
unsigned int i=0; i<=
order_; i++) {
175 for(
unsigned int j=0; j<=a.
order_; j++) {
176 c[i+j] += (*this)[i] * a[j];
180 for(
unsigned int i=0;i<c.size(); i++){
188 for(
unsigned int i=0;i<=
order_;i++){
195 BIASERR(
"Polynom division not yet implemented!");
201 for(
unsigned int i=0;i<=
order_;i++){
208 bool res = (
this == &a);
212 for(
unsigned int i=0; i<=
order_; i++){
213 res = (*this)[i]==a[i];
269 BIASERR(
">> operator not yet implemented for Polynom");
276 for (
int i=order; i>=0; i--) {
297 return p1[o1]<p2[o1];
306 return p1[o1]>p2[o1];
313 #include <Base/Common/BIASpragmaEnd.hh>
315 #endif //__POLYNOM_HH__
void Prune()
removes zero leading coefficients
Polynom & operator-=(const Polynom &a)
Polynom & operator+=(const Polynom &a)
class for Polynoms of arbitary order
Polynom(const Polynom &toCopy)
double Evaluate(double const x) const
Polynom & operator=(const Polynom &a)
Polynom & operator*=(const Polynom &a)
DualQuaternion< T > operator/(const DualQuaternion< T > &l, const T &scalar)
DualQuaternion< T > operator-(const DualQuaternion< T > &l, const DualQuaternion< T > &r)
Polynom & operator/=(const Polynom &a)
DualQuaternion< T > operator+(const DualQuaternion< T > &l, const DualQuaternion< T > &r)
bool operator>(const BIAS::Polynom &p1, const BIAS::Polynom &p2)
bool operator<(const BIAS::Polynom &p1, const BIAS::Polynom &p2)
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
DualQuaternion< T > operator*(const DualQuaternion< T > &l, const T &scalar)
unsigned int GetOrder() const
void SetOrder(unsigned int i)
sets the order of polynom to i new generated coefficients are 0
bool operator==(const Polynom &a) const
bool operator!=(const Polynom &a) const
BIASCommon_EXPORT std::istream & operator>>(std::istream &is, BIAS::TimeStamp &ts)
Standard input operator for TimeStamps.