00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 package parma_polyhedra_library;
00025
00026 import java.io.Writer;
00027 import java.io.IOException;
00028 import javax.management.RuntimeErrorException;
00029
00031
00037 public class Grid_Generator {
00038
00040 private Grid_Generator_Type gt;
00041
00043 private Linear_Expression le;
00044
00049 private Coefficient div;
00050
00051 private Grid_Generator(Linear_Expression e, Coefficient d,
00052 Grid_Generator_Type generator_type) {
00053 le = e.clone();
00054 div = new Coefficient(d);
00055 gt = generator_type;
00056 }
00057
00059
00064 public static Grid_Generator grid_line(Linear_Expression e) {
00065 return new Grid_Generator(e, new Coefficient(0),
00066 Grid_Generator_Type.LINE);
00067 }
00068
00070
00074 public static Grid_Generator parameter(Linear_Expression e,
00075 Coefficient d) {
00076 return new Grid_Generator(e, d, Grid_Generator_Type.PARAMETER);
00077 }
00078
00080
00084 public static Grid_Generator grid_point(Linear_Expression e,
00085 Coefficient d) {
00086 return new Grid_Generator(e, d, Grid_Generator_Type.POINT);
00087 }
00088
00090 public Grid_Generator_Type type() {
00091 return gt;
00092 }
00093
00095 public Linear_Expression linear_expression() {
00096 return le;
00097 }
00098
00100
00104 public Coefficient divisor() {
00105 if (this.gt != Grid_Generator_Type.LINE)
00106 return div;
00107 Error cause = new Error("parma_polyhedra_library."
00108 + "Grid_Generator::divisor:\n"
00109 + "this is neither a grid point"
00110 + " nor a parameter.");
00111 throw new RuntimeErrorException(cause);
00112 }
00113
00115 public native String ascii_dump();
00116
00118 public native String toString();
00119
00120 private static native void initIDs();
00121 static {
00122 initIDs();
00123 }
00124 }
00125