tPolynomial< T > Class Template Reference

mathematical function (to be moved into tools sometime, and currently limited to linear functions) More...

#include <tPolynomial.h>

List of all members.

Public Member Functions

 tPolynomial ()
 constructor
 tPolynomial (int count)
 constructor
 tPolynomial (REAL newCoefs[], int count)
 constructor
 tPolynomial (REAL value)
 constructor for constant polynomial
 tPolynomial (tArray< REAL > newCoefs)
 constructor
 tPolynomial (const tPolynomial< T > &tf)
 constructor
 tPolynomial (std::string str)
 constructor
virtual ~tPolynomial ()
void parse (std::string str)
virtual REAL evaluate (REAL currentVarValue) const
 evaluates the function
REAL operator() (REAL currentVarValue) const
 evaluation operator
tPolynomial< T > const operator * (REAL constant) const
tPolynomial< T > const operator * (const tPolynomial< T > &tfRight) const
tPolynomial< T > const operator+ (REAL constant) const
tPolynomial< T > const operator+ (const tPolynomial< T > &tfRight) const
tPolynomial< T > & operator+= (const tPolynomial< T > &tfRight)
tPolynomial< T > const substitute (const tPolynomial< T > &other) const
 Evaluate this(x) where x is another polynomial.
REALoperator[] (int index)
REAL const & operator[] (int index) const
void operator= (tPolynomial< T > const &other)
void addConstant (REAL constant)
tPolynomial< T > adaptToNewReferenceVarValue (REAL currentVarValue) const
tPolynomial< T > translate (REAL currentVarValue) const
void changeRate (REAL newRate, int newRateLength, REAL currentVarValue)
void setRates (REAL newValues[], int newValuesLength, REAL currentVarValue)
void setRates (tArray< REAL > newValues, REAL currentVarValue)
virtual T & ReadSync (T &m)
virtual T & WriteSync (T &m) const
virtual std::string toString () const
tPolynomial< T > const clamp (REAL min, REAL max, REAL currentVarValue)
int Len () const
void setAtSameReferenceVarValue (const tPolynomial< T > &other)

Protected Member Functions

void setReferenceVarValue (REAL newReferenceVarValue)
void growCoefsArray (int newLength)

Protected Attributes

REAL referenceVarValue
 the evaluation is always done on (currentVarValue - referenceVarValue) rather than (currentVarValue)
tArray< REALcoefs

Friends

template<typename D>
bool operator== (const tPolynomial< D > &left, const tPolynomial< D > &right)
template<typename D>
bool operator!= (const tPolynomial< D > &left, const tPolynomial< D > &right)


Detailed Description

template<typename T>
class tPolynomial< T >

mathematical function (to be moved into tools sometime, and currently limited to linear functions)

Definition at line 45 of file tPolynomial.h.


Constructor & Destructor Documentation

template<typename T>
tPolynomial< T >::tPolynomial (  )  [inline]

constructor

Definition at line 146 of file tPolynomial.h.

00147         : referenceVarValue(0.0),
00148         coefs(0)
00149 {
00150     // Empty
00151 }

template<typename T>
tPolynomial< T >::tPolynomial ( int  count  )  [inline, explicit]

constructor

Parameters:
count  constructor

Definition at line 136 of file tPolynomial.h.

References tPolynomial< T >::coefs.

00137         : referenceVarValue(0.0),
00138         coefs(count)
00139 {
00140     // Initialise to all 0's
00141     for (int i=0; i<coefs.Len(); i++)
00142         coefs[i] = 0.0f;
00143 }

template<typename T>
tPolynomial< T >::tPolynomial ( REAL  newCoefs[],
int  count 
) [inline]

constructor

Parameters:
count  constructor

Definition at line 154 of file tPolynomial.h.

References tPolynomial< T >::coefs.

00155         : referenceVarValue(0.0),
00156         coefs(count)
00157 {
00158     for (int i=0; i<coefs.Len(); i++)
00159         coefs[i] = newCoefs[i];
00160 }

