Package org.ujmp.core
Class AbstractMatrix
java.lang.Object
java.lang.Number
org.ujmp.core.AbstractMatrix
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Matrix>
,HasMetaData
,BaseMatrix
,BooleanCalculations
,CanPerformCalculations
,BasicDoubleCalculations
,DoubleCalculations
,BasicEntrywiseDoubleCalculations
,CreatorDoubleCalculations
,EntrywiseDoubleCalculations
,HyperbolicDoubleCalculations
,MiscEntrywiseDoubleCalculations
,RoundingDoubleCalculations
,TrigonometricDoubleCalculations
,DecompositionDoubleCalculations
,DiscretizeCalculations
,GeneralDoubleCalculations
,MiscGeneralDoubleCalculations
,MissingValueDoubleCalculations
,StatisticalDoubleCalculations
,BaseMatrixProperties
,Clearable
,Conversions
,CoordinateFunctions
,CoreObject
,DistanceMeasures
,ExtendedMatrixProperties
,GettersAndSetters
,HasDescription
,HasGUIObject
,HasId
,HasLabel
,IntCalculations
,Matrix
,ObjectCalculations
,StringCalculations
- Direct Known Subclasses:
AbstractGenericMatrix
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GUIObject
private final long
private static long
private static final long
protected long[]
Fields inherited from interface org.ujmp.core.BaseMatrix
ALL, COLUMN, LINK, NEW, NONE, ORIG, ROW, X, Y, Z
Fields inherited from interface org.ujmp.core.interfaces.HasDescription
DESCRIPTION
Fields inherited from interface org.ujmp.core.annotation.HasMetaData
DIMENSIONMETADATA
Fields inherited from interface org.ujmp.core.Matrix
chol, divideMatrix, divideScalar, eig, Factory, inv, lu, minusMatrix, minusScalar, mtimes, plusMatrix, plusScalar, qr, solve, svd, timesMatrix, timesScalar, transpose
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Matrix
abs
(Calculation.Ret returnType) Calculates the absolute values of all entries in a Matrix.final Matrix
addMissing
(Calculation.Ret returnType, int dimension, double... percentMissing) Adds a specified amount of missing values (Double.NaN) to the Matrixfinal Iterable<long[]>
Returns an Iterator that goes over all coordinates in the Matrix.final Matrix
and
(Calculation.Ret returnType, boolean value) final Matrix
and
(Calculation.Ret returnType, Matrix matrix) final Matrix
append
(Calculation.Ret returnType, int dimension, Matrix... matrices) final Matrix
appendHorizontally
(Calculation.Ret returnType, Matrix... matrices) final Matrix
appendVertically
(Calculation.Ret returnType, Matrix... matrices) atimes
(Calculation.Ret returnType, boolean ignoreNaN, Matrix matrix) Performs an averaging matrix multiplication on the two matrices.final BigDecimal
final BigInteger
final boolean
bootstrap
(Calculation.Ret returnType) bootstrap
(Calculation.Ret returnType, int count) final Matrix
ceil
(Calculation.Ret returnType) Returns a matrix with all entries rounded up to the next integer.center
(Calculation.Ret returnType, int dimension, boolean ignoreNaN) Subtracts the mean from the matrix.final char
double
chebyshevDistanceTo
(Matrix m, boolean ignoreNaN) chol()
Calculates a Cholesky decomposition of the matrix.clone()
int
boolean
boolean
boolean
containsBoolean
(boolean v) boolean
containsByte
(byte v) boolean
containsChar
(char v) boolean
containsDate
(Date v) boolean
containsDouble
(double v) boolean
containsFloat
(float v) boolean
containsInt
(int v) boolean
containsLong
(long v) final boolean
boolean
boolean
boolean
containsShort
(short v) boolean
final Matrix
Creates a copy of the matrix with the desired type for matrix entries.convertEncoding
(Calculation.Ret returnType, String encoding) corrcoef
(Calculation.Ret returnType, boolean ignoreNaN, boolean besselsCorrection) Calculates the Pearson correlation.cos
(Calculation.Ret returnType) Calculates the cosinus of all entries in the matrix.cosh
(Calculation.Ret returnType) Calculates the hyperbolic cosinus of all entries in the matrix.final Matrix
cosineSimilarity
(Calculation.Ret returnType, boolean ignoreNaN) double
cosineSimilarityTo
(Matrix m, boolean ignoreNaN) countMissing
(Calculation.Ret returnType, int dimension) Counts the missing values within the matrix, i.e.cov
(Calculation.Ret returnType, boolean ignoreNaN, boolean besselsCorrection) Calculates the covariance Matrix.final Matrix
cumprod
(boolean ignoreNaN) final Matrix
cumsum
(boolean ignoreNaN) final Date
final Matrix
delete
(Calculation.Ret returnType, long[]... selection) Delete rows and columns in the Matrix and returns a link to it.final Matrix
delete
(Calculation.Ret returnType, String selection) Deletes rows and columns in the Matrix and returns a link to it.final Matrix
delete
(Calculation.Ret returnType, Collection<? extends Number>... selection) Delete rows and columns in the Matrix and returns a link to it.final Matrix
deleteColumns
(Calculation.Ret returnType, long... columns) Deletes columns in the Matrix and returns a link to it.final Matrix
deleteColumns
(Calculation.Ret returnType, Collection<? extends Number> columns) Deletes columns in the Matrix and returns a link to it.final Matrix
deleteColumnsWithMissingValues
(Calculation.Ret returnType) final Matrix
deleteRows
(Calculation.Ret returnType, long... rows) Deletes rows in the Matrix and returns a link to it.final Matrix
deleteRows
(Calculation.Ret returnType, Collection<? extends Number> rows) Deletes rows in the Matrix and returns a link to it.final Matrix
deleteRowsWithMissingValues
(Calculation.Ret returnType, long threshold) double
det()
diag
(Calculation.Ret returnType) diff
(Calculation.Ret returnType, int dimension, boolean ignoreNaN) discretize
(Calculation.Ret returnType, int dimension, Discretize.DiscretizationMethod method, int numberOfBins) discretize
(Calculation.Ret returnType, Dictionary dictionary) discretizeToBoolean
(int targetColumnCount) final Matrix
discretizeToColumns
(long column) divide
(double divisor) Divides every entry in the matrix by a scalar.divide
(Calculation.Ret returnType, boolean ignoreNaN, double factor) Divides every entry in the matrix by a scalar.divide
(Calculation.Ret returnType, boolean ignoreNaN, Matrix factor) Divides every entry in the matrix by the entries of another matrix.Calculates an entrywise division of the two matrices.final double
Matrix[]
eig()
Calculates the Eigen decomposition of the matrix.Matrix[]
eigSymm()
Calculates the Eigen decomposition of a symmetric matrix.final Matrix
eq
(Calculation.Ret returnType, Object value) final Matrix
eq
(Calculation.Ret returnType, Matrix matrix) boolean
final boolean
final boolean
euklideanDistance
(Calculation.Ret returnType, boolean ignoreNaN) double
euklideanDistanceTo
(Matrix m, boolean ignoreNaN) final Matrix
exp
(Calculation.Ret returnType) Calculates the exponential function for all entries in the Matrix.exportTo()
final Matrix
extractAnnotation
(Calculation.Ret returnType, int dimension) Generates annotation such as row or column labels from the content of this matrix.final Matrix
eye
(Calculation.Ret ret) Returns a matrix with ones at the diagonal.final Matrix
fadeIn
(Calculation.Ret ret, int dimension) final Matrix
fadeOut
(Calculation.Ret ret, int dimension) final Matrix
fill
(Calculation.Ret ret, Object value) Returns a matrix with equal size, where all entries are set to a desired value.void
This method is used to signal changes in the object to the corresponding GUIObject if it exists.void
fireValueChanged
(Coordinates coordinates, Object object) void
fireValueChanged
(Coordinates start, Coordinates end) flipdim
(Calculation.Ret returnType, int dimension) final float
final Matrix
floor
(Calculation.Ret returnType) Returns a matrix with all entries rounded down to the next integer.final Matrix
ge
(Calculation.Ret returnType, double value) final Matrix
ge
(Calculation.Ret returnType, Matrix matrix) final double
final double
getAsBigDecimal
(long... coordinates) getAsBigInteger
(long... coordinates) boolean
getAsBoolean
(long... coordinates) Returns a byte representation of an entry in the matrix.byte
getAsByte
(long... coordinates) Returns a byte representation of an entry in the matrix.byte[]
getAsByteArray
(long... coordinates) Returns a byte array representation of an entry in the matrix.char
getAsChar
(long... coordinates) Returns a char representation of an entry in the matrix.getAsDate
(long... coordinates) Returns a Date representation of an entry in the matrix.double
getAsDouble
(long... coordinates) Returns a double representation of an entry in the matrix.float
getAsFloat
(long... coordinates) Returns a float representation of an entry in the matrix.int
getAsInt
(long... coordinates) Returns an int representation of an entry in the matrix.long
getAsLong
(long... coordinates) Returns a long representation of an entry in the matrix.getAsMatrix
(long... coordinates) short
getAsShort
(long... coordinates) Returns a short representation of an entry in the matrix.getAsString
(long... coordinates) Returns a String representation of an entry in the matrix.long
final long
getColumnForLabel
(Object object) final String
getColumnLabel
(long col) final long[]
Returns the position of the maximum value in a Matrix.final long[]
Returns the position of the minimum value in a Matrix.final long
final String
int
final String
getDimensionLabel
(int dimension) final Object
getDimensionMetaData
(int dimension, long... position) final double
BaseMatrixFactory<? extends Matrix>
Returns an object suitable for displaying on the screen.final String
getId()
Returns the String id of an object.final String
getLabel()
Returns the String label of an object.final Object
Returns the label of an object.final double
final double
final Object
getMetaData
(Object key) getMetaDataDimensionMatrix
(int dimension) final double
getMetaDataDouble
(Object key) final Matrix
getMetaDataMatrix
(Object key) final String
getMetaDataString
(Object key) final double
final long[]
getPositionForLabel
(int dimension, Object label) final Object
getPreferredObject
(long... coordinates) Returns a representation of the entry in the matrix that reflects the true object best.final double
getRMS()
long
final long
getRowForLabel
(Object object) final String
getRowLabel
(long row) long[]
getSize()
final long
getSize
(int dimension) final double
long
final double
long
ginv()
Calculates a generalized inverse of the MatrixgrayScale
(Calculation.Ret returnType, GrayScale.ColorChannel colorChannel) final Matrix
gt
(Calculation.Ret returnType, double value) final Matrix
gt
(Calculation.Ret returnType, Matrix matrix) impute
(Calculation.Ret returnType, Impute.ImputationMethod method, Object... parameters) Replaces missing values with various methodsfinal Matrix
includeAnnotation
(Calculation.Ret returnType, int dimension) indexOfMax
(Calculation.Ret returnType, int dimension) Finds the index of the maximum value in the matrixindexOfMin
(Calculation.Ret returnType, int dimension) Finds the index of the minimum value in the matrixfinal int
intValue()
inv()
Calculates the inverse of the Matrix using either LUDecomposition (for square matrices) or QRDecomposition (otherwise).invSPD()
Calculates the inverse of a symmetric positive definite Matrix using Cholesky Decomposition.invSymm()
Calculates the inverse of the Matrix using either LUDecomposition (for square matrices) or QRDecomposition (otherwise).final boolean
final boolean
boolean
isEmpty()
final boolean
boolean
boolean
final boolean
final boolean
isScalar()
boolean
final boolean
isSPD()
final boolean
isSquare()
final boolean
boolean
final Matrix
le
(Calculation.Ret returnType, double value) final Matrix
le
(Calculation.Ret returnType, Matrix matrix) final Matrix
log
(Calculation.Ret returnType) Calculates the natural logarithm of all entries in the Matrix.final Matrix
log10
(Calculation.Ret returnType) Calculates the logarithm with basis 10 of all entries in the Matrix.final Matrix
log2
(Calculation.Ret returnType) Calculates the logarithm with basis 2 of all entries in the Matrix.final Matrix
logistic
(Calculation.Ret returnType) Calculates the logistic function for all entries in the Matrix.final long
lowerCase
(Calculation.Ret returnType) final Matrix
lt
(Calculation.Ret returnType, double value) final Matrix
lt
(Calculation.Ret returnType, Matrix matrix) Matrix[]
lu()
Calculates a LU decomposition of the matrix.manhattenDistance
(Calculation.Ret returnType, boolean ignoreNaN) double
manhattenDistanceTo
(Matrix m, boolean ignoreNaN) max
(Calculation.Ret returnType, int dimension) Calculates the maximum of the values in the matrix either rowwise, columnwise, or global.mean
(Calculation.Ret returnType, int dimension, boolean ignoreNaN) Calculates the mean of all entries in the Matrix either per row, per column, or global.min
(Calculation.Ret returnType, int dimension) Calculates the mimimum of the values in the matrix either rowwise, columnwise, or global.final Matrix
minkowskiDistance
(Calculation.Ret returnType, double p, boolean ignoreNaN) double
minkowskiDistanceTo
(Matrix m, double p, boolean ignoreNaN) minus
(double value) Subtracts a specified value from all entries in the matrix.minus
(Calculation.Ret returnType, boolean ignoreNaN, double v) Subtracts a specified value from all entries in the matrix.minus
(Calculation.Ret returnType, boolean ignoreNaN, Matrix m) Calculates the difference of the entries in both matricesCalculates the difference of the entries in both matricesmtimes
(Calculation.Ret returnType, boolean ignoreNaN, Matrix matrix) Performs a matrix multiplication on the two matrices.Performs a matrix multiplication on the two matrices.mutualInf
(Calculation.Ret returnType) Calculates the mutual information.final Matrix
nans
(Calculation.Ret ret) Returns a matrix with equal size, where all entries are set to Double.NaN.final Matrix
ne
(Calculation.Ret returnType, Object value) final Matrix
ne
(Calculation.Ret returnType, Matrix matrix) Iterable<long[]>
double
norm1()
double
norm2()
normalize
(Calculation.Ret returnType, int dimension) double
normF()
double
normInf()
final Matrix
not
(Calculation.Ret returnType) final Matrix
ones
(Calculation.Ret ret) Returns a matrix with equal size, where all entries are set to 1.0.final Matrix
or
(Calculation.Ret returnType, boolean value) final Matrix
or
(Calculation.Ret returnType, Matrix matrix) pairedTTest
(Calculation.Ret returnType) Calculates a paired T-Test on the matrix.double
pdet()
pinv()
Calculates the pseudo inverse of the Matrix using Singular Value Decomposition.pinv
(int k) Calculates the pseudo inverse of the Matrix using a low rank approximation of the Singular Value Decomposition.plus
(double value) Adds a specified value to all entries in the matrix.plus
(Calculation.Ret returnType, boolean ignoreNaN, double v) Adds a specified value from all entries in the matrix.plus
(Calculation.Ret returnType, boolean ignoreNaN, Matrix m) Calculates the sum of the entries in both matricesCalculates the sum of the entries in both matricesfinal Matrix
power
(Calculation.Ret returnType, double power) Calculates this matrix to the power of the given value (entrywise).final Matrix
power
(Calculation.Ret returnType, Matrix power) Calculates this matrix to the power of the given matrix (entrywise).princomp()
Projects the matrix into the space of the principal components.prod
(Calculation.Ret returnType, int dimension, boolean ignoreNaN) Matrix[]
qr()
Calculates a QR decomposition of the matrix.final Matrix
rand
(Calculation.Ret ret) Returns a matrix with equal size, where all entries are set to uniform random values between 0.0 and 1.0.final Matrix
randn
(Calculation.Ret ret) Returns a matrix with equal size, where all entries are set to random values which are normally distributed with 0.0 mean and 1.0 standard deviation.int
rank()
removeWords
(Calculation.Ret ret, Collection<String> words) final Matrix
replace
(Calculation.Ret returnType, Object search, Object replacement) Replaces matching values in the matrix with another valuereplaceMissingBy
(Matrix matrix) final Matrix
replaceRegex
(Calculation.Ret returnType, String search, String replacement) Replaces matching text in every entry of the matrix.final Matrix
replaceRegex
(Calculation.Ret returnType, Pattern search, String replacement) Replaces matching text in every entry of the matrix.final Matrix
reshape
(Calculation.Ret returnType, long... newSize) final Matrix
round
(Calculation.Ret returnType) Returns a matrix with all entries rounded to integer values.void
void
final Matrix
select
(Calculation.Ret returnType, long[]... selection) Selects rows and columns in the Matrix and returns a link to it.final Matrix
select
(Calculation.Ret returnType, String selection) Selects rows and columns in the Matrix and returns a link to it.final Matrix
select
(Calculation.Ret returnType, Collection<? extends Number>... selection) Selects rows and columns in the Matrix and returns a link to it.selectColumns
(Calculation.Ret returnType, long... columns) Selects columns in the Matrix and returns a link to it.final Matrix
selectColumns
(Calculation.Ret returnType, Collection<? extends Number> columns) Selects columns in the Matrix and returns a link to it.Iterable<long[]>
selectedCoordinates
(long[]... selection) Returns an Iterator that goes only over the Coordinates defined by the selection.Iterable<long[]>
selectedCoordinates
(String selection) Returns an Iterator that goes only over the Coordinates defined by the selection.selectRows
(Calculation.Ret returnType, long... rows) Selects rows in the Matrix and returns a link to it.final Matrix
selectRows
(Calculation.Ret returnType, Collection<? extends Number> rows) Selects rows in the Matrix and returns a link to it.void
setAsBigDecimal
(BigDecimal value, long... coordinates) void
setAsBigInteger
(BigInteger value, long... coordinates) void
setAsBoolean
(boolean value, long... coordinates) Sets an entry in the matrix to a boolean value.void
setAsByte
(byte value, long... coordinates) Sets an entry in the matrix to a byte value.void
setAsByteArray
(byte[] value, long... coordinates) Sets an entry in the matrix to a byte array.void
setAsChar
(char value, long... coordinates) Sets an entry in the matrix to a char value.void
Sets an entry in the matrix to a Date value.void
setAsDouble
(double v, long... coordinates) Sets an entry in the matrix to a double value.void
setAsFloat
(float value, long... coordinates) Sets an entry in the matrix to a float value.void
setAsInt
(int value, long... coordinates) Sets an entry in the matrix to an int value.void
setAsLong
(long value, long... coordinates) Sets an entry in the matrix to a long value.void
setAsMatrix
(Matrix m, long... coordinates) void
setAsShort
(short value, long... coordinates) Sets an entry in the matrix to a short value.void
setAsString
(String string, long... coordinates) Sets an entry in the matrix to a String value.final void
setColumnLabel
(long col, Object label) final Matrix
setContent
(Calculation.Ret returnType, Matrix newContent, long... position) final void
setDescription
(String description) final void
setDimensionLabel
(int dimension, Object label) final void
setDimensionMetaData
(int dimension, Object label, long... position) final void
Sets the id of an objectvoid
Sets the label of an objectfinal void
setMetaData
(String key, Object value) final void
setMetaData
(MapMatrix<String, Object> metaData) void
setMetaDataDimensionMatrix
(int dimension, Matrix matrix) final void
setRowLabel
(long row, Object label) void
setSize
(long... size) Sets the size of the matrix.final void
share
(int port) final void
final JFrame
showGUI()
This method will show the object in a JFrame on the screen.final Matrix
shuffle
(Calculation.Ret returnType) final Matrix
sign
(Calculation.Ret returnType) Calculates the sign of the entries in a Matrix.sin
(Calculation.Ret returnType) Calculates the sinus of all entries in the matrix.sinh
(Calculation.Ret returnType) Calculates the hyperbolic sinus of all entries in the matrix.Solve A*X = BSolve A*X = BSolve A*X = Bfinal Matrix
sortrows
(Calculation.Ret returnType, long column, boolean reverse) final Matrix
sqrt
(Calculation.Ret returnType) Calculates the square root of all the entries in a Matrix.final Matrix
squeeze
(Calculation.Ret returnType) standardize
(Calculation.Ret returnType, int dimension) Subtracts the mean from the matrix and divides by the standard deviation.std
(Calculation.Ret returnType, int dimension, boolean ignoreNaN, boolean besselsCorrection) Calculates the standard deviation of all entries in the Matrix either per row, per column, or global.stem
(Calculation.Ret ret) final String
final Matrix
subMatrix
(Calculation.Ret returnType, long... startAndEndCoordinates) final Matrix
sum
(Calculation.Ret returnType, int dimension, boolean ignoreNaN) Calculates the sum of all entries in the Matrix either per row, per column, or global.Matrix[]
svd()
Calculates the singular value decomposition of the matrix: A = U*S*V'final Matrix[]
svd
(int k) Calculates a low rank approximation of the singular value decomposition of the matrix: A = U*S*V' but considers only the k largest singular values.swap
(Calculation.Ret returnType, int dimension, long pos1, long pos2) tan
(Calculation.Ret returnType) Calculates the tangens of all entries in the matrix.tanh()
tanh
(Calculation.Ret returnType) Calculates the hyperbolic tangens of all entries in the matrix.tfIdf
(boolean calculateTf, boolean calculateIdf, boolean normalize) times
(double factor) Multiplies every entry in the matrix with a scalar.times
(Calculation.Ret returnType, boolean ignoreNaN, double factor) Multiplies every entry in the matrix with a scalar.times
(Calculation.Ret returnType, boolean ignoreNaN, Matrix factor) Multiplies every entry in the matrix with the entries of another Matrix.Calculates the entrywise product of the two matrices.BigDecimal[][]
final BaseBigDecimalMatrix
BigInteger[][]
final BigIntegerMatrix
boolean[][]
Converts the content of a matrix into a 2-dimensional array of boolean values.final BooleanMatrix
byte[][]
Converts the content of a matrix into a 2-dimensional array of byte values.final ByteMatrix
char[][]
Converts the content of a matrix into a 2-dimensional array of char values.final CharMatrix
final Matrix
toColumnVector
(Calculation.Ret returnType) Date[][]
Converts the content of a matrix into a 2-dimensional array of Date values.double[][]
Converts the content of a matrix into a 2-dimensional array of double values.final DoubleMatrix
float[][]
Converts the content of a matrix into a 2-dimensional array of float values.final FloatMatrix
toHtml()
int[][]
Converts the content of a matrix into a 2-dimensional array of int values.final IntMatrix
ListMatrix<?>
long[][]
Converts the content of a matrix into a 2-dimensional array of long values.final LongMatrix
MapMatrix<?,
?> Object[][]
Converts the content of a matrix into a 2-dimensional array of Objects.final ObjectMatrix
final Matrix
toRowVector
(Calculation.Ret returnType) SetMatrix<?>
short[][]
Converts the content of a matrix into a 2-dimensional array of short values.final ShortMatrix
toString()
String[][]
Converts the content of a matrix into a 2-dimensional array of Strings.final StringMatrix
final double
trace()
translate
(Calculation.Ret returnType, String sourceLanguage, String targetLanguage) Returns the transpose of the Matrix, where rows and columns are exchanged.transpose
(Calculation.Ret returnType) Returns the transpose of the Matrix, where rows and columns are exchanged.transpose
(Calculation.Ret returnType, int dimension1, int dimension2) tril
(Calculation.Ret returnType, int k) triu
(Calculation.Ret returnType, int k) unique
(Calculation.Ret returnType) uniqueValueCount
(Calculation.Ret returnType, int dimension) upperCase
(Calculation.Ret returnType) var
(Calculation.Ret returnType, int dimension, boolean ignoreNaN, boolean besselsCorrection) Calculates the variance of all entries in the Matrix either per row, per column, or global.final Matrix
xor
(Calculation.Ret returnType, boolean value) final Matrix
xor
(Calculation.Ret returnType, Matrix matrix) final Matrix
zeros
(Calculation.Ret ret) Returns a matrix with equal size, where all entries are set to zero.Methods inherited from class java.lang.Number
byteValue, shortValue
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ujmp.core.interfaces.BaseMatrixProperties
isSparse
Methods inherited from interface org.ujmp.core.interfaces.CoordinateFunctions
availableCoordinates, containsCoordinates
Methods inherited from interface org.ujmp.core.interfaces.ExtendedMatrixProperties
byteValue, shortValue
Methods inherited from interface org.ujmp.core.interfaces.GettersAndSetters
getAsObject, setAsObject
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
runningId
private static long runningId -
guiObject
-
size
protected long[] size -
id
private final long id -
metaData
-
-
Constructor Details
-
AbstractMatrix
protected AbstractMatrix(long[] size)
-
-
Method Details
-
getRowList
- Specified by:
getRowList
in interfaceBaseMatrixProperties
-
getColumnList
- Specified by:
getColumnList
in interfaceBaseMatrixProperties
-
getFactory
- Specified by:
getFactory
in interfaceBaseMatrix
-
allCoordinates
Description copied from interface:CoordinateFunctions
Returns an Iterator that goes over all coordinates in the Matrix. It goes from 0,0 to the size of the Matrix.- Specified by:
allCoordinates
in interfaceCoordinateFunctions
- Returns:
- Iterable over all coordinates within a Matrix.
-
getCoreObjectId
public final long getCoreObjectId()- Specified by:
getCoreObjectId
in interfaceCoreObject
-
getAsDouble
public double getAsDouble(long... coordinates) Description copied from interface:GettersAndSetters
Returns a double representation of an entry in the matrix. The stored value will be converted to a double as good as possible.- Specified by:
getAsDouble
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a double representation of the entry @
-
setAsDouble
public void setAsDouble(double v, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a double value. If the matrix cannot store double values, the value will be represented as good as possible.- Specified by:
setAsDouble
in interfaceGettersAndSetters
- Parameters:
v
- double valuecoordinates
- location of the entry @
-
getPreferredObject
Description copied from interface:GettersAndSetters
Returns a representation of the entry in the matrix that reflects the true object best. E.g. if the entry is a String "-5.3", this method returns a double with the equivalent value. For a String "text" the string itself is returned.- Specified by:
getPreferredObject
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- object that represents the matrix entry best @
-
getValueType
- Specified by:
getValueType
in interfaceBaseMatrixProperties
-
getMetaDataDimensionMatrix
- Specified by:
getMetaDataDimensionMatrix
in interfaceHasMetaData
-
getDimensionMetaData
- Specified by:
getDimensionMetaData
in interfaceHasMetaData
-
setMetaDataDimensionMatrix
- Specified by:
setMetaDataDimensionMatrix
in interfaceHasMetaData
-
getDimensionLabel
- Specified by:
getDimensionLabel
in interfaceHasMetaData
-
setDimensionMetaData
- Specified by:
setDimensionMetaData
in interfaceHasMetaData
-
setDimensionLabel
- Specified by:
setDimensionLabel
in interfaceHasMetaData
-
getGUIObject
Description copied from interface:HasGUIObject
Returns an object suitable for displaying on the screen. Ensures that, for each basic object, only one GUIObject can be returned.- Specified by:
getGUIObject
in interfaceHasGUIObject
- Returns:
- object suitable for displaying on the screen
-
containsMissingValues
public final boolean containsMissingValues()- Specified by:
containsMissingValues
in interfaceExtendedMatrixProperties
-
getDimensionCount
public int getDimensionCount()- Specified by:
getDimensionCount
in interfaceBaseMatrixProperties
-
getEuklideanValue
public final double getEuklideanValue()- Specified by:
getEuklideanValue
in interfaceExtendedMatrixProperties
-
clone
-
select
Description copied from interface:ObjectCalculations
Selects rows and columns in the Matrix and returns a link to it.- Specified by:
select
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.selection
- selected rows and columns- Returns:
- Link to original Matrix with desired rows and columns @
-
save
- Specified by:
save
in interfaceMatrix
- Throws:
IOException
-
save
- Specified by:
save
in interfaceMatrix
- Throws:
IOException
-
select
Description copied from interface:ObjectCalculations
Selects rows and columns in the Matrix and returns a link to it.- Specified by:
select
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.selection
- selected rows and columns- Returns:
- Link to original Matrix with desired rows and columns @
-
selectRows
Description copied from interface:ObjectCalculations
Selects rows in the Matrix and returns a link to it.- Specified by:
selectRows
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.rows
- selected rows- Returns:
- Link to original Matrix with desired rows @
-
select
Description copied from interface:ObjectCalculations
Selects rows and columns in the Matrix and returns a link to it. Selections can be made in Matlab/Octave style or similar, e.g. "1,2,5-6,8:5;*". Dimensions are separated by ';'. Selections in one dimension are separated by spaces or ','. Ranges are selected using '-' or ':'. A whole dimension can be selected with '*'.- Specified by:
select
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.selection
- String defining the selection- Returns:
- Link to original Matrix with desired rows and columns @
-
selectColumns
Description copied from interface:ObjectCalculations
Selects columns in the Matrix and returns a link to it.- Specified by:
selectColumns
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.- Returns:
- Link to original Matrix with desired columns @
-
selectRows
Description copied from interface:ObjectCalculations
Selects rows in the Matrix and returns a link to it.- Specified by:
selectRows
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.rows
- selected rows- Returns:
- Link to original Matrix with desired rows @
-
selectColumns
Description copied from interface:ObjectCalculations
Selects columns in the Matrix and returns a link to it.- Specified by:
selectColumns
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.columns
- selected columns- Returns:
- Link to original Matrix with desired columns @
-
impute
public Matrix impute(Calculation.Ret returnType, Impute.ImputationMethod method, Object... parameters) Description copied from interface:MissingValueDoubleCalculations
Replaces missing values with various methods- Specified by:
impute
in interfaceMissingValueDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixmethod
- the imputation method to useparameters
- specify a set of parameters if needed- Returns:
- Matrix with missing values replaced @
-
discretize
public Matrix discretize(Calculation.Ret returnType, int dimension, Discretize.DiscretizationMethod method, int numberOfBins) - Specified by:
discretize
in interfaceDiscretizeCalculations
-
discretize
- Specified by:
discretize
in interfaceDiscretizeCalculations
-
discretizeToBoolean
- Specified by:
discretizeToBoolean
in interfaceDiscretizeCalculations
-
indexOfMax
Description copied from interface:StatisticalDoubleCalculations
Finds the index of the maximum value in the matrix- Specified by:
indexOfMax
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculate- Returns:
- Matrix containing the coordinates of the Maximum
-
indexOfMin
Description copied from interface:StatisticalDoubleCalculations
Finds the index of the minimum value in the matrix- Specified by:
indexOfMin
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculate- Returns:
- Matrix containing the coordinates of the Minimum
-
standardize
Description copied from interface:MiscGeneralDoubleCalculations
Subtracts the mean from the matrix and divides by the standard deviation.- Specified by:
standardize
in interfaceMiscGeneralDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculate- Returns:
- Matrix with zero mean and unit variance.
-
normalize
- Specified by:
normalize
in interfaceMiscGeneralDoubleCalculations
-
atimes
Description copied from interface:BasicDoubleCalculations
Performs an averaging matrix multiplication on the two matrices. The matrices must be 2-dimensional and have the correct size.- Specified by:
atimes
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredmatrix
- the second matrix- Returns:
- Matrix product
-
inv
Description copied from interface:DecompositionDoubleCalculations
Calculates the inverse of the Matrix using either LUDecomposition (for square matrices) or QRDecomposition (otherwise).- Specified by:
inv
in interfaceDecompositionDoubleCalculations
- Returns:
- Inverse of the matrix
-
invSymm
Description copied from interface:DecompositionDoubleCalculations
Calculates the inverse of the Matrix using either LUDecomposition (for square matrices) or QRDecomposition (otherwise).- Specified by:
invSymm
in interfaceDecompositionDoubleCalculations
- Returns:
- Inverse of the matrix
-
invSPD
Description copied from interface:DecompositionDoubleCalculations
Calculates the inverse of a symmetric positive definite Matrix using Cholesky Decomposition.- Specified by:
invSPD
in interfaceDecompositionDoubleCalculations
- Returns:
- Inverse of the matrix
-
solve
Description copied from interface:DecompositionDoubleCalculations
Solve A*X = B- Specified by:
solve
in interfaceDecompositionDoubleCalculations
- Parameters:
b
- right hand side- Returns:
- solution for X if A is square, least squares solution otherwise
-
solveSymm
Description copied from interface:DecompositionDoubleCalculations
Solve A*X = B- Specified by:
solveSymm
in interfaceDecompositionDoubleCalculations
- Parameters:
b
- right hand side- Returns:
- solution for X if A is square, least squares solution otherwise
-
solveSPD
Description copied from interface:DecompositionDoubleCalculations
Solve A*X = B- Specified by:
solveSPD
in interfaceDecompositionDoubleCalculations
- Parameters:
b
- right hand side- Returns:
- solution for X if A is square, least squares solution otherwise
-
ginv
Description copied from interface:DecompositionDoubleCalculations
Calculates a generalized inverse of the Matrix- Specified by:
ginv
in interfaceDecompositionDoubleCalculations
- Returns:
- Pseudo inverse of the Matrix
-
princomp
Description copied from interface:DecompositionDoubleCalculations
Projects the matrix into the space of the principal components.- Specified by:
princomp
in interfaceDecompositionDoubleCalculations
- Returns:
- Matrix projected on principal components.
-
pinv
Description copied from interface:DecompositionDoubleCalculations
Calculates the pseudo inverse of the Matrix using Singular Value Decomposition.- Specified by:
pinv
in interfaceDecompositionDoubleCalculations
- Returns:
- Pseudo inverse of the Matrix
-
pinv
Description copied from interface:DecompositionDoubleCalculations
Calculates the pseudo inverse of the Matrix using a low rank approximation of the Singular Value Decomposition. Considers only the k largest singular values. This speeds up processing for large matrices.- Specified by:
pinv
in interfaceDecompositionDoubleCalculations
- Parameters:
k
- number of singular values to consider- Returns:
- Pseudo inverse of the Matrix
-
center
Description copied from interface:MiscGeneralDoubleCalculations
Subtracts the mean from the matrix.- Specified by:
center
in interfaceMiscGeneralDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculateignoreNaN
- should missing values be ignored- Returns:
- Matrix with zero mean.
-
isResizable
public boolean isResizable()- Specified by:
isResizable
in interfaceBaseMatrixProperties
-
convert
Description copied from interface:ObjectCalculations
Creates a copy of the matrix with the desired type for matrix entries.- Specified by:
convert
in interfaceObjectCalculations
- Parameters:
newValueType
- defines the new format of the matrix- Returns:
- Matrix with the same entries in the new format
-
replaceRegex
Description copied from interface:StringCalculations
Replaces matching text in every entry of the matrix.- Specified by:
replaceRegex
in interfaceStringCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixsearch
- Regular expression pattern to search forreplacement
- Replacement String- Returns:
- matrix with modified entries
-
replace
Description copied from interface:ObjectCalculations
Replaces matching values in the matrix with another value- Specified by:
replace
in interfaceObjectCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixsearch
- Object to search forreplacement
- Object used to replace the original value- Returns:
- matrix with modified entries @
-
replaceRegex
Description copied from interface:StringCalculations
Replaces matching text in every entry of the matrix.- Specified by:
replaceRegex
in interfaceStringCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixsearch
- Regular expression to search forreplacement
- Replacement String- Returns:
- matrix with modified entries
-
times
Description copied from interface:BasicDoubleCalculations
Multiplies every entry in the matrix with a scalar.- Specified by:
times
in interfaceBasicDoubleCalculations
- Parameters:
factor
- factor to multiply with- Returns:
- Matrix with all entries multiplied by a factor.
-
tanh
- Specified by:
tanh
in interfaceHyperbolicDoubleCalculations
-
times
Description copied from interface:BasicDoubleCalculations
Calculates the entrywise product of the two matrices.- Specified by:
times
in interfaceBasicDoubleCalculations
- Parameters:
m
- the second matrix- Returns:
- matrix with product of all entries
-
divide
Description copied from interface:BasicDoubleCalculations
Calculates an entrywise division of the two matrices.- Specified by:
divide
in interfaceBasicDoubleCalculations
- Parameters:
m
- the second matrix- Returns:
- matrix with all entries divided by the second matrix's entry.
-
divide
Description copied from interface:BasicDoubleCalculations
Divides every entry in the matrix by a scalar.- Specified by:
divide
in interfaceBasicDoubleCalculations
- Parameters:
divisor
- factor by which to divide- Returns:
- Matrix with all entries divided by a factor.
-
divide
Description copied from interface:BasicDoubleCalculations
Divides every entry in the matrix by a scalar.- Specified by:
divide
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredfactor
- factor by which to divide- Returns:
- Matrix with all entries divided by a factor.
-
times
Description copied from interface:BasicDoubleCalculations
Multiplies every entry in the matrix with a scalar.- Specified by:
times
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredfactor
- factor to multiply with- Returns:
- Matrix with all entries multiplied by a factor.
-
times
Description copied from interface:BasicDoubleCalculations
Multiplies every entry in the matrix with the entries of another Matrix.- Specified by:
times
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredfactor
- factor to multiply with- Returns:
- Matrix with all entries multiplied by a factor.
-
divide
Description copied from interface:BasicDoubleCalculations
Divides every entry in the matrix by the entries of another matrix.- Specified by:
divide
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredfactor
- factor by which to divide- Returns:
- Matrix with all entries divided by a factor.
-
power
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates this matrix to the power of the given value (entrywise).- Specified by:
power
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with all entries to the power of factor.
-
power
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates this matrix to the power of the given matrix (entrywise).- Specified by:
power
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- matrix with all entries to the power of the second matrix's entry.
-
gt
- Specified by:
gt
in interfaceBooleanCalculations
-
gt
- Specified by:
gt
in interfaceBooleanCalculations
-
and
- Specified by:
and
in interfaceBooleanCalculations
-
and
- Specified by:
and
in interfaceBooleanCalculations
-
or
- Specified by:
or
in interfaceBooleanCalculations
-
or
- Specified by:
or
in interfaceBooleanCalculations
-
xor
- Specified by:
xor
in interfaceBooleanCalculations
-
xor
- Specified by:
xor
in interfaceBooleanCalculations
-
not
- Specified by:
not
in interfaceBooleanCalculations
-
lt
- Specified by:
lt
in interfaceBooleanCalculations
-
lt
- Specified by:
lt
in interfaceBooleanCalculations
-
ge
- Specified by:
ge
in interfaceBooleanCalculations
-
ge
- Specified by:
ge
in interfaceBooleanCalculations
-
le
- Specified by:
le
in interfaceBooleanCalculations
-
le
- Specified by:
le
in interfaceBooleanCalculations
-
eq
- Specified by:
eq
in interfaceBooleanCalculations
-
eq
- Specified by:
eq
in interfaceBooleanCalculations
-
ne
- Specified by:
ne
in interfaceBooleanCalculations
-
ne
- Specified by:
ne
in interfaceBooleanCalculations
-
getValueCount
public long getValueCount()- Specified by:
getValueCount
in interfaceBaseMatrixProperties
-
getCoordinatesOfMaximum
public final long[] getCoordinatesOfMaximum()Description copied from interface:CoordinateFunctions
Returns the position of the maximum value in a Matrix. If there is more than one equal maximum values, the first that is found is returned (not necessarily with the lowest coordinates). If no maximum can be found (because there are no numbers in the matrix or all numbers are NaN), the coordinates -1,-1 are returned.- Specified by:
getCoordinatesOfMaximum
in interfaceCoordinateFunctions
- Returns:
- Coordinates of the maximum value @
-
getCoordinatesOfMinimum
public final long[] getCoordinatesOfMinimum()Description copied from interface:CoordinateFunctions
Returns the position of the minimum value in a Matrix. If there is more than one equal minimum values, the first that is found is returned (not necessarily with the lowest coordinates). If no minimum can be found (because there are no numbers in the matrix or all numbers are NaN), the coordinates -1,-1 are returned.- Specified by:
getCoordinatesOfMinimum
in interfaceCoordinateFunctions
- Returns:
- Coordinates of the minimum value @
-
selectedCoordinates
Description copied from interface:CoordinateFunctions
Returns an Iterator that goes only over the Coordinates defined by the selection. The selection is a Matlab/Octave style String, to define what rows or columns should be considered. E.g. "(2:5,[1,3,5,7:9])" to select rows 2 to 5 and the columns 1, 3, 5, 7, 8 and 9. Note that, in UJMP numbering starts at 0 unlike in Matlab and Octave- Specified by:
selectedCoordinates
in interfaceCoordinateFunctions
- Parameters:
selection
- The String defining the selection of rows or columns- Returns:
- Iterable over the desired Coordinates
-
selectedCoordinates
Description copied from interface:CoordinateFunctions
Returns an Iterator that goes only over the Coordinates defined by the selection. The selections consists of a list of long arrays, one for each dimension. The first array contains the row numbers that should be selected, the second the column numbers, and so on.- Specified by:
selectedCoordinates
in interfaceCoordinateFunctions
- Parameters:
selection
- A list of long arrays defining the desired rows or columns- Returns:
- Iterable over the desired Coordinates @
-
isTransient
public boolean isTransient()- Specified by:
isTransient
in interfaceBaseMatrixProperties
-
nonZeroCoordinates
- Specified by:
nonZeroCoordinates
in interfaceCoordinateFunctions
-
toDoubleArray
public double[][] toDoubleArray()Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of double values.- Specified by:
toDoubleArray
in interfaceGettersAndSetters
- Returns:
- double array with matrix entries @
-
toObjectArray
Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of Objects.- Specified by:
toObjectArray
in interfaceGettersAndSetters
- Returns:
- Object array with matrix entries @
-
toIntArray
public int[][] toIntArray()Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of int values.- Specified by:
toIntArray
in interfaceGettersAndSetters
- Returns:
- int array with matrix entries @
-
toLongArray
public long[][] toLongArray()Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of long values.- Specified by:
toLongArray
in interfaceGettersAndSetters
- Returns:
- long array with matrix entries @
-
toShortArray
public short[][] toShortArray()Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of short values.- Specified by:
toShortArray
in interfaceGettersAndSetters
- Returns:
- short array with matrix entries @
-
toCharArray
public char[][] toCharArray()Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of char values.- Specified by:
toCharArray
in interfaceGettersAndSetters
- Returns:
- char array with matrix entries @
-
toStringArray
Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of Strings.- Specified by:
toStringArray
in interfaceGettersAndSetters
- Returns:
- String array with matrix entries @
-
toByteArray
public byte[][] toByteArray()Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of byte values.- Specified by:
toByteArray
in interfaceGettersAndSetters
- Returns:
- byte array with matrix entries @
-
toBooleanArray
public boolean[][] toBooleanArray()Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of boolean values.- Specified by:
toBooleanArray
in interfaceGettersAndSetters
- Returns:
- boolean array with matrix entries @
-
toFloatArray
public float[][] toFloatArray()Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of float values.- Specified by:
toFloatArray
in interfaceGettersAndSetters
- Returns:
- float array with matrix entries @
-
toDateArray
Description copied from interface:GettersAndSetters
Converts the content of a matrix into a 2-dimensional array of Date values.- Specified by:
toDateArray
in interfaceGettersAndSetters
- Returns:
- Date array with matrix entries @
-
toBigDecimalArray
- Specified by:
toBigDecimalArray
in interfaceGettersAndSetters
-
toBigIntegerArray
- Specified by:
toBigIntegerArray
in interfaceGettersAndSetters
-
sqrt
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates the square root of all the entries in a Matrix.- Specified by:
sqrt
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix containing the square roots of all entries
-
round
Description copied from interface:RoundingDoubleCalculations
Returns a matrix with all entries rounded to integer values.- Specified by:
round
in interfaceRoundingDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with rounded values
-
ceil
Description copied from interface:RoundingDoubleCalculations
Returns a matrix with all entries rounded up to the next integer. The result is a new Matrix.- Specified by:
ceil
in interfaceRoundingDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with rounded values
-
extractAnnotation
Description copied from interface:ObjectCalculations
Generates annotation such as row or column labels from the content of this matrix. This is useful for example for data imported from CSV files with labels in the first line.- Specified by:
extractAnnotation
in interfaceObjectCalculations
- Parameters:
returnType
- Specify whether to return a new matrix, or a linkdimension
- Which axis should be shortened to extract the labels. E.g. if you want column labels, you must specifyMatrix.ROW
, which does not seem very intuitive at first glance. However, if you're dealing with multi-dimensional data, this becomes more clear. If you want annotation generated for all dimensions, you can specifyMatrix.ALL
or omit the dimensions parameter.- Returns:
- new Matrix with annotation generated from content. @
-
includeAnnotation
- Specified by:
includeAnnotation
in interfaceObjectCalculations
-
floor
Description copied from interface:RoundingDoubleCalculations
Returns a matrix with all entries rounded down to the next integer. The result is a new Matrix.- Specified by:
floor
in interfaceRoundingDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with rounded values
-
showGUI
Description copied from interface:HasGUIObject
This method will show the object in a JFrame on the screen.- Specified by:
showGUI
in interfaceHasGUIObject
-
fireValueChanged
public void fireValueChanged()Description copied from interface:HasGUIObject
This method is used to signal changes in the object to the corresponding GUIObject if it exists.Maybe this method can be deleted, when all changes are made trough the GUIObject?
- Specified by:
fireValueChanged
in interfaceHasGUIObject
- Specified by:
fireValueChanged
in interfaceMatrix
-
fireValueChanged
- Specified by:
fireValueChanged
in interfaceMatrix
-
fireValueChanged
- Specified by:
fireValueChanged
in interfaceMatrix
-
mtimes
Description copied from interface:BasicDoubleCalculations
Performs a matrix multiplication on the two matrices. The matrices must be 2-dimensional and have the correct size.- Specified by:
mtimes
in interfaceBasicDoubleCalculations
- Parameters:
matrix
- the second matrix- Returns:
- Matrix product
-
mtimes
Description copied from interface:BasicDoubleCalculations
Performs a matrix multiplication on the two matrices. The matrices must be 2-dimensional and have the correct size.- Specified by:
mtimes
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredmatrix
- the second matrix- Returns:
- Matrix product
-
getAsBoolean
public boolean getAsBoolean(long... coordinates) Description copied from interface:GettersAndSetters
Returns a byte representation of an entry in the matrix. The stored value will be converted to a boolean as good as possible.- Specified by:
getAsBoolean
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a boolean representation of the entry @
-
setAsBoolean
public void setAsBoolean(boolean value, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a boolean value. If the matrix cannot store byte values, the value will be represented as good as possible.- Specified by:
setAsBoolean
in interfaceGettersAndSetters
- Parameters:
value
- boolean valuecoordinates
- location of the entry @
-
getAsInt
public int getAsInt(long... coordinates) Description copied from interface:GettersAndSetters
Returns an int representation of an entry in the matrix. The stored value will be converted to an int as good as possible.- Specified by:
getAsInt
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- an int representation of the entry @
-
setAsInt
public void setAsInt(int value, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to an int value. If the matrix cannot store int values, the value will be represented as good as possible.- Specified by:
setAsInt
in interfaceGettersAndSetters
- Parameters:
value
- int valuecoordinates
- location of the entry @
-
getAsByte
public byte getAsByte(long... coordinates) Description copied from interface:GettersAndSetters
Returns a byte representation of an entry in the matrix. The stored value will be converted to a byte as good as possible.- Specified by:
getAsByte
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a byte representation of the entry @
-
getAsByteArray
public byte[] getAsByteArray(long... coordinates) Description copied from interface:GettersAndSetters
Returns a byte array representation of an entry in the matrix. The stored value will be converted to a byte array as good as possible.- Specified by:
getAsByteArray
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a byte array representation of the entry @
-
setAsByteArray
public void setAsByteArray(byte[] value, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a byte array. If the matrix cannot store byte array, the value will be represented as good as possible.- Specified by:
setAsByteArray
in interfaceGettersAndSetters
- Parameters:
value
- byte arraycoordinates
- location of the entry @
-
setAsByte
public void setAsByte(byte value, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a byte value. If the matrix cannot store byte values, the value will be represented as good as possible.- Specified by:
setAsByte
in interfaceGettersAndSetters
- Parameters:
value
- byte valuecoordinates
- location of the entry @
-
getAsChar
public char getAsChar(long... coordinates) Description copied from interface:GettersAndSetters
Returns a char representation of an entry in the matrix. The stored value will be converted to a char as good as possible.- Specified by:
getAsChar
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a char representation of the entry @
-
getAsBigInteger
- Specified by:
getAsBigInteger
in interfaceGettersAndSetters
-
getAsBigDecimal
- Specified by:
getAsBigDecimal
in interfaceGettersAndSetters
-
setAsChar
public void setAsChar(char value, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a char value. If the matrix cannot store char values, the value will be represented as good as possible.- Specified by:
setAsChar
in interfaceGettersAndSetters
- Parameters:
value
- char valuecoordinates
- location of the entry @
-
setAsBigDecimal
- Specified by:
setAsBigDecimal
in interfaceGettersAndSetters
-
setAsBigInteger
- Specified by:
setAsBigInteger
in interfaceGettersAndSetters
-
getAsFloat
public float getAsFloat(long... coordinates) Description copied from interface:GettersAndSetters
Returns a float representation of an entry in the matrix. The stored value will be converted to a float as good as possible.- Specified by:
getAsFloat
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a float representation of the entry @
-
setAsFloat
public void setAsFloat(float value, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a float value. If the matrix cannot store float values, the value will be represented as good as possible.- Specified by:
setAsFloat
in interfaceGettersAndSetters
- Parameters:
value
- float valuecoordinates
- location of the entry @
-
getAsShort
public short getAsShort(long... coordinates) Description copied from interface:GettersAndSetters
Returns a short representation of an entry in the matrix. The stored value will be converted to a short as good as possible.- Specified by:
getAsShort
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a short representation of the entry @
-
getAsMatrix
- Specified by:
getAsMatrix
in interfaceGettersAndSetters
-
setAsMatrix
- Specified by:
setAsMatrix
in interfaceGettersAndSetters
-
setAsShort
public void setAsShort(short value, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a short value. If the matrix cannot store short values, the value will be represented as good as possible.- Specified by:
setAsShort
in interfaceGettersAndSetters
- Parameters:
value
- short valuecoordinates
- location of the entry @
-
getAsLong
public long getAsLong(long... coordinates) Description copied from interface:GettersAndSetters
Returns a long representation of an entry in the matrix. The stored value will be converted to a long as good as possible.- Specified by:
getAsLong
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a long representation of the entry @
-
setAsLong
public void setAsLong(long value, long... coordinates) Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a long value. If the matrix cannot store long values, the value will be represented as good as possible.- Specified by:
setAsLong
in interfaceGettersAndSetters
- Parameters:
value
- long valuecoordinates
- location of the entry @
-
getAsDate
Description copied from interface:GettersAndSetters
Returns a Date representation of an entry in the matrix. The stored value will be converted to a Date object as good as possible.- Specified by:
getAsDate
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a String representation of the entry @
-
setAsDate
Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a Date value. If the matrix cannot store Date objects, the value will be represented as good as possible.- Specified by:
setAsDate
in interfaceGettersAndSetters
coordinates
- location of the entry @
-
delete
Description copied from interface:ObjectCalculations
Deletes rows and columns in the Matrix and returns a link to it. Selections can be made in Matlab/Octave style or similar, e.g. "1,2,5-6,8:5;*". Dimensions are separated by ';'. Selections in one dimension are separated by spaces or ','. Ranges are selected using '-' or ':'. A whole dimension can be selected with '*'.- Specified by:
delete
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.- Returns:
- Link to original Matrix with desired rows and columns deleted @
-
delete
Description copied from interface:ObjectCalculations
Delete rows and columns in the Matrix and returns a link to it.- Specified by:
delete
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.selection
- selected rows and columns- Returns:
- Link to original Matrix with desired rows and columns @
-
delete
Description copied from interface:ObjectCalculations
Delete rows and columns in the Matrix and returns a link to it.- Specified by:
delete
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.selection
- selected rows and columns- Returns:
- Link to original Matrix with desired rows and columns @
-
deleteRows
Description copied from interface:ObjectCalculations
Deletes rows in the Matrix and returns a link to it.- Specified by:
deleteRows
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.rows
- selected rows- Returns:
- Link to original Matrix with desired rows @
-
deleteRows
Description copied from interface:ObjectCalculations
Deletes rows in the Matrix and returns a link to it.- Specified by:
deleteRows
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.rows
- selected rows- Returns:
- Link to original Matrix with desired rows @
-
deleteColumns
Description copied from interface:ObjectCalculations
Deletes columns in the Matrix and returns a link to it.- Specified by:
deleteColumns
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.columns
- selected columns- Returns:
- Link to original Matrix with desired columns @
-
deleteColumns
Description copied from interface:ObjectCalculations
Deletes columns in the Matrix and returns a link to it.- Specified by:
deleteColumns
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.- Returns:
- Link to original Matrix with desired columns @
-
minus
Description copied from interface:BasicDoubleCalculations
Subtracts a specified value from all entries in the matrix.- Specified by:
minus
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredv
- the value to subtract- Returns:
- Matrix with the entries minus the value
-
minus
Description copied from interface:BasicDoubleCalculations
Calculates the difference of the entries in both matrices- Specified by:
minus
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredm
- The matrix to subtract- Returns:
- matrix with difference values
-
plus
Description copied from interface:BasicDoubleCalculations
Adds a specified value from all entries in the matrix.- Specified by:
plus
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredv
- the value to subtract- Returns:
- Matrix with the entries plus the value
-
plus
Description copied from interface:BasicDoubleCalculations
Calculates the sum of the entries in both matrices- Specified by:
plus
in interfaceBasicDoubleCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.ignoreNaN
- should missing values be ignoredm
- The matrix to subtract- Returns:
- matrix with sum values
-
transpose
Description copied from interface:ObjectCalculations
Returns the transpose of the Matrix, where rows and columns are exchanged. This works also if the Matrix has more than two dimensions.- Specified by:
transpose
in interfaceObjectCalculations
- Returns:
- transposed Matrix.
-
transpose
Description copied from interface:ObjectCalculations
Returns the transpose of the Matrix, where rows and columns are exchanged. This works also if the Matrix has more than two dimensions.- Specified by:
transpose
in interfaceObjectCalculations
- Parameters:
returnType
- Defines if a new Matrix or a link should be returned.- Returns:
- transposed Matrix.
-
diag
- Specified by:
diag
in interfaceObjectCalculations
-
mean
Description copied from interface:StatisticalDoubleCalculations
Calculates the mean of all entries in the Matrix either per row, per column, or global.- Specified by:
mean
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculateignoreNaN
- should missing values be ignored- Returns:
- Matrix with the sum of the values along the desired axis
-
var
public Matrix var(Calculation.Ret returnType, int dimension, boolean ignoreNaN, boolean besselsCorrection) Description copied from interface:StatisticalDoubleCalculations
Calculates the variance of all entries in the Matrix either per row, per column, or global.- Specified by:
var
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculateignoreNaN
- should missing values be ignoredbesselsCorrection
- use (n-1) instead of n- Returns:
- Matrix with the sum of the values along the desired axis
-
std
public Matrix std(Calculation.Ret returnType, int dimension, boolean ignoreNaN, boolean besselsCorrection) Description copied from interface:StatisticalDoubleCalculations
Calculates the standard deviation of all entries in the Matrix either per row, per column, or global.- Specified by:
std
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculateignoreNaN
- should missing values be ignoredbesselsCorrection
- use (n-1) instead of n- Returns:
- Matrix with the sum of the values along the desired axis
-
getColumnCount
public long getColumnCount()- Specified by:
getColumnCount
in interfaceBaseMatrixProperties
-
getRowCount
public long getRowCount()- Specified by:
getRowCount
in interfaceBaseMatrixProperties
-
getZCount
public long getZCount()- Specified by:
getZCount
in interfaceBaseMatrixProperties
-
getSize
public final long getSize(int dimension) - Specified by:
getSize
in interfaceBaseMatrixProperties
-
getSize
public long[] getSize()- Specified by:
getSize
in interfaceBaseMatrixProperties
-
prod
- Specified by:
prod
in interfaceStatisticalDoubleCalculations
-
diff
- Specified by:
diff
in interfaceStatisticalDoubleCalculations
-
sum
Description copied from interface:StatisticalDoubleCalculations
Calculates the sum of all entries in the Matrix either per row, per column, or global.- Specified by:
sum
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculateignoreNaN
- should missing values be ignored- Returns:
- Matrix with the sum of the values along the desired axis
-
sign
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates the sign of the entries in a Matrix. For values greater than zero, 1.0 is returned. Negative values will give -1.0 as return value. 0.0 is returned for entries equal to zero.- Specified by:
sign
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with signum values
-
toString
- Specified by:
toString
in interfaceBaseMatrixProperties
- Overrides:
toString
in classObject
-
toHtml
-
ones
Description copied from interface:CreatorDoubleCalculations
Returns a matrix with equal size, where all entries are set to 1.0.- Specified by:
ones
in interfaceCreatorDoubleCalculations
- Returns:
- Matrix with ones.
-
nans
Description copied from interface:CreatorDoubleCalculations
Returns a matrix with equal size, where all entries are set to Double.NaN.- Specified by:
nans
in interfaceCreatorDoubleCalculations
- Returns:
- Matrix with NaNs.
-
fill
Description copied from interface:ObjectCalculations
Returns a matrix with equal size, where all entries are set to a desired value.- Specified by:
fill
in interfaceObjectCalculations
value
- fill with this value- Returns:
- Matrix with ones.
-
zeros
Description copied from interface:CreatorDoubleCalculations
Returns a matrix with equal size, where all entries are set to zero.- Specified by:
zeros
in interfaceCreatorDoubleCalculations
- Returns:
- Matrix with zeros.
-
eye
Description copied from interface:CreatorDoubleCalculations
Returns a matrix with ones at the diagonal.- Specified by:
eye
in interfaceCreatorDoubleCalculations
- Returns:
- Eye matrix with ones at the diagonal
-
plus
Description copied from interface:BasicDoubleCalculations
Adds a specified value to all entries in the matrix.- Specified by:
plus
in interfaceBasicDoubleCalculations
- Parameters:
value
- the value to add- Returns:
- Matrix with the entries plus the value
-
plus
Description copied from interface:BasicDoubleCalculations
Calculates the sum of the entries in both matrices- Specified by:
plus
in interfaceBasicDoubleCalculations
- Parameters:
m
- The matrix to add- Returns:
- matrix with sum values
-
minus
Description copied from interface:BasicDoubleCalculations
Subtracts a specified value from all entries in the matrix.- Specified by:
minus
in interfaceBasicDoubleCalculations
- Parameters:
value
- the value to subtract- Returns:
- Matrix with the entries minus the value
-
minus
Description copied from interface:BasicDoubleCalculations
Calculates the difference of the entries in both matrices- Specified by:
minus
in interfaceBasicDoubleCalculations
- Parameters:
m
- The matrix to subtract- Returns:
- matrix with difference values
-
rand
Description copied from interface:CreatorDoubleCalculations
Returns a matrix with equal size, where all entries are set to uniform random values between 0.0 and 1.0.- Specified by:
rand
in interfaceCreatorDoubleCalculations
- Returns:
- Matrix with uniformly distributed values.
-
randn
Description copied from interface:CreatorDoubleCalculations
Returns a matrix with equal size, where all entries are set to random values which are normally distributed with 0.0 mean and 1.0 standard deviation.- Specified by:
randn
in interfaceCreatorDoubleCalculations
- Returns:
- Matrix with normally distributed values.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Matrix>
-
rank
public int rank()- Specified by:
rank
in interfaceExtendedMatrixProperties
-
isSPD
public final boolean isSPD()- Specified by:
isSPD
in interfaceExtendedMatrixProperties
-
isSymmetric
public final boolean isSymmetric()- Specified by:
isSymmetric
in interfaceBaseMatrixProperties
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceBaseMatrixProperties
-
abs
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates the absolute values of all entries in a Matrix. Positive values stay the same, negative values change sign.- Specified by:
abs
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- A new Matrix with absolute values.
-
log
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates the natural logarithm of all entries in the Matrix.- Specified by:
log
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with logarithm values.
-
setContent
- Specified by:
setContent
in interfaceExtendedMatrixProperties
-
exp
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates the exponential function for all entries in the Matrix.- Specified by:
exp
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with exp values.
-
logistic
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates the logistic function for all entries in the Matrix.- Specified by:
logistic
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with 1/(1+exp(-x)) values.
-
sortrows
- Specified by:
sortrows
in interfaceObjectCalculations
-
cumsum
- Specified by:
cumsum
in interfaceStatisticalDoubleCalculations
-
cumprod
- Specified by:
cumprod
in interfaceStatisticalDoubleCalculations
-
log2
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates the logarithm with basis 2 of all entries in the Matrix.- Specified by:
log2
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with logarithm values.
-
log10
Description copied from interface:BasicEntrywiseDoubleCalculations
Calculates the logarithm with basis 10 of all entries in the Matrix.- Specified by:
log10
in interfaceBasicEntrywiseDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with logarithm values.
-
isDiagonal
public final boolean isDiagonal()- Specified by:
isDiagonal
in interfaceBaseMatrixProperties
-
isSquare
public final boolean isSquare()- Specified by:
isSquare
in interfaceBaseMatrixProperties
-
euklideanDistanceTo
- Specified by:
euklideanDistanceTo
in interfaceDistanceMeasures
-
det
public double det()- Specified by:
det
in interfaceExtendedMatrixProperties
-
pdet
public double pdet()- Specified by:
pdet
in interfaceExtendedMatrixProperties
-
isSingular
public boolean isSingular()- Specified by:
isSingular
in interfaceBaseMatrixProperties
-
manhattenDistanceTo
- Specified by:
manhattenDistanceTo
in interfaceDistanceMeasures
-
manhattenDistance
- Specified by:
manhattenDistance
in interfaceDistanceMeasures
-
euklideanDistance
- Specified by:
euklideanDistance
in interfaceDistanceMeasures
-
minkowskiDistance
- Specified by:
minkowskiDistance
in interfaceDistanceMeasures
-
cosineSimilarity
- Specified by:
cosineSimilarity
in interfaceDistanceMeasures
-
cosineSimilarityTo
- Specified by:
cosineSimilarityTo
in interfaceDistanceMeasures
-
minkowskiDistanceTo
- Specified by:
minkowskiDistanceTo
in interfaceDistanceMeasures
-
chebyshevDistanceTo
- Specified by:
chebyshevDistanceTo
in interfaceDistanceMeasures
-
min
Description copied from interface:StatisticalDoubleCalculations
Calculates the mimimum of the values in the matrix either rowwise, columnwise, or global.- Specified by:
min
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- the axis along which should be calculated, e.g. ROW=0, COLUMN=1 or ALL- Returns:
- A new matrix containing the minimum values
-
max
Description copied from interface:StatisticalDoubleCalculations
Calculates the maximum of the values in the matrix either rowwise, columnwise, or global.- Specified by:
max
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- the axis along which should be calculated, e.g. ROW=0, COLUMN=1 or ALL- Returns:
- A new matrix containing the maximum values
-
addMissing
Description copied from interface:MissingValueDoubleCalculations
Adds a specified amount of missing values (Double.NaN) to the Matrix- Specified by:
addMissing
in interfaceMissingValueDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculatepercentMissing
- defines how many values are missing 0.0 to 1.0- Returns:
- Matrix with missing values @
-
countMissing
Description copied from interface:MissingValueDoubleCalculations
Counts the missing values within the matrix, i.e. Infinity or NaN- Specified by:
countMissing
in interfaceMissingValueDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrixdimension
- The axis along which to calculate- Returns:
- Matrix with counts of missing values @
-
isScalar
public final boolean isScalar()- Specified by:
isScalar
in interfaceBaseMatrixProperties
-
isRowVector
public final boolean isRowVector()- Specified by:
isRowVector
in interfaceBaseMatrixProperties
-
isColumnVector
public final boolean isColumnVector()- Specified by:
isColumnVector
in interfaceBaseMatrixProperties
-
isMultidimensionalMatrix
public final boolean isMultidimensionalMatrix()- Specified by:
isMultidimensionalMatrix
in interfaceBaseMatrixProperties
-
sinh
Description copied from interface:HyperbolicDoubleCalculations
Calculates the hyperbolic sinus of all entries in the matrix.- Specified by:
sinh
in interfaceHyperbolicDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with hyperbolic sinus values
-
cosh
Description copied from interface:HyperbolicDoubleCalculations
Calculates the hyperbolic cosinus of all entries in the matrix.- Specified by:
cosh
in interfaceHyperbolicDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with hyperbolic cosinus values
-
tanh
Description copied from interface:HyperbolicDoubleCalculations
Calculates the hyperbolic tangens of all entries in the matrix.- Specified by:
tanh
in interfaceHyperbolicDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with hyperbolic tangens values
-
sin
Description copied from interface:TrigonometricDoubleCalculations
Calculates the sinus of all entries in the matrix.- Specified by:
sin
in interfaceTrigonometricDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with sinus values
-
cos
Description copied from interface:TrigonometricDoubleCalculations
Calculates the cosinus of all entries in the matrix.- Specified by:
cos
in interfaceTrigonometricDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with cosinus values
-
tril
- Specified by:
tril
in interfaceObjectCalculations
-
triu
- Specified by:
triu
in interfaceObjectCalculations
-
tan
Description copied from interface:TrigonometricDoubleCalculations
Calculates the tangens of all entries in the matrix.- Specified by:
tan
in interfaceTrigonometricDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with tangens values
-
cov
Description copied from interface:StatisticalDoubleCalculations
Calculates the covariance Matrix. Each row is an observation and each column is a variable.- Specified by:
cov
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original MatrixignoreNaN
- should missing values be ignoredbesselsCorrection
- use (n-1) instead of n- Returns:
- Covariance Matrix
-
corrcoef
Description copied from interface:StatisticalDoubleCalculations
Calculates the Pearson correlation. Each row is an observation and each column is a variable.- Specified by:
corrcoef
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original MatrixignoreNaN
- should missing values be ignoredbesselsCorrection
- use (n-1) instead of n- Returns:
- Covariance Matrix
-
mutualInf
Description copied from interface:StatisticalDoubleCalculations
Calculates the mutual information. Each row is an observation and each column is a variable.- Specified by:
mutualInf
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with mutual information
-
pairedTTest
Description copied from interface:StatisticalDoubleCalculations
Calculates a paired T-Test on the matrix. Each row is an observation and each column is a variable.- Specified by:
pairedTTest
in interfaceStatisticalDoubleCalculations
- Parameters:
returnType
- Select whether a new or a linked Matrix is returned, or if the operation is performed on the original Matrix- Returns:
- Matrix with p-values of the T-Test
-
bootstrap
- Specified by:
bootstrap
in interfaceObjectCalculations
-
grayScale
- Specified by:
grayScale
in interfaceMiscEntrywiseDoubleCalculations
-
translate
- Specified by:
translate
in interfaceStringCalculations
-
lowerCase
- Specified by:
lowerCase
in interfaceStringCalculations
-
upperCase
- Specified by:
upperCase
in interfaceStringCalculations
-
convertEncoding
- Specified by:
convertEncoding
in interfaceStringCalculations
-
tfIdf
- Specified by:
tfIdf
in interfaceStringCalculations
-
removePunctuation
- Specified by:
removePunctuation
in interfaceStringCalculations
-
stem
- Specified by:
stem
in interfaceStringCalculations
-
removeWords
- Specified by:
removeWords
in interfaceStringCalculations
-
unique
- Specified by:
unique
in interfaceObjectCalculations
-
uniqueValueCount
- Specified by:
uniqueValueCount
in interfaceObjectCalculations
-
bootstrap
- Specified by:
bootstrap
in interfaceObjectCalculations
-
transpose
- Specified by:
transpose
in interfaceObjectCalculations
-
swap
- Specified by:
swap
in interfaceObjectCalculations
-
flipdim
- Specified by:
flipdim
in interfaceObjectCalculations
-
shuffle
- Specified by:
shuffle
in interfaceObjectCalculations
-
trace
public final double trace()- Specified by:
trace
in interfaceExtendedMatrixProperties
-
setLabel
Description copied from interface:HasLabel
Sets the label of an object -
getLabel
Description copied from interface:HasLabel
Returns the String label of an object. -
setAsString
Description copied from interface:GettersAndSetters
Sets an entry in the matrix to a String value. If the matrix cannot store Strings, the value will be represented as good as possible.- Specified by:
setAsString
in interfaceGettersAndSetters
coordinates
- location of the entry @
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in interfaceBaseMatrixProperties
-
getAsString
Description copied from interface:GettersAndSetters
Returns a String representation of an entry in the matrix. The stored value will be converted to a String as good as possible.- Specified by:
getAsString
in interfaceGettersAndSetters
- Parameters:
coordinates
- location of the entry- Returns:
- a String representation of the entry @
-
getMaxValue
public final double getMaxValue()- Specified by:
getMaxValue
in interfaceExtendedMatrixProperties
-
getMinValue
public final double getMinValue()- Specified by:
getMinValue
in interfaceExtendedMatrixProperties
-
getMeanValue
public final double getMeanValue()- Specified by:
getMeanValue
in interfaceExtendedMatrixProperties
-
getStdValue
public final double getStdValue()- Specified by:
getStdValue
in interfaceExtendedMatrixProperties
-
getValueSum
public final double getValueSum()- Specified by:
getValueSum
in interfaceExtendedMatrixProperties
-
getAbsoluteValueSum
public final double getAbsoluteValueSum()- Specified by:
getAbsoluteValueSum
in interfaceExtendedMatrixProperties
-
getColumnLabel
- Specified by:
getColumnLabel
in interfaceHasMetaData
-
getRowLabel
- Specified by:
getRowLabel
in interfaceHasMetaData
-
getRowForLabel
- Specified by:
getRowForLabel
in interfaceHasMetaData
-
getColumnForLabel
- Specified by:
getColumnForLabel
in interfaceHasMetaData
-
getPositionForLabel
- Specified by:
getPositionForLabel
in interfaceHasMetaData
-
setColumnLabel
- Specified by:
setColumnLabel
in interfaceHasMetaData
-
setRowLabel
- Specified by:
setRowLabel
in interfaceHasMetaData
-
getAbsoluteValueMean
public final double getAbsoluteValueMean()- Specified by:
getAbsoluteValueMean
in interfaceExtendedMatrixProperties
-
toRowVector
- Specified by:
toRowVector
in interfaceObjectCalculations
-
toColumnVector
- Specified by:
toColumnVector
in interfaceObjectCalculations
-
replaceMissingBy
- Specified by:
replaceMissingBy
in interfaceMiscGeneralDoubleCalculations
-
deleteColumnsWithMissingValues
- Specified by:
deleteColumnsWithMissingValues
in interfaceMissingValueDoubleCalculations
-
deleteRowsWithMissingValues
- Specified by:
deleteRowsWithMissingValues
in interfaceMissingValueDoubleCalculations
-
appendHorizontally
- Specified by:
appendHorizontally
in interfaceMiscGeneralDoubleCalculations
-
allValues
- Specified by:
allValues
in interfaceBaseMatrixProperties
-
appendVertically
- Specified by:
appendVertically
in interfaceMiscGeneralDoubleCalculations
-
append
- Specified by:
append
in interfaceMiscGeneralDoubleCalculations
-
discretizeToColumns
- Specified by:
discretizeToColumns
in interfaceDiscretizeCalculations
-
subMatrix
- Specified by:
subMatrix
in interfaceObjectCalculations
-
svd
Description copied from interface:DecompositionDoubleCalculations
Calculates the singular value decomposition of the matrix: A = U*S*V'- Specified by:
svd
in interfaceDecompositionDoubleCalculations
- Returns:
- Singular value decomposition of the matrix.
-
svd
Description copied from interface:DecompositionDoubleCalculations
Calculates a low rank approximation of the singular value decomposition of the matrix: A = U*S*V' but considers only the k largest singular values. This speeds up processing for large matrices.- Specified by:
svd
in interfaceDecompositionDoubleCalculations
- Parameters:
k
- number of singular values to consider- Returns:
- Singular value decomposition of the matrix.
-
eig
Description copied from interface:DecompositionDoubleCalculations
Calculates the Eigen decomposition of the matrix.- Specified by:
eig
in interfaceDecompositionDoubleCalculations
- Returns:
- Eigen decomposition of the matrix.
-
eigSymm
Description copied from interface:DecompositionDoubleCalculations
Calculates the Eigen decomposition of a symmetric matrix.- Specified by:
eigSymm
in interfaceDecompositionDoubleCalculations
- Returns:
- Eigen decomposition of the matrix.
-
qr
Description copied from interface:DecompositionDoubleCalculations
Calculates a QR decomposition of the matrix.- Specified by:
qr
in interfaceDecompositionDoubleCalculations
- Returns:
- QR decomposition of the matrix.
-
lu
Description copied from interface:DecompositionDoubleCalculations
Calculates a LU decomposition of the matrix.- Specified by:
lu
in interfaceDecompositionDoubleCalculations
- Returns:
- LU decomposition of the matrix.
-
chol
Description copied from interface:DecompositionDoubleCalculations
Calculates a Cholesky decomposition of the matrix.- Specified by:
chol
in interfaceDecompositionDoubleCalculations
- Returns:
- Cholesky decomposition of the matrix.
-
setSize
public void setSize(long... size) Description copied from interface:BaseMatrixProperties
Sets the size of the matrix. This is an optional method that is not implemented for all matrices. If this method is not implemented, aMatrixException
is thrown.- Specified by:
setSize
in interfaceBaseMatrixProperties
- Parameters:
size
- the new size of the matrix
-
reshape
- Specified by:
reshape
in interfaceObjectCalculations
-
squeeze
- Specified by:
squeeze
in interfaceObjectCalculations
-
doubleValue
public final double doubleValue()- Specified by:
doubleValue
in interfaceExtendedMatrixProperties
- Specified by:
doubleValue
in classNumber
-
intValue
public final int intValue()- Specified by:
intValue
in interfaceExtendedMatrixProperties
- Specified by:
intValue
in classNumber
-
charValue
public final char charValue()- Specified by:
charValue
in interfaceExtendedMatrixProperties
-
bigIntegerValue
- Specified by:
bigIntegerValue
in interfaceExtendedMatrixProperties
-
bigDecimalValue
- Specified by:
bigDecimalValue
in interfaceExtendedMatrixProperties
-
fadeIn
- Specified by:
fadeIn
in interfaceMiscGeneralDoubleCalculations
-
fadeOut
- Specified by:
fadeOut
in interfaceMiscGeneralDoubleCalculations
-
floatValue
public final float floatValue()- Specified by:
floatValue
in interfaceExtendedMatrixProperties
- Specified by:
floatValue
in classNumber
-
longValue
public final long longValue()- Specified by:
longValue
in interfaceExtendedMatrixProperties
- Specified by:
longValue
in classNumber
-
dateValue
- Specified by:
dateValue
in interfaceExtendedMatrixProperties
-
booleanValue
public final boolean booleanValue()- Specified by:
booleanValue
in interfaceExtendedMatrixProperties
-
stringValue
- Specified by:
stringValue
in interfaceExtendedMatrixProperties
-
getRMS
public final double getRMS()- Specified by:
getRMS
in interfaceExtendedMatrixProperties
-
getMetaData
- Specified by:
getMetaData
in interfaceHasMetaData
-
getMetaDataMatrix
- Specified by:
getMetaDataMatrix
in interfaceHasMetaData
-
getMetaDataDouble
- Specified by:
getMetaDataDouble
in interfaceHasMetaData
-
getMetaDataString
- Specified by:
getMetaDataString
in interfaceHasMetaData
-
getMetaData
- Specified by:
getMetaData
in interfaceHasMetaData
-
setMetaData
- Specified by:
setMetaData
in interfaceHasMetaData
-
setMetaData
- Specified by:
setMetaData
in interfaceHasMetaData
-
equalsAnnotation
- Specified by:
equalsAnnotation
in interfaceBaseMatrixProperties
-
equals
- Specified by:
equals
in interfaceBaseMatrixProperties
- Overrides:
equals
in classObject
-
equalsContent
- Specified by:
equalsContent
in interfaceBaseMatrixProperties
-
toBooleanMatrix
- Specified by:
toBooleanMatrix
in interfaceConversions
-
toByteMatrix
- Specified by:
toByteMatrix
in interfaceConversions
-
toCharMatrix
- Specified by:
toCharMatrix
in interfaceConversions
-
toDoubleMatrix
- Specified by:
toDoubleMatrix
in interfaceConversions
-
toFloatMatrix
- Specified by:
toFloatMatrix
in interfaceConversions
-
toIntMatrix
- Specified by:
toIntMatrix
in interfaceConversions
-
toLongMatrix
- Specified by:
toLongMatrix
in interfaceConversions
-
toBigDecimalMatrix
- Specified by:
toBigDecimalMatrix
in interfaceConversions
-
toBigIntegerMatrix
- Specified by:
toBigIntegerMatrix
in interfaceConversions
-
toObjectMatrix
- Specified by:
toObjectMatrix
in interfaceConversions
-
toShortMatrix
- Specified by:
toShortMatrix
in interfaceConversions
-
toStringMatrix
- Specified by:
toStringMatrix
in interfaceConversions
-
norm1
public double norm1()- Specified by:
norm1
in interfaceExtendedMatrixProperties
-
norm2
public double norm2()- Specified by:
norm2
in interfaceExtendedMatrixProperties
-
normInf
public double normInf()- Specified by:
normInf
in interfaceExtendedMatrixProperties
-
normF
public double normF()- Specified by:
normF
in interfaceExtendedMatrixProperties
-
toListMatrix
- Specified by:
toListMatrix
in interfaceConversions
-
toSetMatrix
- Specified by:
toSetMatrix
in interfaceConversions
-
toMapMatrix
- Specified by:
toMapMatrix
in interfaceConversions
-
containsBigInteger
- Specified by:
containsBigInteger
in interfaceExtendedMatrixProperties
-
containsBigDecimal
- Specified by:
containsBigDecimal
in interfaceExtendedMatrixProperties
-
containsDate
- Specified by:
containsDate
in interfaceExtendedMatrixProperties
-
containsObject
- Specified by:
containsObject
in interfaceExtendedMatrixProperties
-
containsString
- Specified by:
containsString
in interfaceExtendedMatrixProperties
-
containsBoolean
public boolean containsBoolean(boolean v) - Specified by:
containsBoolean
in interfaceExtendedMatrixProperties
-
containsByte
public boolean containsByte(byte v) - Specified by:
containsByte
in interfaceExtendedMatrixProperties
-
containsChar
public boolean containsChar(char v) - Specified by:
containsChar
in interfaceExtendedMatrixProperties
-
containsDouble
public boolean containsDouble(double v) - Specified by:
containsDouble
in interfaceExtendedMatrixProperties
-
containsFloat
public boolean containsFloat(float v) - Specified by:
containsFloat
in interfaceExtendedMatrixProperties
-
containsInt
public boolean containsInt(int v) - Specified by:
containsInt
in interfaceExtendedMatrixProperties
-
containsLong
public boolean containsLong(long v) - Specified by:
containsLong
in interfaceExtendedMatrixProperties
-
containsShort
public boolean containsShort(short v) - Specified by:
containsShort
in interfaceExtendedMatrixProperties
-
containsNull
public boolean containsNull()- Specified by:
containsNull
in interfaceExtendedMatrixProperties
-
exportTo
-
importFrom
- Specified by:
importFrom
in interfaceMatrix
-
getId
Description copied from interface:HasId
Returns the String id of an object. -
setId
Description copied from interface:HasId
Sets the id of an object -
getDescription
- Specified by:
getDescription
in interfaceHasDescription
-
getLabelObject
Description copied from interface:HasLabel
Returns the label of an object.- Specified by:
getLabelObject
in interfaceHasLabel
- Returns:
- the label
-
setDescription
- Specified by:
setDescription
in interfaceHasDescription
-