* indentations + whitespace cleanup

This commit is contained in:
Caner Candan 2011-05-05 16:54:00 +02:00
commit 56c6edab04
285 changed files with 6068 additions and 6223 deletions

View file

@ -58,7 +58,7 @@ public :
typedef eoValueParam<std::vector<double> > vDoubleParam;
eoFileSnapshot(std::string _dirname, unsigned _frequency = 1, std::string _filename = "gen",
std::string _delim = " ", unsigned _counter = 0, bool _rmFiles = true):
std::string _delim = " ", unsigned _counter = 0, bool _rmFiles = true):
dirname(_dirname), frequency(_frequency),
filename(_filename), delim(_delim), counter(_counter), boolChanged(true)
{
@ -71,11 +71,11 @@ public :
// now make sure there is a dir without any genXXX file in it
if (res) // no dir present
{
s = std::string("mkdir ")+dirname;
s = std::string("mkdir ")+dirname;
}
else if (!res && _rmFiles)
{
s = std::string("/bin/rm ")+dirname+ "/" + filename + "*";
s = std::string("/bin/rm ")+dirname+ "/" + filename + "*";
}
else
s = " ";
@ -111,9 +111,9 @@ public :
{
if (counter % frequency)
{
boolChanged = false; // subclass with gnuplot will do nothing
counter++;
return (*this);
boolChanged = false; // subclass with gnuplot will do nothing
counter++;
return (*this);
}
counter++;
boolChanged = true;
@ -137,35 +137,35 @@ public :
static_cast<const eoValueParam<std::vector<double> >* >(vec[0]);
const std::vector<double> v = ptParam->value();
if (vec.size() == 1) // only one std::vector: -> add number in front
if (vec.size() == 1) // only one std::vector: -> add number in front
{
for (unsigned k=0; k<v.size(); k++)
_os << k << " " << v[k] << "\n" ;
for (unsigned k=0; k<v.size(); k++)
_os << k << " " << v[k] << "\n" ;
}
else // need to get all other std::vectors
else // need to get all other std::vectors
{
std::vector<std::vector<double> > vv(vec.size());
vv[0]=v;
for (unsigned i=1; i<vec.size(); i++)
{
ptParam = static_cast<const eoValueParam<std::vector<double> >* >(vec[1]);
vv[i] = ptParam->value();
if (vv[i].size() != v.size())
throw std::runtime_error("Dimension error in eoSnapshotMonitor");
}
for (unsigned k=0; k<v.size(); k++)
{
for (unsigned i=0; i<vec.size(); i++)
_os << vv[i][k] << " " ;
_os << "\n";
}
std::vector<std::vector<double> > vv(vec.size());
vv[0]=v;
for (unsigned i=1; i<vec.size(); i++)
{
ptParam = static_cast<const eoValueParam<std::vector<double> >* >(vec[1]);
vv[i] = ptParam->value();
if (vv[i].size() != v.size())
throw std::runtime_error("Dimension error in eoSnapshotMonitor");
}
for (unsigned k=0; k<v.size(); k++)
{
for (unsigned i=0; i<vec.size(); i++)
_os << vv[i][k] << " " ;
_os << "\n";
}
}
return *this;
}
virtual const std::string getDirName() // for eoGnuPlot
virtual const std::string getDirName() // for eoGnuPlot
{ return dirname;}
virtual const std::string baseFileName() // the title for eoGnuPlot
virtual const std::string baseFileName() // the title for eoGnuPlot
{ return filename;}
/// add checks whether it is a std::vector of doubles