PPL  1.2
Scalar_Products_defs.hh
Go to the documentation of this file.
1 /* Scalar_Products class definition.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_Scalar_Products_defs_hh
25 #define PPL_Scalar_Products_defs_hh 1
26 
27 #include "Scalar_Products_types.hh"
28 #include "Coefficient_types.hh"
30 #include "Constraint_types.hh"
31 #include "Generator_types.hh"
32 #include "Congruence_types.hh"
33 #include "Grid_Generator_types.hh"
34 
35 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
36 
43 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
45 public:
47  static void assign(Coefficient& z,
48  const Linear_Expression& x, const Linear_Expression& y);
49 
51  static void assign(Coefficient& z, const Constraint& c, const Generator& g);
52 
54  static void assign(Coefficient& z, const Generator& g, const Constraint& c);
55 
57  static void assign(Coefficient& z,
58  const Constraint& c, const Grid_Generator& gg);
59 
61  static void assign(Coefficient& z,
62  const Grid_Generator& gg, const Congruence& cg);
63 
65  static void assign(Coefficient& z,
66  const Congruence& cg, const Grid_Generator& gg);
67 
69  static int sign(const Linear_Expression& x, const Linear_Expression& y);
70 
72  static int sign(const Constraint& c, const Generator& g);
73 
75  static int sign(const Generator& g, const Constraint& c);
76 
78  static int sign(const Constraint& c, const Grid_Generator& g);
79 
85  static void reduced_assign(Coefficient& z,
86  const Linear_Expression& x,
87  const Linear_Expression& y);
88 
94  static void reduced_assign(Coefficient& z,
95  const Constraint& c, const Generator& g);
96 
102  static void reduced_assign(Coefficient& z,
103  const Generator& g, const Constraint& c);
104 
109  static void reduced_assign(Coefficient& z,
110  const Grid_Generator& gg, const Congruence& cg);
111 
116  static int reduced_sign(const Linear_Expression& x,
117  const Linear_Expression& y);
118 
123  static int reduced_sign(const Constraint& c, const Generator& g);
124 
129  static int reduced_sign(const Generator& g, const Constraint& c);
130 
136  static void homogeneous_assign(Coefficient& z,
137  const Linear_Expression& x,
138  const Linear_Expression& y);
144  static void homogeneous_assign(Coefficient& z,
145  const Linear_Expression& e,
146  const Generator& g);
147 
152  static void homogeneous_assign(Coefficient& z,
153  const Grid_Generator& gg,
154  const Constraint& c);
155 
160  static void homogeneous_assign(Coefficient& z,
161  const Grid_Generator& gg,
162  const Congruence& cg);
163 
168  static void homogeneous_assign(Coefficient& z,
169  const Linear_Expression& e,
170  const Grid_Generator& g);
171 
176  static int homogeneous_sign(const Linear_Expression& x,
177  const Linear_Expression& y);
178 
183  static int homogeneous_sign(const Linear_Expression& e, const Generator& g);
184 
188  static int homogeneous_sign(const Linear_Expression& e,
189  const Grid_Generator& g);
190 
194  static int homogeneous_sign(const Grid_Generator& g, const Constraint& c);
195 };
196 
197 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
198 
200 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
202 public:
205 
208 
210  int operator()(const Constraint&, const Generator&) const;
211 
213  int operator()(const Generator&, const Constraint&) const;
214 
215 private:
217  typedef int (* const SPS_type)(const Linear_Expression&,
218  const Linear_Expression&);
219 
222 };
223 
224 // NOTE: Scalar_Products_inlines.hh is NOT included here, to avoid cyclic
225 // include dependencies.
226 
227 #endif // !defined(PPL_Scalar_Products_defs_hh)
static int homogeneous_sign(const Linear_Expression &x, const Linear_Expression &y)
Returns the sign of the homogeneous scalar product of x and y, where the inhomogeneous terms are igno...
Scalar product sign function object depending on topology.
A linear equality or inequality.
int(*const SPS_type)(const Linear_Expression &, const Linear_Expression &)
The type of the scalar product sign function pointer.
int operator()(const Constraint &, const Generator &) const
Computes the (topology adjusted) scalar product sign of c and g.
A line, ray, point or closure point.
static void reduced_assign(Coefficient &z, const Linear_Expression &x, const Linear_Expression &y)
Computes the reduced scalar product of x and y, where the coefficient of x is ignored, and assigns the result to z.
Topology_Adjusted_Scalar_Product_Sign(const Constraint &c)
Constructs the function object according to the topology of c.
static int reduced_sign(const Linear_Expression &x, const Linear_Expression &y)
Returns the sign of the reduced scalar product of x and y, where the coefficient of x is ignored...
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir unsigned int
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
static void homogeneous_assign(Coefficient &z, const Linear_Expression &x, const Linear_Expression &y)
Computes the homogeneous scalar product of x and y, where the inhomogeneous terms are ignored...
static int sign(const Linear_Expression &x, const Linear_Expression &y)
Returns the sign of the scalar product between x and y.
static void assign(Coefficient &z, const Linear_Expression &x, const Linear_Expression &y)
Computes the scalar product of x and y and assigns it to z.
Coefficient c
Definition: PIP_Tree.cc:64
SPS_type sps_fp
The scalar product sign function pointer.
A grid line, parameter or grid point.
A class implementing various scalar product functions.