|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.akutan.optimization.SASolution
public class SASolution
Consists of the vector of weights before processing and a convenience data structure to identify which assets are in the weight vector.
| Field Summary | |
|---|---|
protected double |
_objective
|
protected int[] |
_Q
|
protected cern.colt.matrix.DoubleMatrix1D |
_s
|
protected cern.colt.matrix.DoubleMatrix1D |
_w
|
| Constructor Summary | |
|---|---|
SASolution(int[] Q,
cern.colt.matrix.DoubleMatrix1D s,
double objective)
Constructs |
|
| Method Summary | |
|---|---|
void |
addAsset(double w,
int ptr,
java.lang.Integer[] potential)
Adds the selected asset to the solution |
protected java.lang.Object |
clone()
Deep copy of the solution |
int |
compareTo(SASolution s)
Compares a SASolution object to this |
boolean |
equals(java.lang.Object obj)
equivalence of two solutions, _s vector and objectives match. |
double |
getObjective()
Returns the value of the objective function for this proposed solution |
int[] |
getQ()
Returns the Q vector (Indicates point in or out of weights) for this potential solution |
cern.colt.matrix.DoubleMatrix1D |
getS()
Returns the S vector |
cern.colt.matrix.DoubleMatrix1D |
getW()
Returns the weights of the assets at this solution |
int |
hashCode()
Hashcode. |
java.lang.Integer[] |
removeAsset(int index)
Removes an asset from the solution, and returns a set containing the assets which are not currently in the solution, and are not the asset just removed from the solution. |
void |
rescale(double epsilon)
Called to readjust the s values to be s = w - _epsilon |
cern.colt.matrix.DoubleMatrix1D |
reweight(double epsilon)
Updates the weights based on the values in the 's' vector. |
java.lang.String |
toString()
Formats this object into a string for debugging |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int[] _Q
protected cern.colt.matrix.DoubleMatrix1D _s
protected cern.colt.matrix.DoubleMatrix1D _w
protected double _objective
| Constructor Detail |
|---|
public SASolution(int[] Q,
cern.colt.matrix.DoubleMatrix1D s,
double objective)
Q - s - objective - | Method Detail |
|---|
public double getObjective()
public int[] getQ()
public cern.colt.matrix.DoubleMatrix1D getS()
public cern.colt.matrix.DoubleMatrix1D getW()
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic int compareTo(SASolution s)
compareTo in interface java.lang.Comparable<SASolution>s - SASolution to compare to this
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - to compare to this
Object.equals(java.lang.Object)public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
public void addAsset(double w,
int ptr,
java.lang.Integer[] potential)
w - Weight of the assetptr - Ptr to this asset in the vectorpotential - Array of potentials for each assetpublic java.lang.Integer[] removeAsset(int index)
index - Index of asset to remove from the solution
public void rescale(double epsilon)
epsilon - Constant to subtract from each weightpublic cern.colt.matrix.DoubleMatrix1D reweight(double epsilon)
epsilon - Constant to subtract from each weight
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||