46 m_afCoeff =
new Real[m_iDegree+1];
81 m_afCoeff =
new Real[m_iDegree+1];
101 template <
class Real>
107 template <
class Real>
113 template <
class Real>
119 template <
class Real>
127 m_afCoeff =
new Real[m_iDegree+1];
128 for (
int i = 0; i <= m_iDegree; i++)
137 template <
class Real>
140 if (m_iDegree < 0)
return 0;
142 Real fResult = m_afCoeff[m_iDegree];
143 for (
int i = m_iDegree-1; i >= 0; i--)
146 fResult += m_afCoeff[i];
151 template <
class Real>
165 for (i = rkPoly.
m_iDegree+1; i <= m_iDegree; i++)
174 for (i = 0; i <= m_iDegree; i++)
178 for (i = m_iDegree+1; i <= rkPoly.
m_iDegree; i++)
187 template <
class Real>
201 for (i = rkPoly.
m_iDegree+1; i <= m_iDegree; i++)
210 for (i = 0; i <= m_iDegree; i++)
214 for (i = m_iDegree+1; i <= rkPoly.
m_iDegree; i++)
223 template <
class Real>
230 for (
int i0 = 0; i0 <= m_iDegree; i0++)
232 for (
int i1 = 0; i1 <= rkPoly.
m_iDegree; i1++)
242 template <
class Real>
250 template <
class Real>
258 template <
class Real>
262 for (
int i = 0; i <= m_iDegree; i++)
264 kProd.
m_afCoeff[i] = fScalar*m_afCoeff[i];
269 template <
class Real>
275 if (fScalar != (Real)0.0)
277 Real fInvScalar = ((Real)1.0)/fScalar;
278 for (i = 0; i <= m_iDegree; i++)
280 kProd.
m_afCoeff[i] = fInvScalar*m_afCoeff[i];
285 for (i = 0; i <= m_iDegree; i++)
294 template <
class Real>
298 for (
int i = 0; i <= m_iDegree; i++)
306 template <
class Real>
309 *
this = *
this + rkPoly;
313 template <
class Real>
316 *
this = *
this - rkPoly;
320 template <
class Real>
323 *
this = (*this)*rkPoly;
327 template <
class Real>
330 m_afCoeff[0] += fScalar;
334 template <
class Real>
337 m_afCoeff[0] -= fScalar;
341 template <
class Real>
344 *
this = (*this)*fScalar;
348 template <
class Real>
351 *
this = (*this)/fScalar;
355 template <
class Real>
361 for (
int i0 = 0, i1 = 1; i0 < m_iDegree; i0++, i1++)
367 else if (m_iDegree == 0)
376 template <
class Real>
380 for (
int i = 0; i <= m_iDegree; i++)
382 kInvPoly.
m_afCoeff[i] = m_afCoeff[m_iDegree-i];
387 template <
class Real>
391 for (i = m_iDegree; i >= 0; i--)
405 Real fInvLeading = ((Real)1.0)/m_afCoeff[m_iDegree];
406 m_afCoeff[m_iDegree] = (Real)1.0;
407 for (i = 0; i < m_iDegree; i++)
409 m_afCoeff[i] *= fInvLeading;
414 template <
class Real>
418 int iQuotDegree = m_iDegree - rkDiv.
m_iDegree;
419 if (iQuotDegree >= 0)
427 Real fInv = ((Real)1.0)/rkDiv[rkDiv.
m_iDegree];
428 for (
int iQ = iQuotDegree; iQ >= 0; iQ--)
431 rkQuot[iQ] = fInv*kTmp[iR];
432 for (iR--; iR >= iQ; iR--)
434 kTmp[iR] -= rkQuot[iQ]*rkDiv[iR-iQ];
451 size_t uiSize = (iRemDeg+1)*
sizeof(Real);
457 rkQuot[0] = (Real)0.0;
moPolynomial1 operator*(const moPolynomial1 &rkPoly) const
moPolynomial1 & operator*=(const moPolynomial1 &rkPoly)
moPolynomial1 operator+(const moPolynomial1 &rkPoly) const
moPolynomial1(int iDegree=-1)
moPolynomial1 & operator=(const moPolynomial1 &rkPoly)
Real operator[](int i) const
moPolynomial1 & operator/=(Real fScalar)
void SetDegree(int iDegree)
void Divide(const moPolynomial1 &rkDiv, moPolynomial1 &rkQuot, moPolynomial1 &rkRem, Real fEpsilon) const
moPolynomial1 & operator-=(const moPolynomial1 &rkPoly)
Clase base abstracta de donde deben derivar los objetos [virtual pura].
void Compress(Real fEpsilon)
moPolynomial1 operator/(Real fScalar) const
Real operator()(Real fT) const
moPolynomial1 operator-() const
moPolynomial1 GetDerivative() const
moPolynomial1 & operator+=(const moPolynomial1 &rkPoly)
moPolynomial1 GetInversion() const