FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.solutionSpaces.AddableBigDecimal Class Reference

An arbitrary-precision real number that implements Addable. More...

Inheritance diagram for frodo2.solutionSpaces.AddableBigDecimal:

Classes

class  MinInfinity
 This class implements the minus infinity element. More...
class  PlusInfinity
 This class implements the plus infinity element. More...
class  AddableBigDecimalDelayed
 Class used to speed up n-ary additions and multiplications. More...

Public Member Functions

 AddableBigDecimal ()
 Empty constructor.
 AddableBigDecimal (double value)
 Constructor.
void writeExternal (ObjectOutput arg0) throws IOException
void readExternal (ObjectInput arg0) throws IOException, ClassNotFoundException
Object readResolve ()
final boolean externalize ()
AddableBigDecimal abs ()
AddableBigDecimal add (AddableBigDecimal o)
AddableDelayed< AddableBigDecimaladdDelayed ()
int compareTo (AddableBigDecimal o)
int compareTo (final AddableBigDecimal o, double error)
 Compares this real number with another one with some error margin.
AddableBigDecimal divide (AddableBigDecimal o)
boolean equals (Object o)
boolean equals (final AddableBigDecimal that, double error)
 Compares two AddableBigDecimals within some error margin.
AddableBigDecimal flipSign ()
AddableBigDecimal fromString (String str)
AddableBigDecimal fromInt (int nbr)
AddableBigDecimal getMinInfinity ()
AddableBigDecimal getPlusInfinity ()
AddableBigDecimal getZero ()
int hashCode ()
int intValue ()
double doubleValue ()
AddableBigDecimal max (AddableBigDecimal o)
AddableBigDecimal min (AddableBigDecimal o)
AddableBigDecimal multiply (AddableBigDecimal o)
AddableBigDecimal subtract (AddableBigDecimal o)
Addable< AddableBigDecimal >[] range (AddableBigDecimal begin, AddableBigDecimal end)
String toString ()
Public Member Functions inherited from frodo2.solutionSpaces.Addable< AddableBigDecimal >
int intValue ()
double doubleValue ()
fromString (String str)
 Parses a string to construct a new instance.
fromInt (int nbr)
 Creates an instance from an int.
add (T o)
 Adds an object to this object.
AddableDelayed< T > addDelayed ()
 Creates an object with the same value as this object, used to delay the resolution of a large number of additions.
subtract (T o)
 Subtracts an object from this object.
multiply (T o)
 Multiplies an object with this object.
boolean equals (Object o)
 The equals function must be implemented so that the hashmap storing the steps for each value can find the proper step for the provided value.
int hashCode ()
 The hashCode function must be implemented so that the hashmap storing the steps for each value can find the proper step for the provided value.
getZero ()
 Returns a neutral object for the addition operation ("zero").
getPlusInfinity ()
 Returns the "+infinity" object.
getMinInfinity ()
 Returns the "-infinity" object.
abs ()
divide (T o)
flipSign ()
 Flip the sign of this number.
Addable< T >[] range (T begin, T end)
 Returns an array containing all the values between begin and end.

Protected Member Functions

 AddableBigDecimal (BigDecimal val)
 Constructor.

Private Attributes

BigDecimal val
 The value of this real number.

Static Private Attributes

static final AddableBigDecimal ZERO = new AddableBigDecimal(BigDecimal.ZERO)
 ZERO.

Detailed Description

An arbitrary-precision real number that implements Addable.

Author
Thomas Leaute, Eric Zbinden

Constructor & Destructor Documentation

◆ AddableBigDecimal() [1/3]

◆ AddableBigDecimal() [2/3]

frodo2.solutionSpaces.AddableBigDecimal.AddableBigDecimal ( double value)

Constructor.

Parameters
valuethe value for the real number

◆ AddableBigDecimal() [3/3]

frodo2.solutionSpaces.AddableBigDecimal.AddableBigDecimal ( BigDecimal val)
protected

Constructor.

Parameters
valThe value in a BigInteger form

References val.

Member Function Documentation

◆ abs()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.abs ( )
See also
Addable.abs()

Reimplemented in frodo2.solutionSpaces.AddableBigDecimal.MinInfinity, and frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.

References AddableBigDecimal().

Here is the call graph for this function:

◆ add()

◆ addDelayed()

◆ compareTo() [1/2]

int frodo2.solutionSpaces.AddableBigDecimal.compareTo ( AddableBigDecimal o)
See also
java.lang.Comparable#compareTo(java.lang.Object)

Reimplemented in frodo2.solutionSpaces.AddableBigDecimal.MinInfinity, and frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.