template<typename T>
tPolynomial< T >::tPolynomial ( REAL  value  )  [inline]

constructor for constant polynomial

Parameters:
value  constructor for constant polynomial

Definition at line 163 of file tPolynomial.h.

References tPolynomial< T >::coefs.

00164         : referenceVarValue(0.0),
00165         coefs(1)
00166 {
00167     coefs[0] = value;
00168 }

template<typename T>
tPolynomial< T >::tPolynomial ( tArray< REAL newCoefs  )  [inline]

constructor

Parameters:
newCoefs  constructor

Definition at line 171 of file tPolynomial.h.

00172         : referenceVarValue(0.0),
00173         coefs(newCoefs)
00174 {
00175     // Empty
00176 }

template<typename T>
tPolynomial< T >::tPolynomial ( const tPolynomial< T > &  tf  )  [inline]

constructor

Parameters:
tf  constructor

Definition at line 179 of file tPolynomial.h.

00180         : referenceVarValue(tf.referenceVarValue),
00181         coefs(tf.coefs)
00182 {
00183     // Empty
00184 }

template<typename T>
tPolynomial< T >::tPolynomial ( std::string  str  )  [inline]

constructor

Definition at line 600 of file tPolynomial.h.

References tPolynomial< T >::parse().

00601   : referenceVarValue(0.0),
00602      coefs(0)
00603 {
00604   parse(str);
00605 }

Here is the call graph for this function:

template<typename T>
virtual tPolynomial< T >::~tPolynomial (  )  [inline, virtual]

Definition at line 57 of file tPolynomial.h.

00058     {
00059     }


Member Function Documentation

template<typename T>
void tPolynomial< T >::parse ( std::string  str  )  [inline]

Definition at line 608 of file tPolynomial.h.

References tPolynomial< T >::coefs, pos, REAL, and TPOLYNOMIAL_DELIMITER.

Referenced by tPolynomialTest::testParse(), tPolynomialTest::testSubstitute(), and tPolynomial< T >::tPolynomial().

00609 {
00610     int pos;
00611     int prevPos = 0;
00612     int index = 0;
00613 
00614 #define TPOLYNOMIAL_DELIMITER ';'
00615 
00616     pos = str.find(TPOLYNOMIAL_DELIMITER, 0);
00617     if(-1 != pos) {
00618       do{
00619         REAL value = atof(str.substr(prevPos, pos).c_str());
00620         coefs.SetLen(index + 2); // +1 because to write at index n, the len must be n+1. +1 to allocate a place for the element after the last ':'
00621         coefs[index] = value;
00622         
00623         prevPos = pos + 1;
00624         index ++;
00625       }
00626       while ( (pos = str.find(TPOLYNOMIAL_DELIMITER, prevPos)) != -1) ;
00627 
00628       coefs[index] = atof(str.substr(prevPos, pos).c_str());
00629 
00630     }
00631     else {
00632       coefs.SetLen(1);
00633       coefs[0] = atof(str.c_str());
00634     }
00635 }

Here is the caller graph for this function:

template<typename T>
REAL tPolynomial< T >::evaluate ( REAL  currentVarValue  )  const [inline, virtual]

evaluates the function

Definition at line 423 of file tPolynomial.h.

References tPolynomial< T >::coefs, REAL, and tPolynomial< T >::referenceVarValue.

Referenced by tPolynomial< T >::clamp(), tPolynomialWithBase< T >::evaluate(), zShapePolygon::isInside(), tPolynomial< T >::operator()(), zShapePolygon::render(), zShapeCircle::render(), zShapePolygon::render2d(), zShapeCircle::render2d(), tPolynomialTest::testEvaluateAndBaseArgument(), and zMonitor::Timestep().

