Package com.macrofocus.high_d.mds.tsne
Class AbstractMatrixOperations
- java.lang.Object
-
- com.macrofocus.high_d.mds.tsne.AbstractMatrixOperations
-
- All Implemented Interfaces:
MatrixOperations
- Direct Known Subclasses:
DefaultMatrixOperations
public abstract class AbstractMatrixOperations extends java.lang.Object implements MatrixOperations
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.macrofocus.high_d.mds.tsne.MatrixOperations
MatrixOperations.MatrixOp
-
-
Constructor Summary
Constructors Constructor Description AbstractMatrixOperations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[][]abs(boolean[][] booleans)double[][]addColumnVector(double[][] matrix, double[][] colvector)double[][]addRowVector(double[][] matrix, double[][] rowvector)voidassignAllLessThan(double[][] matrix, double lessthan, double assign)All values in matrix that is less thanlessthanis assigned the valueassignvoidassignAtIndex(double[][] num, int[] range, int[] range1, double value)voidassignValuesToRow(double[][] matrix, int row, int[] indicies, double[] values)boolean[][]biggerThan(double[][] matrix, double value)Returns a new matrix of booleans where true is set if the value in the matrix is bigger than valueint[]concatenate(int[] v1, int[] v2)double[][]diag(double[][] ds)boolean[][]equal(boolean[][] matrix1, boolean[][] matrix2)Returns a new matrix of booleans where true is set if the values to the two matrices are the same at that indexdouble[][]exp(double[][] v1)Destructively sets the values in matrix to its exponentiated valuedouble[][]fillMatrix(int rows, int cols, double fillvalue)double[][]getValuesFromRow(double[][] matrix, int row, int[] indicies)double[][]maximum(double[][] matrix, double maxval)Return a new matrix with the max value of either the value in the matrix or maxval otherwisedouble[][]mean(double[][] matrix, int axis)boolean[][]negate(boolean[][] booleans)Returns new matrix with booleans which are the negations of the inputdouble[][]plus(double[][] m1, double[][] m2)int[]range(int n)int[]range(int a, int b)double[][]rnorm(int m, int n)Returns new 2D matrix with normal random values with mean 0 and std.double[][]scalarDivide(double[][] numerator, double denom)double[][]scalarInverse(double[][] m1)Returns scalar inverse of matrixdouble[][]scalarMult(double[][] m1, double mul)double[][]scalarPlus(double[][] m1, double m2)double[][]scalarPow(double[][] matrix, double power)double[][]square(double[][] matrix)Returns a new matrix with the values of matrix squareddoublesum(double[][] matrix)Returns sum of all values in the matrixdouble[][]sum(double[][] matrix, int axis)double[][]tile(double[][] matrix, int rowtimes, int coltimes)double[][]times(double[][] a, double[][] b)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.macrofocus.high_d.mds.tsne.MatrixOperations
dnrom, minus, scalarMultiply, transpose
-
-
-
-
Method Detail
-
mean
public double[][] mean(double[][] matrix, int axis)- Specified by:
meanin interfaceMatrixOperations
-
exp
public double[][] exp(double[][] v1)
Description copied from interface:MatrixOperationsDestructively sets the values in matrix to its exponentiated value- Specified by:
expin interfaceMatrixOperations- Returns:
- same matrix with values exponentiated
-
scalarInverse
public double[][] scalarInverse(double[][] m1)
Description copied from interface:MatrixOperationsReturns scalar inverse of matrix- Specified by:
scalarInversein interfaceMatrixOperations
-
rnorm
public double[][] rnorm(int m, int n)Description copied from interface:MatrixOperationsReturns new 2D matrix with normal random values with mean 0 and std. dev 1- Specified by:
rnormin interfaceMatrixOperations
-
equal
public boolean[][] equal(boolean[][] matrix1, boolean[][] matrix2)Description copied from interface:MatrixOperationsReturns a new matrix of booleans where true is set if the values to the two matrices are the same at that index- Specified by:
equalin interfaceMatrixOperations- Returns:
- new matrix with booelans with values matrix1[i,j] == matrix2[i,j]
-
biggerThan
public boolean[][] biggerThan(double[][] matrix, double value)Description copied from interface:MatrixOperationsReturns a new matrix of booleans where true is set if the value in the matrix is bigger than value- Specified by:
biggerThanin interfaceMatrixOperations- Returns:
- new matrix with booelans with values matrix1[i,j] == matrix2[i,j]
-
negate
public boolean[][] negate(boolean[][] booleans)
Description copied from interface:MatrixOperationsReturns new matrix with booleans which are the negations of the input- Specified by:
negatein interfaceMatrixOperations
-
abs
public double[][] abs(boolean[][] booleans)
- Specified by:
absin interfaceMatrixOperations
-
sum
public double[][] sum(double[][] matrix, int axis)- Specified by:
sumin interfaceMatrixOperations
-
sum
public double sum(double[][] matrix)
Description copied from interface:MatrixOperationsReturns sum of all values in the matrix- Specified by:
sumin interfaceMatrixOperations
-
maximum
public double[][] maximum(double[][] matrix, double maxval)Description copied from interface:MatrixOperationsReturn a new matrix with the max value of either the value in the matrix or maxval otherwise- Specified by:
maximumin interfaceMatrixOperations
-
assignAllLessThan
public void assignAllLessThan(double[][] matrix, double lessthan, double assign)Description copied from interface:MatrixOperationsAll values in matrix that is less thanlessthanis assigned the valueassign- Specified by:
assignAllLessThanin interfaceMatrixOperations
-
square
public double[][] square(double[][] matrix)
Description copied from interface:MatrixOperationsReturns a new matrix with the values of matrix squared- Specified by:
squarein interfaceMatrixOperations
-
scalarPow
public double[][] scalarPow(double[][] matrix, double power)- Specified by:
scalarPowin interfaceMatrixOperations
-
addColumnVector
public double[][] addColumnVector(double[][] matrix, double[][] colvector)- Specified by:
addColumnVectorin interfaceMatrixOperations
-
addRowVector
public double[][] addRowVector(double[][] matrix, double[][] rowvector)- Specified by:
addRowVectorin interfaceMatrixOperations
-
tile
public double[][] tile(double[][] matrix, int rowtimes, int coltimes)- Specified by:
tilein interfaceMatrixOperations
-
range
public int[] range(int n)
- Specified by:
rangein interfaceMatrixOperations
-
range
public int[] range(int a, int b)- Specified by:
rangein interfaceMatrixOperations
-
concatenate
public int[] concatenate(int[] v1, int[] v2)- Specified by:
concatenatein interfaceMatrixOperations
-
assignAtIndex
public void assignAtIndex(double[][] num, int[] range, int[] range1, double value)- Specified by:
assignAtIndexin interfaceMatrixOperations
-
getValuesFromRow
public double[][] getValuesFromRow(double[][] matrix, int row, int[] indicies)- Specified by:
getValuesFromRowin interfaceMatrixOperations
-
assignValuesToRow
public void assignValuesToRow(double[][] matrix, int row, int[] indicies, double[] values)- Specified by:
assignValuesToRowin interfaceMatrixOperations
-
fillMatrix
public double[][] fillMatrix(int rows, int cols, double fillvalue)- Specified by:
fillMatrixin interfaceMatrixOperations
-
plus
public double[][] plus(double[][] m1, double[][] m2)- Specified by:
plusin interfaceMatrixOperations
-
scalarPlus
public double[][] scalarPlus(double[][] m1, double m2)- Specified by:
scalarPlusin interfaceMatrixOperations
-
scalarDivide
public double[][] scalarDivide(double[][] numerator, double denom)- Specified by:
scalarDividein interfaceMatrixOperations
-
scalarMult
public double[][] scalarMult(double[][] m1, double mul)- Specified by:
scalarMultin interfaceMatrixOperations
-
times
public double[][] times(double[][] a, double[][] b)- Specified by:
timesin interfaceMatrixOperations
-
diag
public double[][] diag(double[][] ds)
- Specified by:
diagin interfaceMatrixOperations
-
-