ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/math/ChebyshevPolynomials.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/math/ChebyshevPolynomials.cpp (file contents):
Revision 1747 by tim, Wed Nov 17 18:58:49 2004 UTC vs.
Revision 1748 by tim, Wed Nov 17 21:47:42 2004 UTC

# Line 33 | Line 33 | ChebyshevPolynomials::GeneratePolynomials(int maxPower
33   }
34  
35   ChebyshevPolynomials::GeneratePolynomials(int maxPower) {
36 +
37 +    GenerateFirstTwoTerms();
38 +
39 +    DoublePolynomial twoX;
40 +    twoX.setCoefficient(1, 2.0);
41 +
42 +    //recursive generate the high order term of Chebyshev Polynomials
43 +    //Cn+1(x) = Cn(x) * 2x - Cn-1(x)
44 +    for (int i = 2; i <= maxPower; ++i) {
45 +        DoublePolynomial cn;
46 +        
47 +        cn = polyList_[i-1] * twoX - polyList_[i-2];
48 +        polyList_.push_back(cn);
49 +    }
50 + }
51 +
52 +
53 + ChebyshevT::GenerateFirstTwoTerms() {
54      DoublePolynomial t0;
55      t0.setCoefficient(0, 1.0);
56      polyList_.push_back(t0);
57      
58      DoublePolynomial t1;
59      t1.setCoefficient(1, 1.0);
60 +    polyList_.push_back(t1);    
61 + }
62  
63 <    DoublePolynomial twoX;
64 <    twoX.setCoefficient(1, 2.0);
63 > ChebyshevU::GenerateFirstTwoTerms() {
64 >    DoublePolynomial u0;
65 >    u0.setCoefficient(0, 1.0);
66 >    polyList_.push_back(u0);
67      
68 <    for (int i = 2; i <= maxPower; ++i) {
69 <        DoublePolynomial tn;
70 <        
49 <        tn = polyList_[i] * twoX - polyList_[i-2];
50 <        polyList_.push_back(tn);
51 <    }
68 >    DoublePolynomial u1;
69 >    u1.setCoefficient(1, 2.0);
70 >    polyList_.push_back(u1);  
71   }
72  
73   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines