FRAMES NO FRAMES

Class IlcConstFloatArray

Definition file: ilsolver/fltexp.h
Include file: <ilsolver/ilosolver.h>

IlcConstFloatArray is the unchanging, constant array class for the basic floating-point class. You cannot modify the values of elements of such an array. When you build an instance of this class, its constructor systematically copies the array passed to it. This is a handle class. The implementation class for IlcConstFloatArray is the undocumented class IlcConstFloatArrayI. Instances of this class are useful, for example, in the function IlcTableConstraint when you want to share an array rather than copy it.

See Also:

Constructor Summary
public IlcConstFloatArray()
public IlcConstFloatArray(IlcConstFloatArrayI * impl)
public IlcConstFloatArray(IloSolver s, IlcInt size, IlcFloat * values)
public IlcConstFloatArray(IloSolver s, IlcFloatArray array)
public IlcConstFloatArray(IloSolver solver, IlcInt size, IlcFloat exp0, IlcFloat exp...)
public IlcConstFloatArray(IloSolver solver, IlcInt size, IlcInt exp0, IlcInt exp...)
Method Summary
public voiddisplay(ostream & strm) const
public IlcConstFloatArrayI *getImpl() const
public IlcIntgetSize() const
public IloSolvergetSolver() const
public voidoperator=(const IlcConstFloatArray & h)
public IlcFloatoperator[](IlcInt i) const
Constructor Detail

IlcConstFloatArray

public IlcConstFloatArray()

This constructor creates an empty handle. You must initialize it before you use it.


IlcConstFloatArray

public IlcConstFloatArray(IlcConstFloatArrayI * impl)

This constructor creates a handle object from a pointer to an implementation object.


IlcConstFloatArray

public IlcConstFloatArray(IloSolver s, IlcInt size, IlcFloat * values)

This constructor creates a constant array containing the values in the array values. The argument size must be the length of the array values; it must also be strictly greater than 0 (zero). Solver does not keep a pointer to the array values.


IlcConstFloatArray

public IlcConstFloatArray(IloSolver s, IlcFloatArray array)

This constructor creates a constant array where the values of the elements cannot be changed from the elements of array.


IlcConstFloatArray

public IlcConstFloatArray(IloSolver solver, IlcInt size, IlcFloat exp0, IlcFloat exp...)

This constructor accepts a variable number of arguments. Its first argument, size, indicates the length of the array that this constructor will create; size must be the same as the number of instances of IlcFloat passed as arguments; it must also be strictly greater than 0 (zero). The constructor creates a constant array of the values indicated by the other arguments.


IlcConstFloatArray

public IlcConstFloatArray(IloSolver solver, IlcInt size, IlcInt exp0, IlcInt exp...)

This constructor accepts a variable number of arguments. Its first argument, size, indicates the length of the array that this constructor will create; size must be the same as the number of instances of IlcInt passed as arguments; it must also be strictly greater than 0 (zero). The constructor creates a constant array of the values indicated by the other arguments. The other arguments must all be of the same type. Do not mix the type of elements in a given array.


Method Detail

display

public void display(ostream & strm) const

This member function is called by the operator <<. The string IlcConstFloatArrayI will be printed on the given output stream, followed by the display of all the elements of the array enclosed by brackets.


getImpl

public IlcConstFloatArrayI * getImpl() const
This constructor creates an object by copying another one.

This member function returns a pointer to the implementation object of the invoking handle.


getSize

public IlcInt getSize() const

This member function returns the number of elements in the array.


getSolver

public IloSolver getSolver() const

This member function returns an instance of IloSolver associated with the invoking object.


operator=

public void operator=(const IlcConstFloatArray & h)

This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the provided argument.


operator[]

public IlcFloat operator[](IlcInt i) const

This operator returns the element at index i. This operator can be used for accessing (that is, simply reading) the element.