diff --git a/Makefile b/Makefile index 8d42e2b..92ab003 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CXX=g++ -EIGEN_LOCATION=XXX +EIGEN_LOCATION=/usr/include/eigen3 BUILD_DIR=objs CXXFLAGS =-Wall diff --git a/Utils.hpp b/Utils.hpp index 605be20..5b1884a 100644 --- a/Utils.hpp +++ b/Utils.hpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace Utils{ inline double max(const double& x, const double& y){ @@ -39,12 +40,12 @@ namespace Utils{ } inline void infNan(const double& x){ - assert(!isnan(x) && !isinf(x)); + assert(!std::isnan(x) && !std::isinf(x)); } inline void save(std::ofstream& ofs, const MatD& params){ double val = 0.0; - + for (int i = 0; i < params.cols(); ++i){ for (int j = 0; j < params.rows(); ++j){ val = params.coeff(j, i); @@ -55,7 +56,7 @@ namespace Utils{ inline void load(std::ifstream& ifs, MatD& params){ double val = 0.0; - + for (int i = 0; i < params.cols(); ++i){ for (int j = 0; j < params.rows(); ++j){ ifs.read((char*)&val, sizeof(double));