KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test_load.cpp
Go to the documentation of this file.
1 #include "kermorpp.h"
2 #include <iostream>
3 
4 using namespace kermorpp;
5 using namespace std;
6 using namespace Eigen;
7 
8 int main(int argc, char **argv) {
9 
10  string path = string(".");
11  if (argc == 2) {
12  path = string(argv[1]);
13  }
14 
16 
17  cout << "loaded " << *k << endl;
18 
19  MatrixXd points = Util.loadMatrix(path + DIR_SEPARATOR + "points.bin");
20 
21  MatrixXd res = k->evaluate(points);
22  MatrixXd res_comp = Util.loadMatrix(path + DIR_SEPARATOR + "eval.bin");
23 
24  int rcode = 0;
25  if (res.rows() != res_comp.rows() || res.cols() != res_comp.cols())
26  rcode--;
27  if (!res.isApprox(res_comp))
28  rcode--;
29 
30  return rcode;
31 }
32 
int main(int argc, char **argv)
Definition: test_load.cpp:8
#define DIR_SEPARATOR
Definition: kermorpp.h:16
MatrixXd evaluate(MatrixXd points)
static MatrixXd loadMatrix(string file)
Definition: Util.cpp:56
static KernelExpansion * loadFrom(string dir)