Changeset 436 for library/tests/enorm_test.cpp
- Timestamp:
- 07/28/09 15:07:47 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/enorm_test.cpp
r428 r436 3 3 #include "stat/emix.h" 4 4 #include "mat_checks.h" 5 #include "test_util.h" 5 6 #include "UnitTest++.h" 6 7 … … 34 35 } 35 36 36 }37 38 double normcoef ( const epdf* ep,const vec &xb, const vec &yb, int Ngr=100 ) {39 mat PPdf ( Ngr+1,Ngr+1 );40 vec rgr ( 2 );41 42 int i=0,j=0;43 double xstep= ( xb ( 1 )-xb ( 0 ) ) /Ngr;44 double ystep= ( yb ( 1 )-yb ( 0 ) ) /Ngr;45 46 for ( double x=xb ( 0 );x<=xb ( 1 );x+= xstep,i++ ) {47 rgr ( 0 ) =x;j=0;48 for ( double y=yb ( 0 );y<=yb ( 1 );y+=ystep,j++ ) {49 rgr ( 1 ) =y;50 PPdf ( i,j ) =exp ( ep->evallog ( rgr ) );51 }52 }53 return sumsum ( PPdf ) *xstep*ystep;54 37 } 55 38