[shark] 11/58: Renamed files to aviod name collision
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Mar 16 10:05:27 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository shark.
commit 7fb9a60df11d79fb04edc00b7eef216579c39fa3
Author: Jens Holm <jensgholm15 at gmail.com>
Date: Thu Jan 28 09:20:10 2016 +0100
Renamed files to aviod name collision
---
.../{CrossEntropy.cpp => CrossEntropyMethod.cpp} | 20 ++++++++--------
Test/CMakeLists.txt | 2 +-
.../{CrossEntropy.h => CrossEntropyMethod.h} | 6 ++---
.../{CrossEntropy.cpp => CrossEntropyMethod.cpp} | 28 +++++++++++-----------
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/Test/Algorithms/DirectSearch/CrossEntropy.cpp b/Test/Algorithms/DirectSearch/CrossEntropyMethod.cpp
similarity index 75%
rename from Test/Algorithms/DirectSearch/CrossEntropy.cpp
rename to Test/Algorithms/DirectSearch/CrossEntropyMethod.cpp
index 3f8b44c..897a7b7 100644
--- a/Test/Algorithms/DirectSearch/CrossEntropy.cpp
+++ b/Test/Algorithms/DirectSearch/CrossEntropyMethod.cpp
@@ -2,7 +2,7 @@
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
-#include <shark/Algorithms/DirectSearch/CrossEntropy.h>
+#include <shark/Algorithms/DirectSearch/CrossEntropyMethod.h>
#include <shark/ObjectiveFunctions/Benchmarks/Rosenbrock.h>
#include <shark/ObjectiveFunctions/Benchmarks/Cigar.h>
#include <shark/ObjectiveFunctions/Benchmarks/Discus.h>
@@ -14,39 +14,39 @@
using namespace shark;
-BOOST_AUTO_TEST_SUITE (Algorithms_DirectSearch_CrossEntropy)
+BOOST_AUTO_TEST_SUITE (Algorithms_DirectSearch_CrossEntropyMethod)
-BOOST_AUTO_TEST_CASE( CrossEntropy_Cigar )
+BOOST_AUTO_TEST_CASE( CrossEntropyMethod_Cigar )
{
Cigar function(3);
- CrossEntropy optimizer;
+ CrossEntropyMethod optimizer;
std::cout<<"Testing: "<<optimizer.name()<<" with "<<function.name()<<std::endl;
test_function( optimizer, function, _trials = 10, _iterations = 1000, _epsilon = 1E-10 );
}
-BOOST_AUTO_TEST_CASE( CrossEntropy_Discus )
+BOOST_AUTO_TEST_CASE( CrossEntropyMethod_Discus )
{
Discus function(3);
- CrossEntropy optimizer;
+ CrossEntropyMethod optimizer;
std::cout<<"\nTesting: "<<optimizer.name()<<" with "<<function.name()<<std::endl;
test_function( optimizer, function, _trials = 10, _iterations = 1000, _epsilon = 1E-10 );
}
-BOOST_AUTO_TEST_CASE( CrossEntropy_Ellipsoid )
+BOOST_AUTO_TEST_CASE( CrossEntropyMethod_Ellipsoid )
{
Ellipsoid function(5);
- CrossEntropy optimizer;
+ CrossEntropyMethod optimizer;
std::cout << "\nTesting: " << optimizer.name() << " with " << function.name() << std::endl;
test_function( optimizer, function, _trials = 10, _iterations = 1000, _epsilon = 1E-10 );
}
-BOOST_AUTO_TEST_CASE( CrossEntropy_DiffPowers )
+BOOST_AUTO_TEST_CASE( CrossEntropyMethod_DiffPowers )
{
DiffPowers function( 3 );
- CrossEntropy optimizer;
+ CrossEntropyMethod optimizer;
std::cout << "\nTesting: " << optimizer.name() << " with " << function.name() << std::endl;
test_function( optimizer, function, _trials = 10, _iterations = 10000, _epsilon = 1E-10 );
diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt
index 8f00920..0fbfb68 100644
--- a/Test/CMakeLists.txt
+++ b/Test/CMakeLists.txt
@@ -80,7 +80,7 @@ shark_add_test( LinAlg/PartlyPrecomputedMatrix.cpp LinAlg_PartlyPrecomputedMatri
shark_add_test( Algorithms/DirectSearch/CMA.cpp DirectSearch_CMA )
shark_add_test( Algorithms/DirectSearch/CMSA.cpp DirectSearch_CMSA )
shark_add_test( Algorithms/DirectSearch/ElitistCMA.cpp DirectSearch_ElitistCMA )
-shark_add_test( Algorithms/DirectSearch/CrossEntropy.cpp DirectSearch_CrossEntropy )
+shark_add_test( Algorithms/DirectSearch/CrossEntropyMethod.cpp DirectSearch_CrossEntropyMethod )
shark_add_test( Algorithms/DirectSearch/VDCMA.cpp DirectSearch_VDCMA )
shark_add_test( Algorithms/DirectSearch/MOCMA.cpp DirectSearch_MOCMA )
shark_add_test( Algorithms/DirectSearch/SteadyStateMOCMA.cpp DirectSearch_SteadyStateMOCMA )
diff --git a/include/shark/Algorithms/DirectSearch/CrossEntropy.h b/include/shark/Algorithms/DirectSearch/CrossEntropyMethod.h
similarity index 97%
rename from include/shark/Algorithms/DirectSearch/CrossEntropy.h
rename to include/shark/Algorithms/DirectSearch/CrossEntropyMethod.h
index 51c6d3b..f351da6 100644
--- a/include/shark/Algorithms/DirectSearch/CrossEntropy.h
+++ b/include/shark/Algorithms/DirectSearch/CrossEntropyMethod.h
@@ -45,7 +45,7 @@
namespace shark {
- class CrossEntropy : public AbstractSingleObjectiveOptimizer<RealVector >
+ class CrossEntropyMethod : public AbstractSingleObjectiveOptimizer<RealVector >
{
public:
@@ -100,11 +100,11 @@ namespace shark {
/**
* \brief Default c'tor.
*/
- SHARK_EXPORT_SYMBOL CrossEntropy();
+ SHARK_EXPORT_SYMBOL CrossEntropyMethod();
/// \brief From INameable: return the class name.
std::string name() const
- { return "Cross Entropy"; }
+ { return "Cross Entropy Method"; }
/**
* \brief Sets default value for Population size.
diff --git a/src/Algorithms/DirectSearch/CrossEntropy.cpp b/src/Algorithms/DirectSearch/CrossEntropyMethod.cpp
similarity index 84%
rename from src/Algorithms/DirectSearch/CrossEntropy.cpp
rename to src/Algorithms/DirectSearch/CrossEntropyMethod.cpp
index 15713df..78de3c1 100644
--- a/src/Algorithms/DirectSearch/CrossEntropy.cpp
+++ b/src/Algorithms/DirectSearch/CrossEntropyMethod.cpp
@@ -35,14 +35,14 @@
#include <shark/Algorithms/DirectSearch/Operators/Evaluation/PenalizingEvaluator.h>
#include <shark/Algorithms/DirectSearch/FitnessExtractor.h>
#include <shark/Algorithms/DirectSearch/Operators/Selection/ElitistSelection.h>
-#include <shark/Algorithms/DirectSearch/CrossEntropy.h>
+#include <shark/Algorithms/DirectSearch/CrossEntropyMethod.h>
using namespace shark;
/**
* \brief Suggest a population size of 100.
*/
-unsigned CrossEntropy::suggestPopulationSize( ) {
+unsigned CrossEntropyMethod::suggestPopulationSize( ) {
/*
* Most papers suggests a population size of 100, thus
* simply choose 100.
@@ -53,7 +53,7 @@ unsigned CrossEntropy::suggestPopulationSize( ) {
/**
* \brief Calculates Selection Size for the supplied Population Size.
*/
-unsigned int CrossEntropy::suggestSelectionSize( unsigned int populationSize ) {
+unsigned int CrossEntropyMethod::suggestSelectionSize( unsigned int populationSize ) {
/*
* Most papers says 10% of the population size is used for
* the new generation, thus, just take 10% of the population size.
@@ -61,7 +61,7 @@ unsigned int CrossEntropy::suggestSelectionSize( unsigned int populationSize ) {
return (unsigned int) (populationSize / 10.0);
}
-CrossEntropy::CrossEntropy()
+CrossEntropyMethod::CrossEntropyMethod()
: m_variance( 0 )
, m_counter( 0 )
, m_distribution( Normal< Rng::rng_type >( Rng::globalRng, 0, 1.0 ) )
@@ -70,7 +70,7 @@ CrossEntropy::CrossEntropy()
m_features |= REQUIRES_VALUE;
}
-void CrossEntropy::read( InArchive & archive ) {
+void CrossEntropyMethod::read( InArchive & archive ) {
archive >> m_numberOfVariables;
archive >> m_selectionSize;
archive >> m_populationSize;
@@ -82,7 +82,7 @@ void CrossEntropy::read( InArchive & archive ) {
archive >> m_counter;
}
-void CrossEntropy::write( OutArchive & archive ) const {
+void CrossEntropyMethod::write( OutArchive & archive ) const {
archive << m_numberOfVariables;
archive << m_selectionSize;
archive << m_populationSize;
@@ -95,10 +95,10 @@ void CrossEntropy::write( OutArchive & archive ) const {
}
-void CrossEntropy::init( ObjectiveFunctionType & function, SearchPointType const& p) {
+void CrossEntropyMethod::init( ObjectiveFunctionType & function, SearchPointType const& p) {
- unsigned int populationSize = CrossEntropy::suggestPopulationSize( );
- unsigned int selectionSize = CrossEntropy::suggestSelectionSize( populationSize );
+ unsigned int populationSize = CrossEntropyMethod::suggestPopulationSize( );
+ unsigned int selectionSize = CrossEntropyMethod::suggestSelectionSize( populationSize );
RealVector initialVariance(p.size());
// Most papers set the variance to 100 by default.
@@ -117,7 +117,7 @@ void CrossEntropy::init( ObjectiveFunctionType & function, SearchPointType const
/**
* \brief Initializes the algorithm for the supplied objective function.
*/
-void CrossEntropy::init(
+void CrossEntropyMethod::init(
ObjectiveFunctionType& function,
SearchPointType const& initialSearchPoint,
unsigned int populationSize,
@@ -145,7 +145,7 @@ void CrossEntropy::init(
/**
* \brief Updates the strategy parameters based on the supplied parent population.
*/
-void CrossEntropy::updateStrategyParameters( const std::vector<Individual<RealVector, double> > & parents ) {
+void CrossEntropyMethod::updateStrategyParameters( const std::vector<Individual<RealVector, double> > & parents ) {
/* Calculate the centroid of the parents */
RealVector m(m_numberOfVariables);
@@ -184,7 +184,7 @@ void CrossEntropy::updateStrategyParameters( const std::vector<Individual<RealVe
/**
* \brief Executes one iteration of the algorithm.
*/
-void CrossEntropy::step(ObjectiveFunctionType const& function){
+void CrossEntropyMethod::step(ObjectiveFunctionType const& function){
std::vector< Individual<RealVector, double> > offspring( m_populationSize );
@@ -212,9 +212,9 @@ void CrossEntropy::step(ObjectiveFunctionType const& function){
m_best.value= parents[ 0 ].unpenalizedFitness();
}
-void CrossEntropy::init(ObjectiveFunctionType& function ){
+void CrossEntropyMethod::init(ObjectiveFunctionType& function ){
if(!(function.features() & ObjectiveFunctionType::CAN_PROPOSE_STARTING_POINT))
throw SHARKEXCEPTION( "[AbstractSingleObjectiveOptimizer::init] Objective function does not propose a starting point");
- CrossEntropy::init(function,function.proposeStartingPoint());
+ CrossEntropyMethod::init(function,function.proposeStartingPoint());
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/shark.git
More information about the debian-science-commits
mailing list