00424 {
00425     REAL deltaVariableValue = (currentVarValue - referenceVarValue);
00426 
00427     REAL res = 0.0;
00428 
00429     // Compute res = c[0] + c[1]*var + (c[2]/2)*var^2 + ... + (c[N]/N)*var^N
00430     for (int i=coefs.Len()-1; i>0; i--) {
00431         res = (res + coefs[i]/i) * deltaVariableValue;
00432     }
00433     if (coefs.Len()!=0)
00434         res += (coefs[0]);
00435 
00436     return res;
00437 
00438 }

Here is the caller graph for this function:

template<typename T>
REAL tPolynomial< T >::operator() ( REAL  currentVarValue  )  const [inline]

evaluation operator

Returns:
the function value

Definition at line 197 of file tPolynomial.h.

References tPolynomial< T >::evaluate().

00198 {
00199     return evaluate( currentVarValue );
00200 }

Here is the call graph for this function:

template<typename T>
tPolynomial< T > const tPolynomial< T >::operator * ( REAL  constant  )  const [inline]

Definition at line 474 of file tPolynomial.h.

References tPolynomial< T >::coefs.

00474                                                                     {
00475     tPolynomial<T> tf(*this);
00476 
00477     for (int i=0; i<coefs.Len(); i++) {
00478         tf[i] *= constant;
00479     }
00480     return tf;
00481 }

template<typename T>
tPolynomial< T > const tPolynomial< T >::operator * ( const tPolynomial< T > &  tfRight  )  const [inline]

Definition at line 484 of file tPolynomial.h.

References tPolynomial< T >::coefs, and tPolynomial< T >::setAtSameReferenceVarValue().

00484                                                                                      {
00485     tPolynomial<T> tf;
00486     tf.setAtSameReferenceVarValue(tfRight);
00487 
00488     // If any Polygonial is of size 0, then the resulting one is too
00489     // Otherwise, it is the sum of both lenght, minus 1.
00490     int newLength =
00491         (0 == this->coefs.Len() || 0 == tfRight.coefs.Len())
00492         ? 0
00493         : (this->coefs.Len() + tfRight.coefs.Len() - 1);
00494 
00495     int oldLength = tf.coefs.Len();
00496     tf.coefs.SetLen(newLength);
00497     for (int i=oldLength; i<newLength; i++) {
00498         tf[i] = 0.0;
00499     }
00500 
00501     if (0 == newLength) {
00502         // Special case, nothing needs to be done
00503     }
00504     else {
00505         for (int i=0; i<this->coefs.Len(); i++) {
00506             for (int j=0; j<tfRight.coefs.Len(); j++) {
00507                 tf[i+j] += (this->coefs[i]) * tfRight[j];
00508             }
00509         }
00510     }
00511     return tf;
00512 }

Here is the call graph for this function:

template<typename T>
tPolynomial< T > const tPolynomial< T >::operator+ ( REAL  constant  )  const [inline]

Definition at line 515 of file tPolynomial.h.

00515                                                                     {
00516     tPolynomial<T> tf(*this);
00517     tf[0] += constant;
00518     return tf;
00519 }

template<typename T>
tPolynomial< T > const tPolynomial< T >::operator+ ( const tPolynomial< T > &  tfRight  )  const [inline]

Definition at line 522 of file tPolynomial.h.

References tPolynomial< T >::adaptToNewReferenceVarValue(), tPolynomial< T >::coefs, and MAX.

00522                                                                                     {
00523     // Bring the polynomial to the same baseValue, so that the terms mean the same thing
00524     tPolynomial<T> tRebasedRight(tfRight.adaptToNewReferenceVarValue(this->referenceVarValue));
00525 
00526     int maxLength = MAX(this->coefs.Len(), tfRight.coefs.Len());
00527 
00528     // Set the lenght to the longest member of the addition
00529     tRebasedRight.coefs.SetLen(maxLength);
00530 
00531     for (int i=0; i<this->coefs.Len(); i++) {
00532         tRebasedRight[i] += coefs[i];
00533     }
00534 
00535     return tRebasedRight;
00536 }

Here is the call graph for this function:

template<typename T>
tPolynomial< T > & tPolynomial< T >::operator+= ( const tPolynomial< T > &  tfRight  )  [inline]

