jsat.linear
Class GenericMatrix
- java.lang.Object
-
- jsat.linear.Matrix
-
- jsat.linear.GenericMatrix
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- DenseMatrix, MatrixOfVecs, RandomMatrix, SubMatrix, TransposeView
public abstract class GenericMatrix extends Matrix
This Class provides default implementations of most all functions in row major form. Only a small portion must be implemented by the extending class- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GenericMatrix()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Matrixclone()Matrix[]lup()Matrix[]lup(java.util.concurrent.ExecutorService threadPool)voidmultiply(Matrix b, Matrix C)Alters the matrix C to be equal to C = C+A*Bvoidmultiply(Matrix b, Matrix C, java.util.concurrent.ExecutorService threadPool)Alters the matrix C to be equal to C = C+A*Bvoidmultiply(Vec b, double z, Vec c)If this matrix is Am x n, and b has a length of n, and c has a length of m, then this will mutate c to store c = c + A*b*zvoidmultiplyTranspose(Matrix b, Matrix C)Alters the matrix C to be equal to C = C+A*BTvoidmultiplyTranspose(Matrix b, Matrix C, java.util.concurrent.ExecutorService threadPool)Alters the matrix C to be equal to C = C+A*BTvoidmutableAdd(double c)Alters the current matrix to store the value A+cvoidmutableAdd(double c, java.util.concurrent.ExecutorService threadPool)Alters the current matrix to store the value A+cvoidmutableAdd(double c, Matrix b)Alters the current matrix to store the value A+c*BvoidmutableAdd(double c, Matrix b, java.util.concurrent.ExecutorService threadPool)Alters the current matrix to store the value A+c*BvoidmutableMultiply(double c)Alters the current matrix to be equal to A*cvoidmutableMultiply(double c, java.util.concurrent.ExecutorService threadPool)Alters the current matrix to be equal to A*cvoidmutableTranspose()Transposes the current matrix in place, altering its value.Matrix[]qr()Matrix[]qr(java.util.concurrent.ExecutorService threadPool)voidswapRows(int r1, int r2)Alters the current matrix by swapping the values stored in two different rows.voidtranspose(Matrix C)Overwrites the values stored in matrix C to store the value of A'voidtransposeMultiply(double c, Vec b, Vec x)Alters the vector x to be equal to x = x + A'*b*cvoidtransposeMultiply(Matrix b, Matrix C)Alters the matrix C so that C = C + A'*BvoidtransposeMultiply(Matrix b, Matrix C, java.util.concurrent.ExecutorService threadPool)Alters the matrix C so that C = C + A'*BvoidzeroOut()Alters the current matrix so that all values are equal to zero.-
Methods inherited from class jsat.linear.Matrix
add, add, add, add, canBeMutated, canMultiply, changeSize, cols, copyTo, diag, diagMult, diagMult, equals, equals, eye, get, getColumn, getColumnView, getRow, getRowView, increment, isSparce, isSquare, isSymmetric, isSymmetric, multiply, multiply, multiply, multiply, multiply, multiplyTranspose, multiplyTranspose, mutableAdd, mutableAdd, mutableSubtract, mutableSubtract, mutableSubtract, mutableSubtract, mutableSubtract, mutableSubtract, nnz, OuterProductUpdate, OuterProductUpdate, pascal, random, rows, sameDimensions, set, subtract, subtract, subtract, subtract, toString, transpose, transposeMultiply, transposeMultiply, transposeMultiply, updateRow
-
-
-
-
Method Detail
-
mutableAdd
public void mutableAdd(double c, Matrix b)Description copied from class:MatrixAlters the current matrix to store the value A+c*B- Specified by:
mutableAddin classMatrix- Parameters:
c- the scalar constant to multiple B byb- the matrix to add to this
-
mutableAdd
public void mutableAdd(double c, Matrix b, java.util.concurrent.ExecutorService threadPool)Description copied from class:MatrixAlters the current matrix to store the value A+c*B- Specified by:
mutableAddin classMatrix- Parameters:
c- the scalar constant to multiple B byb- the matrix to add to thisthreadPool- the source of threads to do computation in parallel
-
mutableAdd
public void mutableAdd(double c)
Description copied from class:MatrixAlters the current matrix to store the value A+c- Specified by:
mutableAddin classMatrix- Parameters:
c- the scalar constant to add to this
-
mutableAdd
public void mutableAdd(double c, java.util.concurrent.ExecutorService threadPool)Description copied from class:MatrixAlters the current matrix to store the value A+c- Specified by:
mutableAddin classMatrix- Parameters:
c- the scalar constant to add to thisthreadPool- the source of threads to do computation in parallel
-
multiply
public void multiply(Vec b, double z, Vec c)
Description copied from class:MatrixIf this matrix is Am x n, and b has a length of n, and c has a length of m, then this will mutate c to store c = c + A*b*z
-
multiply
public void multiply(Matrix b, Matrix C)
Description copied from class:MatrixAlters the matrix C to be equal to C = C+A*B
-
multiplyTranspose
public void multiplyTranspose(Matrix b, Matrix C)
Description copied from class:MatrixAlters the matrix C to be equal to C = C+A*BT- Specified by:
multiplyTransposein classMatrix- Parameters:
b- the matrix to multiply this withC- the matrix to add the result to
-
multiplyTranspose
public void multiplyTranspose(Matrix b, Matrix C, java.util.concurrent.ExecutorService threadPool)
Description copied from class:MatrixAlters the matrix C to be equal to C = C+A*BT- Specified by:
multiplyTransposein classMatrix- Parameters:
b- the matrix to multiply this withC- the matrix to add the result tothreadPool- the source of threads to do computation in parallel
-
multiply
public void multiply(Matrix b, Matrix C, java.util.concurrent.ExecutorService threadPool)
Description copied from class:MatrixAlters the matrix C to be equal to C = C+A*B
-
mutableMultiply
public void mutableMultiply(double c)
Description copied from class:MatrixAlters the current matrix to be equal to A*c- Specified by:
mutableMultiplyin classMatrix- Parameters:
c- the scalar constant to multiply by
-
mutableMultiply
public void mutableMultiply(double c, java.util.concurrent.ExecutorService threadPool)Description copied from class:MatrixAlters the current matrix to be equal to A*c- Specified by:
mutableMultiplyin classMatrix- Parameters:
c- the scalar constant to multiply bythreadPool- the source of threads to do computation in parallel
-
transposeMultiply
public void transposeMultiply(double c, Vec b, Vec x)Description copied from class:MatrixAlters the vector x to be equal to x = x + A'*b*c- Specified by:
transposeMultiplyin classMatrix- Parameters:
c- the scalar constant to multiply byb- the vector to multiply byx- the vector the add the result to
-
transposeMultiply
public void transposeMultiply(Matrix b, Matrix C)
Description copied from class:MatrixAlters the matrix C so that C = C + A'*B- Specified by:
transposeMultiplyin classMatrix- Parameters:
b- the matrix to multiply byC- the matrix to add the result to
-
transposeMultiply
public void transposeMultiply(Matrix b, Matrix C, java.util.concurrent.ExecutorService threadPool)
Description copied from class:MatrixAlters the matrix C so that C = C + A'*B- Specified by:
transposeMultiplyin classMatrix- Parameters:
b- the matrix to multiply byC- the matrix to place the results inthreadPool- the source of threads to do computation in parallel
-
mutableTranspose
public void mutableTranspose()
Description copied from class:MatrixTransposes the current matrix in place, altering its value. Only valid for square matrices- Specified by:
mutableTransposein classMatrix
-
transpose
public void transpose(Matrix C)
Description copied from class:MatrixOverwrites the values stored in matrix C to store the value of A'
-
swapRows
public void swapRows(int r1, int r2)Description copied from class:MatrixAlters the current matrix by swapping the values stored in two different rows.
-
zeroOut
public void zeroOut()
Description copied from class:MatrixAlters the current matrix so that all values are equal to zero.
-
lup
public Matrix[] lup(java.util.concurrent.ExecutorService threadPool)
-
qr
public Matrix[] qr(java.util.concurrent.ExecutorService threadPool)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG