this repo has no description
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Vincent Barichard <Vincent.Barichard@univ-angers.fr>
5 *
6 * Copyright:
7 * Vincent Barichard, 2012
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.org
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining
14 * a copy of this software and associated documentation files (the
15 * "Software"), to deal in the Software without restriction, including
16 * without limitation the rights to use, copy, modify, merge, publish,
17 * distribute, sublicense, and/or sell copies of the Software, and to
18 * permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be
22 * included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 *
32 */
33
34#ifndef GECODE_FLOAT_TRANSCENDENTAL_HH
35#define GECODE_FLOAT_TRANSCENDENTAL_HH
36
37#include <gecode/float.hh>
38
39/**
40 * \namespace Gecode::Float::Transcendental
41 * \brief %Transcendental propagators
42 */
43
44namespace Gecode { namespace Float { namespace Transcendental {
45
46 /**
47 * \brief %Propagator for bounds consistent exp operator
48 *
49 * The types \a A and \a B give the types of the views.
50 *
51 * Requires \code #include <gecode/float/transcendental.hh> \endcode
52 * \ingroup FuncFloatProp
53 */
54 template<class A, class B>
55 class Exp : public MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND> {
56 protected:
57 using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0;
58 using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1;
59
60 /// Constructor for cloning \a p
61 Exp(Space& home, Exp& p);
62 /// Constructor for creation
63 Exp(Home home, A x0, B x1);
64 public:
65 /// Create copy during cloning
66 virtual Actor* copy(Space& home);
67 /// Perform propagation
68 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
69 /// Post propagator for \f$e^{x_0} = x_1\f$
70 static ExecStatus post(Home home, A x0, B x1);
71 };
72
73
74 /**
75 * \brief %Propagator for bounds consistent pow operator
76 *
77 * The types \a A and \a B give the types of the views.
78 *
79 * Requires \code #include <gecode/float/transcendental.hh> \endcode
80 * \ingroup FuncFloatProp
81 */
82 template<class A, class B>
83 class Pow : public MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND> {
84 protected:
85 using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0;
86 using MixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1;
87 FloatNum base;
88
89 /// Constructor for cloning \a p
90 Pow(Space& home, Pow& p);
91 /// Constructor for creation
92 Pow(Home home, FloatNum base, A x0, B x1);
93 public:
94 /// Create copy during cloning
95 virtual Actor* copy(Space& home);
96 /// Perform propagation
97 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
98 /// Post propagator for \f$\mathit{base}^{x_0} = x_1\f$
99 static ExecStatus post(Home home, FloatNum base, A x0, B x1);
100 };
101
102}}}
103
104#include <gecode/float/transcendental/exp-log.hpp>
105
106#endif
107
108// STATISTICS: float-prop