PPL Java Language Interface  1.2
Coefficient.java
Go to the documentation of this file.
1 /* Coefficient 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 java.math.BigInteger;
27 
29 
34 public class Coefficient {
35 
37  private BigInteger value;
38 
40  public Coefficient(int i) {
41  value = BigInteger.valueOf(i);
42  }
43 
45  public Coefficient(long l) {
46  value = BigInteger.valueOf(l);
47  }
48 
50  public Coefficient(BigInteger bi) {
51  value = bi;
52  }
53 
55 
59  public Coefficient(String s) {
60  value = new BigInteger(s);
61  }
62 
65  value = c.value;
66  }
67 
69  public String toString() {
70  return value.toString();
71  }
72 
74  public BigInteger getBigInteger() {
75  return value;
76  }
77 
79  public static native int bits();
80 
81  private static native void initIDs();
82  static {
83  initIDs();
84  }
85 }
Coefficient(String s)
Builds a coefficient from the decimal representation in s.
static native int bits()
Returns the number of bits of PPL coefficients; 0 if unbounded.
Coefficient(BigInteger bi)
Builds a coefficient valued bi.
BigInteger value
Holds the value of this.
String toString()
Returns a String representation of this.
BigInteger getBigInteger()
Returns the value held by this.
Coefficient(long l)
Builds a coefficient valued l.
Coefficient(Coefficient c)
Builds a copy of c.
Coefficient(int i)
Builds a coefficient valued i.