mlpack  3.1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 T>
88 bool Save(const std::string& filename,
89  const std::string& name,
90  T& t,
91  const bool fatal = false,
93 
104 template<typename eT>
105 bool Save(const std::string& filename,
106  arma::Mat<eT>& matrix,
107  ImageInfo& info,
108  const bool fatal = false);
109 
120 template<typename eT>
121 bool Save(const std::vector<std::string>& files,
122  arma::Mat<eT>& matrix,
123  ImageInfo& info,
124  const bool fatal = false);
125 
129 bool SaveImage(const std::string& filename,
130  arma::Mat<unsigned char>& image,
131  ImageInfo& info,
132  const bool fatal = false);
133 
134 } // namespace data
135 } // namespace mlpack
136 
137 // Include implementation.
138 #include "save_impl.hpp"
139 
140 #endif
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.
string(REGEX REPLACE".*#define MLPACK_VERSION_MINOR ([0-9]+).*""\\1"MLPACK_VERSION_MINOR"${VERSION_HPP_CONTENTS}") string(REGEX REPLACE".* "\\1" MLPACK_VERSION_PATCH "$
Definition: CMakeLists.txt:35