| 1 | 
< | 
 /* | 
| 1 | 
> | 
/* | 
| 2 | 
  | 
 * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. | 
| 3 | 
  | 
 * | 
| 4 | 
  | 
 * The University of Notre Dame grants you ("Licensee") a | 
| 42 | 
  | 
#include "math/ChebyshevPolynomials.hpp" | 
| 43 | 
  | 
 | 
| 44 | 
  | 
namespace oopse { | 
| 45 | 
< | 
ChebyshevPolynomials::ChebyshevPolynomials(int maxPower) : maxPower_(maxPower){ | 
| 45 | 
> | 
  ChebyshevPolynomials::ChebyshevPolynomials(int maxPower) : maxPower_(maxPower){ | 
| 46 | 
  | 
 | 
| 47 | 
  | 
    assert(maxPower >= 0); | 
| 48 | 
  | 
    GeneratePolynomials(maxPower_); | 
| 49 | 
< | 
} | 
| 49 | 
> | 
  } | 
| 50 | 
  | 
 | 
| 51 | 
< | 
ChebyshevPolynomials::GeneratePolynomials(int maxPower) { | 
| 51 | 
> | 
  void ChebyshevPolynomials::GeneratePolynomials(int maxPower) { | 
| 52 | 
  | 
 | 
| 53 | 
  | 
    GenerateFirstTwoTerms(); | 
| 54 | 
  | 
 | 
| 58 | 
  | 
    //recursive generate the high order term of Chebyshev Polynomials | 
| 59 | 
  | 
    //Cn+1(x) = Cn(x) * 2x - Cn-1(x) | 
| 60 | 
  | 
    for (int i = 2; i <= maxPower; ++i) { | 
| 61 | 
< | 
        DoublePolynomial cn; | 
| 61 | 
> | 
      DoublePolynomial cn; | 
| 62 | 
  | 
         | 
| 63 | 
< | 
        cn = polyList_[i-1] * twoX - polyList_[i-2]; | 
| 64 | 
< | 
        polyList_.push_back(cn); | 
| 63 | 
> | 
      cn = polyList_[i-1] * twoX - polyList_[i-2]; | 
| 64 | 
> | 
      polyList_.push_back(cn); | 
| 65 | 
  | 
    } | 
| 66 | 
< | 
} | 
| 66 | 
> | 
  } | 
| 67 | 
  | 
 | 
| 68 | 
< | 
 | 
| 69 | 
< | 
ChebyshevT::GenerateFirstTwoTerms() { | 
| 68 | 
> | 
/* | 
| 69 | 
> | 
  void ChebyshevT::GenerateFirstTwoTerms() { | 
| 70 | 
  | 
    DoublePolynomial t0; | 
| 71 | 
  | 
    t0.setCoefficient(0, 1.0); | 
| 72 | 
  | 
    polyList_.push_back(t0); | 
| 74 | 
  | 
    DoublePolynomial t1; | 
| 75 | 
  | 
    t1.setCoefficient(1, 1.0); | 
| 76 | 
  | 
    polyList_.push_back(t1);     | 
| 77 | 
< | 
} | 
| 77 | 
> | 
  } | 
| 78 | 
  | 
 | 
| 79 | 
< | 
ChebyshevU::GenerateFirstTwoTerms() { | 
| 79 | 
> | 
  void ChebyshevU::GenerateFirstTwoTerms() { | 
| 80 | 
  | 
    DoublePolynomial u0; | 
| 81 | 
  | 
    u0.setCoefficient(0, 1.0); | 
| 82 | 
  | 
    polyList_.push_back(u0); | 
| 84 | 
  | 
    DoublePolynomial u1; | 
| 85 | 
  | 
    u1.setCoefficient(1, 2.0); | 
| 86 | 
  | 
    polyList_.push_back(u1);    | 
| 87 | 
< | 
} | 
| 87 | 
> | 
  } | 
| 88 | 
> | 
*/ | 
| 89 | 
  | 
 | 
| 90 | 
  | 
} //end namespace oopse |