Project-1/src/main.cpp
2023-09-07 13:59:19 +02:00

25 lines
425 B
C++

#include "GeneralAlgorithm.hpp"
#include <armadillo>
#include <iostream>
double f(double x) {
return 100. * std::exp(-10.*x);
}
double a_sol(double x) {
return 1. - (1. - std::exp(-10)) * x - std::exp(-10*x);
}
int main() {
arma::mat A = arma::eye(3,3);
GeneralAlgorithm ga(3, &A, f, a_sol, 0., 1.);
ga.solve();
std::cout << "Time: " << ga.time(5) << std::endl;
ga.error();
return 0;
}