PPL Java Language Interface  1.2
Grid_Generator.java
Go to the documentation of this file.
1 /* Grid Generator Java class declaration and implementation.
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 package parma_polyhedra_library;
25 
26 import javax.management.RuntimeErrorException;
27 
29 
35 public class Grid_Generator {
36 
39 
42 
47  private Coefficient div;
48 
50  Grid_Generator_Type generator_type) {
51  le = e.clone();
52  div = new Coefficient(d);
53  gt = generator_type;
54  }
55 
57 
63  return new Grid_Generator(e, new Coefficient(0),
65  }
66 
68 
73  Coefficient d) {
75  }
76 
78 
83  Coefficient d) {
84  return new Grid_Generator(e, d, Grid_Generator_Type.POINT);
85  }
86 
89  return gt;
90  }
91 
94  return le;
95  }
96 
98 
102  public Coefficient divisor() {
103  if (this.gt != Grid_Generator_Type.LINE)
104  return div;
105  Error cause = new Error("parma_polyhedra_library."
106  + "Grid_Generator::divisor:\n"
107  + "this is neither a grid point"
108  + " nor a parameter.");
109  throw new RuntimeErrorException(cause);
110  }
111 
113  public native String ascii_dump();
114 
116  public native String toString();
117 
118  private static native void initIDs();
119  static {
120  initIDs();
121  }
122 }
123 
Coefficient divisor()
If this is either a grid point or a parameter, returns its divisor.
Grid_Generator_Type type()
Returns the generator type.
abstract Linear_Expression clone()
Returns a copy of the linear expression.
Grid_Generator(Linear_Expression e, Coefficient d, Grid_Generator_Type generator_type)
Linear_Expression linear_expression()
Returns the linear expression in this.
Coefficient div
The coefficient used if the grid generator is a parameter or a grid point a parameter.
static Grid_Generator parameter(Linear_Expression e, Coefficient d)
Returns the parameter at e / d.
Linear_Expression le
The linear expression.
A grid line, parameter or grid point.
Grid_Generator_Type gt
The grid generator type.
PPL_COEFFICIENT_TYPE Coefficient
static Grid_Generator grid_point(Linear_Expression e, Coefficient d)
Returns the point at e / d.
native String ascii_dump()
Returns an ascii formatted internal representation of this.
native String toString()
Returns a string representation of this.
static Grid_Generator grid_line(Linear_Expression e)
Returns the line of direction e.