1 #include "BaseRandomModel.h" 10 FILE *pFile = fopen(fileName.c_str(),
"wb");
12 DGM_WARNING(
"Can't create file %s. Data was NOT saved.", fileName.c_str());
22 FILE *pFile = fopen(fileName.c_str(),
"rb");
23 DGM_ASSERT_MSG(pFile,
"Can't load data from %s", fileName.c_str());
32 std::string className =
typeid(*this).name();
33 name = className.substr(className.find(
"::") + 3);
37 if (idx >= 0) sprintf(str,
"_%05d", idx);
38 return path + name + str +
".dat";
std::string generateFileName(const std::string &path, const std::string &name, short idx) const
Generates name of the data file for storing random model parameters.
virtual void load(const std::string &path, const std::string &name=std::string(), short idx=-1)
Loads the training data.
virtual void save(const std::string &path, const std::string &name=std::string(), short idx=-1) const
Saves the training data.
virtual void saveFile(FILE *pFile) const =0
Saves the random model into the file.
virtual void loadFile(FILE *pFile)=0
Loads the random model from the file.