Definition at line 539 of file tPolynomial.h.

References tPolynomial< T >::adaptToNewReferenceVarValue(), tPolynomial< T >::coefs, and MAX.

00539                                                                            {
00540     // Bring the polynomial to the same baseValue, so that the terms mean the same thing
00541     tPolynomial<T> tRebasedRight = tfRight.adaptToNewReferenceVarValue(this->referenceVarValue);
00542 
00543     int maxLength = MAX(this->coefs.Len(), tfRight.coefs.Len());
00544     // Set the lenght to the longest member of the addition
00545     coefs.SetLen(maxLength);
00546 
00547     for (int i=0; i<maxLength; i++) {
00548         coefs[i] += tRebasedRight[i];
00549     }
00550 
00551     return *this;
00552 }

Here is the call graph for this function:

template<typename T>
tPolynomial< T > const tPolynomial< T >::substitute ( const tPolynomial< T > &  other  )  const [inline]

Evaluate this(x) where x is another polynomial.

Definition at line 558 of file tPolynomial.h.

References tPolynomial< T >::setAtSameReferenceVarValue().

Referenced by tPolynomialTest::testSubstitute().

00558                                                                                    {
00559   tPolynomial<T> tf(0);
00560   tf.setAtSameReferenceVarValue(other);
00561   for(int i=this->Len()-1; i>0; i--) {
00562     tf = (tf + (*this)[i]) * other;
00563   }
00564   if(0 != this->Len()) {
00565     tf = tf + (*this)[0];
00566   }
00567 
00568   return tf;
00569 }

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T>
REAL & tPolynomial< T >::operator[] ( int  index  )  [inline]

Definition at line 572 of file tPolynomial.h.

References tPolynomial< T >::coefs.

00573 {
00574     // Manually growing the array to set all new elements to 0
00575     if (index >= coefs.Len()) {
00576         int previousLength = coefs.Len();
00577         coefs.SetLen(index + 1);
00578         for (int i=previousLength; i<coefs.Len(); i++) {
00579             coefs[i] = 0.0;
00580         }
00581     }
00582 
00583     return coefs[index];
00584 }

template<typename T>
REAL const & tPolynomial< T >::operator[] ( int  index  )  const [inline]

Definition at line 587 of file tPolynomial.h.

References tPolynomial< T >::coefs.

00588 {
00589     return coefs[index];
00590 }

template<typename T>
void tPolynomial< T >::operator= ( tPolynomial< T > const &  other  )  [inline]

Definition at line 593 of file tPolynomial.h.

References tPolynomial< T >::coefs, and tPolynomial< T >::referenceVarValue.

00594 {
00595     coefs = other.coefs;
00596     referenceVarValue = other.referenceVarValue;
00597 }

template<typename T>
void tPolynomial< T >::addConstant ( REAL  constant  )  [inline]

Definition at line 78 of file tPolynomial.h.

00078                                     {
00079         if (coefs.Len()==0) {
00080             coefs.SetLen(1);
00081             coefs[0] = 0;
00082         } 
00083         coefs[0] += constant;
00084     }

template<typename T>
tPolynomial< T > tPolynomial< T >::adaptToNewReferenceVarValue ( REAL  currentVarValue  )  const [inline]

Definition at line 309 of file tPolynomial.h.

References tPolynomial< T >::coefs, REAL, tPolynomial< T >::referenceVarValue, and tPolynomial< T >::setReferenceVarValue().

Referenced by tPolynomial< T >::changeRate(), tPolynomial< T >::operator+(), tPolynomial< T >::operator+=(), operator==(), tPolynomialTest::testAddition(), tPolynomialTest::testEvaluateAndBaseArgument(), tPolynomialMarshalerTest::testMarshaling(), tPolynomialMarshalerTest::testMarshalingWithBase(), and tPolynomialTest::testSubstitute().

