9 #include <eigen3/Eigen/Dense> 22 template <
typename T >
23 std::vector< T > PerfFOS() {
25 std::cout <<
"Timing FOS for data type: " << get_type_name<T>() << std::endl;
27 std::string data_set_path =
"/home/bephillips2/Desktop/Hanger Bay 1/Academia/HDIM/test_data.csv";
29 Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > raw_data = CSV2Eigen< T >( data_set_path );
31 std::cout <<
"Imported an m = " << raw_data.rows() <<
" by n = " << raw_data.cols() <<
" Matrix." << std::endl;
33 std::vector < T > timing_results;
35 for(
unsigned int k = 200; k <= 2000 ; k += 200 ) {
37 std::cout <<
"Testing FOS for a " \
44 Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > X = raw_data.block( 0, 1, k, k );
45 Eigen::Matrix< T, Eigen::Dynamic, 1 > Y = raw_data.block( 0, 0, k, 1 );
47 FOS< T > algo_fos ( X, Y );
49 auto start = std::chrono::high_resolution_clock::now();
53 auto end = std::chrono::high_resolution_clock::now();
54 std::chrono::duration<double, std::milli> ms = end - start;
55 auto time_taken = ms.count();
57 std::cout <<
"FOS took " << time_taken <<
" ms." << std::endl;
59 timing_results.push_back( time_taken );
62 return timing_results;
65 namespace experimental {
67 template <
typename T >
68 std::vector< T > PerfX_FOS( SolverType s_type ) {
70 std::cout <<
"Timing FOS for data type: " << get_type_name<T>() << std::endl;
72 std::string data_set_path =
"/home/bephillips2/Desktop/Hanger Bay 1/Academia/HDIM/test_data.csv";
74 Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > raw_data = CSV2Eigen< T >( data_set_path );
77 std::cout <<
"Imported an m = " << raw_data.rows() <<
" by n = " << raw_data.cols() <<
" Matrix." << std::endl;
79 std::vector < T > timing_results;
81 for(
unsigned int k = 200; k <= 2000 ; k += 200 ) {
83 std::cout <<
"Testing FOS for a " \
90 Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > X = raw_data.block( 0, 1, k, k );
91 Eigen::Matrix< T, Eigen::Dynamic, 1 > Y = raw_data.block( 0, 0, k, 1 );
95 auto start = std::chrono::high_resolution_clock::now();
97 algo_fos( X, Y, s_type );
99 auto end = std::chrono::high_resolution_clock::now();
100 std::chrono::duration<double, std::milli> ms = end - start;
101 auto time_taken = ms.count();
103 std::cout <<
"FOS took " << time_taken <<
" ms." << std::endl;
105 timing_results.push_back( time_taken );
108 return timing_results;