org.encog.ml.data.sparse
public class SparseMLData extends Object implements MLData, Serializable, Cloneable
Constructor and Description |
---|
SparseMLData(double[] d)
Construct this object with the specified data.
|
SparseMLData(double[] d,
int[] i)
Construct this object with the specified data.
|
SparseMLData(int size)
Construct this object with blank data and a specified size.
|
SparseMLData(MLData d)
Construct a new BasicMLData object from an existing one.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
double value)
Add a value to the specified index.
|
void |
clear()
Clear any data to zero.
|
MLData |
clone()
Clone this object.
|
Centroid<MLData> |
createCentroid() |
int |
findIndex(int index) |
double[] |
getData() |
double |
getData(int index)
Get the element specified index value.
|
double[] |
getSparseData() |
int[] |
getSparseIndex() |
void |
setData(double[] theData)
Set all of the data as an array of doubles.
|
void |
setData(int index,
double d)
Set the specified element.
|
int |
size() |
String |
toString() |
public SparseMLData(double[] d)
d
- The data to construct this object with.public SparseMLData(double[] d, int[] i)
d
- The data to construct this object with.public SparseMLData(int size)
size
- The amount of data to store.public SparseMLData(MLData d)
d
- The object to be copied.public int findIndex(int index)
public void add(int index, double value)
public MLData clone()
public double[] getData()
public double getData(int index)
public void setData(double[] theData)
public void setData(int index, double d)
public int size()
public int[] getSparseIndex()
public double[] getSparseData()
public Centroid<MLData> createCentroid()
createCentroid
in interface CentroidFactory<MLData>
Copyright © 2014. All Rights Reserved.