Home
Get Started
Documentation
Community
Google Summer of Code
FAQ
GitHub
Home
Get Started
Documentation
Community
Google Summer of Code
FAQ
GitHub
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
,
133
format
f =
format::autodetect
);
134
135
}
// namespace data
136
}
// namespace mlpack
137
138
// Include implementation.
139
#include "save_impl.hpp"
140
141
#endif
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition:
add_to_cli11.hpp:21
image_info.hpp
mlpack::data::format
format
Define the formats we can read through cereal.
Definition:
format.hpp:20
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
format.hpp
detect_file_type.hpp
core::v2::data
constexpr auto data(Container const &container) noexcept -> decltype(container.data())
Definition:
iterator.hpp:79
mlpack::data::FileType::AutoDetect
attempt to automatically detect the file type
log.hpp
mlpack::data::autodetect
Definition:
format.hpp:22
mlpack::data::FileType
FileType
Definition:
types.hpp:28
save_image.hpp
mlpack::data::Save
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.