org.akutan.optimization.diversified
Class DVector

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

public class DVector
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
DVector(int uw, int vw, int xw)
          Constructs
DVector(int uw, int vw, int xw, cern.colt.matrix.DoubleMatrix1D v)
          Constructs
 
Method Summary
 void add(DVector v)
          Called to add a vector to this elementwise
 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
 DVector multiply(double d)
          Returns a copy of this vector in which every element of the vector has been multiplied by the constant d.
 DVector 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)
           
 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 x 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()
          (non-Javadoc) Returns the string representation of the object, 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

DVector

public DVector(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

DVector

public DVector(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)

clone

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

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

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 x from a vector

Parameters:
x -

getX

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

Returns:
The x portion of the 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:
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:
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:
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:
w1 vector

setW2

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

Parameters:
w2 - Vector of slack variables

setW2

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

Parameters:
w - Constant value to set all w2 elements to

getW2

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

Returns:
w2 vector

setZ

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

Parameters:
d - constant to set in all elements of the z vector

setZ

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

Parameters:
z - Vector to set the z vector from

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 vector

negate

public DVector 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 DVector multiply(double d)
Returns a copy of this vector in which every element of the vector has been multiplied by the constant d.

Parameters:
d - Constant to multiple values by
Returns:
New DVector 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(DVector v)
Called to add a vector to this elementwise

Parameters:
v - Elementwise adds a this vector to this

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()
(non-Javadoc) Returns the string representation of the object, just delegates to the embedded vector

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()