Package cc.mallet.types
Class DenseMatrix
- java.lang.Object
-
- cc.mallet.types.DenseMatrix
-
- All Implemented Interfaces:
ConstantMatrix
,Matrix
,java.io.Serializable
- Direct Known Subclasses:
DenseVector
,Matrixn
public abstract class DenseMatrix extends java.lang.Object implements Matrix, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
hasInfinite
-
Constructor Summary
Constructors Constructor Description DenseMatrix()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description double
absNorm()
double
absNormalize()
boolean
almostEquals(ConstantMatrix m2)
abstract ConstantMatrix
cloneMatrix()
void
divideEquals(double factor)
double
dotProduct(ConstantMatrix m)
void
elementwiseDivideEquals(ConstantMatrix m)
void
elementwiseDivideEquals(ConstantMatrix m, double factor)
void
elementwiseTimesEquals(ConstantMatrix m)
void
elementwiseTimesEquals(ConstantMatrix m, double factor)
void
equalsPlus(double factor, ConstantMatrix m)
abstract int
getDimensions(int[] sizes)
abstract int
getNumDimensions()
void
incrementSingleValue(int i, double delta)
int
indexAtLocation(int location)
double
infinityNorm()
static double
infinityNorm(double[] vector)
double
infinityNormalize()
boolean
isNaN()
int
location(int index)
int
numLocations()
double
oneNorm()
double
oneNormalize()
void
plusEquals(double v)
static void
plusEquals(double[] accumulator, double[] addend)
static void
plusEquals(double[] accumulator, double[] addend, double factor)
void
plusEquals(ConstantMatrix m)
void
plusEquals(ConstantMatrix m, double factor)
void
print()
void
set(ConstantMatrix m)
void
setAll(double v)
void
setSingleValue(int i, double value)
abstract void
setValue(int[] indices, double value)
void
setValueAtLocation(int loc, double value)
void
setWithAddend(ConstantMatrix m, double addend)
void
setWithFactor(ConstantMatrix m, double factor)
abstract int
singleIndex(int[] indices)
int
singleSize()
abstract void
singleToIndices(int i, int[] indices)
double
singleValue(int i)
void
substitute(double oldValue, double newValue)
void
timesEquals(double factor)
static void
timesEquals(double[] accumulator, double[] product)
double
twoNorm()
double
twoNormalize()
abstract double
value(int[] indices)
double
valueAtLocation(int location)
-
-
-
Method Detail
-
getNumDimensions
public abstract int getNumDimensions()
- Specified by:
getNumDimensions
in interfaceConstantMatrix
-
getDimensions
public abstract int getDimensions(int[] sizes)
- Specified by:
getDimensions
in interfaceConstantMatrix
-
value
public abstract double value(int[] indices)
- Specified by:
value
in interfaceConstantMatrix
-
setValue
public abstract void setValue(int[] indices, double value)
-
cloneMatrix
public abstract ConstantMatrix cloneMatrix()
- Specified by:
cloneMatrix
in interfaceConstantMatrix
-
singleIndex
public abstract int singleIndex(int[] indices)
- Specified by:
singleIndex
in interfaceConstantMatrix
-
singleToIndices
public abstract void singleToIndices(int i, int[] indices)
- Specified by:
singleToIndices
in interfaceConstantMatrix
-
singleValue
public double singleValue(int i)
- Specified by:
singleValue
in interfaceConstantMatrix
-
setSingleValue
public void setSingleValue(int i, double value)
- Specified by:
setSingleValue
in interfaceMatrix
-
incrementSingleValue
public void incrementSingleValue(int i, double delta)
- Specified by:
incrementSingleValue
in interfaceMatrix
-
setValueAtLocation
public void setValueAtLocation(int loc, double value)
- Specified by:
setValueAtLocation
in interfaceMatrix
-
singleSize
public int singleSize()
- Specified by:
singleSize
in interfaceConstantMatrix
-
numLocations
public int numLocations()
- Specified by:
numLocations
in interfaceConstantMatrix
-
location
public int location(int index)
- Specified by:
location
in interfaceConstantMatrix
-
valueAtLocation
public double valueAtLocation(int location)
- Specified by:
valueAtLocation
in interfaceConstantMatrix
-
indexAtLocation
public int indexAtLocation(int location)
- Specified by:
indexAtLocation
in interfaceConstantMatrix
-
set
public void set(ConstantMatrix m)
-
setWithAddend
public void setWithAddend(ConstantMatrix m, double addend)
- Specified by:
setWithAddend
in interfaceMatrix
-
setWithFactor
public void setWithFactor(ConstantMatrix m, double factor)
- Specified by:
setWithFactor
in interfaceMatrix
-
plusEquals
public void plusEquals(double v)
-
plusEquals
public void plusEquals(ConstantMatrix m)
- Specified by:
plusEquals
in interfaceMatrix
-
plusEquals
public void plusEquals(ConstantMatrix m, double factor)
- Specified by:
plusEquals
in interfaceMatrix
-
equalsPlus
public void equalsPlus(double factor, ConstantMatrix m)
- Specified by:
equalsPlus
in interfaceMatrix
-
timesEquals
public void timesEquals(double factor)
- Specified by:
timesEquals
in interfaceMatrix
-
elementwiseTimesEquals
public void elementwiseTimesEquals(ConstantMatrix m)
- Specified by:
elementwiseTimesEquals
in interfaceMatrix
-
elementwiseTimesEquals
public void elementwiseTimesEquals(ConstantMatrix m, double factor)
- Specified by:
elementwiseTimesEquals
in interfaceMatrix
-
divideEquals
public void divideEquals(double factor)
- Specified by:
divideEquals
in interfaceMatrix
-
elementwiseDivideEquals
public void elementwiseDivideEquals(ConstantMatrix m)
- Specified by:
elementwiseDivideEquals
in interfaceMatrix
-
elementwiseDivideEquals
public void elementwiseDivideEquals(ConstantMatrix m, double factor)
- Specified by:
elementwiseDivideEquals
in interfaceMatrix
-
dotProduct
public double dotProduct(ConstantMatrix m)
- Specified by:
dotProduct
in interfaceConstantMatrix
-
absNorm
public double absNorm()
- Specified by:
absNorm
in interfaceConstantMatrix
-
oneNorm
public double oneNorm()
- Specified by:
oneNorm
in interfaceConstantMatrix
-
twoNorm
public double twoNorm()
- Specified by:
twoNorm
in interfaceConstantMatrix
-
infinityNorm
public double infinityNorm()
- Specified by:
infinityNorm
in interfaceConstantMatrix
-
oneNormalize
public double oneNormalize()
- Specified by:
oneNormalize
in interfaceMatrix
-
twoNormalize
public double twoNormalize()
- Specified by:
twoNormalize
in interfaceMatrix
-
absNormalize
public double absNormalize()
- Specified by:
absNormalize
in interfaceMatrix
-
infinityNormalize
public double infinityNormalize()
- Specified by:
infinityNormalize
in interfaceMatrix
-
print
public void print()
- Specified by:
print
in interfaceConstantMatrix
-
isNaN
public boolean isNaN()
- Specified by:
isNaN
in interfaceConstantMatrix
-
substitute
public final void substitute(double oldValue, double newValue)
-
plusEquals
public static void plusEquals(double[] accumulator, double[] addend)
-
plusEquals
public static void plusEquals(double[] accumulator, double[] addend, double factor)
-
timesEquals
public static void timesEquals(double[] accumulator, double[] product)
-
infinityNorm
public static double infinityNorm(double[] vector)
-
almostEquals
public boolean almostEquals(ConstantMatrix m2)
-
-