EvolvingObjects
eoEsFull.h
00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
00002 
00003 //-----------------------------------------------------------------------------
00004 // eoEsFull.h
00005 // (c) GeNeura Team, 2000 - EEAAX 1999 - Maarten Keijzer 2000
00006 /*
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021     Contact: todos@geneura.ugr.es, http://geneura.ugr.es
00022              Marc.Schoenauer@polytechnique.fr
00023              mak@dhi.dk
00024  */
00025 //-----------------------------------------------------------------------------
00026 
00027 #ifndef _eoEsFull_h
00028 #define _eoEsFull_h
00029 
00030 #include <eoVector.h>
00031 
00039 template <class Fit>
00040 class eoEsFull : public eoVector<Fit, double>
00041 {
00042 public:
00043 
00044     using eoVector<Fit, double>::size;
00045 
00046 
00047     typedef double Type;
00048 
00049     eoEsFull(void) : eoVector<Fit, double>() {}
00050 
00051     virtual std::string className(void) const { return "eoEsFull"; }
00052 
00053     void printOn(std::ostream& os) const
00054     {
00055         eoVector<Fit,double>::printOn(os);
00056         os << ' ';
00057         std::copy(stdevs.begin(), stdevs.end(), std::ostream_iterator<double>(os, " "));
00058         os << ' ';
00059         std::copy(correlations.begin(), correlations.end(), std::ostream_iterator<double>(os, " "));
00060         os << ' ';
00061     }
00062 
00063     void readFrom(std::istream& is)
00064     {
00065         eoVector<Fit,double>::readFrom(is);
00066 
00067         stdevs.resize(size());
00068 
00069         unsigned i;
00070         for (i = 0; i < size(); ++i)
00071             is >> stdevs[i];
00072 
00073         correlations.resize(size()*(size() - 1) / 2);
00074 
00075         for (i = 0; i < correlations.size(); ++i)
00076             is >> correlations[i];
00077     }
00078 
00079     std::vector<double> stdevs;
00080     std::vector<double> correlations;
00081 };
00082 
00083 
00084 
00085 #endif
 All Classes Namespaces Files Functions Variables Typedefs Friends