mlpack  master
load.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_DATA_LOAD_HPP
15 #define MLPACK_CORE_DATA_LOAD_HPP
16 
17 #include <mlpack/prereqs.hpp>
18 #include <mlpack/core/util/log.hpp>
19 #include <string>
20 
21 #include "format.hpp"
22 #include "dataset_mapper.hpp"
23 
24 namespace mlpack {
25 namespace data {
26 
61 template<typename eT>
62 bool Load(const std::string& filename,
63  arma::Mat<eT>& matrix,
64  const bool fatal = false,
65  const bool transpose = true);
66 
67 extern template bool Load<int>(const std::string&, arma::Mat<int>&, const bool, const bool);
68 extern template bool Load<size_t>(const std::string&, arma::Mat<size_t>&, const bool, const bool);
69 extern template bool Load<float>(const std::string&, arma::Mat<float>&, const bool, const bool);
70 extern template bool Load<double>(const std::string&, arma::Mat<double>&, const bool, const bool);
71 
72 #ifndef _WIN32
73 extern template bool Load<unsigned long long>(const std::string&, arma::Mat<unsigned long long>&, const bool, const bool);
74 #endif
75 
103 template<typename eT>
104 bool Load(const std::string& filename,
105  arma::Col<eT>& vec,
106  const bool fatal = false);
107 
135 template<typename eT>
136 bool Load(const std::string& filename,
137  arma::Row<eT>& rowvec,
138  const bool fatal = false);
139 
172 template<typename eT, typename PolicyType>
173 bool Load(const std::string& filename,
174  arma::Mat<eT>& matrix,
175  DatasetMapper<PolicyType>& info,
176  const bool fatal = false,
177  const bool transpose = true);
178 
179 extern template bool Load<int, IncrementPolicy>(const std::string&, arma::Mat<int>&,
180  DatasetMapper<IncrementPolicy>&,
181  const bool, const bool);
182 
183 extern template bool Load<size_t, IncrementPolicy>(const std::string&, arma::Mat<size_t>&,
184  DatasetMapper<IncrementPolicy>&,
185  const bool, const bool);
186 
187 extern template bool Load<float, IncrementPolicy>(const std::string&, arma::Mat<float>&,
188  DatasetMapper<IncrementPolicy>&,
189  const bool, const bool);
190 
191 extern template bool Load<double, IncrementPolicy>(const std::string&, arma::Mat<double>&,
192  DatasetMapper<IncrementPolicy>&,
193  const bool, const bool);
194 
195 extern template bool Load<unsigned long long, IncrementPolicy>(const std::string&, arma::Mat<unsigned long long>&,
196  DatasetMapper<IncrementPolicy>&,
197  const bool, const bool);
198 
224 template<typename T>
225 bool Load(const std::string& filename,
226  const std::string& name,
227  T& t,
228  const bool fatal = false,
230 
231 } // namespace data
232 } // namespace mlpack
233 
234 // Include implementation of model-loading Load() overload.
235 #include "load_model_impl.hpp"
236 // Include implementation of Load() for vectors.
237 #include "load_vec_impl.hpp"
238 
239 #endif
template bool Load< size_t >(const std::string &, arma::Mat< size_t > &, const bool, const bool)
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
The core includes that mlpack expects; standard C++ includes and Armadillo.
template bool Load< double >(const std::string &, arma::Mat< double > &, const bool, const bool)
template bool Load< size_t, IncrementPolicy >(const std::string &, arma::Mat< size_t > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)
template bool Load< double, IncrementPolicy >(const std::string &, arma::Mat< double > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)
template bool Load< int, IncrementPolicy >(const std::string &, arma::Mat< int > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)
template bool Load< unsigned long long, IncrementPolicy >(const std::string &, arma::Mat< unsigned long long > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)
template bool Load< unsigned long long >(const std::string &, arma::Mat< unsigned long long > &, const bool, const bool)
template bool Load< int >(const std::string &, arma::Mat< int > &, const bool, const bool)
bool Load(const std::string &filename, arma::Mat< eT > &matrix, const bool fatal=false, const bool transpose=true)
Loads a matrix from file, guessing the filetype from the extension.
format
Define the formats we can read through boost::serialization.
Definition: format.hpp:20
test cpp RESULT_VARIABLE MEX_RESULT_TRASH OUTPUT_VARIABLE MEX_OUTPUT ERROR_VARIABLE MEX_ERROR_TRASH string(REGEX MATCH"Warning: You are using"MEX_WARNING"${MEX_OUTPUT}") if(MEX_WARNING) string(REGEX REPLACE".*using [a-zA-Z]* version \"([0-9.]*)[^\"]*\".*""\\1"OTHER_COMPILER_VERSION"$
Definition: CMakeLists.txt:18
template bool Load< float >(const std::string &, arma::Mat< float > &, const bool, const bool)
template bool Load< float, IncrementPolicy >(const std::string &, arma::Mat< float > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)