References AddableBigDecimal(), frodo2.solutionSpaces.AddableBigDecimal.MinInfinity.MIN_INF, frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.PLUS_INF, and val.

Referenced by max(), and min().

Here is the call graph for this function:

◆ compareTo() [2/2]

int frodo2.solutionSpaces.AddableBigDecimal.compareTo ( final AddableBigDecimal o,
double error )

Compares this real number with another one with some error margin.

Parameters
othe other real number
errorthe (non-negative) error margin
Returns
+1 if this number is greater than o, -1 if it is smaller, and 0 if they are equal
See also
java.lang.Comparable#compareTo(java.lang.Object)

Reimplemented in frodo2.solutionSpaces.AddableBigDecimal.MinInfinity, and frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.

References AddableBigDecimal(), frodo2.solutionSpaces.AddableBigDecimal.MinInfinity.MIN_INF, frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.PLUS_INF, and val.

Here is the call graph for this function:

◆ divide()

◆ doubleValue()

double frodo2.solutionSpaces.AddableBigDecimal.doubleValue ( )

◆ equals() [1/2]

boolean frodo2.solutionSpaces.AddableBigDecimal.equals ( final AddableBigDecimal that,
double error )

Compares two AddableBigDecimals within some error margin.

Parameters
thatthe other AddableBigDecimal
errorthe (non-negative) error margin
Returns
whether the two AddableBigDecimals are equal within the given error margin

Reimplemented in frodo2.solutionSpaces.AddableBigDecimal.MinInfinity, and frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.

References AddableBigDecimal(), frodo2.solutionSpaces.AddableBigDecimal.MinInfinity.MIN_INF, frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.PLUS_INF, and val.

Here is the call graph for this function:

◆ equals() [2/2]

◆ externalize()

final boolean frodo2.solutionSpaces.AddableBigDecimal.externalize ( )

◆ flipSign()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.flipSign ( )

◆ fromInt()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.fromInt ( int nbr)
See also
Addable.fromInt(int)

References AddableBigDecimal().

Here is the call graph for this function:

◆ fromString()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.fromString ( String str)

◆ getMinInfinity()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.getMinInfinity ( )
See also
Addable.getMinInfinity()

References AddableBigDecimal(), and frodo2.solutionSpaces.AddableBigDecimal.MinInfinity.MIN_INF.

Here is the call graph for this function:

◆ getPlusInfinity()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.getPlusInfinity ( )
See also
Addable.getPlusInfinity()

References AddableBigDecimal(), and frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.PLUS_INF.

Here is the call graph for this function:

◆ getZero()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.getZero ( )
See also
Addable.getZero()

References AddableBigDecimal(), and ZERO.

Here is the call graph for this function:

◆ hashCode()

int frodo2.solutionSpaces.AddableBigDecimal.hashCode ( )

◆ intValue()

int frodo2.solutionSpaces.AddableBigDecimal.intValue ( )

◆ max()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.max ( AddableBigDecimal o)
See also
AddableLimited#max(AddableLimited)

References AddableBigDecimal(), and compareTo().

Here is the call graph for this function:

◆ min()

AddableBigDecimal frodo2.solutionSpaces.AddableBigDecimal.min ( AddableBigDecimal o)
See also
AddableLimited#min(AddableLimited)

References AddableBigDecimal(), and compareTo().

Here is the call graph for this function:

◆ multiply()

◆ range()

Addable< AddableBigDecimal >[] frodo2.solutionSpaces.AddableBigDecimal.range ( AddableBigDecimal begin,
AddableBigDecimal end )
See also
Addable#range(Addable, Addable)

References AddableBigDecimal().

Here is the call graph for this function:

◆ readExternal()

void frodo2.solutionSpaces.AddableBigDecimal.readExternal ( ObjectInput arg0) throws IOException, ClassNotFoundException
See also
java.io.Externalizable#readExternal(java.io.ObjectInput)

Reimplemented in frodo2.solutionSpaces.AddableBigDecimal.MinInfinity, and frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.

◆ readResolve()

Object frodo2.solutionSpaces.AddableBigDecimal.readResolve ( )

◆ subtract()

◆ toString()

String frodo2.solutionSpaces.AddableBigDecimal.toString ( )

◆ writeExternal()

void frodo2.solutionSpaces.AddableBigDecimal.writeExternal ( ObjectOutput arg0) throws IOException
See also
java.io.Externalizable#writeExternal(java.io.ObjectOutput)

Reimplemented in frodo2.solutionSpaces.AddableBigDecimal.MinInfinity, and frodo2.solutionSpaces.AddableBigDecimal.PlusInfinity.

Member Data Documentation

◆ val

◆ ZERO


The documentation for this class was generated from the following file: