Some 'improvements' added
This commit is contained in:
parent
00780d785a
commit
49ee190e10
4 changed files with 45 additions and 41 deletions
|
|
@ -40,7 +40,7 @@ class eoFixedLength : public EO<FitT>, public std::vector<GeneType>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
typedef typename GeneType Type;
|
typedef GeneType Type;
|
||||||
|
|
||||||
/// to avoid conflicts between EO::operator< and vector<double>::operator<
|
/// to avoid conflicts between EO::operator< and vector<double>::operator<
|
||||||
bool operator<(const eoFixedLength<FitT, GeneType>& _eo) const
|
bool operator<(const eoFixedLength<FitT, GeneType>& _eo) const
|
||||||
|
|
@ -48,6 +48,31 @@ class eoFixedLength : public EO<FitT>, public std::vector<GeneType>
|
||||||
return EO<FitT>::operator<(_eo);
|
return EO<FitT>::operator<(_eo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// printing...
|
||||||
|
void printOn(ostream& os) const
|
||||||
|
{
|
||||||
|
EO<FitT>::printOn(os);
|
||||||
|
os << ' ';
|
||||||
|
|
||||||
|
os << size() << ' ';
|
||||||
|
|
||||||
|
std::copy(begin(), end(), ostream_iterator<double>(os));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// reading...
|
||||||
|
void readFrom(istream& is)
|
||||||
|
{
|
||||||
|
EO<FitT>::readFrom(is);
|
||||||
|
|
||||||
|
unsigned sz;
|
||||||
|
is >> sz;
|
||||||
|
|
||||||
|
resize(sz);
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
for (i = 0; i < sz; ++i)
|
||||||
|
is >> operator[](i);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// to avoid conflicts between EO::operator< and vector<double>::operator<
|
/// to avoid conflicts between EO::operator< and vector<double>::operator<
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ template <class Fit>
|
||||||
class eoEsFull : public eoFixedLength<Fit, double>
|
class eoEsFull : public eoFixedLength<Fit, double>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
typedef double Type;
|
||||||
|
|
||||||
eoEsFull(void) : eoFixedLength<Fit, double>() {}
|
eoEsFull(void) : eoFixedLength<Fit, double>() {}
|
||||||
|
|
||||||
|
|
@ -47,9 +48,7 @@ class eoEsFull : public eoFixedLength<Fit, double>
|
||||||
|
|
||||||
void printOn(std::ostream& os) const
|
void printOn(std::ostream& os) const
|
||||||
{
|
{
|
||||||
os << size() << ' ';
|
eoFixedLength<Fit,double>::printOn(os);
|
||||||
|
|
||||||
std::copy(begin(), end(), std::ostream_iterator<double>(os));
|
|
||||||
|
|
||||||
os << ' ';
|
os << ' ';
|
||||||
std::copy(stdevs.begin(), stdevs.end(), std::ostream_iterator<double>(os));
|
std::copy(stdevs.begin(), stdevs.end(), std::ostream_iterator<double>(os));
|
||||||
|
|
@ -63,21 +62,15 @@ class eoEsFull : public eoFixedLength<Fit, double>
|
||||||
|
|
||||||
void readFrom(istream& is)
|
void readFrom(istream& is)
|
||||||
{
|
{
|
||||||
unsigned sz;
|
eoFixedLength<Fit,double>::readFrom(is);
|
||||||
is >> sz;
|
|
||||||
|
stdevs.resize(size());
|
||||||
|
|
||||||
resize(sz);
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
for (i = 0; i < size(); ++i)
|
||||||
for (i = 0; i < sz; ++i)
|
|
||||||
is >> operator[](i);
|
|
||||||
|
|
||||||
stdevs.resize(sz);
|
|
||||||
|
|
||||||
for (i = 0; i < sz; ++i)
|
|
||||||
is >> stdevs[i];
|
is >> stdevs[i];
|
||||||
|
|
||||||
correlations.resize(sz*(sz - 1) / 2);
|
correlations.resize(size()*(size() - 1) / 2);
|
||||||
|
|
||||||
for (i = 0; i < correlations.size(); ++i)
|
for (i = 0; i < correlations.size(); ++i)
|
||||||
is >> correlations[i];
|
is >> correlations[i];
|
||||||
|
|
|
||||||
|
|
@ -48,29 +48,22 @@ class eoEsSimple : public eoFixedLength<Fit, double>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
|
typedef double Type;
|
||||||
|
|
||||||
eoEsSimple(void) : eoFixedLength<Fit, double>() {}
|
eoEsSimple(void) : eoFixedLength<Fit, double>() {}
|
||||||
|
|
||||||
std::string className(void) const { return "eoEsSimple"; }
|
std::string className(void) const { return "eoEsSimple"; }
|
||||||
|
|
||||||
void printOn(ostream& os) const
|
void printOn(std::ostream& os) const
|
||||||
{
|
{
|
||||||
os << size() << ' ';
|
eoFixedLength<Fit,double>::printOn(os);
|
||||||
|
|
||||||
std::copy(begin(), end(), ostream_iterator<double>(os));
|
|
||||||
|
|
||||||
os << ' ' << stdev << ' ';
|
os << ' ' << stdev << ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
void readFrom(istream& is)
|
void readFrom(istream& is)
|
||||||
{
|
{
|
||||||
unsigned sz;
|
eoFixedLength<Fit,double>::readFrom(is);
|
||||||
is >> sz;
|
|
||||||
|
|
||||||
resize(sz);
|
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
for (i = 0; i < sz; ++i)
|
|
||||||
is >> operator[](i);
|
|
||||||
|
|
||||||
is >> stdev;
|
is >> stdev;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,15 @@ class eoEsStdev : public eoFixedLength<Fit, double>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
|
typedef double Type;
|
||||||
|
|
||||||
eoEsStdev(void) : eoFixedLength<Fit, double>() {}
|
eoEsStdev(void) : eoFixedLength<Fit, double>() {}
|
||||||
|
|
||||||
std::string className(void) const { return "eoEsStdev"; }
|
std::string className(void) const { return "eoEsStdev"; }
|
||||||
|
|
||||||
void printOn(std::ostream& os) const
|
void printOn(std::ostream& os) const
|
||||||
{
|
{
|
||||||
os << size() << ' ';
|
eoFixedLength<Fit,double>::printOn(os);
|
||||||
|
|
||||||
std::copy(begin(), end(), std::ostream_iterator<double>(os));
|
|
||||||
|
|
||||||
os << ' ';
|
os << ' ';
|
||||||
std::copy(stdevs.begin(), stdevs.end(), std::ostream_iterator<double>(os));
|
std::copy(stdevs.begin(), stdevs.end(), std::ostream_iterator<double>(os));
|
||||||
|
|
@ -59,18 +59,11 @@ class eoEsStdev : public eoFixedLength<Fit, double>
|
||||||
|
|
||||||
void readFrom(istream& is)
|
void readFrom(istream& is)
|
||||||
{
|
{
|
||||||
unsigned sz;
|
eoFixedLength<Fit,double>::readFrom(is);
|
||||||
is >> sz;
|
stdevs.resize(size());
|
||||||
|
|
||||||
resize(sz);
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
for (i = 0; i < size(); ++i)
|
||||||
for (i = 0; i < sz; ++i)
|
|
||||||
is >> operator[](i);
|
|
||||||
|
|
||||||
stdevs.resize(sz);
|
|
||||||
|
|
||||||
for (i = 0; i < sz; ++i)
|
|
||||||
is >> stdevs[i];
|
is >> stdevs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue