Changeset 92


Ignore:
Timestamp:
May 30, 2004, 12:44:39 AM (19 years ago)
Author:
Jari Häkkinen
Message:

Added test data for Wead, also wrote test for Wead.

Location:
trunk/test
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/test_wead.cc

    r58 r92  
    66
    77#include "FileIO.h"
     8#include "matrix.h"
    89#include "Wead.h"
    910
     
    100101  theplu::cpptools::Wead wead(matrix_stream,flag_stream,option.neighbours());
    101102  wead.estimate();
    102   std::cout << wead.matrix() << std::endl;
    103   return 0; // normal exit
     103  std::ifstream control_stream("data/wead_result.data");
     104  theplu::gslapi::matrix control(control_stream);
     105  control-=wead.matrix();
     106  for (unsigned int i=0; i<control.rows(); i++)
     107    for (unsigned int j=0; j<control.columns(); j++)
     108      // Jari, should we use GSL defined round off errors? Anyway, the
     109      // hardcoded number below should be changed.
     110      if (fabs(control(i,j))>5e-13)
     111        exit(-1); // calculation result out of accepted error bounds
     112  exit(0);        // normal exit
    104113}
Note: See TracChangeset for help on using the changeset viewer.