123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /*!
- @file: optimization/ParamLog.cpp
- @author: Esther Wacker
- */
- #include "optimization/ParamLog.h"
- #include <iostream>
- using namespace std;
- using namespace OPTIMIZATION;
- ParamLog::ParamLog( std::string file)
- {
- // open file
- m_stream.open(file.c_str(), ios_base::out);
- }
- ParamLog::~ParamLog()
- {
- // close file
- m_stream.close();
- }
- void ParamLog::writeLogError(const char* szMessage)
- {
- }
- void ParamLog::writeLogWarning(const char* szMessage)
- {
- }
- void ParamLog::writeLogTrace(const char* szMessage)
- {
- }
- void ParamLog::writeParamsToFile(OPTIMIZATION::matrix_type& parammatrix)
- {
- int numParams= parammatrix.rows();
- if(m_stream.good())
- {
- for(int i= 0; i< numParams; ++i)
- {
- m_stream <<parammatrix(i,0)<<" ";
- }
- m_stream<<endl;
- m_stream.flush();
- }
- else
- {
- std::cerr << " the log file stream is bad! " <<endl;
- }
- }
|