Skip to content
Snippets Groups Projects
Commit 0a339713 authored by Mark Woolrich's avatar Mark Woolrich
Browse files

*** empty log message ***

parent f56b83cd
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
/* CCOPYRIGHT */ /* CCOPYRIGHT */
#if !defined(Log_h)
#define Log_h
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>
...@@ -13,10 +16,10 @@ ...@@ -13,10 +16,10 @@
#include "newmatio.h" #include "newmatio.h"
using namespace NEWMAT; using namespace NEWMAT;
namespace Utilities{ namespace Utilities{
#if !defined(Log_h) template<class t> string tostring(const t obj);
#define Log_h
class Log class Log
{ {
...@@ -28,18 +31,18 @@ namespace Utilities{ ...@@ -28,18 +31,18 @@ namespace Utilities{
keeps adding "+" to pdirname until unique directory is made: */ keeps adding "+" to pdirname until unique directory is made: */
void makeDir(const string& pdirname, const string& plogfilename = "logfile"); void makeDir(const string& pdirname, const string& plogfilename = "logfile");
/** Sets an existing directory to place results into: */ /** Sets an existing directory to place results into: */
void setDir(const string& pdirname, const string& plogfilename = "logfile"); void setDir(const string& pdirname, const string& plogfilename = "logfile");
const string& getDir() const { return dir; } const string& getDir() const { return dir; }
const string& getLogFileName() const { return logfilename; } const string& getLogFileName() const { return logfilename; }
const string appendFileName(const string& filename) const { return dir + "/" + filename;} const string appendDir(const string& filename) const { return dir + "/" + filename;}
void out(const string& p_fname, const Matrix& p_mat); void out(const string& p_fname, const Matrix& p_mat);
void out(const string& p_fname, const RowVector& p_mat); void out(const string& p_fname, const RowVector& p_mat);
void out(const string& p_fname, const ColumnVector& p_mat); void out(const string& p_fname, const ColumnVector& p_mat);
static int counter() { return count++; }
ofstream& str(); ofstream& str();
private: private:
...@@ -52,6 +55,7 @@ namespace Utilities{ ...@@ -52,6 +55,7 @@ namespace Utilities{
string dir; string dir;
ofstream logfileout; ofstream logfileout;
string logfilename; string logfilename;
static int count;
bool logEstablished; bool logEstablished;
}; };
...@@ -139,9 +143,8 @@ namespace Utilities{ ...@@ -139,9 +143,8 @@ namespace Utilities{
return logfileout; return logfileout;
} }
#endif
} }
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment