Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
7.6 kB · 219 lines
C++
at develop
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220/* -*- 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::Float::Trigonometric * \brief %Trigonometric propagators */namespace Gecode { namespace Float { namespace Trigonometric {
/** * \brief %Propagator for bounds consistent sinus operator * * The types \a A and \a B give the types of the views. * * Requires \code #include <gecode/float/trigonometric.hh> \endcode * \ingroup FuncFloatProp */ 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; /// Perform actual propagation static ExecStatus dopropagate(Space& home, A x0, B x1); /// Constructor for cloning \a p Sin(Space& home, Sin& p); /// Constructor for creation Sin(Home home, A x0, B x1); public: /// Create copy during cloning virtual Actor* copy(Space& home); /// Perform propagation virtual ExecStatus propagate(Space& home, const ModEventDelta& med); /// Post propagator for \f$sin(x_0) = x_1\f$ static ExecStatus post(Home home, A x0, B x1); };
/** * \brief %Propagator for bounds consistent cosinus operator * * The types \a A and \a B give the types of the views. * * Requires \code #include <gecode/float/trigonometric.hh> \endcode * \ingroup FuncFloatProp */ 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; /// Perform actual propagation static ExecStatus dopropagate(Space& home, A x0, B x1); /// Constructor for cloning \a p Cos(Space& home, Cos& p); /// Constructor for creation Cos(Home home, A x0, B x1); public: /// Create copy during cloning virtual Actor* copy(Space& home); /// Perform propagation virtual ExecStatus propagate(Space& home, const ModEventDelta& med); /// Post propagator for \f$cos(x_0) = x_1\f$ static ExecStatus post(Home home, A x0, B x1); };
/** * \brief %Propagator for bounds consistent arc sinus operator * * The types \a A and \a B give the types of the views. * * Requires \code #include <gecode/float/trigonometric.hh> \endcode * \ingroup FuncFloatProp */ 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;
/// Constructor for cloning \a p ASin(Space& home, ASin& p); /// Constructor for creation ASin(Home home, A x0, B x1); public: /// Create copy during cloning virtual Actor* copy(Space& home); /// Perform propagation virtual ExecStatus propagate(Space& home, const ModEventDelta& med); /// Post propagator for \f$asin(x_0) = x_1\f$ static ExecStatus post(Home home, A x0, B x1); };
/** * \brief %Propagator for bounds consistent arc cosinus operator * * The types \a A and \a B give the types of the views. * * Requires \code #include <gecode/float/trigonometric.hh> \endcode * \ingroup FuncFloatProp */ 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;
/// Constructor for cloning \a p ACos(Space& home, ACos& p); /// Constructor for creation ACos(Home home, A x0, B x1); public: /// Create copy during cloning virtual Actor* copy(Space& home); /// Perform propagation virtual ExecStatus propagate(Space& home, const ModEventDelta& med); /// Post propagator for \f$acos(x_0) = x_1\f$ static ExecStatus post(Home home, A x0, B x1); };
/** * \brief %Propagator for bounds consistent tangent operator * * The types \a A and \a B give the types of the views. * * Requires \code #include <gecode/float/trigonometric.hh> \endcode * \ingroup FuncFloatProp */ 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; /// Perform actual propagation static ExecStatus dopropagate(Space& home, A x0, B x1); /// Constructor for cloning \a p Tan(Space& home, Tan& p); /// Constructor for creation Tan(Home home, A x0, B x1); public: /// Create copy during cloning virtual Actor* copy(Space& home); /// Perform propagation virtual ExecStatus propagate(Space& home, const ModEventDelta& med); /// Post propagator for \f$tan(x_0) = x_1\f$ static ExecStatus post(Home home, A x0, B x1); };
/** * \brief %Propagator for bounds consistent arc tangent operator * * The types \a A and \a B give the types of the views. * * Requires \code #include <gecode/float/trigonometric.hh> \endcode * \ingroup FuncFloatProp */ 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;
/// Constructor for cloning \a p ATan(Space& home, ATan& p); /// Constructor for creation ATan(Home home, A x0, B x1); public: /// Create copy during cloning virtual Actor* copy(Space& home); /// Perform propagation virtual ExecStatus propagate(Space& home, const ModEventDelta& med); /// Post propagator for \f$atan(x_0) = x_1\f$ 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