00310 {
00311     tPolynomial<T> tf(*this);
00312 
00313     // Compute the coefficients at "currentVarValue" (var for short)
00314     // c0' = c0 + (c1/sum(1))*var + (c2/sum(2))*var^2 + ... + (c[N]/sum(N))*var^N
00315     // c1' = c1 + (c2/sum(1))*var + ... + (c[N]/sum(N-1))*var^(N-1)
00316     // c2' = c2 + ... + (c[N]/sum(N-2))*var^(N-2)
00317     // ...
00318     // c[N-1] = c[N-1] + (c[N]/sum(1))*var
00319     // c[N] = c[N]
00320     //
00321     // so:
00322     // [0   , 0 , a] at currentVarValue=0 will become
00323     // [9a/2, 3a, a] at currentVarValue=3
00324 
00325     REAL deltaVariableValue = currentVarValue - referenceVarValue;
00326 
00327     // Compute for each coefficient their new value
00328     for (int coefIndex=0; coefIndex<coefs.Len(); coefIndex++) {
00329         REAL newCoefValue = 0.0;
00330         for (int j=coefs.Len()-1; j>coefIndex; j--) {
00331             newCoefValue = (newCoefValue + coefs[j] ) * deltaVariableValue /(j - coefIndex);
00332         }
00333         tf.coefs[coefIndex] += newCoefValue;
00334     }
00335 
00336     tf.setReferenceVarValue(currentVarValue);
00337     return tf;
00338 }

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T>
tPolynomial< T > tPolynomial< T >::translate ( REAL  currentVarValue  )  const [inline]

Definition at line 344 of file tPolynomial.h.

References tPolynomial< T >::coefs, REAL, tPolynomial< T >::referenceVarValue, and tPolynomial< T >::setReferenceVarValue().

Referenced by tPolynomialTest::testTranslate().

00345 {
00346     tPolynomial<T> tf(*this);
00347 
00348     // Compute the coefficients at "currentVarValue" (var for short)
00349     // c0' = c0 + (c1)*var + (c2)*var^2 + ... + (c[N])*var^N
00350     // c1' = c1 + (c2)*var + ... + (c[N])*var^(N-1)
00351     // c2' = c2 + ... + (c[N])*var^(N-2)
00352     // ...
00353     // c[N-1] = c[N-1] + (c[N])*var
00354     // c[N] = c[N]
00355     //
00356     // so:
00357     // [0   , 0 , a] at currentVarValue=0 will become
00358     // [9a, 6a, a] at currentVarValue=3
00359 
00360     REAL deltaVariableValue = currentVarValue - referenceVarValue;
00361 
00362     // Compute for each coefficient their new value
00363     for (int coefIndex=0; coefIndex<coefs.Len(); coefIndex++) {
00364         REAL newCoefValue = 0.0;
00365         for (int j=coefs.Len()-1; j>coefIndex; j--) {
00366             newCoefValue = (newCoefValue + coefs[j] ) * deltaVariableValue;
00367         }
00368         tf.coefs[coefIndex] += newCoefValue;
00369     }
00370 
00371     tf.setReferenceVarValue(currentVarValue);
00372     return tf;
00373 }

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T>
void tPolynomial< T >::changeRate ( REAL  newRate,
int  newRateLength,
REAL  currentVarValue 
) [inline]

Definition at line 379 of file tPolynomial.h.

References tPolynomial< T >::adaptToNewReferenceVarValue(), and tPolynomial< T >::coefs.

Referenced by tPolynomialTest::testEvaluateAndBaseArgument(), and zMonitor::Timestep().

00380 {
00381     if (coefs.Len() <= newRateIndex) {
00382         int oldLength = coefs.Len();
00383         coefs.SetLen(newRateIndex + 1);
00384         for (int i=oldLength; i<newRateIndex; i++) {
00385             coefs[i] = 0.0;
00386         }
00387     }
00388 
00389     *this = adaptToNewReferenceVarValue(currentVarValue);
00390 
00391     coefs[newRateIndex] = newRate;
00392 }

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T>
void tPolynomial< T >::setRates ( REAL  newValues[],
int  newValuesLength,
REAL  currentVarValue 
) [inline]

