Commit 31b9141f authored by gsell's avatar gsell
Browse files

cleanup: comment out unused parameters in optimizer

parent 07185905
......@@ -32,7 +32,7 @@ class SocialNetworkGraph : public TopoDiscoveryStrategy_t {
public:
std::set<size_t> execute(size_t numMasters, size_t dimensions, size_t id,
int island_id) {
int /*island_id*/) {
numMasters_ = numMasters;
dim_ = dimensions;
......
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(ANNOTATION_HPP)
#define ANNOTATION_HPP
#include <map>
#include <boost/variant/apply_visitor.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/mpl/bool.hpp>
#include "ast.hpp"
namespace client
{
///////////////////////////////////////////////////////////////////////////////
// The annotation handler links the AST to a map of iterator positions
// for the purpose of subsequent semantic error handling when the
// program is being compiled.
///////////////////////////////////////////////////////////////////////////////
template <typename Iterator>
struct annotation
{
#if BOOST_VERSION >= 106200
template <typename>
#else
template <typename, typename>
#endif
struct result { typedef void type; };
std::vector<Iterator>& iters;
annotation(std::vector<Iterator>& iters)
: iters(iters) {}
struct set_id
{
typedef void result_type;
int id;
set_id(int id) : id(id) {}
void operator()(ast::function_call& x) const
{
x.function_name.id = id;
}
void operator()(ast::identifier& x) const
{
x.id = id;
}
template <typename T>
void operator()(T& /*x*/) const
{
// no-op
}
};
void operator()(ast::operand& ast, Iterator pos) const
{
int id = iters.size();
iters.push_back(pos);
boost::apply_visitor(set_id(id), ast);
}
void operator()(ast::identifier& ast, Iterator pos) const
{
int id = iters.size();
iters.push_back(pos);
ast.id = id;
}
};
}
#endif
......@@ -52,7 +52,7 @@ namespace client
}
template <typename T>
void operator()(T& x) const
void operator()(T& /*x*/) const
{
// no-op
}
......@@ -74,4 +74,4 @@ namespace client
};
}
#endif
\ No newline at end of file
#endif
......@@ -35,10 +35,10 @@ namespace client { namespace code_gen
}
bool operator()(ast::nil) { BOOST_ASSERT(0); return false; }
bool operator()(unsigned int x) { return true; }
bool operator()(double x) { return true; }
bool operator()(bool x) { return true; }
bool operator()(ast::quoted_string const &x) { return true; }
bool operator()(unsigned int /*x*/) { return true; }
bool operator()(double /*x*/) { return true; }
bool operator()(bool /*x*/) { return true; }
bool operator()(ast::quoted_string const & /*x*/) { return true; }
bool operator()(ast::operation const& x) {
if (!boost::apply_visitor(*this, x.operand_))
......@@ -97,4 +97,5 @@ namespace client { namespace code_gen
};
}}
#endif
\ No newline at end of file
#endif
......@@ -16,7 +16,7 @@
template <class T> struct BlendCrossover
{
void crossover(boost::shared_ptr<T> ind1, boost::shared_ptr<T> ind2,
CmdArguments_t args) {
CmdArguments_t /*args*/) {
// BLX-0.5 performs better than BLX operators with any other \alpha
// value
......@@ -34,4 +34,5 @@ template <class T> struct BlendCrossover
ind2->genes_m[i] = (1 - gamma2) * ming + gamma2 * maxg;
}
}
};
\ No newline at end of file
};
......@@ -77,7 +77,7 @@ public:
/// serialization of structure
template<class Archive>
void serialize(Archive & ar, const unsigned int version) {
void serialize(Archive & ar, const unsigned int /*version*/) {
ar & genes_m;
ar & objectives_m;
ar & id_m;
......@@ -157,4 +157,5 @@ private:
constraints_t constraints_m;
};
#endif
\ No newline at end of file
#endif
......@@ -4,7 +4,7 @@
template <class T> struct NaiveOnePointCrossover
{
void crossover(boost::shared_ptr<T> ind1, boost::shared_ptr<T> ind2,
CmdArguments_t args) {
CmdArguments_t /*args*/) {
typedef typename T::genes_t genes_t;
genes_t genes_ind2;
......
......@@ -5,7 +5,7 @@
template <class T> struct NaiveUniformCrossover
{
void crossover(boost::shared_ptr<T> ind1, boost::shared_ptr<T> ind2,
CmdArguments_t args) {
CmdArguments_t /*args*/) {
Individual::genes_t genes_ind2 = ind2->genes_m;
......
......@@ -4,7 +4,7 @@
/// Mutate exactly one gene of an individual.
template <class T> struct OneBitMutation
{
void mutate(boost::shared_ptr<T> ind, CmdArguments_t args) {
void mutate(boost::shared_ptr<T> ind, CmdArguments_t /*args*/) {
int range = ind->genes_m.size();
int position = static_cast<int>((rand() / (RAND_MAX + 1.0)) * range);
......
......@@ -216,7 +216,7 @@ private:
protected:
void parseInputFile(functionDictionary_t known_expr_funcs, bool isOptimizationRun) {
void parseInputFile(functionDictionary_t /*known_expr_funcs*/, bool isOptimizationRun) {
try {
input_file_ = cmd_args_->getArg<std::string>("inputfile", true);
......@@ -679,4 +679,4 @@ protected:
};
#endif
\ No newline at end of file
#endif
......@@ -28,7 +28,7 @@ public:
pipeline_.push_back(component);
}
void unregisterComponent(std::string name) {
void unregisterComponent(std::string /*name*/) {
//TODO: set null @ idx
}
......
......@@ -53,7 +53,7 @@ typedef struct {
bool is_valid;
template<class Archive>
void serialize(Archive & ar, const unsigned int version) {
void serialize(Archive & ar, const unsigned int /*version*/) {
ar & type;
ar & value;
ar & is_valid;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment