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/core/util/log.hpp>
18 #include <mlpack/core/arma_extend/arma_extend.hpp> // Includes Armadillo.
19 #include <string>
20 
21 #include "format.hpp"
22 #include "image_info.hpp"
23 
24 namespace mlpack {
25 namespace data {
26 
56 template<typename eT>
57 bool Save(const std::string& filename,
58  const arma::Mat<eT>& matrix,
59  const bool fatal = false,
60  bool transpose = true);
61 
87 template<typename eT>
88 bool Save(const std::string& filename,
89  const arma::SpMat<eT>& matrix,
90  const bool fatal = false,
91  bool transpose = true);
92 
118 template<typename T>
119 bool Save(const std::string& filename,
120  const std::string& name,
121  T& t,
122  const bool fatal = false,
124 
134 template<typename eT>
135 bool Save(const std::string& filename,
136  arma::Mat<eT>& matrix,
137  ImageInfo& info,
138  const bool fatal = false);
139 
149 template<typename eT>
150 bool Save(const std::vector<std::string>& files,
151  arma::Mat<eT>& matrix,
152  ImageInfo& info,
153  const bool fatal = false);
154 
158 bool SaveImage(const std::string& filename,
159  arma::Mat<unsigned char>& image,
160  ImageInfo& info,
161  const bool fatal = false);
162 
163 } // namespace data
164 } // namespace mlpack
165 
166 // Include implementation.
167 #include "save_impl.hpp"
168 
169 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_po.hpp:21
bool SaveImage(const std::string &filename, arma::Mat< unsigned char > &image, ImageInfo &info, const bool fatal=false)
Helper function to save files.
format
Define the formats we can read through boost::serialization.
Definition: format.hpp:20
bool Save(const std::string &filename, const arma::Mat< eT > &matrix, const bool fatal=false, bool transpose=true)
Saves a matrix to file, guessing the filetype from the extension.