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