trigonometric.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
*
* Copyright:
* 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_FLOAT_TRIGONOMETRIC_HH__
#define __GECODE_FLOAT_TRIGONOMETRIC_HH__
#include <gecode/float.hh>
namespace Gecode { namespace Float { namespace Trigonometric {
template<class A, class B>
class Sin : public MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND> {
protected:
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0;
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1;
static ExecStatus dopropagate(Space& home, A x0, B x1);
Sin(Space& home, Sin& p);
Sin(Home home, A x0, B x1);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1);
};
template<class A, class B>
class Cos : public MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND> {
protected:
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0;
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1;
static ExecStatus dopropagate(Space& home, A x0, B x1);
Cos(Space& home, Cos& p);
Cos(Home home, A x0, B x1);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1);
};
template<class A, class B>
class ASin : public MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND> {
protected:
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0;
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1;
ASin(Space& home, ASin& p);
ASin(Home home, A x0, B x1);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1);
};
template<class A, class B>
class ACos : public MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND> {
protected:
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0;
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1;
ACos(Space& home, ACos& p);
ACos(Home home, A x0, B x1);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1);
};
template<class A, class B>
class Tan : public MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND> {
protected:
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0;
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1;
static ExecStatus dopropagate(Space& home, A x0, B x1);
Tan(Space& home, Tan& p);
Tan(Home home, A x0, B x1);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1);
};
template<class A, class B>
class ATan : public MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND> {
protected:
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0;
using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1;
ATan(Space& home, ATan& p);
ATan(Home home, A x0, B x1);
public:
virtual Actor* copy(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, A x0, B x1);
};
}}}
#include <gecode/float/trigonometric/sincos.hpp>
#include <gecode/float/trigonometric/asinacos.hpp>
#include <gecode/float/trigonometric/tanatan.hpp>
#endif
// STATISTICS: float-prop
asinacos.hpp
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::Float::Trigonometric::ACos::ACos
ACos(Space &home, ACos &p)
Constructor for cloning p.
Definition asinacos.hpp:117
Gecode::Float::Trigonometric::ACos::post
static ExecStatus post(Home home, A x0, B x1)
Post propagator for .
Definition asinacos.hpp:95
Gecode::Float::Trigonometric::ACos::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition asinacos.hpp:122
Gecode::Float::Trigonometric::ACos::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition asinacos.hpp:128
Gecode::Float::Trigonometric::ASin::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition asinacos.hpp:69
Gecode::Float::Trigonometric::ASin::post
static ExecStatus post(Home home, A x0, B x1)
Post propagator for .
Definition asinacos.hpp:48
Gecode::Float::Trigonometric::ASin::ASin
ASin(Space &home, ASin &p)
Constructor for cloning p.
Definition asinacos.hpp:64
Gecode::Float::Trigonometric::ASin::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition asinacos.hpp:75
Gecode::Float::Trigonometric::ATan::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition tanatan.hpp:212
Gecode::Float::Trigonometric::ATan::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition tanatan.hpp:218
Gecode::Float::Trigonometric::ATan::post
static ExecStatus post(Home home, A x0, B x1)
Post propagator for .
Definition tanatan.hpp:193
Gecode::Float::Trigonometric::ATan::ATan
ATan(Space &home, ATan &p)
Constructor for cloning p.
Definition tanatan.hpp:207
Gecode::Float::Trigonometric::Cos::dopropagate
static ExecStatus dopropagate(Space &home, A x0, B x1)
Perform actual propagation.
Definition sincos.hpp:184
Gecode::Float::Trigonometric::Cos::post
static ExecStatus post(Home home, A x0, B x1)
Post propagator for .
Definition sincos.hpp:210
Gecode::Float::Trigonometric::Cos::Cos
Cos(Space &home, Cos &p)
Constructor for cloning p.
Definition sincos.hpp:231
Gecode::Float::Trigonometric::Cos::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition sincos.hpp:236
Gecode::Float::Trigonometric::Cos::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition sincos.hpp:242
Gecode::Float::Trigonometric::Sin::dopropagate
static ExecStatus dopropagate(Space &home, A x0, B x1)
Perform actual propagation.
Definition sincos.hpp:120
Gecode::Float::Trigonometric::Sin::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition sincos.hpp:172
Gecode::Float::Trigonometric::Sin::post
static ExecStatus post(Home home, A x0, B x1)
Post propagator for .
Definition sincos.hpp:145
Gecode::Float::Trigonometric::Sin::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition sincos.hpp:166
Gecode::Float::Trigonometric::Sin::Sin
Sin(Space &home, Sin &p)
Constructor for cloning p.
Definition sincos.hpp:161
Gecode::Float::Trigonometric::Tan::post
static ExecStatus post(Home home, A x0, B x1)
Post propagator for .
Definition tanatan.hpp:151
Gecode::Float::Trigonometric::Tan::dopropagate
static ExecStatus dopropagate(Space &home, A x0, B x1)
Perform actual propagation.
Definition tanatan.hpp:93
Gecode::Float::Trigonometric::Tan::copy
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition tanatan.hpp:170
Gecode::Float::Trigonometric::Tan::Tan
Tan(Space &home, Tan &p)
Constructor for cloning p.
Definition tanatan.hpp:165
Gecode::Float::Trigonometric::Tan::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition tanatan.hpp:176
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::MixBinaryPropagator< A, PC_FLOAT_BND, B, PC_FLOAT_BND >::x1
B x1
Definition pattern.hpp:209
Gecode::MixBinaryPropagator< A, PC_FLOAT_BND, B, PC_FLOAT_BND >::MixBinaryPropagator
MixBinaryPropagator(Space &home, MixBinaryPropagator &p)
Definition pattern.hpp:597
Gecode::MixBinaryPropagator< A, PC_FLOAT_BND, B, PC_FLOAT_BND >::x0
A x0
Definition pattern.hpp:207
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation).
Definition core.hpp:1075
float.hh
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode::Float::Trigonometric
Trigonometric propagators
Gecode::Float
Floating point numbers.
Gecode::Float::PC_FLOAT_BND
const Gecode::PropCond PC_FLOAT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:292
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
sincos.hpp
tanatan.hpp