17 #ifndef __MLPACK_CORE_UTIL_SAVE_RESTORE_UTILITY_HPP
18 #define __MLPACK_CORE_UTIL_SAVE_RESTORE_UTILITY_HPP
26 #include <libxml/parser.h>
27 #include <libxml/tree.h>
29 #include <boost/tokenizer.hpp>
54 bool ReadFile(
const std::string& filename);
59 bool WriteFile(
const std::string& filename);
71 std::vector<T>&
LoadParameter(std::vector<T>& v,
const std::string& name);
81 std::string
LoadParameter(std::string& str,
const std::string& name);
86 arma::mat&
LoadParameter(arma::mat& matrix,
const std::string& name);
100 void SaveParameter(
const std::vector<T>& v,
const std::string& name);
110 void SaveParameter(
const arma::mat& mat,
const std::string& name);
116 const std::string& name);
121 const std::string& name);
127 #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.