save.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_DATA_SAVE_HPP
15 #define MLPACK_CORE_DATA_SAVE_HPP
16 
17 #include <mlpack/prereqs.hpp>
18 #include <mlpack/core/util/log.hpp>
19 #include <mlpack/core/arma_extend/arma_extend.hpp> // Includes Armadillo.
20 #include <string>
21 
22 #include "format.hpp"
23 #include "image_info.hpp"
24 #include "detect_file_type.hpp"
25 #include "save_image.hpp"
26 
27 namespace mlpack {
28 namespace data {
29 
65 template<typename eT>
66 bool Save(const std::string& filename,
67  const arma::Mat<eT>& matrix,
68  const bool fatal = false,
69  bool transpose = true,
70  FileType inputSaveType = FileType::AutoDetect);
71 
97 template<typename eT>
98 bool Save(const std::string& filename,
99  const arma::SpMat<eT>& matrix,
100  const bool fatal = false,
101  bool transpose = true);
102 
128 template<typename T>
129 bool Save(const std::string& filename,
130  const std::string& name,
131  T& t,
132  const bool fatal = false,
134 
135 } // namespace data
136 } // namespace mlpack
137 
138 // Include implementation.
139 #include "save_impl.hpp"
140 
141 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
format
Define the formats we can read through cereal.
Definition: format.hpp:20
The core includes that mlpack expects; standard C++ includes and Armadillo.
constexpr auto data(Container const &container) noexcept -> decltype(container.data())
Definition: iterator.hpp:79
attempt to automatically detect the file type
bool Save(const std::string &filename, const arma::Mat< eT > &matrix, const bool fatal=false, bool transpose=true, FileType inputSaveType=FileType::AutoDetect)
Saves a matrix to file, guessing the filetype from the extension.