This perform a hard setting of all the coefficients

Definition at line 398 of file tPolynomial.h.

References tPolynomial< T >::coefs, and tPolynomial< T >::setReferenceVarValue().

00399 {
00400     if (coefs.Len() < newValuesLength) {
00401         int oldLength = coefs.Len();
00402         coefs.SetLen(newValuesLength + 1);
00403         for (int i=oldLength; i<newValuesLength; i++) {
00404             coefs[i] = 0.0;
00405         }
00406     }
00407 
00408     setReferenceVarValue(currentVarValue);
00409 
00410     for (int i=0; i<newValuesLength; i++) {
00411         coefs[i] = newValues[i];
00412     }
00413 }

Here is the call graph for this function:

template<typename T>
void tPolynomial< T >::setRates ( tArray< REAL newValues,
REAL  currentVarValue 
) [inline]

Definition at line 416 of file tPolynomial.h.

References tPolynomial< T >::coefs, and tPolynomial< T >::setReferenceVarValue().

00417 {
00418     coefs = newValues;
00419     setReferenceVarValue(currentVarValue);
00420 }

Here is the call graph for this function:

template<typename T>
T & tPolynomial< T >::ReadSync ( T &  m  )  [inline, virtual]

Definition at line 456 of file tPolynomial.h.

References tPolynomial< T >::coefs, and tPolynomial< T >::referenceVarValue.

Referenced by operator>>(), and tPolynomialWithBase< T >::ReadSync().

00457 {
00458     m >> referenceVarValue;
00459 
00460     // Read the length
00461     int newLength = 0;
00462     m >> newLength;
00463     coefs.SetLen(newLength);
00464 
00465     for (int i=0; i<coefs.Len(); i++)
00466     {
00467         m >> coefs[i];
00468     }
00469 
00470     return m;
00471 }

Here is the caller graph for this function:

template<typename T>
T & tPolynomial< T >::WriteSync ( T &  m  )  const [inline, virtual]

Definition at line 441 of file tPolynomial.h.

References tPolynomial< T >::coefs, and tPolynomial< T >::referenceVarValue.

Referenced by tPolynomialWithBase< T >::WriteSync().

00442 {
00443     m << referenceVarValue;
00444     // write length
00445     m << coefs.Len();
00446 
00447     for (int i=0; i<coefs.Len(); i++)
00448     {
00449         m << coefs[i];
00450     }
00451 
00452     return m;
00453 }

Here is the caller graph for this function:

template<typename T>
std::string tPolynomial< T >::toString (  )  const [inline, virtual]

Definition at line 638 of file tPolynomial.h.

References tPolynomial< T >::coefs, and tPolynomial< T >::referenceVarValue.

Referenced by tPolynomialMarshalerTest::testMarshaling(), tPolynomialTest::testSubstitute(), and tPolynomialTest::testTranslate().

00638                                          {
00639     std::ostringstream ostr("");
00640 
00641     ostr << "base :" << referenceVarValue << " lenght:" << coefs.Len();
00642 
00643     for (int i=0; i<coefs.Len(); i++) {
00644         ostr << " c[" << i << "]:" << coefs[i];
00645     }
00646     return ostr.str();
00647 }

Here is the caller graph for this function:

template<typename T>
tPolynomial< T > const tPolynomial< T >::clamp ( REAL  minValue,
REAL  maxValue,
REAL  currentVarValue 
) [inline]

If the current polynomial is within the range, return a copy of itself Otherwise, return a new polynomial that is bound by the range

Definition at line 655 of file tPolynomial.h.

References tPolynomial< T >::coefs, tPolynomial< T >::evaluate(), and REAL.

Referenced by zMonitor::Timestep().

