25 #ifndef __MLPACK_CORE_UTIL_SAVE_RESTORE_UTILITY_HPP
26 #define __MLPACK_CORE_UTIL_SAVE_RESTORE_UTILITY_HPP
34 #include <libxml/parser.h>
35 #include <libxml/tree.h>
37 #include <boost/tokenizer.hpp>
62 bool ReadFile(
const std::string& filename);
67 bool WriteFile(
const std::string& filename);
79 std::vector<T>&
LoadParameter(std::vector<T>& v,
const std::string& name);
89 std::string
LoadParameter(std::string& str,
const std::string& name);
94 arma::mat&
LoadParameter(arma::mat& matrix,
const std::string& name);
108 void SaveParameter(
const std::vector<T>& v,
const std::string& name);
118 void SaveParameter(
const arma::mat& mat,
const std::string& name);
124 const std::string& name);
129 const std::string& name);
135 #include "save_restore_utility_impl.hpp"
void SaveParameter(const T &t, const std::string &name)
SaveParameter saves a parameter to the parameters map.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void RecurseOnNodes(xmlNode *n)
RecurseOnNodes performs a depth first search of the XML tree.
T & LoadParameter(T &t, const std::string &name)
LoadParameter loads a parameter from the parameters map.
std::map< std::string, std::string > parameters
parameters contains a list of names and parameters in string form.
bool ReadFile(const std::string &filename)
ReadFile reads an XML tree from a file.
bool WriteFile(const std::string &filename)
WriteFile writes the XML tree to a file.