public void testEvaluation(){
  PolynomialTerm term0=new PolynomialTerm(1.0,new int[]{0});
  PolynomialTerm term1=new PolynomialTerm(1.0,new int[]{1});
  PolynomialTerm term2=new PolynomialTerm(1.0,new int[]{2,3});
  List terms=new ArrayList();
  terms.add(term0);
  terms.add(term1);
  terms.add(term2);
  Polynomial p=new Polynomial(terms);
  double[] values=new double[]{1.0,2.0,3.0,4.0};
  assertEquals(15.0,p.evaluate(values),0.00001);
}

public void testEvaluation ( ) { PolynomialTerm term0 = new PolynomialTerm ( 1.0 , new int [ ] { 0 } ) ; PolynomialTerm term1 = new PolynomialTerm ( 1.0 , new int [ ] { 1 } ) ; PolynomialTerm term2 = new PolynomialTerm ( 1.0 , new int [ ] { 2 , 3 } ) ; List terms = new ArrayList ( ) ; terms . add ( term0 ) ; terms . add ( term1 ) ; terms . add ( term2 ) ; Polynomial p = new Polynomial ( terms ) ; double [ ] values = new double [ ] { 1.0 , 2.0 , 3.0 , 4.0 } ; assertEquals ( 15.0 , p . evaluate ( values ) , 0.00001 ) ; }
test the evaluation of terms .
