next up previous contents
Next: The Polynomial Class In Up: The Implementation: Previous: The Evaluation Method:

The DOt Product of Two Polynomials:

    // ***************************************** //
    //              Dot Product                  //
    // ***************************************** //
FLOAT FLOAT_POLY::inner_product(FLOAT a,FLOAT b,FLOAT_POLY& P)
{
  FLOAT value;
  if(P.head==NULL && head!=NULL){
    //the incoming polynomial is degenerate
    value = 0;
    return(value);
    }
  if(P.head!=NULL && head==NULL){
    //this is NULL
    value = 0;
    return(value);
    } 
  if(P.head==NULL && head==NULL){
    //both are NULL
    value = 0;
    return(value);
    }   
  if(P.head!=NULL && head!=NULL){
    //both are non NULL
    FLOAT_POLY R = P*(*this);
    value = R.definite_integral(a,b);
    return(value);
    }
}



Jim Peterson
1999-04-22