org.akutan.optimization.entropy
Class EVector

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

public class EVector
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 x solution vector y lagrange multipliers for all constraints w slack vector for inquality constraints z dual variables for solution vector


Field Summary
protected  int _w1offset
           
protected  int _w1width
           
protected  int _w2offset
           
protected  int _w2width
           
protected  int _xoffset
           
protected  int _xwidth
           
protected  int _y0offset
           
protected  int _y0width
           
protected  int _y1offset
           
protected  int _y1width
           
protected  int _y2offset
           
protected  int _y2width
           
protected  int _zoffset
           
protected  int _zwidth
           
 
Constructor Summary
EVector(int uw, int vw, int xw)
          Constructs
EVector(int uw, int vw, int xw, cern.colt.matrix.DoubleMatrix1D v)
          Constructs
 
Method Summary
 void add(EVector v)
          Called to add a vector to this one
 java.lang.Object clone()
          Clones the object with a deep copy
 cern.colt.matrix.DoubleMatrix1D get()
          Called to get access to the contents expressed as a 1D vector
 cern.colt.matrix.DoubleMatrix1D getW1()
          Called to return the W1 vector
 cern.colt.matrix.DoubleMatrix1D getW2()
          Called to return the W2 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 getY2()
          Called to return the y2 vector
 cern.colt.matrix.DoubleMatrix1D getZ()
          Called to return the Z vector
 EVector multiply(double d)
          Returns a new EVector which is a new EVector where each element in this vector has been multiplied by d.
 EVector 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
protected  void setup(int uw, int vw, int xw)
          Called to setup the internal structure
 void setW1(cern.colt.matrix.DoubleMatrix1D w1)
          Called to set the w1 vector
 void setW2(double w)
          Called to set the w2 vector to a constant
 void setW2(cern.colt.matrix.DoubleMatrix1D w2)
          Called to set the w2 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 from a vector
 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 setY2(double cons)
          Called to set all y1 values equal to cons
 void setY2(cern.colt.matrix.DoubleMatrix1D y2)
          Called to set all uy1 values from a vector
 void setZ(double d)
          Called to set the z vector
 void setZ(cern.colt.matrix.DoubleMatrix1D z)
          Called to set the z vector
 java.lang.String toString()
          Returns the a string representation, just delegates to the embedded vector.
 double xDotProduct()
          Computes the distance (or something) of delta X * delta X which should be 0 at the solution.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_xwidth

protected int _xwidth

_y0width

protected int _y0width

_y1width

protected int _y1width

_y2width

protected final int _y2width
See Also:
Constant Field Values

_w1width

protected int _w1width

_w2width

protected final int _w2width
See Also:
Constant Field Values

_zwidth

protected int _zwidth

_xoffset

protected final int _xoffset
See Also:
Constant Field Values

_y0offset

protected int _y0offset

_y1offset

protected int _y1offset

_y2offset

protected int _y2offset

_w1offset

protected int _w1offset

_w2offset

protected int _w2offset

_zoffset

protected int _zoffset
Constructor Detail

EVector

public EVector(int uw,
               int vw,
               int xw)
Constructs

Parameters:
uw - Number of equality constraints
vw - Number of inequality constraints
xw - Number of variables in the solution vector

EVector

public EVector(int uw,
               int vw,
               int xw,
               cern.colt.matrix.DoubleMatrix1D v)
Constructs

Parameters:
uw - Number of equality constraints
vw - Number of inequality constraints
xw - Number of variables in the solution vector
v - Vector to use for storage
Method Detail

setup

protected void setup(int uw,
                     int vw,
                     int xw)
Called to setup the internal structure

Parameters:
uw -
vw -
xw -

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the object with a deep copy

Overrides:
clone in class java.lang.Object
Returns:
deep copy of the object
Throws:
java.lang.CloneNotSupportedException
See Also:
Object.clone()

setX

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

Parameters:
cons -

setX

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

Parameters:
x -

getX

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

Returns:
The x vector

setY0

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

Parameters:
cons -

setY0

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

Parameters:
y0 -

getY0

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

Returns:
The y0 vector

setY1

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

Parameters:
cons -

setY1

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

Parameters:
y1 -

getY1

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

Returns:
The y1 vector

setY2

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

Parameters:
cons -

setY2

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

Parameters:
y2 -

getY2

public cern.colt.matrix.DoubleMatrix1D getY2()
Called to return the y2 vector

Returns:
The y2 vector

setW1

public void setW1(cern.colt.matrix.DoubleMatrix1D w1)
Called to set the w1 vector

Parameters:
w1 - Vector of slack variables for inequality constraints

getW1

public cern.colt.matrix.DoubleMatrix1D getW1()
Called to return the W1 vector

Returns:
The w1 vector

setW2

public void setW2(cern.colt.matrix.DoubleMatrix1D w2)
Called to set the w2 vector

Parameters:
w2 - Vector of slack variables for inequality constraints

setW2

public void setW2(double w)
Called to set the w2 vector to a constant

Parameters:
w - Constant to set all w2 values to

getW2

public cern.colt.matrix.DoubleMatrix1D getW2()
Called to return the W2 vector

Returns:
The w2 vector

setZ

public void setZ(double d)
Called to set the z vector

Parameters:
d - constant

setZ

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

Parameters:
z -

getZ

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

Returns:
z vector

get

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

Returns:
a copy of the underlying vctor

negate

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

Returns:
Negated copy of the vector

multiply

public EVector multiply(double d)
Returns a new EVector which is a new EVector where each element in this vector has been multiplied by d.

Parameters:
d - constant multiplier
Returns:
New EVector with each element multiplied by d

rows

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

Returns:
Number of rows in vector

add

public void add(EVector v)
Called to add a vector to this one

Parameters:
v - Vector to be elementwise added to this vector

xDotProduct

public double xDotProduct()
Computes the distance (or something) of delta X * delta X which should be 0 at the solution.

Returns:
Measure of step size for termination checks

toString

public java.lang.String toString()
Returns the a string representation, just delegates to the embedded vector.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the objetc
See Also:
Object.toString()