[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[oMetah-devel] ometah ./SConstruct common/matrix.hpp communica...
From: |
Johann |
Subject: |
[oMetah-devel] ometah ./SConstruct common/matrix.hpp communica... |
Date: |
Sat, 26 Mar 2005 15:33:02 -0500 |
CVSROOT: /cvsroot/ometah
Module name: ometah
Branch:
Changes by: Johann <address@hidden> 05/03/26 20:33:02
Modified files:
. : SConstruct
common : matrix.hpp
communication : itsCommunication.cpp itsCommunication.hpp
interface : ometah.cpp
metaheuristic : itsEstimationOfDistribution.cpp
itsMetaheuristic.cpp itsMetaheuristic.hpp
problem : itsProblem.cpp itsProblem.hpp itsRosenbrock.cpp
Log message:
* corrections for signed integer
* flags for compilation
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/SConstruct.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/common/matrix.hpp.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/communication/itsCommunication.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/communication/itsCommunication.hpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/interface/ometah.cpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/metaheuristic/itsEstimationOfDistribution.cpp.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/metaheuristic/itsMetaheuristic.cpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/metaheuristic/itsMetaheuristic.hpp.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/problem/itsProblem.cpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/problem/itsProblem.hpp.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/problem/itsRosenbrock.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: ometah/SConstruct
diff -u ometah/SConstruct:1.6 ometah/SConstruct:1.7
--- ometah/SConstruct:1.6 Sat Mar 26 09:17:38 2005
+++ ometah/SConstruct Sat Mar 26 20:33:01 2005
@@ -1,4 +1,19 @@
-env = Environment(CCFLAGS = '-Wno-deprecated -g')
+# flags for optimization, use them in production
+foptim = '-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks \
+ -felide-constructors -fexpensive-optimizations -ffast-math \
+ -ffloat-store -funroll-all-loops -funroll-loops -O3'
+
+# flags for checking the code
+fcheck = '-Wall -ansi -pedantic -Wimplicit -Wmissing-prototypes \
+ -Wredundant-decls -Wreturn-type -Wstrict-prototypes -Wunused'
+
+# flags for debugging
+fdebug = '-ggdb'
+
+# more flags
+fsup = '-Wno-deprecated'
+
+env = Environment(CCFLAGS = " ".join( [fcheck,fdebug,fsup] ) )
Index: ometah/common/matrix.hpp
diff -u ometah/common/matrix.hpp:1.6 ometah/common/matrix.hpp:1.7
--- ometah/common/matrix.hpp:1.6 Sat Mar 26 09:17:38 2005
+++ ometah/common/matrix.hpp Sat Mar 26 20:33:02 2005
@@ -1,7 +1,7 @@
/***************************************************************************
* matrix.hpp
*
- * $Id: matrix.hpp,v 1.6 2005/03/26 09:17:38 nojhan Exp $
+ * $Id: matrix.hpp,v 1.7 2005/03/26 20:33:02 nojhan Exp $
* Author : Johann Dréo <address@hidden>
****************************************************************************/
@@ -324,7 +324,7 @@
//! Find the minimum value of a vector
template<class T>
-typename T::value_type min(T aVector, int begin=0, int during=0)
+typename T::value_type min(T aVector, unsigned int begin=0, unsigned int
during=0)
{
if (during==0) {
during = aVector.size() - begin;
@@ -343,7 +343,7 @@
//! Find the maximum value of a vector
template<class T>
-typename T::value_type max(T aVector, int begin=0, int during=0)
+typename T::value_type max(T aVector, unsigned int begin=0, unsigned int
during=0)
{
if (during==0) {
during = aVector.size() - begin;
Index: ometah/communication/itsCommunication.cpp
diff -u ometah/communication/itsCommunication.cpp:1.1
ometah/communication/itsCommunication.cpp:1.2
--- ometah/communication/itsCommunication.cpp:1.1 Sat Mar 12 22:37:47 2005
+++ ometah/communication/itsCommunication.cpp Sat Mar 26 20:33:02 2005
@@ -1,5 +1,5 @@
/***************************************************************************
- * $Id: itsCommunication.cpp,v 1.1 2005/03/12 22:37:47 nojhan Exp $
+ * $Id: itsCommunication.cpp,v 1.2 2005/03/26 20:33:02 nojhan Exp $
* Copyright : Université Paris 12 Val-de-Marne
* Author : Johann Dréo <address@hidden>
****************************************************************************/
@@ -26,3 +26,8 @@
{
return this->key;
}
+
+void itsCommunication::setKey(string key)
+{
+ this->key = key;
+}
Index: ometah/communication/itsCommunication.hpp
diff -u ometah/communication/itsCommunication.hpp:1.1
ometah/communication/itsCommunication.hpp:1.2
--- ometah/communication/itsCommunication.hpp:1.1 Sat Mar 12 22:37:47 2005
+++ ometah/communication/itsCommunication.hpp Sat Mar 26 20:33:02 2005
@@ -1,5 +1,5 @@
/***************************************************************************
- * $Id: itsCommunication.hpp,v 1.1 2005/03/12 22:37:47 nojhan Exp $
+ * $Id: itsCommunication.hpp,v 1.2 2005/03/26 20:33:02 nojhan Exp $
* Copyright : Université Paris 12 Val-de-Marne
* Author : Johann Dréo <address@hidden>
****************************************************************************/
@@ -32,6 +32,12 @@
string key;
public:
+ //! Virtual destructor
+ /*!
+ Necessary because of the abstract factory
+ */
+ virtual ~itsCommunication();
+
//! Call the problem on a point to get its associated values
virtual itsPoint call(itsPoint point);
@@ -53,6 +59,8 @@
//! Return the key
string getKey();
+ //! Change the key
+ void setKey(string key);
};
#endif
Index: ometah/interface/ometah.cpp
diff -u ometah/interface/ometah.cpp:1.7 ometah/interface/ometah.cpp:1.8
--- ometah/interface/ometah.cpp:1.7 Sat Mar 26 11:46:47 2005
+++ ometah/interface/ometah.cpp Sat Mar 26 20:33:02 2005
@@ -1,5 +1,5 @@
/***************************************************************************
- * $Id: ometah.cpp,v 1.7 2005/03/26 11:46:47 nojhan Exp $
+ * $Id: ometah.cpp,v 1.8 2005/03/26 20:33:02 nojhan Exp $
* Copyright : Université Paris 12 Val-de-Marne
* Author : Johann Dréo <address@hidden>
****************************************************************************/
@@ -25,18 +25,23 @@
#include <hash_map.h>
+// common stuff
#include "../common/logic.hpp"
-
#include "../common/itsSet.hpp"
+
+// basic classes
#include "../metaheuristic/itsMetaheuristic.hpp"
#include "../problem/itsProblem.hpp"
#include "../communication/itsCommunicationClient.hpp"
#include "../communication/itsCommunicationServer.hpp"
+// metaheuristics
#include "../metaheuristic/itsEstimationOfDistribution.hpp"
+// problems
#include "../problem/itsRosenbrock.hpp"
+// communication
#include "../communication/itsCommunicationServer_embedded.hpp"
#include "../communication/itsCommunicationClient_embedded.hpp"
Index: ometah/metaheuristic/itsEstimationOfDistribution.cpp
diff -u ometah/metaheuristic/itsEstimationOfDistribution.cpp:1.9
ometah/metaheuristic/itsEstimationOfDistribution.cpp:1.10
--- ometah/metaheuristic/itsEstimationOfDistribution.cpp:1.9 Sat Mar 26
09:17:38 2005
+++ ometah/metaheuristic/itsEstimationOfDistribution.cpp Sat Mar 26
20:33:02 2005
@@ -1,7 +1,7 @@
/***************************************************************************
* itsMetaheuristic.hpp
*
- * $Id: itsEstimationOfDistribution.cpp,v 1.9 2005/03/26 09:17:38 nojhan Exp $
+ * $Id: itsEstimationOfDistribution.cpp,v 1.10 2005/03/26 20:33:02 nojhan Exp
$
* Author : Johann Dréo <address@hidden>
****************************************************************************/
@@ -81,7 +81,7 @@
}
// find the minimum and the maximum for each dimension
- for(unsigned int dim=0; dim < this->problem->getDimension(); dim++) {
+ for(int dim=0; dim < this->problem->getDimension(); dim++) {
// store them
this->parameterUniformMinima.push_back( min(
transposedSimplifiedSample[dim] ) );
this->parameterUniformMaxima.push_back( max(
transposedSimplifiedSample[dim] ) );
Index: ometah/metaheuristic/itsMetaheuristic.cpp
diff -u ometah/metaheuristic/itsMetaheuristic.cpp:1.7
ometah/metaheuristic/itsMetaheuristic.cpp:1.8
--- ometah/metaheuristic/itsMetaheuristic.cpp:1.7 Sat Mar 26 09:17:38 2005
+++ ometah/metaheuristic/itsMetaheuristic.cpp Sat Mar 26 20:33:02 2005
@@ -196,12 +196,12 @@
}
-int itsMetaheuristic::getSampleSize()
+unsigned int itsMetaheuristic::getSampleSize()
{
return this->sampleSize;
}
-void itsMetaheuristic::setSampleSize(int size)
+void itsMetaheuristic::setSampleSize(unsigned int size)
{
this->sampleSize = size;
// WARNING : changing the size cause the vector to be reinitialized
@@ -210,12 +210,12 @@
}
-int itsMetaheuristic::getIterationsMaxNumber()
+unsigned int itsMetaheuristic::getIterationsMaxNumber()
{
return this->iterationsMaxNumber;
}
-void itsMetaheuristic::setIterationsMaxNumber(int nbr)
+void itsMetaheuristic::setIterationsMaxNumber(unsigned int nbr)
{
this->iterationsMaxNumber = nbr;
}
Index: ometah/metaheuristic/itsMetaheuristic.hpp
diff -u ometah/metaheuristic/itsMetaheuristic.hpp:1.8
ometah/metaheuristic/itsMetaheuristic.hpp:1.9
--- ometah/metaheuristic/itsMetaheuristic.hpp:1.8 Sat Mar 26 09:17:38 2005
+++ ometah/metaheuristic/itsMetaheuristic.hpp Sat Mar 26 20:33:02 2005
@@ -40,6 +40,12 @@
class itsMetaheuristic
{
protected:
+ //! Virtual destructor
+ /*!
+ Necessary because of the abstract factory
+ */
+ virtual ~itsMetaheuristic();
+
//! The intensification phase
virtual void intensification();
@@ -108,16 +114,16 @@
vector<itsPoint> sample;
//! Number of points in the sample
- int sampleSize;
+ unsigned int sampleSize;
//! Current iterations number
- int iterationsCurrent;
+ unsigned int iterationsCurrent;
//! Maximum iterations number
/*!
This is used if you choose the associated stopping criteria
*/
- int iterationsMaxNumber;
+ unsigned int iterationsMaxNumber;
//! Stream for the main result of the optimization
/*!
@@ -199,17 +205,17 @@
void setFamily(string family);
//! Return the sample size
- int getSampleSize();
+ unsigned int getSampleSize();
//! Change the sample size
/*!
WARNING : changing the size cause the vector to be reinitialized
*/
- void setSampleSize(int size);
+ void setSampleSize(unsigned int size);
//! Return the maximum iterations number
- int getIterationsMaxNumber();
+ unsigned int getIterationsMaxNumber();
//! Change the maximum iterations number
- void setIterationsMaxNumber(int nbr);
+ void setIterationsMaxNumber(unsigned int nbr);
//! Return the key
string getKey();
Index: ometah/problem/itsProblem.cpp
diff -u ometah/problem/itsProblem.cpp:1.7 ometah/problem/itsProblem.cpp:1.8
--- ometah/problem/itsProblem.cpp:1.7 Sat Mar 26 09:17:38 2005
+++ ometah/problem/itsProblem.cpp Sat Mar 26 20:33:02 2005
@@ -1,5 +1,5 @@
-/***************************************************************************
- * $Id: itsProblem.cpp,v 1.7 2005/03/26 09:17:38 nojhan Exp $
+in/***************************************************************************
+ * $Id: itsProblem.cpp,v 1.8 2005/03/26 20:33:02 nojhan Exp $
* Copyright 2005 Université Paris 12 Val-de-Marne
* Author : Johann Dréo <address@hidden>
****************************************************************************/
@@ -81,12 +81,12 @@
}
-int itsProblem::getDimension()
+unsigned int itsProblem::getDimension()
{
return this->dimension;
}
-void itsProblem::setDimension(int dimension)
+void itsProblem::setDimension(unsigned int dimension)
{
this->dimension = dimension;
Index: ometah/problem/itsProblem.hpp
diff -u ometah/problem/itsProblem.hpp:1.10 ometah/problem/itsProblem.hpp:1.11
--- ometah/problem/itsProblem.hpp:1.10 Sat Mar 26 09:17:38 2005
+++ ometah/problem/itsProblem.hpp Sat Mar 26 20:33:02 2005
@@ -1,5 +1,5 @@
/***************************************************************************
- * $Id: itsProblem.hpp,v 1.10 2005/03/26 09:17:38 nojhan Exp $
+ * $Id: itsProblem.hpp,v 1.11 2005/03/26 20:33:02 nojhan Exp $
* Copyright 2005 Université Paris 12 Val-de-Marne
* Author : Johann Dréo <address@hidden>
****************************************************************************/
@@ -64,7 +64,7 @@
string formula;
//! Number of variables
- int dimension;
+ unsigned int dimension;
//! The global optima
/*!
@@ -91,6 +91,12 @@
//! Constructor
itsProblem();
+ //! Virtual destructor
+ /*!
+ Necessary because of the abstract factory
+ */
+ virtual ~itsProblem();
+
//! Simple attribute accesses
//address@hidden
@@ -110,9 +116,9 @@
void setCitation(string citation);
//! Return the dimension
- int getDimension();
+ unsigned int getDimension();
//! Change the dimension
- void setDimension(int dimension);
+ void setDimension(unsigned int dimension);
//! Return the formula
string getFormula();
Index: ometah/problem/itsRosenbrock.cpp
diff -u ometah/problem/itsRosenbrock.cpp:1.3
ometah/problem/itsRosenbrock.cpp:1.4
--- ometah/problem/itsRosenbrock.cpp:1.3 Sat Mar 12 22:50:35 2005
+++ ometah/problem/itsRosenbrock.cpp Sat Mar 26 20:33:02 2005
@@ -1,5 +1,5 @@
/***************************************************************************
- * $Id: itsRosenbrock.cpp,v 1.3 2005/03/12 22:50:35 nojhan Exp $
+ * $Id: itsRosenbrock.cpp,v 1.4 2005/03/26 20:33:02 nojhan Exp $
* Copyright 2005 Université Paris 12 Val-de-Marne
* Author : Johann Dréo <address@hidden>
****************************************************************************/
@@ -71,5 +71,5 @@
itsProblem * itsRosenbrockFactory::create()
{
- return new itsRosenbrock;
+ return new itsRosenbrock();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [oMetah-devel] ometah ./SConstruct common/matrix.hpp communica...,
Johann <=