public abstract class GenericMatrix extends Matrix
Modifier and Type | Field and Description |
---|---|
protected static int |
NB2
Step size if the computation accesses 2*NB2^2 * dataTypeSize data,
so that the data being worked on fits into the L2 cache
|
Constructor and Description |
---|
GenericMatrix() |
Modifier and Type | Method and Description |
---|---|
Matrix |
clone() |
protected abstract Matrix |
getMatrixOfSameType(int rows,
int cols)
Creates a new matrix of the same type
|
Matrix[] |
lup() |
Matrix[] |
lup(ExecutorService threadPool) |
void |
multiply(Matrix b,
Matrix C)
Alters the matrix C to be equal to C = C+A*B
|
void |
multiply(Matrix b,
Matrix C,
ExecutorService threadPool)
Alters the matrix C to be equal to C = C+A*B
|
void |
multiply(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*z
|
void |
multiplyTranspose(Matrix b,
Matrix C)
Alters the matrix C to be equal to C = C+A*BT
|
void |
multiplyTranspose(Matrix b,
Matrix C,
ExecutorService threadPool)
Alters the matrix C to be equal to C = C+A*BT
|
void |
mutableAdd(double c)
Alters the current matrix to store the value A+c
|
void |
mutableAdd(double c,
ExecutorService threadPool)
Alters the current matrix to store the value A+c
|
void |
mutableAdd(double c,
Matrix b)
Alters the current matrix to store the value A+c*B
|
void |
mutableAdd(double c,
Matrix b,
ExecutorService threadPool)
Alters the current matrix to store the value A+c*B
|
void |
mutableMultiply(double c)
Alters the current matrix to be equal to A*c
|
void |
mutableMultiply(double c,
ExecutorService threadPool)
Alters the current matrix to be equal to A*c
|
void |
mutableTranspose()
Transposes the current matrix in place, altering its value.
|
Matrix[] |
qr() |
Matrix[] |
qr(ExecutorService threadPool) |
void |
swapRows(int r1,
int r2)
Alters the current matrix by swapping the values stored in two different
rows.
|
void |
transpose(Matrix C)
Overwrites the values stored in matrix C to store the value of
A'
|
void |
transposeMultiply(double c,
Vec b,
Vec x)
Alters the vector x to be equal to x = x + A'*b*c
|
void |
transposeMultiply(Matrix b,
Matrix C)
Alters the matrix C so that C = C + A'*B
|
void |
transposeMultiply(Matrix b,
Matrix C,
ExecutorService threadPool)
Alters the matrix C so that C = C + A'*B
|
void |
zeroOut()
Alters the current matrix so that all values are equal to zero.
|
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
protected static int NB2
protected abstract Matrix getMatrixOfSameType(int rows, int cols)
rows
- the number of rows for the matrix to havecols
- the number of columns for the matrix to havepublic void mutableAdd(double c, Matrix b)
Matrix
mutableAdd
in class Matrix
c
- the scalar constant to multiple B byb
- the matrix to add to thispublic void mutableAdd(double c, Matrix b, ExecutorService threadPool)
Matrix
mutableAdd
in class Matrix
c
- the scalar constant to multiple B byb
- the matrix to add to thisthreadPool
- the source of threads to do computation in parallelpublic void mutableAdd(double c)
Matrix
mutableAdd
in class Matrix
c
- the scalar constant to add to thispublic void mutableAdd(double c, ExecutorService threadPool)
Matrix
mutableAdd
in class Matrix
c
- the scalar constant to add to thisthreadPool
- the source of threads to do computation in parallelpublic void multiply(Vec b, double z, Vec c)
Matrix
public void multiply(Matrix b, Matrix C)
Matrix
public void multiplyTranspose(Matrix b, Matrix C)
Matrix
multiplyTranspose
in class Matrix
b
- the matrix to multiply this withC
- the matrix to add the result topublic void multiplyTranspose(Matrix b, Matrix C, ExecutorService threadPool)
Matrix
multiplyTranspose
in class Matrix
b
- the matrix to multiply this withC
- the matrix to add the result tothreadPool
- the source of threads to do computation in parallelpublic void multiply(Matrix b, Matrix C, ExecutorService threadPool)
Matrix
public void mutableMultiply(double c)
Matrix
mutableMultiply
in class Matrix
c
- the scalar constant to multiply bypublic void mutableMultiply(double c, ExecutorService threadPool)
Matrix
mutableMultiply
in class Matrix
c
- the scalar constant to multiply bythreadPool
- the source of threads to do computation in parallelpublic void transposeMultiply(double c, Vec b, Vec x)
Matrix
transposeMultiply
in class Matrix
c
- the scalar constant to multiply byb
- the vector to multiply byx
- the vector the add the result topublic void transposeMultiply(Matrix b, Matrix C)
Matrix
transposeMultiply
in class Matrix
b
- the matrix to multiply byC
- the matrix to add the result topublic void transposeMultiply(Matrix b, Matrix C, ExecutorService threadPool)
Matrix
transposeMultiply
in class Matrix
b
- the matrix to multiply byC
- the matrix to place the results inthreadPool
- the source of threads to do computation in parallelpublic void mutableTranspose()
Matrix
mutableTranspose
in class Matrix
public void transpose(Matrix C)
Matrix
public void swapRows(int r1, int r2)
Matrix
public void zeroOut()
Matrix
public Matrix[] lup(ExecutorService threadPool)
public Matrix[] qr(ExecutorService threadPool)
Copyright © 2017. All rights reserved.