1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include "optimization/ParamLog.h"
- #include <iostream>
- using namespace std;
- ParamLog::ParamLog( std::string file)
- {
-
- m_stream.open(file.c_str(), ios_base::out);
- }
- ParamLog::~ParamLog()
- {
-
- 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;
- }
- }
|