cc.mallet.types
Class DenseMatrix

java.lang.Object
  extended by cc.mallet.types.DenseMatrix
All Implemented Interfaces:
ConstantMatrix, Matrix, java.io.Serializable
Direct Known Subclasses:
DenseVector, Matrix2, Matrixn

public abstract class DenseMatrix
extends java.lang.Object
implements Matrix, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  boolean hasInfinite
           
 
Constructor Summary
DenseMatrix()
           
 
Method Summary
 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(ConstantMatrix m)
           
 void plusEquals(ConstantMatrix m, double factor)
           
 void plusEquals(double v)
           
static void plusEquals(double[] accumulator, double[] addend)
           
static void plusEquals(double[] accumulator, double[] addend, 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hasInfinite

protected boolean hasInfinite
Constructor Detail

DenseMatrix

public DenseMatrix()
Method Detail

getNumDimensions

public abstract int getNumDimensions()
Specified by:
getNumDimensions in interface ConstantMatrix

getDimensions

public abstract int getDimensions(int[] sizes)
Specified by:
getDimensions in interface ConstantMatrix

value

public abstract double value(int[] indices)
Specified by:
value in interface ConstantMatrix

setValue

public abstract void setValue(int[] indices,
                              double value)
Specified by:
setValue in interface Matrix

cloneMatrix

public abstract ConstantMatrix cloneMatrix()
Specified by:
cloneMatrix in interface ConstantMatrix

singleIndex

public abstract int singleIndex(int[] indices)
Specified by:
singleIndex in interface ConstantMatrix

singleToIndices

public abstract void singleToIndices(int i,
                                     int[] indices)
Specified by:
singleToIndices in interface ConstantMatrix

singleValue

public double singleValue(int i)
Specified by:
singleValue in interface ConstantMatrix

setSingleValue

public void setSingleValue(int i,
                           double value)
Specified by:
setSingleValue in interface Matrix

incrementSingleValue

public void incrementSingleValue(int i,
                                 double delta)
Specified by:
incrementSingleValue in interface Matrix

setValueAtLocation

public void setValueAtLocation(int loc,
                               double value)
Specified by:
setValueAtLocation in interface Matrix

singleSize

public int singleSize()
Specified by:
singleSize in interface ConstantMatrix

numLocations

public int numLocations()
Specified by:
numLocations in interface ConstantMatrix

location

public int location(int index)
Specified by:
location in interface ConstantMatrix

valueAtLocation

public double valueAtLocation(int location)
Specified by:
valueAtLocation in interface ConstantMatrix

indexAtLocation

public int indexAtLocation(int location)
Specified by:
indexAtLocation in interface ConstantMatrix

setAll

public void setAll(double v)
Specified by:
setAll in interface Matrix

set

public void set(ConstantMatrix m)
Specified by:
set in interface Matrix

setWithAddend

public void setWithAddend(ConstantMatrix m,
                          double addend)
Specified by:
setWithAddend in interface Matrix

setWithFactor

public void setWithFactor(ConstantMatrix m,
                          double factor)
Specified by:
setWithFactor in interface Matrix

plusEquals

public void plusEquals(double v)

plusEquals

public void plusEquals(ConstantMatrix m)
Specified by:
plusEquals in interface Matrix

plusEquals

public void plusEquals(ConstantMatrix m,
                       double factor)
Specified by:
plusEquals in interface Matrix

equalsPlus

public void equalsPlus(double factor,
                       ConstantMatrix m)
Specified by:
equalsPlus in interface Matrix

timesEquals

public void timesEquals(double factor)
Specified by:
timesEquals in interface Matrix

elementwiseTimesEquals

public void elementwiseTimesEquals(ConstantMatrix m)
Specified by:
elementwiseTimesEquals in interface Matrix

elementwiseTimesEquals

public void elementwiseTimesEquals(ConstantMatrix m,
                                   double factor)
Specified by:
elementwiseTimesEquals in interface Matrix

divideEquals

public void divideEquals(double factor)
Specified by:
divideEquals in interface Matrix

elementwiseDivideEquals

public void elementwiseDivideEquals(ConstantMatrix m)
Specified by:
elementwiseDivideEquals in interface Matrix

elementwiseDivideEquals

public void elementwiseDivideEquals(ConstantMatrix m,
                                    double factor)
Specified by:
elementwiseDivideEquals in interface Matrix

dotProduct

public double dotProduct(ConstantMatrix m)
Specified by:
dotProduct in interface ConstantMatrix

absNorm

public double absNorm()
Specified by:
absNorm in interface ConstantMatrix

oneNorm

public double oneNorm()
Specified by:
oneNorm in interface ConstantMatrix

twoNorm

public double twoNorm()
Specified by:
twoNorm in interface ConstantMatrix

infinityNorm

public double infinityNorm()
Specified by:
infinityNorm in interface ConstantMatrix

oneNormalize

public double oneNormalize()
Specified by:
oneNormalize in interface Matrix

twoNormalize

public double twoNormalize()
Specified by:
twoNormalize in interface Matrix

absNormalize

public double absNormalize()
Specified by:
absNormalize in interface Matrix

infinityNormalize

public double infinityNormalize()
Specified by:
infinityNormalize in interface Matrix

print

public void print()
Specified by:
print in interface ConstantMatrix

isNaN

public boolean isNaN()
Specified by:
isNaN in interface ConstantMatrix

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)