00656 {
00657     tPolynomial<T> tf(*this);
00658 
00659     REAL valueAt = evaluate(currentVarValue);
00660     if (valueAt < minValue) {
00661         tf[0] = minValue;
00662         for (int i=1; i<coefs.Len(); i++) {
00663             if (tf[i] < 0) {
00664                 tf[i] = 0.0;
00665             }
00666         }
00667     }
00668     if (maxValue < valueAt) {
00669         tf[0] = maxValue;
00670         for (int i=1; i<coefs.Len(); i++) {
00671             if (tf[i] > 0) {
00672                 tf[i] = 0.0;
00673             }
00674         }
00675     }
00676 
00677     return tf;
00678 }

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T>
int tPolynomial< T >::Len (  )  const [inline]

Definition at line 104 of file tPolynomial.h.

Referenced by zMonitor::Timestep().

00104                    {
00105         return coefs.Len();
00106     };

Here is the caller graph for this function:

template<typename T>
void tPolynomial< T >::setAtSameReferenceVarValue ( const tPolynomial< T > &  other  )  [inline]

Will change our referenceVarValue to that of the designated object.

Definition at line 684 of file tPolynomial.h.

References a, REAL, and tPolynomial< T >::referenceVarValue.

Referenced by tPolynomialMarshaler< T >::marshal(), tPolynomial< T >::operator *(), and tPolynomial< T >::substitute().

00685 {
00686   REAL a = other.referenceVarValue;
00687   referenceVarValue = a;
00688   //  referenceVarValue = other.referenceVarValue;
00689 }

Here is the caller graph for this function:

template<typename T>
void tPolynomial< T >::setReferenceVarValue ( REAL  newReferenceVarValue  )  [inline, protected]

Definition at line 110 of file tPolynomial.h.

Referenced by tPolynomial< T >::adaptToNewReferenceVarValue(), tPolynomial< T >::setRates(), and tPolynomial< T >::translate().

00110                                                          {
00111         referenceVarValue = newReferenceVarValue;
00112     }

Here is the caller graph for this function:

template<typename T>
void tPolynomial< T >::growCoefsArray ( int  newLength  )  [protected]


Friends And Related Function Documentation

template<typename T>
template<typename D>
bool operator== ( const tPolynomial< D > &  left,
const tPolynomial< D > &  right 
) [friend]

template<typename T>
template<typename D>
bool operator!= ( const tPolynomial< D > &  left,
const tPolynomial< D > &  right 
) [friend]


Member Data Documentation

template<typename T>
REAL tPolynomial< T >::referenceVarValue [protected]

the evaluation is always done on (currentVarValue - referenceVarValue) rather than (currentVarValue)

Definition at line 116 of file tPolynomial.h.

Referenced by tPolynomial< T >::adaptToNewReferenceVarValue(), tPolynomial< T >::evaluate(), tPolynomial< T >::operator=(), operator==(), tPolynomial< T >::ReadSync(), tPolynomial< T >::setAtSameReferenceVarValue(), tPolynomial< nMessage >::setReferenceVarValue(), tPolynomial< T >::toString(), tPolynomial< T >::translate(), and tPolynomial< T >::WriteSync().

template<typename T>
tArray<REAL> tPolynomial< T >::coefs [protected]

Definition at line 117 of file tPolynomial.h.

Referenced by tPolynomial< T >::adaptToNewReferenceVarValue(), tPolynomial< nMessage >::addConstant(), tPolynomial< T >::changeRate(), tPolynomial< T >::clamp(), tPolynomial< T >::evaluate(), tPolynomial< nMessage >::Len(), tPolynomial< T >::operator *(), tPolynomial< T >::operator+(), tPolynomial< T >::operator+=(), tPolynomial< T >::operator=(), operator==(), tPolynomial< T >::operator[](), tPolynomial< T >::parse(), tPolynomial< T >::ReadSync(), tPolynomial< T >::setRates(), tPolynomial< T >::toString(), tPolynomial< T >::tPolynomial(), tPolynomial< T >::translate(), and tPolynomial< T >::WriteSync().


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:58:17 2008 for Armagetron Advanced by  doxygen 1.5.4