jsat.linear
Class IndexValue
- java.lang.Object
-
- jsat.linear.IndexValue
-
public class IndexValue extends java.lang.ObjectThe value at a specified index for one dimension. This is a tool mean for use with sparce data structures. The values should not be backed by any list, and changes to the IndexValue should not alter any data structures. This class is mean to be returned by an iterator, and the iterator may reuse the same IndexValue object for efficency.
-
-
Constructor Summary
Constructors Constructor and Description IndexValue(int index, double value)Creates a new IndexValue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetIndex()Returns the index of the stored valuedoublegetValue()Returns the value of the stored indexvoidsetIndex(int index)Sets the index associated with the value.voidsetValue(double value)Sets the value associated with the index
-
-
-
Constructor Detail
-
IndexValue
public IndexValue(int index, double value)Creates a new IndexValue- Parameters:
index- the index for the given valuevalue- the value at the specified index
-
-
Method Detail
-
setIndex
public void setIndex(int index)
Sets the index associated with the value.- Parameters:
index- the new index
-
setValue
public void setValue(double value)
Sets the value associated with the index- Parameters:
value- the new value
-
getIndex
public int getIndex()
Returns the index of the stored value- Returns:
- the index of the stored value
-
getValue
public double getValue()
Returns the value of the stored index- Returns:
- the value of the stored index
-
-
DataMelt 3.0 © DataMelt by jWork.ORG