initial commit
This commit is contained in:
27
test_models.cpp
Executable file
27
test_models.cpp
Executable file
@@ -0,0 +1,27 @@
|
||||
#include<iostream>
|
||||
#include<stdlib.h>
|
||||
#include"models.h"
|
||||
|
||||
int main(){
|
||||
Data Exp1("Exp1");
|
||||
Exp1.randSet(20,1,0.2);
|
||||
LinearApprox Lin1;
|
||||
Lin1.setExpData(Exp1);
|
||||
Lin1.getCost();
|
||||
std::cout << "Cost : " << Lin1.getCost() << std::endl;
|
||||
Lin1.exportModel();
|
||||
|
||||
Data Exp2("Exp2");
|
||||
Exp2.randSet(20,1,0.2);
|
||||
PolynomialApprox Pol2(2);
|
||||
Pol2.setExpData(Exp2);
|
||||
Pol2.setParams({3.,4.});
|
||||
Pol2.getCost();
|
||||
std::cout << "Cost : " << Pol2.getCost() << std::endl;
|
||||
//Pol2.exportModel();
|
||||
std::vector<double> n_param = Pol2.getNeighbor(0.1);
|
||||
PolynomialApprox Pol3(n_param);
|
||||
std::cout << Pol3.getParam()[0] << " test" << std::endl;
|
||||
Pol3.exportModel();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user