assign.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Contributing authors:
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
*
* Copyright:
* Christian Schulte, 2008
* Vincent Barichard, 2012
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __GECODE_TEST_ASSIGN_HH__
#define __GECODE_TEST_ASSIGN_HH__
#include <gecode/kernel.hh>
#include <gecode/int.hh>
#ifdef GECODE_HAS_SET_VARS
#include <gecode/set.hh>
#endif
#ifdef GECODE_HAS_FLOAT_VARS
#include <gecode/float.hh>
#endif
#include "test/test.hh"
namespace Test {
namespace Assign {
class IntTest : public Base {
protected:
int arity;
Gecode::IntSet dom;
public:
IntTest(const std::string& s, int a, const Gecode::IntSet& d);
virtual bool run(void);
virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) = 0;
};
class BoolTest : public Base {
protected:
int arity;
public:
BoolTest(const std::string& s, int a);
virtual bool run(void);
virtual void post(Gecode::Space& home, Gecode::BoolVarArray& x) = 0;
};
#ifdef GECODE_HAS_SET_VARS
class SetTest : public Base {
protected:
int arity;
Gecode::IntSet dom;
public:
SetTest(const std::string& s, int a, const Gecode::IntSet& d);
virtual bool run(void);
virtual void post(Gecode::Space& home, Gecode::SetVarArray& x) = 0;
};
#endif
#ifdef GECODE_HAS_FLOAT_VARS
class FloatTest : public Base {
protected:
int arity;
Gecode::FloatVal dom;
public:
FloatTest(const std::string& s, int a, const Gecode::FloatVal& d);
virtual bool run(void);
virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) = 0;
};
#endif
}
}
#endif
// STATISTICS: test-branch
Gecode::BoolVarArray
Boolean variable array.
Definition int.hh:808
Gecode::FloatVal
Float value type.
Definition float.hh:334
Gecode::FloatVarArray
Float variable array.
Definition float.hh:1030
Gecode::IntSet
Integer sets.
Definition int.hh:174
Gecode::IntVarArray
Integer variable array.
Definition int.hh:763
Gecode::SetVarArray
Set variable array
Definition set.hh:570
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Test::Assign::BoolTest::run
virtual bool run(void)
Perform test.
Test::Assign::BoolTest::BoolTest
BoolTest(const std::string &s, int a)
Construct and register test.
Test::Assign::BoolTest::arity
int arity
Number of variables.
Definition assign.hh:83
Test::Assign::BoolTest::post
virtual void post(Gecode::Space &home, Gecode::BoolVarArray &x)=0
Post assignment on variables x.
Test::Assign::FloatTest::FloatTest
FloatTest(const std::string &s, int a, const Gecode::FloatVal &d)
Construct and register test.
Test::Assign::FloatTest::dom
Gecode::FloatVal dom
Domain of variables.
Definition assign.hh:127
Test::Assign::FloatTest::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)=0
Post assignment on variables x.
Test::Assign::FloatTest::arity
int arity
Number of variables.
Definition assign.hh:125
Test::Assign::FloatTest::run
virtual bool run(void)
Perform test.
Test::Assign::IntTest::run
virtual bool run(void)
Perform test.
Test::Assign::IntTest::IntTest
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Test::Assign::IntTest::dom
Gecode::IntSet dom
Domain of variables.
Definition assign.hh:66
Test::Assign::IntTest::arity
int arity
Number of variables.
Definition assign.hh:64
Test::Assign::IntTest::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post assignment on variables x.
Test::Assign::SetTest::arity
int arity
Number of variables.
Definition assign.hh:102
Test::Assign::SetTest::dom
Gecode::IntSet dom
Upper bound of variable domains.
Definition assign.hh:104
Test::Assign::SetTest::run
virtual bool run(void)
Perform test.
Test::Assign::SetTest::post
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x)=0
Post assignment on variables x.
Test::Assign::SetTest::SetTest
SetTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Test::Base::Base
Base(const std::string &s)
Create and register test with name s.
Definition test.cpp:59
float.hh
int.hh
set.hh
kernel.hh
Test::Assign
Tests for assignments.
Definition assign.cpp:42
Test
General test support.
Definition afc.cpp:39
test.hh