net.sourceforge.combean.mathprog.linalg
Class DoubleVec<Label>

Package class diagram package DoubleVec
java.lang.Object
  extended by net.sourceforge.combean.mathprog.linalg.DoubleVec<Label>
All Implemented Interfaces:
SparseVec<Label>
Direct Known Subclasses:
DoubleLPVector, DoubleVector

public class DoubleVec<Label>
extends Object
implements SparseVec<Label>

A plain double array as SparseVec.


Field Summary
protected  Label label
           
 
Constructor Summary
protected DoubleVec(double[] doubleArr)
          Constructor
protected DoubleVec(double[] doubleArr, Label label)
          Constructor
 
Method Summary
 int getDimension()
           
 int getNumIterations()
          Return the number of entries of the vector through which the iterator returned by getIterator() iterates.
 VectorIterator<Label> iterator()
          Get an iterator which iterates through all non-zero entries of the vector.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

label

protected Label label
Constructor Detail

DoubleVec

protected DoubleVec(double[] doubleArr)
Constructor

Parameters:
doubleArr - the double array to be wrapped.

DoubleVec

protected DoubleVec(double[] doubleArr,
                    Label label)
Constructor

Parameters:
doubleArr - the double array to be wrapped.
Method Detail

getDimension

public int getDimension()

iterator

public VectorIterator<Label> iterator()
Description copied from interface: SparseVec
Get an iterator which iterates through all non-zero entries of the vector. The iteration must stop after exactly getNumNonZeroEntries() steps. An implementation may choose to also return zero entries during the iteration. In that case, these entries must also be counted by getNumIterations(); The iteration does not have to return the values in order of increasing indices.

Specified by:
iterator in interface SparseVec<Label>
Returns:
an iterator for the non-zero entries.

getNumIterations

public int getNumIterations()
Description copied from interface: SparseVec
Return the number of entries of the vector through which the iterator returned by getIterator() iterates.

Specified by:
getNumIterations in interface SparseVec<Label>
Returns:
the number of iterations of getIterator.

toString

public String toString()
Overrides:
toString in class Object