org.akutan.optimization
Class IPConsVector

java.lang.Object
  extended by org.akutan.optimization.IPConsVector
All Implemented Interfaces:
java.lang.Cloneable

public class IPConsVector
extends java.lang.Object
implements java.lang.Cloneable

This class encapsulates the assignment and structure of the various subcomponents of the interior point method solution. The Vector is broken out into w slack vector for inquality constraints x solution vector y lagrange multipliers for all constraints z dual variables for solution vector


Field Summary
protected  int _c1
           
protected  int _c2
           
protected  int _c3
           
protected  int _c4
           
protected  int _c5
           
protected  int _oc1
           
protected  int _oc2
           
protected  int _oc3
           
protected  int _oc4
           
protected  int _oc5
           
 
Constructor Summary
IPConsVector(int uw, int vw, int xw, int zw)
          Constructs
 
Method Summary
 void add(cern.colt.matrix.DoubleMatrix1D x)
          Called to add a vector to this
 java.lang.Object clone()
          Clones the object making a deep copy of the underlying vector
 cern.colt.matrix.DoubleMatrix1D get()
          Called to get access to the contents expressed as a 1D vector
 cern.colt.matrix.DoubleMatrix1D getW()
          Called to return the W vector
 cern.colt.matrix.DoubleMatrix1D getX()
          Called to get access to the x vector
 cern.colt.matrix.DoubleMatrix1D getY0()
          Called to return the y0 vector
 cern.colt.matrix.DoubleMatrix1D getY1()
          Called to return the y1 vector
 cern.colt.matrix.DoubleMatrix1D getZ()
          Called to return the Z vector
 IPConsVector negate()
          Called to negate an IPVector, copies the vector, negates the copy and then returns the negated copy.
 int rows()
          Returns the size of the wrapper DoubleMatrix1D
 void setW(double cons)
          Called to set the w vector to a constant
 void setW(cern.colt.matrix.DoubleMatrix1D w)
          Called to set the w vector
 void setX(double cons)
          Called to set all x values equal to cons
 void setX(cern.colt.matrix.DoubleMatrix1D x)
          Called to set all x values equal to the vector cons
 void setY0(double cons)
          Called to set all y0 values equal to cons
 void setY0(cern.colt.matrix.DoubleMatrix1D y0)
          Called to set all y0 values from a vector
 void setY1(double cons)
          Called to set all y1 values equal to cons
 void setY1(cern.colt.matrix.DoubleMatrix1D y1)
          Called to set all uy1 values from a vector
 void setZ(double cons)
          Called to set the z vector (dual variables)
 void setZ(cern.colt.matrix.DoubleMatrix1D z)
          Called to set the z vector (dual variables)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_c1

protected int _c1

_c2

protected int _c2

_c3

protected int _c3

_c4

protected int _c4

_c5

protected int _c5

_oc1

protected final int _oc1
See Also:
Constant Field Values

_oc2

protected int _oc2

_oc3

protected int _oc3

_oc4

protected int _oc4

_oc5

protected int _oc5
Constructor Detail

IPConsVector

public IPConsVector(int uw,
                    int vw,
                    int xw,
                    int zw)
Constructs

Parameters:
uw - Number of equality constraints
vw - Number of inequality constraints
xw - Number of variables (1 per asset class)
zw - Number of dual variables for x (same order as x)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the object making a deep copy of the underlying vector

Overrides:
clone in class java.lang.Object
Returns:
New object which is a copy of the current object
Throws:
java.lang.CloneNotSupportedException

setX

public void setX(double cons)
Called to set all x values equal to cons

Parameters:
cons - Constant to use for all values in the X vector

setX

public void setX(cern.colt.matrix.DoubleMatrix1D x)
Called to set all x values equal to the vector cons

Parameters:
x - Vector to set into the x vector

getX

public cern.colt.matrix.DoubleMatrix1D getX()
Called to get access to the x vector

Returns:
The X vector portion of the solution vector.

setY0

public void setY0(double cons)
Called to set all y0 values equal to cons

Parameters:
cons - The constant to set in all Y0 values

setY0

public void setY0(cern.colt.matrix.DoubleMatrix1D y0)
Called to set all y0 values from a vector

Parameters:
y0 - The vector to set y0 from

getY0

public cern.colt.matrix.DoubleMatrix1D getY0()
Called to return the y0 vector

Returns:
The Y0 portion of the solution vector

setY1

public void setY1(double cons)
Called to set all y1 values equal to cons

Parameters:
cons - The constant value to place in all y1 values

setY1

public void setY1(cern.colt.matrix.DoubleMatrix1D y1)
Called to set all uy1 values from a vector

Parameters:
y1 - The vector to use for setting y1

getY1

public cern.colt.matrix.DoubleMatrix1D getY1()
Called to return the y1 vector

Returns:
The Y1 vector portion of the solution vector

setW

public void setW(double cons)
Called to set the w vector to a constant

Parameters:
cons - constant to set w equal to

setW

public void setW(cern.colt.matrix.DoubleMatrix1D w)
Called to set the w vector

Parameters:
w - Vector of slack variables for inequality constraints

getW

public cern.colt.matrix.DoubleMatrix1D getW()
Called to return the W vector

Returns:
The W portion of the solution vector

setZ

public void setZ(double cons)
Called to set the z vector (dual variables)

Parameters:
cons - The constant value to use for all z values

setZ

public void setZ(cern.colt.matrix.DoubleMatrix1D z)
Called to set the z vector (dual variables)

Parameters:
z - The vector to use in setting z

getZ

public cern.colt.matrix.DoubleMatrix1D getZ()
Called to return the Z vector

Returns:
Returns the Z portion of the solution vector

get

public cern.colt.matrix.DoubleMatrix1D get()
Called to get access to the contents expressed as a 1D vector

Returns:
The underlying vector

negate

public IPConsVector negate()
Called to negate an IPVector, copies the vector, negates the copy and then returns the negated copy.

Returns:
Negated copy of the vector

rows

public int rows()
Returns the size of the wrapper DoubleMatrix1D

Returns:
The number of rows in the solution vector

add

public void add(cern.colt.matrix.DoubleMatrix1D x)
Called to add a vector to this

Parameters:
x - The addend for the x solution vector

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
The underlying vector formatted into a String
See Also:
Object.toString()