tmaklin / cpprate

Reimplementation of the variable selection via RATE method https://github.com/lorinanthony/RATE
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Error message if input or output files don't exist / aren't writable #10

Closed tmaklin closed 7 months ago

tmaklin commented 1 year ago

running the below command if the file design_matrix.csv does not exist should crash when reading the inputs:

cpprate --beta-draws beta_draws.csv.gz -x design_matrix.csv --threads 4 --id-start 0 --id-end 1

but instead gives error

cpprate: /home/temaklin/software/cpprate/build/external/eigen/Eigen/src/Core/Redux.h:411: typename Eigen::internal::traits<T>::Scalar Eigen::DenseBase<Derived>::redux(const Func&) const [with BinaryOp = Eigen::internal::scalar_max_op<double, double, 1>; Derived = Eigen::CwiseUnaryOp<Eigen::internal::scalar_abs_op<double>, const Eigen::Matrix<double, -1, -1> >; typename Eigen::internal::traits<T>::Scalar = double]: Assertion `this->rows()>0 && this->cols()>0 && "you are using an empty matrix"' failed.
Aborted (core dumped)

Checking the files can be handled with the standard library \<filesystem> headers since we require c++17 to build anyway.