13 #ifndef MLPACK_CORE_DATA_LOAD_VEC_IMPL_HPP 14 #define MLPACK_CORE_DATA_LOAD_VEC_IMPL_HPP 24 bool Load(
const std::string& filename,
30 bool success =
Load(filename, tmp, fatal,
false);
45 Log::Fatal <<
"Matrix in file '" << filename <<
"' is not a vector, but" 46 <<
" instead has size " << tmp.n_rows <<
"x" << tmp.n_cols <<
"!" 51 Log::Warn <<
"Matrix in file '" << filename <<
"' is not a vector, but " 52 <<
"instead has size " << tmp.n_rows <<
"x" << tmp.n_cols <<
"!" 66 arma::access::rw(tmp.n_rows) = tmp.n_cols;
67 arma::access::rw(tmp.n_cols) = 1;
73 *((arma::Mat<eT>*) &vec) = std::move(tmp);
81 *((arma::Mat<eT>*) &vec) = std::move(tmp);
88 bool Load(
const std::string& filename,
89 arma::Row<eT>& rowvec,
93 bool success =
Load(filename, tmp, fatal,
false);
107 Log::Fatal <<
"Matrix in file '" << filename <<
"' is not a vector, but" 108 <<
" instead has size " << tmp.n_rows <<
"x" << tmp.n_cols <<
"!" 113 Log::Warn <<
"Matrix in file '" << filename <<
"' is not a vector, but " 114 <<
"instead has size " << tmp.n_rows <<
"x" << tmp.n_cols <<
"!" 128 arma::access::rw(tmp.n_cols) = tmp.n_rows;
129 arma::access::rw(tmp.n_rows) = 1;
135 *((arma::Mat<eT>*) &rowvec) = std::move(tmp);
142 *((arma::Mat<eT>*) &rowvec) = std::move(tmp);
static MLPACK_EXPORT util::PrefixedOutStream Fatal
Prints fatal messages prefixed with [FATAL], then terminates the program.
Definition: log.hpp:90
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
static MLPACK_EXPORT util::PrefixedOutStream Warn
Prints warning messages prefixed with [WARN ].
Definition: log.hpp:87
bool Load(const std::string &filename, arma::Mat< eT > &matrix, const bool fatal=false, const bool transpose=true, const arma::file_type inputLoadType=arma::auto_detect)
Loads a matrix from file, guessing the filetype from the extension.
Definition: load_impl.hpp:89