edu.isi.karma.modeling.semantictypes.mycrf.math
Class Matrix
java.lang.Object
edu.isi.karma.modeling.semantictypes.mycrf.math.Matrix
public class Matrix
- extends java.lang.Object
This class represents matrices and vectors.
It is primarily used to perform vector computations,
such as,
addition, dot product, and scalar multiplication.
- Author:
- amangoel
Constructor Summary |
Matrix(java.util.ArrayList<java.util.ArrayList<java.lang.Double>> newData)
|
Matrix(double[][] newData)
|
Matrix(int numOfRows,
int numOfCols)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Matrix
public Matrix(int numOfRows,
int numOfCols)
Matrix
public Matrix(java.util.ArrayList<java.util.ArrayList<java.lang.Double>> newData)
Matrix
public Matrix(double[][] newData)
multiply
public Matrix multiply(Matrix otherMatrix)
transpose
public Matrix transpose()
add
public Matrix add(Matrix otherMatrix)
subtract
public Matrix subtract(Matrix otherMatrix)
multiply_with_constant
public Matrix multiply_with_constant(double k)
clone
public Matrix clone()
- Overrides:
clone
in class java.lang.Object
norm
public static double norm(Matrix m)
plusEquals
public static void plusEquals(double[] x,
double[] y,
double m)
dotProduct
public static double dotProduct(double[] x,
double[] y)
norm
public static double norm(double[] x)