1 package JSci.maths.polynomials; 2 3 7 public class ChebychevBasis extends RealLagrangeBasis 8 implements PolynomialBasis { 9 12 public ChebychevBasis( int dim ) { 13 super(); 14 if ( dim <= 0 ) { 15 throw new IllegalArgumentException (); 16 } 17 super._dim = dim; 18 _samplingsX = new double[_dim]; 19 20 int n = _dim - 1; 21 for ( int k = 0; k < _dim; k++ ) { 22 _samplingsX[k] = Math.cos( ( (double) ( 2 * k + 1 ) * Math.PI ) / (double) ( 2 * n + 2 ) ); 23 } 24 buildBasis(); 25 } 26 } 27 28 | Popular Tags |