|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.types.DenseMatrix cc.mallet.types.Matrixn
public class Matrixn
Implementation of Matrix that allows arbitrary
number of dimensions. This implementation
simply uses a flat array.
This also provides static utilities for doing
arbitrary-dimensional array indexing (see
singleIndex(int[])
, singleToIndices(int, int[])
).
Created: Tue Sep 16 14:52:37 2003
Field Summary |
---|
Fields inherited from class cc.mallet.types.DenseMatrix |
---|
hasInfinite |
Constructor Summary | |
---|---|
Matrixn(double[] vals)
Create a 1-d matrix with the given values. |
|
Matrixn(int[] szs)
Create a matrix with the given dimensions. |
|
Matrixn(int[] szs,
double[] vals)
Create a matrix with the given dimensions and the given values. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
ConstantMatrix |
cloneMatrix()
|
boolean |
equals(java.lang.Object o)
|
int |
getDimensions(int[] szs)
|
int |
getNumDimensions()
|
static void |
main(java.lang.String[] args)
|
void |
setValue(int[] indices,
double value)
|
int |
singleIndex(int[] indices)
|
static int |
singleIndex(int[] szs,
int[] indices)
|
void |
singleToIndices(int single,
int[] indices)
|
static void |
singleToIndices(int single,
int[] indices,
int[] szs)
Just a utility function for arbitrary-dimensional matrix dereferencing. |
double[] |
toArray()
Returns a one-dimensional array representation of the matrix. |
double |
value(int[] indices)
|
Methods inherited from class cc.mallet.types.DenseMatrix |
---|
absNorm, absNormalize, almostEquals, divideEquals, dotProduct, elementwiseDivideEquals, elementwiseDivideEquals, elementwiseTimesEquals, elementwiseTimesEquals, equalsPlus, incrementSingleValue, indexAtLocation, infinityNorm, infinityNorm, infinityNormalize, isNaN, location, numLocations, oneNorm, oneNormalize, plusEquals, plusEquals, plusEquals, plusEquals, plusEquals, print, set, setAll, setSingleValue, setValueAtLocation, setWithAddend, setWithFactor, singleSize, singleValue, substitute, timesEquals, timesEquals, twoNorm, twoNormalize, valueAtLocation |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Matrixn(double[] vals)
public Matrixn(int[] szs)
szs
- An array containing the maximum for
each dimension.public Matrixn(int[] szs, double[] vals)
szs
- An array containing the maximum for
each dimension.vals
- A flat array of the entries of the
matrix, in row-major order.Method Detail |
---|
public int getNumDimensions()
getNumDimensions
in interface ConstantMatrix
getNumDimensions
in class DenseMatrix
public int getDimensions(int[] szs)
getDimensions
in interface ConstantMatrix
getDimensions
in class DenseMatrix
public double value(int[] indices)
value
in interface ConstantMatrix
value
in class DenseMatrix
public void setValue(int[] indices, double value)
setValue
in interface Matrix
setValue
in class DenseMatrix
public ConstantMatrix cloneMatrix()
cloneMatrix
in interface ConstantMatrix
cloneMatrix
in class DenseMatrix
public java.lang.Object clone()
clone
in class java.lang.Object
public int singleIndex(int[] indices)
singleIndex
in interface ConstantMatrix
singleIndex
in class DenseMatrix
public static int singleIndex(int[] szs, int[] indices)
public void singleToIndices(int single, int[] indices)
singleToIndices
in interface ConstantMatrix
singleToIndices
in class DenseMatrix
public static void singleToIndices(int single, int[] indices, int[] szs)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public double[] toArray()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |