|
#include <iostream>
#include <stdlib.h>
#include "quadrature.h"
using namespace GenericField;
struct QuadratureTest
{
double afunction(double x,double y) {return x*x+y*y;}
};
double bfunction(double x,double y) {return x-y;}
int main(int argc, char *argv[])
{
double a=Quadrature< 2,GaussLegendre,2,GaussLegendre >::Instance().Integrate<double>( &bfunction );
typedef double (QuadratureTest::*PFN)(double,double);
PFN pfn=&QuadratureTest::afunction;
QuadratureTest atest;
double b=Quadrature< 2,GaussLegendre,2,GaussLegendre >::Instance().Integrate( atest, pfn );
std::cout << "Sucess: " << a << " "<< b << std::endl;
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.