org.ujmp.core
Class AbstractMatrix
- java.lang.Object
-
- java.lang.Number
-
- org.ujmp.core.AbstractMatrix
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.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
public abstract class AbstractMatrix extends java.lang.Number implements Matrix
- See Also:
- Serialized Form
-
-
Field Summary
-
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
-
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.annotation.HasMetaData
DIMENSIONMETADATA
-
Fields inherited from interface org.ujmp.core.interfaces.HasDescription
DESCRIPTION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Matrixabs(Calculation.Ret returnType)Calculates the absolute values of all entries in a Matrix.MatrixaddMissing(Calculation.Ret returnType, int dimension, double... percentMissing)Adds a specified amount of missing values (Double.NaN) to the Matrixjava.lang.Iterable<long[]>allCoordinates()Returns an Iterator that goes over all coordinates in the Matrix.java.lang.Iterable<java.lang.Object>allValues()Matrixand(Calculation.Ret returnType, boolean value)Matrixand(Calculation.Ret returnType, Matrix matrix)Matrixappend(Calculation.Ret returnType, int dimension, Matrix... matrices)MatrixappendHorizontally(Calculation.Ret returnType, Matrix... matrices)MatrixappendVertically(Calculation.Ret returnType, Matrix... matrices)Matrixatimes(Calculation.Ret returnType, boolean ignoreNaN, Matrix matrix)Performs an averaging matrix multiplication on the two matrices.java.math.BigDecimalbigDecimalValue()java.math.BigIntegerbigIntegerValue()booleanbooleanValue()Matrixbootstrap(Calculation.Ret returnType)Matrixbootstrap(Calculation.Ret returnType, int count)Matrixceil(Calculation.Ret returnType)Returns a matrix with all entries rounded up to the next integer.Matrixcenter(Calculation.Ret returnType, int dimension, boolean ignoreNaN)Subtracts the mean from the matrix.charcharValue()doublechebyshevDistanceTo(Matrix m, boolean ignoreNaN)Matrixchol()Calculates a Cholesky decomposition of the matrix.Matrixclone()intcompareTo(Matrix m)booleancontainsBigDecimal(java.math.BigDecimal v)booleancontainsBigInteger(java.math.BigInteger v)booleancontainsBoolean(boolean v)booleancontainsByte(byte v)booleancontainsChar(char v)booleancontainsDate(java.util.Date v)booleancontainsDouble(double v)booleancontainsFloat(float v)booleancontainsInt(int v)booleancontainsLong(long v)booleancontainsMissingValues()booleancontainsNull()booleancontainsObject(java.lang.Object o)booleancontainsShort(short v)booleancontainsString(java.lang.String s)Matrixconvert(ValueType newValueType)Creates a copy of the matrix with the desired type for matrix entries.MatrixconvertEncoding(Calculation.Ret returnType, java.lang.String encoding)Matrixcorrcoef(Calculation.Ret returnType, boolean ignoreNaN, boolean besselsCorrection)Calculates the Pearson correlation.Matrixcos(Calculation.Ret returnType)Calculates the cosinus of all entries in the matrix.Matrixcosh(Calculation.Ret returnType)Calculates the hyperbolic cosinus of all entries in the matrix.MatrixcosineSimilarity(Calculation.Ret returnType, boolean ignoreNaN)doublecosineSimilarityTo(Matrix m, boolean ignoreNaN)MatrixcountMissing(Calculation.Ret returnType, int dimension)Counts the missing values within the matrix, i.e.Matrixcov(Calculation.Ret returnType, boolean ignoreNaN, boolean besselsCorrection)Calculates the covariance Matrix.Matrixcumprod(boolean ignoreNaN)Matrixcumsum(boolean ignoreNaN)java.util.DatedateValue()Matrixdelete(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number>... selection)Delete rows and columns in the Matrix and returns a link to it.Matrixdelete(Calculation.Ret returnType, long[]... selection)Delete rows and columns in the Matrix and returns a link to it.Matrixdelete(Calculation.Ret returnType, java.lang.String selection)Deletes rows and columns in the Matrix and returns a link to it.MatrixdeleteColumns(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number> columns)Deletes columns in the Matrix and returns a link to it.MatrixdeleteColumns(Calculation.Ret returnType, long... columns)Deletes columns in the Matrix and returns a link to it.MatrixdeleteColumnsWithMissingValues(Calculation.Ret returnType)MatrixdeleteRows(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number> rows)Deletes rows in the Matrix and returns a link to it.MatrixdeleteRows(Calculation.Ret returnType, long... rows)Deletes rows in the Matrix and returns a link to it.MatrixdeleteRowsWithMissingValues(Calculation.Ret returnType, long threshold)doubledet()Matrixdiag(Calculation.Ret returnType)Matrixdiff(Calculation.Ret returnType, int dimension, boolean ignoreNaN)Matrixdiscretize(Calculation.Ret returnType, Dictionary dictionary)Matrixdiscretize(Calculation.Ret returnType, int dimension, Discretize.DiscretizationMethod method, int numberOfBins)MatrixdiscretizeToBoolean(int targetColumnCount)MatrixdiscretizeToColumns(long column)Matrixdivide(Calculation.Ret returnType, boolean ignoreNaN, double factor)Divides every entry in the matrix by a scalar.Matrixdivide(Calculation.Ret returnType, boolean ignoreNaN, Matrix factor)Divides every entry in the matrix by the entries of another matrix.Matrixdivide(double divisor)Divides every entry in the matrix by a scalar.Matrixdivide(Matrix m)Calculates an entrywise division of the two matrices.doubledoubleValue()Matrix[]eig()Calculates the Eigen decomposition of the matrix.Matrix[]eigSymm()Calculates the Eigen decomposition of a symmetric matrix.Matrixeq(Calculation.Ret returnType, Matrix matrix)Matrixeq(Calculation.Ret returnType, java.lang.Object value)booleanequals(java.lang.Object o)booleanequalsAnnotation(java.lang.Object o)booleanequalsContent(java.lang.Object o)MatrixeuklideanDistance(Calculation.Ret returnType, boolean ignoreNaN)doubleeuklideanDistanceTo(Matrix m, boolean ignoreNaN)Matrixexp(Calculation.Ret returnType)Calculates the exponential function for all entries in the Matrix.MatrixExportDestinationSelectorexportTo()MatrixextractAnnotation(Calculation.Ret returnType, int dimension)Generates annotation such as row or column labels from the content of this matrix.Matrixeye(Calculation.Ret ret)Returns a matrix with ones at the diagonal.MatrixfadeIn(Calculation.Ret ret, int dimension)MatrixfadeOut(Calculation.Ret ret, int dimension)Matrixfill(Calculation.Ret ret, java.lang.Object value)Returns a matrix with equal size, where all entries are set to a desired value.voidfireValueChanged()This method is used to signal changes in the object to the corresponding GUIObject if it exists.voidfireValueChanged(Coordinates start, Coordinates end)voidfireValueChanged(Coordinates coordinates, java.lang.Object object)Matrixflipdim(Calculation.Ret returnType, int dimension)floatfloatValue()Matrixfloor(Calculation.Ret returnType)Returns a matrix with all entries rounded down to the next integer.Matrixge(Calculation.Ret returnType, double value)Matrixge(Calculation.Ret returnType, Matrix matrix)doublegetAbsoluteValueMean()doublegetAbsoluteValueSum()java.math.BigDecimalgetAsBigDecimal(long... coordinates)java.math.BigIntegergetAsBigInteger(long... coordinates)booleangetAsBoolean(long... coordinates)Returns a byte representation of an entry in the matrix.bytegetAsByte(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.chargetAsChar(long... coordinates)Returns a char representation of an entry in the matrix.java.util.DategetAsDate(long... coordinates)Returns a Date representation of an entry in the matrix.doublegetAsDouble(long... coordinates)Returns a double representation of an entry in the matrix.floatgetAsFloat(long... coordinates)Returns a float representation of an entry in the matrix.intgetAsInt(long... coordinates)Returns an int representation of an entry in the matrix.longgetAsLong(long... coordinates)Returns a long representation of an entry in the matrix.MatrixgetAsMatrix(long... coordinates)shortgetAsShort(long... coordinates)Returns a short representation of an entry in the matrix.java.lang.StringgetAsString(long... coordinates)Returns a String representation of an entry in the matrix.longgetColumnCount()longgetColumnForLabel(java.lang.Object object)java.lang.StringgetColumnLabel(long col)java.util.List<Matrix>getColumnList()long[]getCoordinatesOfMaximum()Returns the position of the maximum value in a Matrix.long[]getCoordinatesOfMinimum()Returns the position of the minimum value in a Matrix.longgetCoreObjectId()java.lang.StringgetDescription()intgetDimensionCount()java.lang.StringgetDimensionLabel(int dimension)java.lang.ObjectgetDimensionMetaData(int dimension, long... position)doublegetEuklideanValue()BaseMatrixFactory<? extends Matrix>getFactory()GUIObjectgetGUIObject()Returns an object suitable for displaying on the screen.java.lang.StringgetId()Returns the String id of an object.java.lang.StringgetLabel()Returns the String label of an object.java.lang.ObjectgetLabelObject()Returns the label of an object.doublegetMaxValue()doublegetMeanValue()MapMatrix<java.lang.String,java.lang.Object>getMetaData()java.lang.ObjectgetMetaData(java.lang.Object key)MatrixgetMetaDataDimensionMatrix(int dimension)doublegetMetaDataDouble(java.lang.Object key)MatrixgetMetaDataMatrix(java.lang.Object key)java.lang.StringgetMetaDataString(java.lang.Object key)doublegetMinValue()long[]getPositionForLabel(int dimension, java.lang.Object label)java.lang.ObjectgetPreferredObject(long... coordinates)Returns a representation of the entry in the matrix that reflects the true object best.doublegetRMS()longgetRowCount()longgetRowForLabel(java.lang.Object object)java.lang.StringgetRowLabel(long row)java.util.List<Matrix>getRowList()long[]getSize()longgetSize(int dimension)doublegetStdValue()longgetValueCount()doublegetValueSum()ValueTypegetValueType()longgetZCount()Matrixginv()Calculates a generalized inverse of the MatrixMatrixgrayScale(Calculation.Ret returnType, GrayScale.ColorChannel colorChannel)Matrixgt(Calculation.Ret returnType, double value)Matrixgt(Calculation.Ret returnType, Matrix matrix)MatrixImportSourceSelectorimportFrom()Matriximpute(Calculation.Ret returnType, Impute.ImputationMethod method, java.lang.Object... parameters)Replaces missing values with various methodsMatrixincludeAnnotation(Calculation.Ret returnType, int dimension)MatrixindexOfMax(Calculation.Ret returnType, int dimension)Finds the index of the maximum value in the matrixMatrixindexOfMin(Calculation.Ret returnType, int dimension)Finds the index of the minimum value in the matrixintintValue()Matrixinv()Calculates the inverse of the Matrix using either LUDecomposition (for square matrices) or QRDecomposition (otherwise).MatrixinvSPD()Calculates the inverse of a symmetric positive definite Matrix using Cholesky Decomposition.MatrixinvSymm()Calculates the inverse of the Matrix using either LUDecomposition (for square matrices) or QRDecomposition (otherwise).booleanisColumnVector()booleanisDiagonal()booleanisEmpty()booleanisMultidimensionalMatrix()booleanisReadOnly()booleanisResizable()booleanisRowVector()booleanisScalar()booleanisSingular()booleanisSPD()booleanisSquare()booleanisSymmetric()booleanisTransient()Matrixle(Calculation.Ret returnType, double value)Matrixle(Calculation.Ret returnType, Matrix matrix)Matrixlog(Calculation.Ret returnType)Calculates the natural logarithm of all entries in the Matrix.Matrixlog10(Calculation.Ret returnType)Calculates the logarithm with basis 10 of all entries in the Matrix.Matrixlog2(Calculation.Ret returnType)Calculates the logarithm with basis 2 of all entries in the Matrix.Matrixlogistic(Calculation.Ret returnType)Calculates the logistic function for all entries in the Matrix.longlongValue()MatrixlowerCase(Calculation.Ret returnType)Matrixlt(Calculation.Ret returnType, double value)Matrixlt(Calculation.Ret returnType, Matrix matrix)Matrix[]lu()Calculates a LU decomposition of the matrix.MatrixmanhattenDistance(Calculation.Ret returnType, boolean ignoreNaN)doublemanhattenDistanceTo(Matrix m, boolean ignoreNaN)Matrixmax(Calculation.Ret returnType, int dimension)Calculates the maximum of the values in the matrix either rowwise, columnwise, or global.Matrixmean(Calculation.Ret returnType, int dimension, boolean ignoreNaN)Calculates the mean of all entries in the Matrix either per row, per column, or global.Matrixmin(Calculation.Ret returnType, int dimension)Calculates the mimimum of the values in the matrix either rowwise, columnwise, or global.MatrixminkowskiDistance(Calculation.Ret returnType, double p, boolean ignoreNaN)doubleminkowskiDistanceTo(Matrix m, double p, boolean ignoreNaN)Matrixminus(Calculation.Ret returnType, boolean ignoreNaN, double v)Subtracts a specified value from all entries in the matrix.Matrixminus(Calculation.Ret returnType, boolean ignoreNaN, Matrix m)Calculates the difference of the entries in both matricesMatrixminus(double value)Subtracts a specified value from all entries in the matrix.Matrixminus(Matrix m)Calculates the difference of the entries in both matricesMatrixmtimes(Calculation.Ret returnType, boolean ignoreNaN, Matrix matrix)Performs a matrix multiplication on the two matrices.Matrixmtimes(Matrix matrix)Performs a matrix multiplication on the two matrices.MatrixmutualInf(Calculation.Ret returnType)Calculates the mutual information.Matrixnans(Calculation.Ret ret)Returns a matrix with equal size, where all entries are set to Double.NaN.Matrixne(Calculation.Ret returnType, Matrix matrix)Matrixne(Calculation.Ret returnType, java.lang.Object value)java.lang.Iterable<long[]>nonZeroCoordinates()doublenorm1()doublenorm2()Matrixnormalize(Calculation.Ret returnType, int dimension)doublenormF()doublenormInf()Matrixnot(Calculation.Ret returnType)Matrixones(Calculation.Ret ret)Returns a matrix with equal size, where all entries are set to 1.0.Matrixor(Calculation.Ret returnType, boolean value)Matrixor(Calculation.Ret returnType, Matrix matrix)MatrixpairedTTest(Calculation.Ret returnType)Calculates a paired T-Test on the matrix.doublepdet()Matrixpinv()Calculates the pseudo inverse of the Matrix using Singular Value Decomposition.Matrixpinv(int k)Calculates the pseudo inverse of the Matrix using a low rank approximation of the Singular Value Decomposition.Matrixplus(Calculation.Ret returnType, boolean ignoreNaN, double v)Adds a specified value from all entries in the matrix.Matrixplus(Calculation.Ret returnType, boolean ignoreNaN, Matrix m)Calculates the sum of the entries in both matricesMatrixplus(double value)Adds a specified value to all entries in the matrix.Matrixplus(Matrix m)Calculates the sum of the entries in both matricesMatrixpower(Calculation.Ret returnType, double power)Calculates this matrix to the power of the given value (entrywise).Matrixpower(Calculation.Ret returnType, Matrix power)Calculates this matrix to the power of the given matrix (entrywise).Matrixprincomp()Projects the matrix into the space of the principal components.Matrixprod(Calculation.Ret returnType, int dimension, boolean ignoreNaN)Matrix[]qr()Calculates a QR decomposition of the matrix.Matrixrand(Calculation.Ret ret)Returns a matrix with equal size, where all entries are set to uniform random values between 0.0 and 1.0.Matrixrandn(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.intrank()MatrixremovePunctuation(Calculation.Ret ret)MatrixremoveWords(Calculation.Ret ret, java.util.Collection<java.lang.String> words)Matrixreplace(Calculation.Ret returnType, java.lang.Object search, java.lang.Object replacement)Replaces matching values in the matrix with another valueMatrixreplaceMissingBy(Matrix matrix)MatrixreplaceRegex(Calculation.Ret returnType, java.util.regex.Pattern search, java.lang.String replacement)Replaces matching text in every entry of the matrix.MatrixreplaceRegex(Calculation.Ret returnType, java.lang.String search, java.lang.String replacement)Replaces matching text in every entry of the matrix.Matrixreshape(Calculation.Ret returnType, long... newSize)Matrixround(Calculation.Ret returnType)Returns a matrix with all entries rounded to integer values.voidsave(java.io.File file)voidsave(java.lang.String filename)Matrixselect(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number>... selection)Selects rows and columns in the Matrix and returns a link to it.Matrixselect(Calculation.Ret returnType, long[]... selection)Selects rows and columns in the Matrix and returns a link to it.Matrixselect(Calculation.Ret returnType, java.lang.String selection)Selects rows and columns in the Matrix and returns a link to it.MatrixselectColumns(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number> columns)Selects columns in the Matrix and returns a link to it.MatrixselectColumns(Calculation.Ret returnType, long... columns)Selects columns in the Matrix and returns a link to it.java.lang.Iterable<long[]>selectedCoordinates(long[]... selection)Returns an Iterator that goes only over the Coordinates defined by the selection.java.lang.Iterable<long[]>selectedCoordinates(java.lang.String selection)Returns an Iterator that goes only over the Coordinates defined by the selection.MatrixselectRows(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number> rows)Selects rows in the Matrix and returns a link to it.MatrixselectRows(Calculation.Ret returnType, long... rows)Selects rows in the Matrix and returns a link to it.voidsetAsBigDecimal(java.math.BigDecimal value, long... coordinates)voidsetAsBigInteger(java.math.BigInteger value, long... coordinates)voidsetAsBoolean(boolean value, long... coordinates)Sets an entry in the matrix to a boolean value.voidsetAsByte(byte value, long... coordinates)Sets an entry in the matrix to a byte value.voidsetAsByteArray(byte[] value, long... coordinates)Sets an entry in the matrix to a byte array.voidsetAsChar(char value, long... coordinates)Sets an entry in the matrix to a char value.voidsetAsDate(java.util.Date date, long... coordinates)Sets an entry in the matrix to a Date value.voidsetAsDouble(double v, long... coordinates)Sets an entry in the matrix to a double value.voidsetAsFloat(float value, long... coordinates)Sets an entry in the matrix to a float value.voidsetAsInt(int value, long... coordinates)Sets an entry in the matrix to an int value.voidsetAsLong(long value, long... coordinates)Sets an entry in the matrix to a long value.voidsetAsMatrix(Matrix m, long... coordinates)voidsetAsShort(short value, long... coordinates)Sets an entry in the matrix to a short value.voidsetAsString(java.lang.String string, long... coordinates)Sets an entry in the matrix to a String value.voidsetColumnLabel(long col, java.lang.Object label)MatrixsetContent(Calculation.Ret returnType, Matrix newContent, long... position)voidsetDescription(java.lang.String description)voidsetDimensionLabel(int dimension, java.lang.Object label)voidsetDimensionMetaData(int dimension, java.lang.Object label, long... position)voidsetId(java.lang.String id)Sets the id of an objectvoidsetLabel(java.lang.Object label)Sets the label of an objectvoidsetMetaData(MapMatrix<java.lang.String,java.lang.Object> metaData)voidsetMetaData(java.lang.String key, java.lang.Object value)voidsetMetaDataDimensionMatrix(int dimension, Matrix matrix)voidsetRowLabel(long row, java.lang.Object label)voidsetSize(long... size)Sets the size of the matrix.voidshare(int port)voidshare(java.lang.String hostname, int port)javax.swing.JFrameshowGUI()This method will show the object in a JFrame on the screen.Matrixshuffle(Calculation.Ret returnType)Matrixsign(Calculation.Ret returnType)Calculates the sign of the entries in a Matrix.Matrixsin(Calculation.Ret returnType)Calculates the sinus of all entries in the matrix.Matrixsinh(Calculation.Ret returnType)Calculates the hyperbolic sinus of all entries in the matrix.Matrixsolve(Matrix b)Solve A*X = BMatrixsolveSPD(Matrix b)Solve A*X = BMatrixsolveSymm(Matrix b)Solve A*X = BMatrixsortrows(Calculation.Ret returnType, long column, boolean reverse)Matrixsqrt(Calculation.Ret returnType)Calculates the square root of all the entries in a Matrix.Matrixsqueeze(Calculation.Ret returnType)Matrixstandardize(Calculation.Ret returnType, int dimension)Subtracts the mean from the matrix and divides by the standard deviation.Matrixstd(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.Matrixstem(Calculation.Ret ret)java.lang.StringstringValue()MatrixsubMatrix(Calculation.Ret returnType, long... startAndEndCoordinates)Matrixsum(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'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.Matrixswap(Calculation.Ret returnType, int dimension, long pos1, long pos2)Matrixtan(Calculation.Ret returnType)Calculates the tangens of all entries in the matrix.Matrixtanh()Matrixtanh(Calculation.Ret returnType)Calculates the hyperbolic tangens of all entries in the matrix.MatrixtfIdf(boolean calculateTf, boolean calculateIdf, boolean normalize)Matrixtimes(Calculation.Ret returnType, boolean ignoreNaN, double factor)Multiplies every entry in the matrix with a scalar.Matrixtimes(Calculation.Ret returnType, boolean ignoreNaN, Matrix factor)Multiplies every entry in the matrix with the entries of another Matrix.Matrixtimes(double factor)Multiplies every entry in the matrix with a scalar.Matrixtimes(Matrix m)Calculates the entrywise product of the two matrices.java.math.BigDecimal[][]toBigDecimalArray()BaseBigDecimalMatrixtoBigDecimalMatrix()java.math.BigInteger[][]toBigIntegerArray()BigIntegerMatrixtoBigIntegerMatrix()boolean[][]toBooleanArray()Converts the content of a matrix into a 2-dimensional array of boolean values.BooleanMatrixtoBooleanMatrix()byte[][]toByteArray()Converts the content of a matrix into a 2-dimensional array of byte values.ByteMatrixtoByteMatrix()char[][]toCharArray()Converts the content of a matrix into a 2-dimensional array of char values.CharMatrixtoCharMatrix()MatrixtoColumnVector(Calculation.Ret returnType)java.util.Date[][]toDateArray()Converts the content of a matrix into a 2-dimensional array of Date values.double[][]toDoubleArray()Converts the content of a matrix into a 2-dimensional array of double values.DoubleMatrixtoDoubleMatrix()float[][]toFloatArray()Converts the content of a matrix into a 2-dimensional array of float values.FloatMatrixtoFloatMatrix()java.lang.StringtoHtml()int[][]toIntArray()Converts the content of a matrix into a 2-dimensional array of int values.IntMatrixtoIntMatrix()ListMatrix<?>toListMatrix()long[][]toLongArray()Converts the content of a matrix into a 2-dimensional array of long values.LongMatrixtoLongMatrix()MapMatrix<?,?>toMapMatrix()java.lang.Object[][]toObjectArray()Converts the content of a matrix into a 2-dimensional array of Objects.ObjectMatrixtoObjectMatrix()MatrixtoRowVector(Calculation.Ret returnType)SetMatrix<?>toSetMatrix()short[][]toShortArray()Converts the content of a matrix into a 2-dimensional array of short values.ShortMatrixtoShortMatrix()java.lang.StringtoString()java.lang.String[][]toStringArray()Converts the content of a matrix into a 2-dimensional array of Strings.StringMatrixtoStringMatrix()doubletrace()Matrixtranslate(Calculation.Ret returnType, java.lang.String sourceLanguage, java.lang.String targetLanguage)Matrixtranspose()Returns the transpose of the Matrix, where rows and columns are exchanged.Matrixtranspose(Calculation.Ret returnType)Returns the transpose of the Matrix, where rows and columns are exchanged.Matrixtranspose(Calculation.Ret returnType, int dimension1, int dimension2)Matrixtril(Calculation.Ret returnType, int k)Matrixtriu(Calculation.Ret returnType, int k)Matrixunique(Calculation.Ret returnType)MatrixuniqueValueCount(Calculation.Ret returnType, int dimension)MatrixupperCase(Calculation.Ret returnType)Matrixvar(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.Matrixxor(Calculation.Ret returnType, boolean value)Matrixxor(Calculation.Ret returnType, Matrix matrix)Matrixzeros(Calculation.Ret ret)Returns a matrix with equal size, where all entries are set to zero.-
Methods inherited from class java.lang.Object
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.GettersAndSetters
getAsObject, setAsObject
-
Methods inherited from interface org.ujmp.core.interfaces.ExtendedMatrixProperties
byteValue, shortValue
-
-
-
-
Method Detail
-
getRowList
public java.util.List<Matrix> getRowList()
- Specified by:
getRowListin interfaceBaseMatrixProperties
-
getColumnList
public java.util.List<Matrix> getColumnList()
- Specified by:
getColumnListin interfaceBaseMatrixProperties
-
getFactory
public BaseMatrixFactory<? extends Matrix> getFactory()
- Specified by:
getFactoryin interfaceBaseMatrix
-
allCoordinates
public final java.lang.Iterable<long[]> allCoordinates()
Description copied from interface:CoordinateFunctionsReturns an Iterator that goes over all coordinates in the Matrix. It goes from 0,0 to the size of the Matrix.- Specified by:
allCoordinatesin interfaceCoordinateFunctions- Returns:
- Iterable over all coordinates within a Matrix.
-
getCoreObjectId
public final long getCoreObjectId()
- Specified by:
getCoreObjectIdin interfaceCoreObject
-
getAsDouble
public double getAsDouble(long... coordinates)
Description copied from interface:GettersAndSettersReturns a double representation of an entry in the matrix. The stored value will be converted to a double as good as possible.- Specified by:
getAsDoublein 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:GettersAndSettersSets 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:
setAsDoublein interfaceGettersAndSetters- Parameters:
v- double valuecoordinates- location of the entry @
-
getPreferredObject
public final java.lang.Object getPreferredObject(long... coordinates)
Description copied from interface:GettersAndSettersReturns 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:
getPreferredObjectin interfaceGettersAndSetters- Parameters:
coordinates- location of the entry- Returns:
- object that represents the matrix entry best @
-
getValueType
public ValueType getValueType()
- Specified by:
getValueTypein interfaceBaseMatrixProperties
-
getMetaDataDimensionMatrix
public Matrix getMetaDataDimensionMatrix(int dimension)
- Specified by:
getMetaDataDimensionMatrixin interfaceHasMetaData
-
getDimensionMetaData
public final java.lang.Object getDimensionMetaData(int dimension, long... position)- Specified by:
getDimensionMetaDatain interfaceHasMetaData
-
setMetaDataDimensionMatrix
public void setMetaDataDimensionMatrix(int dimension, Matrix matrix)- Specified by:
setMetaDataDimensionMatrixin interfaceHasMetaData
-
getDimensionLabel
public final java.lang.String getDimensionLabel(int dimension)
- Specified by:
getDimensionLabelin interfaceHasMetaData
-
setDimensionMetaData
public final void setDimensionMetaData(int dimension, java.lang.Object label, long... position)- Specified by:
setDimensionMetaDatain interfaceHasMetaData
-
setDimensionLabel
public final void setDimensionLabel(int dimension, java.lang.Object label)- Specified by:
setDimensionLabelin interfaceHasMetaData
-
getGUIObject
public GUIObject getGUIObject()
Description copied from interface:HasGUIObjectReturns an object suitable for displaying on the screen. Ensures that, for each basic object, only one GUIObject can be returned.- Specified by:
getGUIObjectin interfaceHasGUIObject- Returns:
- object suitable for displaying on the screen
-
containsMissingValues
public final boolean containsMissingValues()
- Specified by:
containsMissingValuesin interfaceExtendedMatrixProperties
-
getDimensionCount
public int getDimensionCount()
- Specified by:
getDimensionCountin interfaceBaseMatrixProperties
-
getEuklideanValue
public final double getEuklideanValue()
- Specified by:
getEuklideanValuein interfaceExtendedMatrixProperties
-
clone
public Matrix clone()
- Specified by:
clonein interfaceCoreObject- Specified by:
clonein interfaceMatrix- Overrides:
clonein classjava.lang.Object
-
select
public final Matrix select(Calculation.Ret returnType, long[]... selection)
Description copied from interface:ObjectCalculationsSelects rows and columns in the Matrix and returns a link to it.- Specified by:
selectin 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
public void save(java.lang.String filename) throws java.io.IOException
-
save
public void save(java.io.File file) throws java.io.IOException
-
select
public final Matrix select(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number>... selection)
Description copied from interface:ObjectCalculationsSelects rows and columns in the Matrix and returns a link to it.- Specified by:
selectin 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
public Matrix selectRows(Calculation.Ret returnType, long... rows)
Description copied from interface:ObjectCalculationsSelects rows in the Matrix and returns a link to it.- Specified by:
selectRowsin 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
public final Matrix select(Calculation.Ret returnType, java.lang.String selection)
Description copied from interface:ObjectCalculationsSelects 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:
selectin 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
public Matrix selectColumns(Calculation.Ret returnType, long... columns)
Description copied from interface:ObjectCalculationsSelects columns in the Matrix and returns a link to it.- Specified by:
selectColumnsin interfaceObjectCalculations- Parameters:
returnType- Defines if a new Matrix or a link should be returned.- Returns:
- Link to original Matrix with desired columns @
-
selectRows
public final Matrix selectRows(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number> rows)
Description copied from interface:ObjectCalculationsSelects rows in the Matrix and returns a link to it.- Specified by:
selectRowsin 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
public final Matrix selectColumns(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number> columns)
Description copied from interface:ObjectCalculationsSelects columns in the Matrix and returns a link to it.- Specified by:
selectColumnsin 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, java.lang.Object... parameters)
Description copied from interface:MissingValueDoubleCalculationsReplaces missing values with various methods- Specified by:
imputein 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:
discretizein interfaceDiscretizeCalculations
-
discretize
public Matrix discretize(Calculation.Ret returnType, Dictionary dictionary)
- Specified by:
discretizein interfaceDiscretizeCalculations
-
discretizeToBoolean
public Matrix discretizeToBoolean(int targetColumnCount)
- Specified by:
discretizeToBooleanin interfaceDiscretizeCalculations
-
indexOfMax
public Matrix indexOfMax(Calculation.Ret returnType, int dimension)
Description copied from interface:StatisticalDoubleCalculationsFinds the index of the maximum value in the matrix- Specified by:
indexOfMaxin 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
public Matrix indexOfMin(Calculation.Ret returnType, int dimension)
Description copied from interface:StatisticalDoubleCalculationsFinds the index of the minimum value in the matrix- Specified by:
indexOfMinin 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
public Matrix standardize(Calculation.Ret returnType, int dimension)
Description copied from interface:MiscGeneralDoubleCalculationsSubtracts the mean from the matrix and divides by the standard deviation.- Specified by:
standardizein 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
public Matrix normalize(Calculation.Ret returnType, int dimension)
- Specified by:
normalizein interfaceMiscGeneralDoubleCalculations
-
atimes
public Matrix atimes(Calculation.Ret returnType, boolean ignoreNaN, Matrix matrix)
Description copied from interface:BasicDoubleCalculationsPerforms an averaging matrix multiplication on the two matrices. The matrices must be 2-dimensional and have the correct size.- Specified by:
atimesin 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
public Matrix inv()
Description copied from interface:DecompositionDoubleCalculationsCalculates the inverse of the Matrix using either LUDecomposition (for square matrices) or QRDecomposition (otherwise).- Specified by:
invin interfaceDecompositionDoubleCalculations- Returns:
- Inverse of the matrix
-
invSymm
public Matrix invSymm()
Description copied from interface:DecompositionDoubleCalculationsCalculates the inverse of the Matrix using either LUDecomposition (for square matrices) or QRDecomposition (otherwise).- Specified by:
invSymmin interfaceDecompositionDoubleCalculations- Returns:
- Inverse of the matrix
-
invSPD
public Matrix invSPD()
Description copied from interface:DecompositionDoubleCalculationsCalculates the inverse of a symmetric positive definite Matrix using Cholesky Decomposition.- Specified by:
invSPDin interfaceDecompositionDoubleCalculations- Returns:
- Inverse of the matrix
-
solve
public Matrix solve(Matrix b)
Description copied from interface:DecompositionDoubleCalculationsSolve A*X = B- Specified by:
solvein interfaceDecompositionDoubleCalculations- Parameters:
b- right hand side- Returns:
- solution for X if A is square, least squares solution otherwise
-
solveSymm
public Matrix solveSymm(Matrix b)
Description copied from interface:DecompositionDoubleCalculationsSolve A*X = B- Specified by:
solveSymmin interfaceDecompositionDoubleCalculations- Parameters:
b- right hand side- Returns:
- solution for X if A is square, least squares solution otherwise
-
solveSPD
public Matrix solveSPD(Matrix b)
Description copied from interface:DecompositionDoubleCalculationsSolve A*X = B- Specified by:
solveSPDin interfaceDecompositionDoubleCalculations- Parameters:
b- right hand side- Returns:
- solution for X if A is square, least squares solution otherwise
-
ginv
public Matrix ginv()
Description copied from interface:DecompositionDoubleCalculationsCalculates a generalized inverse of the Matrix- Specified by:
ginvin interfaceDecompositionDoubleCalculations- Returns:
- Pseudo inverse of the Matrix
-
princomp
public Matrix princomp()
Description copied from interface:DecompositionDoubleCalculationsProjects the matrix into the space of the principal components.- Specified by:
princompin interfaceDecompositionDoubleCalculations- Returns:
- Matrix projected on principal components.
-
pinv
public Matrix pinv()
Description copied from interface:DecompositionDoubleCalculationsCalculates the pseudo inverse of the Matrix using Singular Value Decomposition.- Specified by:
pinvin interfaceDecompositionDoubleCalculations- Returns:
- Pseudo inverse of the Matrix
-
pinv
public Matrix pinv(int k)
Description copied from interface:DecompositionDoubleCalculationsCalculates 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:
pinvin interfaceDecompositionDoubleCalculations- Parameters:
k- number of singular values to consider- Returns:
- Pseudo inverse of the Matrix
-
center
public Matrix center(Calculation.Ret returnType, int dimension, boolean ignoreNaN)
Description copied from interface:MiscGeneralDoubleCalculationsSubtracts the mean from the matrix.- Specified by:
centerin 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:
isResizablein interfaceBaseMatrixProperties
-
convert
public final Matrix convert(ValueType newValueType)
Description copied from interface:ObjectCalculationsCreates a copy of the matrix with the desired type for matrix entries.- Specified by:
convertin interfaceObjectCalculations- Parameters:
newValueType- defines the new format of the matrix- Returns:
- Matrix with the same entries in the new format
-
replaceRegex
public final Matrix replaceRegex(Calculation.Ret returnType, java.util.regex.Pattern search, java.lang.String replacement)
Description copied from interface:StringCalculationsReplaces matching text in every entry of the matrix.- Specified by:
replaceRegexin 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
public final Matrix replace(Calculation.Ret returnType, java.lang.Object search, java.lang.Object replacement)
Description copied from interface:ObjectCalculationsReplaces matching values in the matrix with another value- Specified by:
replacein 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
public final Matrix replaceRegex(Calculation.Ret returnType, java.lang.String search, java.lang.String replacement)
Description copied from interface:StringCalculationsReplaces matching text in every entry of the matrix.- Specified by:
replaceRegexin 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
public Matrix times(double factor)
Description copied from interface:BasicDoubleCalculationsMultiplies every entry in the matrix with a scalar.- Specified by:
timesin interfaceBasicDoubleCalculations- Parameters:
factor- factor to multiply with- Returns:
- Matrix with all entries multiplied by a factor.
-
tanh
public Matrix tanh()
- Specified by:
tanhin interfaceHyperbolicDoubleCalculations
-
times
public Matrix times(Matrix m)
Description copied from interface:BasicDoubleCalculationsCalculates the entrywise product of the two matrices.- Specified by:
timesin interfaceBasicDoubleCalculations- Parameters:
m- the second matrix- Returns:
- matrix with product of all entries
-
divide
public Matrix divide(Matrix m)
Description copied from interface:BasicDoubleCalculationsCalculates an entrywise division of the two matrices.- Specified by:
dividein interfaceBasicDoubleCalculations- Parameters:
m- the second matrix- Returns:
- matrix with all entries divided by the second matrix's entry.
-
divide
public Matrix divide(double divisor)
Description copied from interface:BasicDoubleCalculationsDivides every entry in the matrix by a scalar.- Specified by:
dividein interfaceBasicDoubleCalculations- Parameters:
divisor- factor by which to divide- Returns:
- Matrix with all entries divided by a factor.
-
divide
public Matrix divide(Calculation.Ret returnType, boolean ignoreNaN, double factor)
Description copied from interface:BasicDoubleCalculationsDivides every entry in the matrix by a scalar.- Specified by:
dividein 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
public Matrix times(Calculation.Ret returnType, boolean ignoreNaN, double factor)
Description copied from interface:BasicDoubleCalculationsMultiplies every entry in the matrix with a scalar.- Specified by:
timesin 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
public Matrix times(Calculation.Ret returnType, boolean ignoreNaN, Matrix factor)
Description copied from interface:BasicDoubleCalculationsMultiplies every entry in the matrix with the entries of another Matrix.- Specified by:
timesin 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
public Matrix divide(Calculation.Ret returnType, boolean ignoreNaN, Matrix factor)
Description copied from interface:BasicDoubleCalculationsDivides every entry in the matrix by the entries of another matrix.- Specified by:
dividein 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
public final Matrix power(Calculation.Ret returnType, double power)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates this matrix to the power of the given value (entrywise).- Specified by:
powerin 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
public final Matrix power(Calculation.Ret returnType, Matrix power)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates this matrix to the power of the given matrix (entrywise).- Specified by:
powerin 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
public final Matrix gt(Calculation.Ret returnType, Matrix matrix)
- Specified by:
gtin interfaceBooleanCalculations
-
gt
public final Matrix gt(Calculation.Ret returnType, double value)
- Specified by:
gtin interfaceBooleanCalculations
-
and
public final Matrix and(Calculation.Ret returnType, Matrix matrix)
- Specified by:
andin interfaceBooleanCalculations
-
and
public final Matrix and(Calculation.Ret returnType, boolean value)
- Specified by:
andin interfaceBooleanCalculations
-
or
public final Matrix or(Calculation.Ret returnType, Matrix matrix)
- Specified by:
orin interfaceBooleanCalculations
-
or
public final Matrix or(Calculation.Ret returnType, boolean value)
- Specified by:
orin interfaceBooleanCalculations
-
xor
public final Matrix xor(Calculation.Ret returnType, Matrix matrix)
- Specified by:
xorin interfaceBooleanCalculations
-
xor
public final Matrix xor(Calculation.Ret returnType, boolean value)
- Specified by:
xorin interfaceBooleanCalculations
-
not
public final Matrix not(Calculation.Ret returnType)
- Specified by:
notin interfaceBooleanCalculations
-
lt
public final Matrix lt(Calculation.Ret returnType, Matrix matrix)
- Specified by:
ltin interfaceBooleanCalculations
-
lt
public final Matrix lt(Calculation.Ret returnType, double value)
- Specified by:
ltin interfaceBooleanCalculations
-
ge
public final Matrix ge(Calculation.Ret returnType, Matrix matrix)
- Specified by:
gein interfaceBooleanCalculations
-
ge
public final Matrix ge(Calculation.Ret returnType, double value)
- Specified by:
gein interfaceBooleanCalculations
-
le
public final Matrix le(Calculation.Ret returnType, Matrix matrix)
- Specified by:
lein interfaceBooleanCalculations
-
le
public final Matrix le(Calculation.Ret returnType, double value)
- Specified by:
lein interfaceBooleanCalculations
-
eq
public final Matrix eq(Calculation.Ret returnType, Matrix matrix)
- Specified by:
eqin interfaceBooleanCalculations
-
eq
public final Matrix eq(Calculation.Ret returnType, java.lang.Object value)
- Specified by:
eqin interfaceBooleanCalculations
-
ne
public final Matrix ne(Calculation.Ret returnType, Matrix matrix)
- Specified by:
nein interfaceBooleanCalculations
-
ne
public final Matrix ne(Calculation.Ret returnType, java.lang.Object value)
- Specified by:
nein interfaceBooleanCalculations
-
getValueCount
public long getValueCount()
- Specified by:
getValueCountin interfaceBaseMatrixProperties
-
getCoordinatesOfMaximum
public final long[] getCoordinatesOfMaximum()
Description copied from interface:CoordinateFunctionsReturns 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:
getCoordinatesOfMaximumin interfaceCoordinateFunctions- Returns:
- Coordinates of the maximum value @
-
getCoordinatesOfMinimum
public final long[] getCoordinatesOfMinimum()
Description copied from interface:CoordinateFunctionsReturns 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:
getCoordinatesOfMinimumin interfaceCoordinateFunctions- Returns:
- Coordinates of the minimum value @
-
selectedCoordinates
public java.lang.Iterable<long[]> selectedCoordinates(java.lang.String selection)
Description copied from interface:CoordinateFunctionsReturns 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:
selectedCoordinatesin interfaceCoordinateFunctions- Parameters:
selection- The String defining the selection of rows or columns- Returns:
- Iterable over the desired Coordinates
-
selectedCoordinates
public java.lang.Iterable<long[]> selectedCoordinates(long[]... selection)
Description copied from interface:CoordinateFunctionsReturns 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:
selectedCoordinatesin 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:
isTransientin interfaceBaseMatrixProperties
-
nonZeroCoordinates
public java.lang.Iterable<long[]> nonZeroCoordinates()
- Specified by:
nonZeroCoordinatesin interfaceCoordinateFunctions
-
toDoubleArray
public double[][] toDoubleArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of double values.- Specified by:
toDoubleArrayin interfaceGettersAndSetters- Returns:
- double array with matrix entries @
-
toObjectArray
public java.lang.Object[][] toObjectArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of Objects.- Specified by:
toObjectArrayin interfaceGettersAndSetters- Returns:
- Object array with matrix entries @
-
toIntArray
public int[][] toIntArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of int values.- Specified by:
toIntArrayin interfaceGettersAndSetters- Returns:
- int array with matrix entries @
-
toLongArray
public long[][] toLongArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of long values.- Specified by:
toLongArrayin interfaceGettersAndSetters- Returns:
- long array with matrix entries @
-
toShortArray
public short[][] toShortArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of short values.- Specified by:
toShortArrayin interfaceGettersAndSetters- Returns:
- short array with matrix entries @
-
toCharArray
public char[][] toCharArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of char values.- Specified by:
toCharArrayin interfaceGettersAndSetters- Returns:
- char array with matrix entries @
-
toStringArray
public java.lang.String[][] toStringArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of Strings.- Specified by:
toStringArrayin interfaceGettersAndSetters- Returns:
- String array with matrix entries @
-
toByteArray
public byte[][] toByteArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of byte values.- Specified by:
toByteArrayin interfaceGettersAndSetters- Returns:
- byte array with matrix entries @
-
toBooleanArray
public boolean[][] toBooleanArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of boolean values.- Specified by:
toBooleanArrayin interfaceGettersAndSetters- Returns:
- boolean array with matrix entries @
-
toFloatArray
public float[][] toFloatArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of float values.- Specified by:
toFloatArrayin interfaceGettersAndSetters- Returns:
- float array with matrix entries @
-
toDateArray
public java.util.Date[][] toDateArray()
Description copied from interface:GettersAndSettersConverts the content of a matrix into a 2-dimensional array of Date values.- Specified by:
toDateArrayin interfaceGettersAndSetters- Returns:
- Date array with matrix entries @
-
toBigDecimalArray
public java.math.BigDecimal[][] toBigDecimalArray()
- Specified by:
toBigDecimalArrayin interfaceGettersAndSetters
-
toBigIntegerArray
public java.math.BigInteger[][] toBigIntegerArray()
- Specified by:
toBigIntegerArrayin interfaceGettersAndSetters
-
sqrt
public final Matrix sqrt(Calculation.Ret returnType)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates the square root of all the entries in a Matrix.- Specified by:
sqrtin 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
public final Matrix round(Calculation.Ret returnType)
Description copied from interface:RoundingDoubleCalculationsReturns a matrix with all entries rounded to integer values.- Specified by:
roundin 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
public final Matrix ceil(Calculation.Ret returnType)
Description copied from interface:RoundingDoubleCalculationsReturns a matrix with all entries rounded up to the next integer. The result is a new Matrix.- Specified by:
ceilin 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
public final Matrix extractAnnotation(Calculation.Ret returnType, int dimension)
Description copied from interface:ObjectCalculationsGenerates 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:
extractAnnotationin 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.ALLor omit the dimensions parameter.- Returns:
- new Matrix with annotation generated from content. @
-
includeAnnotation
public final Matrix includeAnnotation(Calculation.Ret returnType, int dimension)
- Specified by:
includeAnnotationin interfaceObjectCalculations
-
floor
public final Matrix floor(Calculation.Ret returnType)
Description copied from interface:RoundingDoubleCalculationsReturns a matrix with all entries rounded down to the next integer. The result is a new Matrix.- Specified by:
floorin 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
public final javax.swing.JFrame showGUI()
Description copied from interface:HasGUIObjectThis method will show the object in a JFrame on the screen.- Specified by:
showGUIin interfaceHasGUIObject
-
fireValueChanged
public void fireValueChanged()
Description copied from interface:HasGUIObjectThis 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:
fireValueChangedin interfaceHasGUIObject- Specified by:
fireValueChangedin interfaceMatrix
-
fireValueChanged
public void fireValueChanged(Coordinates coordinates, java.lang.Object object)
- Specified by:
fireValueChangedin interfaceMatrix
-
fireValueChanged
public void fireValueChanged(Coordinates start, Coordinates end)
- Specified by:
fireValueChangedin interfaceMatrix
-
mtimes
public Matrix mtimes(Matrix matrix)
Description copied from interface:BasicDoubleCalculationsPerforms a matrix multiplication on the two matrices. The matrices must be 2-dimensional and have the correct size.- Specified by:
mtimesin interfaceBasicDoubleCalculations- Parameters:
matrix- the second matrix- Returns:
- Matrix product
-
mtimes
public Matrix mtimes(Calculation.Ret returnType, boolean ignoreNaN, Matrix matrix)
Description copied from interface:BasicDoubleCalculationsPerforms a matrix multiplication on the two matrices. The matrices must be 2-dimensional and have the correct size.- Specified by:
mtimesin 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:GettersAndSettersReturns a byte representation of an entry in the matrix. The stored value will be converted to a boolean as good as possible.- Specified by:
getAsBooleanin 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:GettersAndSettersSets 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:
setAsBooleanin interfaceGettersAndSetters- Parameters:
value- boolean valuecoordinates- location of the entry @
-
getAsInt
public int getAsInt(long... coordinates)
Description copied from interface:GettersAndSettersReturns an int representation of an entry in the matrix. The stored value will be converted to an int as good as possible.- Specified by:
getAsIntin 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:GettersAndSettersSets 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:
setAsIntin interfaceGettersAndSetters- Parameters:
value- int valuecoordinates- location of the entry @
-
getAsByte
public byte getAsByte(long... coordinates)
Description copied from interface:GettersAndSettersReturns a byte representation of an entry in the matrix. The stored value will be converted to a byte as good as possible.- Specified by:
getAsBytein interfaceGettersAndSetters- Parameters:
coordinates- location of the entry- Returns:
- a byte representation of the entry @
-
getAsByteArray
public byte[] getAsByteArray(long... coordinates)
Description copied from interface:GettersAndSettersReturns 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:
getAsByteArrayin 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:GettersAndSettersSets 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:
setAsByteArrayin interfaceGettersAndSetters- Parameters:
value- byte arraycoordinates- location of the entry @
-
setAsByte
public void setAsByte(byte value, long... coordinates)Description copied from interface:GettersAndSettersSets 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:
setAsBytein interfaceGettersAndSetters- Parameters:
value- byte valuecoordinates- location of the entry @
-
getAsChar
public char getAsChar(long... coordinates)
Description copied from interface:GettersAndSettersReturns a char representation of an entry in the matrix. The stored value will be converted to a char as good as possible.- Specified by:
getAsCharin interfaceGettersAndSetters- Parameters:
coordinates- location of the entry- Returns:
- a char representation of the entry @
-
getAsBigInteger
public java.math.BigInteger getAsBigInteger(long... coordinates)
- Specified by:
getAsBigIntegerin interfaceGettersAndSetters
-
getAsBigDecimal
public java.math.BigDecimal getAsBigDecimal(long... coordinates)
- Specified by:
getAsBigDecimalin interfaceGettersAndSetters
-
setAsChar
public void setAsChar(char value, long... coordinates)Description copied from interface:GettersAndSettersSets 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:
setAsCharin interfaceGettersAndSetters- Parameters:
value- char valuecoordinates- location of the entry @
-
setAsBigDecimal
public void setAsBigDecimal(java.math.BigDecimal value, long... coordinates)- Specified by:
setAsBigDecimalin interfaceGettersAndSetters
-
setAsBigInteger
public void setAsBigInteger(java.math.BigInteger value, long... coordinates)- Specified by:
setAsBigIntegerin interfaceGettersAndSetters
-
getAsFloat
public float getAsFloat(long... coordinates)
Description copied from interface:GettersAndSettersReturns a float representation of an entry in the matrix. The stored value will be converted to a float as good as possible.- Specified by:
getAsFloatin 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:GettersAndSettersSets 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:
setAsFloatin interfaceGettersAndSetters- Parameters:
value- float valuecoordinates- location of the entry @
-
getAsShort
public short getAsShort(long... coordinates)
Description copied from interface:GettersAndSettersReturns a short representation of an entry in the matrix. The stored value will be converted to a short as good as possible.- Specified by:
getAsShortin interfaceGettersAndSetters- Parameters:
coordinates- location of the entry- Returns:
- a short representation of the entry @
-
getAsMatrix
public Matrix getAsMatrix(long... coordinates)
- Specified by:
getAsMatrixin interfaceGettersAndSetters
-
setAsMatrix
public void setAsMatrix(Matrix m, long... coordinates)
- Specified by:
setAsMatrixin interfaceGettersAndSetters
-
setAsShort
public void setAsShort(short value, long... coordinates)Description copied from interface:GettersAndSettersSets 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:
setAsShortin interfaceGettersAndSetters- Parameters:
value- short valuecoordinates- location of the entry @
-
getAsLong
public long getAsLong(long... coordinates)
Description copied from interface:GettersAndSettersReturns a long representation of an entry in the matrix. The stored value will be converted to a long as good as possible.- Specified by:
getAsLongin 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:GettersAndSettersSets 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:
setAsLongin interfaceGettersAndSetters- Parameters:
value- long valuecoordinates- location of the entry @
-
getAsDate
public java.util.Date getAsDate(long... coordinates)
Description copied from interface:GettersAndSettersReturns 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:
getAsDatein interfaceGettersAndSetters- Parameters:
coordinates- location of the entry- Returns:
- a String representation of the entry @
-
setAsDate
public void setAsDate(java.util.Date date, long... coordinates)Description copied from interface:GettersAndSettersSets 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:
setAsDatein interfaceGettersAndSetterscoordinates- location of the entry @
-
delete
public final Matrix delete(Calculation.Ret returnType, java.lang.String selection)
Description copied from interface:ObjectCalculationsDeletes 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:
deletein 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
public final Matrix delete(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number>... selection)
Description copied from interface:ObjectCalculationsDelete rows and columns in the Matrix and returns a link to it.- Specified by:
deletein 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
public final Matrix delete(Calculation.Ret returnType, long[]... selection)
Description copied from interface:ObjectCalculationsDelete rows and columns in the Matrix and returns a link to it.- Specified by:
deletein 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
public final Matrix deleteRows(Calculation.Ret returnType, long... rows)
Description copied from interface:ObjectCalculationsDeletes rows in the Matrix and returns a link to it.- Specified by:
deleteRowsin 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
public final Matrix deleteRows(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number> rows)
Description copied from interface:ObjectCalculationsDeletes rows in the Matrix and returns a link to it.- Specified by:
deleteRowsin 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
public final Matrix deleteColumns(Calculation.Ret returnType, java.util.Collection<? extends java.lang.Number> columns)
Description copied from interface:ObjectCalculationsDeletes columns in the Matrix and returns a link to it.- Specified by:
deleteColumnsin 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
public final Matrix deleteColumns(Calculation.Ret returnType, long... columns)
Description copied from interface:ObjectCalculationsDeletes columns in the Matrix and returns a link to it.- Specified by:
deleteColumnsin interfaceObjectCalculations- Parameters:
returnType- Defines if a new Matrix or a link should be returned.- Returns:
- Link to original Matrix with desired columns @
-
minus
public Matrix minus(Calculation.Ret returnType, boolean ignoreNaN, double v)
Description copied from interface:BasicDoubleCalculationsSubtracts a specified value from all entries in the matrix.- Specified by:
minusin 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
public Matrix minus(Calculation.Ret returnType, boolean ignoreNaN, Matrix m)
Description copied from interface:BasicDoubleCalculationsCalculates the difference of the entries in both matrices- Specified by:
minusin 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
public Matrix plus(Calculation.Ret returnType, boolean ignoreNaN, double v)
Description copied from interface:BasicDoubleCalculationsAdds a specified value from all entries in the matrix.- Specified by:
plusin 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
public Matrix plus(Calculation.Ret returnType, boolean ignoreNaN, Matrix m)
Description copied from interface:BasicDoubleCalculationsCalculates the sum of the entries in both matrices- Specified by:
plusin 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
public Matrix transpose()
Description copied from interface:ObjectCalculationsReturns the transpose of the Matrix, where rows and columns are exchanged. This works also if the Matrix has more than two dimensions.- Specified by:
transposein interfaceObjectCalculations- Returns:
- transposed Matrix.
-
transpose
public Matrix transpose(Calculation.Ret returnType)
Description copied from interface:ObjectCalculationsReturns the transpose of the Matrix, where rows and columns are exchanged. This works also if the Matrix has more than two dimensions.- Specified by:
transposein interfaceObjectCalculations- Parameters:
returnType- Defines if a new Matrix or a link should be returned.- Returns:
- transposed Matrix.
-
diag
public Matrix diag(Calculation.Ret returnType)
- Specified by:
diagin interfaceObjectCalculations
-
mean
public Matrix mean(Calculation.Ret returnType, int dimension, boolean ignoreNaN)
Description copied from interface:StatisticalDoubleCalculationsCalculates the mean of all entries in the Matrix either per row, per column, or global.- Specified by:
meanin 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:StatisticalDoubleCalculationsCalculates the variance of all entries in the Matrix either per row, per column, or global.- Specified by:
varin 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:StatisticalDoubleCalculationsCalculates the standard deviation of all entries in the Matrix either per row, per column, or global.- Specified by:
stdin 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:
getColumnCountin interfaceBaseMatrixProperties
-
getRowCount
public long getRowCount()
- Specified by:
getRowCountin interfaceBaseMatrixProperties
-
getZCount
public long getZCount()
- Specified by:
getZCountin interfaceBaseMatrixProperties
-
getSize
public final long getSize(int dimension)
- Specified by:
getSizein interfaceBaseMatrixProperties
-
getSize
public long[] getSize()
- Specified by:
getSizein interfaceBaseMatrixProperties
-
prod
public Matrix prod(Calculation.Ret returnType, int dimension, boolean ignoreNaN)
- Specified by:
prodin interfaceStatisticalDoubleCalculations
-
diff
public Matrix diff(Calculation.Ret returnType, int dimension, boolean ignoreNaN)
- Specified by:
diffin interfaceStatisticalDoubleCalculations
-
sum
public final Matrix sum(Calculation.Ret returnType, int dimension, boolean ignoreNaN)
Description copied from interface:StatisticalDoubleCalculationsCalculates the sum of all entries in the Matrix either per row, per column, or global.- Specified by:
sumin 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
public final Matrix sign(Calculation.Ret returnType)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates 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:
signin 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
public java.lang.String toString()
- Specified by:
toStringin interfaceBaseMatrixProperties- Overrides:
toStringin classjava.lang.Object
-
ones
public final Matrix ones(Calculation.Ret ret)
Description copied from interface:CreatorDoubleCalculationsReturns a matrix with equal size, where all entries are set to 1.0.- Specified by:
onesin interfaceCreatorDoubleCalculations- Returns:
- Matrix with ones.
-
nans
public final Matrix nans(Calculation.Ret ret)
Description copied from interface:CreatorDoubleCalculationsReturns a matrix with equal size, where all entries are set to Double.NaN.- Specified by:
nansin interfaceCreatorDoubleCalculations- Returns:
- Matrix with NaNs.
-
fill
public final Matrix fill(Calculation.Ret ret, java.lang.Object value)
Description copied from interface:ObjectCalculationsReturns a matrix with equal size, where all entries are set to a desired value.- Specified by:
fillin interfaceObjectCalculationsvalue- fill with this value- Returns:
- Matrix with ones.
-
zeros
public final Matrix zeros(Calculation.Ret ret)
Description copied from interface:CreatorDoubleCalculationsReturns a matrix with equal size, where all entries are set to zero.- Specified by:
zerosin interfaceCreatorDoubleCalculations- Returns:
- Matrix with zeros.
-
eye
public final Matrix eye(Calculation.Ret ret)
Description copied from interface:CreatorDoubleCalculationsReturns a matrix with ones at the diagonal.- Specified by:
eyein interfaceCreatorDoubleCalculations- Returns:
- Eye matrix with ones at the diagonal
-
plus
public Matrix plus(double value)
Description copied from interface:BasicDoubleCalculationsAdds a specified value to all entries in the matrix.- Specified by:
plusin interfaceBasicDoubleCalculations- Parameters:
value- the value to add- Returns:
- Matrix with the entries plus the value
-
plus
public Matrix plus(Matrix m)
Description copied from interface:BasicDoubleCalculationsCalculates the sum of the entries in both matrices- Specified by:
plusin interfaceBasicDoubleCalculations- Parameters:
m- The matrix to add- Returns:
- matrix with sum values
-
minus
public Matrix minus(double value)
Description copied from interface:BasicDoubleCalculationsSubtracts a specified value from all entries in the matrix.- Specified by:
minusin interfaceBasicDoubleCalculations- Parameters:
value- the value to subtract- Returns:
- Matrix with the entries minus the value
-
minus
public Matrix minus(Matrix m)
Description copied from interface:BasicDoubleCalculationsCalculates the difference of the entries in both matrices- Specified by:
minusin interfaceBasicDoubleCalculations- Parameters:
m- The matrix to subtract- Returns:
- matrix with difference values
-
rand
public final Matrix rand(Calculation.Ret ret)
Description copied from interface:CreatorDoubleCalculationsReturns a matrix with equal size, where all entries are set to uniform random values between 0.0 and 1.0.- Specified by:
randin interfaceCreatorDoubleCalculations- Returns:
- Matrix with uniformly distributed values.
-
randn
public final Matrix randn(Calculation.Ret ret)
Description copied from interface:CreatorDoubleCalculationsReturns 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:
randnin interfaceCreatorDoubleCalculations- Returns:
- Matrix with normally distributed values.
-
compareTo
public int compareTo(Matrix m)
- Specified by:
compareToin interfacejava.lang.Comparable<Matrix>
-
rank
public int rank()
- Specified by:
rankin interfaceExtendedMatrixProperties
-
isSPD
public final boolean isSPD()
- Specified by:
isSPDin interfaceExtendedMatrixProperties
-
isSymmetric
public final boolean isSymmetric()
- Specified by:
isSymmetricin interfaceBaseMatrixProperties
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceBaseMatrixProperties
-
abs
public final Matrix abs(Calculation.Ret returnType)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates the absolute values of all entries in a Matrix. Positive values stay the same, negative values change sign.- Specified by:
absin 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
public final Matrix log(Calculation.Ret returnType)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates the natural logarithm of all entries in the Matrix.- Specified by:
login 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
public final Matrix setContent(Calculation.Ret returnType, Matrix newContent, long... position)
- Specified by:
setContentin interfaceExtendedMatrixProperties
-
exp
public final Matrix exp(Calculation.Ret returnType)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates the exponential function for all entries in the Matrix.- Specified by:
expin 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
public final Matrix logistic(Calculation.Ret returnType)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates the logistic function for all entries in the Matrix.- Specified by:
logisticin 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
public final Matrix sortrows(Calculation.Ret returnType, long column, boolean reverse)
- Specified by:
sortrowsin interfaceObjectCalculations
-
cumsum
public final Matrix cumsum(boolean ignoreNaN)
- Specified by:
cumsumin interfaceStatisticalDoubleCalculations
-
cumprod
public final Matrix cumprod(boolean ignoreNaN)
- Specified by:
cumprodin interfaceStatisticalDoubleCalculations
-
log2
public final Matrix log2(Calculation.Ret returnType)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates the logarithm with basis 2 of all entries in the Matrix.- Specified by:
log2in 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
public final Matrix log10(Calculation.Ret returnType)
Description copied from interface:BasicEntrywiseDoubleCalculationsCalculates the logarithm with basis 10 of all entries in the Matrix.- Specified by:
log10in 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:
isDiagonalin interfaceBaseMatrixProperties
-
isSquare
public final boolean isSquare()
- Specified by:
isSquarein interfaceBaseMatrixProperties
-
euklideanDistanceTo
public double euklideanDistanceTo(Matrix m, boolean ignoreNaN)
- Specified by:
euklideanDistanceToin interfaceDistanceMeasures
-
det
public double det()
- Specified by:
detin interfaceExtendedMatrixProperties
-
pdet
public double pdet()
- Specified by:
pdetin interfaceExtendedMatrixProperties
-
isSingular
public boolean isSingular()
- Specified by:
isSingularin interfaceBaseMatrixProperties
-
manhattenDistanceTo
public double manhattenDistanceTo(Matrix m, boolean ignoreNaN)
- Specified by:
manhattenDistanceToin interfaceDistanceMeasures
-
manhattenDistance
public Matrix manhattenDistance(Calculation.Ret returnType, boolean ignoreNaN)
- Specified by:
manhattenDistancein interfaceDistanceMeasures
-
euklideanDistance
public Matrix euklideanDistance(Calculation.Ret returnType, boolean ignoreNaN)
- Specified by:
euklideanDistancein interfaceDistanceMeasures
-
minkowskiDistance
public final Matrix minkowskiDistance(Calculation.Ret returnType, double p, boolean ignoreNaN)
- Specified by:
minkowskiDistancein interfaceDistanceMeasures
-
cosineSimilarity
public final Matrix cosineSimilarity(Calculation.Ret returnType, boolean ignoreNaN)
- Specified by:
cosineSimilarityin interfaceDistanceMeasures
-
cosineSimilarityTo
public double cosineSimilarityTo(Matrix m, boolean ignoreNaN)
- Specified by:
cosineSimilarityToin interfaceDistanceMeasures
-
minkowskiDistanceTo
public double minkowskiDistanceTo(Matrix m, double p, boolean ignoreNaN)
- Specified by:
minkowskiDistanceToin interfaceDistanceMeasures
-
chebyshevDistanceTo
public double chebyshevDistanceTo(Matrix m, boolean ignoreNaN)
- Specified by:
chebyshevDistanceToin interfaceDistanceMeasures
-
min
public Matrix min(Calculation.Ret returnType, int dimension)
Description copied from interface:StatisticalDoubleCalculationsCalculates the mimimum of the values in the matrix either rowwise, columnwise, or global.- Specified by:
minin 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
public Matrix max(Calculation.Ret returnType, int dimension)
Description copied from interface:StatisticalDoubleCalculationsCalculates the maximum of the values in the matrix either rowwise, columnwise, or global.- Specified by:
maxin 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
public final Matrix addMissing(Calculation.Ret returnType, int dimension, double... percentMissing)
Description copied from interface:MissingValueDoubleCalculationsAdds a specified amount of missing values (Double.NaN) to the Matrix- Specified by:
addMissingin 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
public Matrix countMissing(Calculation.Ret returnType, int dimension)
Description copied from interface:MissingValueDoubleCalculationsCounts the missing values within the matrix, i.e. Infinity or NaN- Specified by:
countMissingin 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:
isScalarin interfaceBaseMatrixProperties
-
isRowVector
public final boolean isRowVector()
- Specified by:
isRowVectorin interfaceBaseMatrixProperties
-
isColumnVector
public final boolean isColumnVector()
- Specified by:
isColumnVectorin interfaceBaseMatrixProperties
-
isMultidimensionalMatrix
public final boolean isMultidimensionalMatrix()
- Specified by:
isMultidimensionalMatrixin interfaceBaseMatrixProperties
-
sinh
public Matrix sinh(Calculation.Ret returnType)
Description copied from interface:HyperbolicDoubleCalculationsCalculates the hyperbolic sinus of all entries in the matrix.- Specified by:
sinhin 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
public Matrix cosh(Calculation.Ret returnType)
Description copied from interface:HyperbolicDoubleCalculationsCalculates the hyperbolic cosinus of all entries in the matrix.- Specified by:
coshin 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
public Matrix tanh(Calculation.Ret returnType)
Description copied from interface:HyperbolicDoubleCalculationsCalculates the hyperbolic tangens of all entries in the matrix.- Specified by:
tanhin 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
public Matrix sin(Calculation.Ret returnType)
Description copied from interface:TrigonometricDoubleCalculationsCalculates the sinus of all entries in the matrix.- Specified by:
sinin 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
public Matrix cos(Calculation.Ret returnType)
Description copied from interface:TrigonometricDoubleCalculationsCalculates the cosinus of all entries in the matrix.- Specified by:
cosin 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
public Matrix tril(Calculation.Ret returnType, int k)
- Specified by:
trilin interfaceObjectCalculations
-
triu
public Matrix triu(Calculation.Ret returnType, int k)
- Specified by:
triuin interfaceObjectCalculations
-
tan
public Matrix tan(Calculation.Ret returnType)
Description copied from interface:TrigonometricDoubleCalculationsCalculates the tangens of all entries in the matrix.- Specified by:
tanin 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
public Matrix cov(Calculation.Ret returnType, boolean ignoreNaN, boolean besselsCorrection)
Description copied from interface:StatisticalDoubleCalculationsCalculates the covariance Matrix. Each row is an observation and each column is a variable.- Specified by:
covin 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
public Matrix corrcoef(Calculation.Ret returnType, boolean ignoreNaN, boolean besselsCorrection)
Description copied from interface:StatisticalDoubleCalculationsCalculates the Pearson correlation. Each row is an observation and each column is a variable.- Specified by:
corrcoefin 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
public Matrix mutualInf(Calculation.Ret returnType)
Description copied from interface:StatisticalDoubleCalculationsCalculates the mutual information. Each row is an observation and each column is a variable.- Specified by:
mutualInfin 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
public Matrix pairedTTest(Calculation.Ret returnType)
Description copied from interface:StatisticalDoubleCalculationsCalculates a paired T-Test on the matrix. Each row is an observation and each column is a variable.- Specified by:
pairedTTestin 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
public Matrix bootstrap(Calculation.Ret returnType)
- Specified by:
bootstrapin interfaceObjectCalculations
-
grayScale
public Matrix grayScale(Calculation.Ret returnType, GrayScale.ColorChannel colorChannel)
- Specified by:
grayScalein interfaceMiscEntrywiseDoubleCalculations
-
translate
public Matrix translate(Calculation.Ret returnType, java.lang.String sourceLanguage, java.lang.String targetLanguage)
- Specified by:
translatein interfaceStringCalculations
-
lowerCase
public Matrix lowerCase(Calculation.Ret returnType)
- Specified by:
lowerCasein interfaceStringCalculations
-
upperCase
public Matrix upperCase(Calculation.Ret returnType)
- Specified by:
upperCasein interfaceStringCalculations
-
convertEncoding
public Matrix convertEncoding(Calculation.Ret returnType, java.lang.String encoding)
- Specified by:
convertEncodingin interfaceStringCalculations
-
tfIdf
public Matrix tfIdf(boolean calculateTf, boolean calculateIdf, boolean normalize)
- Specified by:
tfIdfin interfaceStringCalculations
-
removePunctuation
public Matrix removePunctuation(Calculation.Ret ret)
- Specified by:
removePunctuationin interfaceStringCalculations
-
stem
public Matrix stem(Calculation.Ret ret)
- Specified by:
stemin interfaceStringCalculations
-
removeWords
public Matrix removeWords(Calculation.Ret ret, java.util.Collection<java.lang.String> words)
- Specified by:
removeWordsin interfaceStringCalculations
-
unique
public Matrix unique(Calculation.Ret returnType)
- Specified by:
uniquein interfaceObjectCalculations
-
uniqueValueCount
public Matrix uniqueValueCount(Calculation.Ret returnType, int dimension)
- Specified by:
uniqueValueCountin interfaceObjectCalculations
-
bootstrap
public Matrix bootstrap(Calculation.Ret returnType, int count)
- Specified by:
bootstrapin interfaceObjectCalculations
-
transpose
public Matrix transpose(Calculation.Ret returnType, int dimension1, int dimension2)
- Specified by:
transposein interfaceObjectCalculations
-
swap
public Matrix swap(Calculation.Ret returnType, int dimension, long pos1, long pos2)
- Specified by:
swapin interfaceObjectCalculations
-
flipdim
public Matrix flipdim(Calculation.Ret returnType, int dimension)
- Specified by:
flipdimin interfaceObjectCalculations
-
shuffle
public final Matrix shuffle(Calculation.Ret returnType)
- Specified by:
shufflein interfaceObjectCalculations
-
trace
public final double trace()
- Specified by:
tracein interfaceExtendedMatrixProperties
-
setLabel
public void setLabel(java.lang.Object label)
Description copied from interface:HasLabelSets the label of an object
-
getLabel
public final java.lang.String getLabel()
Description copied from interface:HasLabelReturns the String label of an object.
-
setAsString
public void setAsString(java.lang.String string, long... coordinates)Description copied from interface:GettersAndSettersSets 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:
setAsStringin interfaceGettersAndSetterscoordinates- location of the entry @
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceBaseMatrixProperties
-
getAsString
public java.lang.String getAsString(long... coordinates)
Description copied from interface:GettersAndSettersReturns a String representation of an entry in the matrix. The stored value will be converted to a String as good as possible.- Specified by:
getAsStringin interfaceGettersAndSetters- Parameters:
coordinates- location of the entry- Returns:
- a String representation of the entry @
-
getMaxValue
public final double getMaxValue()
- Specified by:
getMaxValuein interfaceExtendedMatrixProperties
-
getMinValue
public final double getMinValue()
- Specified by:
getMinValuein interfaceExtendedMatrixProperties
-
getMeanValue
public final double getMeanValue()
- Specified by:
getMeanValuein interfaceExtendedMatrixProperties
-
getStdValue
public final double getStdValue()
- Specified by:
getStdValuein interfaceExtendedMatrixProperties
-
getValueSum
public final double getValueSum()
- Specified by:
getValueSumin interfaceExtendedMatrixProperties
-
getAbsoluteValueSum
public final double getAbsoluteValueSum()
- Specified by:
getAbsoluteValueSumin interfaceExtendedMatrixProperties
-
getColumnLabel
public final java.lang.String getColumnLabel(long col)
- Specified by:
getColumnLabelin interfaceHasMetaData
-
getRowLabel
public final java.lang.String getRowLabel(long row)
- Specified by:
getRowLabelin interfaceHasMetaData
-
getRowForLabel
public final long getRowForLabel(java.lang.Object object)
- Specified by:
getRowForLabelin interfaceHasMetaData
-
getColumnForLabel
public final long getColumnForLabel(java.lang.Object object)
- Specified by:
getColumnForLabelin interfaceHasMetaData
-
getPositionForLabel
public final long[] getPositionForLabel(int dimension, java.lang.Object label)- Specified by:
getPositionForLabelin interfaceHasMetaData
-
setColumnLabel
public final void setColumnLabel(long col, java.lang.Object label)- Specified by:
setColumnLabelin interfaceHasMetaData
-
setRowLabel
public final void setRowLabel(long row, java.lang.Object label)- Specified by:
setRowLabelin interfaceHasMetaData
-
getAbsoluteValueMean
public final double getAbsoluteValueMean()
- Specified by:
getAbsoluteValueMeanin interfaceExtendedMatrixProperties
-
toRowVector
public final Matrix toRowVector(Calculation.Ret returnType)
- Specified by:
toRowVectorin interfaceObjectCalculations
-
toColumnVector
public final Matrix toColumnVector(Calculation.Ret returnType)
- Specified by:
toColumnVectorin interfaceObjectCalculations
-
replaceMissingBy
public Matrix replaceMissingBy(Matrix matrix)
- Specified by:
replaceMissingByin interfaceMiscGeneralDoubleCalculations
-
deleteColumnsWithMissingValues
public final Matrix deleteColumnsWithMissingValues(Calculation.Ret returnType)
- Specified by:
deleteColumnsWithMissingValuesin interfaceMissingValueDoubleCalculations
-
deleteRowsWithMissingValues
public final Matrix deleteRowsWithMissingValues(Calculation.Ret returnType, long threshold)
- Specified by:
deleteRowsWithMissingValuesin interfaceMissingValueDoubleCalculations
-
appendHorizontally
public final Matrix appendHorizontally(Calculation.Ret returnType, Matrix... matrices)
- Specified by:
appendHorizontallyin interfaceMiscGeneralDoubleCalculations
-
allValues
public java.lang.Iterable<java.lang.Object> allValues()
- Specified by:
allValuesin interfaceBaseMatrixProperties
-
appendVertically
public final Matrix appendVertically(Calculation.Ret returnType, Matrix... matrices)
- Specified by:
appendVerticallyin interfaceMiscGeneralDoubleCalculations
-
append
public final Matrix append(Calculation.Ret returnType, int dimension, Matrix... matrices)
- Specified by:
appendin interfaceMiscGeneralDoubleCalculations
-
discretizeToColumns
public final Matrix discretizeToColumns(long column)
- Specified by:
discretizeToColumnsin interfaceDiscretizeCalculations
-
subMatrix
public final Matrix subMatrix(Calculation.Ret returnType, long... startAndEndCoordinates)
- Specified by:
subMatrixin interfaceObjectCalculations
-
svd
public Matrix[] svd()
Description copied from interface:DecompositionDoubleCalculationsCalculates the singular value decomposition of the matrix: A = U*S*V'- Specified by:
svdin interfaceDecompositionDoubleCalculations- Returns:
- Singular value decomposition of the matrix.
-
svd
public final Matrix[] svd(int k)
Description copied from interface:DecompositionDoubleCalculationsCalculates 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:
svdin interfaceDecompositionDoubleCalculations- Parameters:
k- number of singular values to consider- Returns:
- Singular value decomposition of the matrix.
-
eig
public Matrix[] eig()
Description copied from interface:DecompositionDoubleCalculationsCalculates the Eigen decomposition of the matrix.- Specified by:
eigin interfaceDecompositionDoubleCalculations- Returns:
- Eigen decomposition of the matrix.
-
eigSymm
public Matrix[] eigSymm()
Description copied from interface:DecompositionDoubleCalculationsCalculates the Eigen decomposition of a symmetric matrix.- Specified by:
eigSymmin interfaceDecompositionDoubleCalculations- Returns:
- Eigen decomposition of the matrix.
-
qr
public Matrix[] qr()
Description copied from interface:DecompositionDoubleCalculationsCalculates a QR decomposition of the matrix.- Specified by:
qrin interfaceDecompositionDoubleCalculations- Returns:
- QR decomposition of the matrix.
-
lu
public Matrix[] lu()
Description copied from interface:DecompositionDoubleCalculationsCalculates a LU decomposition of the matrix.- Specified by:
luin interfaceDecompositionDoubleCalculations- Returns:
- LU decomposition of the matrix.
-
chol
public Matrix chol()
Description copied from interface:DecompositionDoubleCalculationsCalculates a Cholesky decomposition of the matrix.- Specified by:
cholin interfaceDecompositionDoubleCalculations- Returns:
- Cholesky decomposition of the matrix.
-
setSize
public void setSize(long... size)
Description copied from interface:BaseMatrixPropertiesSets the size of the matrix. This is an optional method that is not implemented for all matrices. If this method is not implemented, aMatrixExceptionis thrown.- Specified by:
setSizein interfaceBaseMatrixProperties- Parameters:
size- the new size of the matrix
-
reshape
public final Matrix reshape(Calculation.Ret returnType, long... newSize)
- Specified by:
reshapein interfaceObjectCalculations
-
squeeze
public final Matrix squeeze(Calculation.Ret returnType)
- Specified by:
squeezein interfaceObjectCalculations
-
doubleValue
public final double doubleValue()
- Specified by:
doubleValuein interfaceExtendedMatrixProperties- Specified by:
doubleValuein classjava.lang.Number
-
intValue
public final int intValue()
- Specified by:
intValuein interfaceExtendedMatrixProperties- Specified by:
intValuein classjava.lang.Number
-
charValue
public final char charValue()
- Specified by:
charValuein interfaceExtendedMatrixProperties
-
bigIntegerValue
public final java.math.BigInteger bigIntegerValue()
- Specified by:
bigIntegerValuein interfaceExtendedMatrixProperties
-
bigDecimalValue
public final java.math.BigDecimal bigDecimalValue()
- Specified by:
bigDecimalValuein interfaceExtendedMatrixProperties
-
fadeIn
public final Matrix fadeIn(Calculation.Ret ret, int dimension)
- Specified by:
fadeInin interfaceMiscGeneralDoubleCalculations
-
fadeOut
public final Matrix fadeOut(Calculation.Ret ret, int dimension)
- Specified by:
fadeOutin interfaceMiscGeneralDoubleCalculations
-
floatValue
public final float floatValue()
- Specified by:
floatValuein interfaceExtendedMatrixProperties- Specified by:
floatValuein classjava.lang.Number
-
longValue
public final long longValue()
- Specified by:
longValuein interfaceExtendedMatrixProperties- Specified by:
longValuein classjava.lang.Number
-
dateValue
public final java.util.Date dateValue()
- Specified by:
dateValuein interfaceExtendedMatrixProperties
-
booleanValue
public final boolean booleanValue()
- Specified by:
booleanValuein interfaceExtendedMatrixProperties
-
stringValue
public final java.lang.String stringValue()
- Specified by:
stringValuein interfaceExtendedMatrixProperties
-
getRMS
public final double getRMS()
- Specified by:
getRMSin interfaceExtendedMatrixProperties
-
getMetaData
public final java.lang.Object getMetaData(java.lang.Object key)
- Specified by:
getMetaDatain interfaceHasMetaData
-
getMetaDataMatrix
public final Matrix getMetaDataMatrix(java.lang.Object key)
- Specified by:
getMetaDataMatrixin interfaceHasMetaData
-
getMetaDataDouble
public final double getMetaDataDouble(java.lang.Object key)
- Specified by:
getMetaDataDoublein interfaceHasMetaData
-
getMetaDataString
public final java.lang.String getMetaDataString(java.lang.Object key)
- Specified by:
getMetaDataStringin interfaceHasMetaData
-
getMetaData
public final MapMatrix<java.lang.String,java.lang.Object> getMetaData()
- Specified by:
getMetaDatain interfaceHasMetaData
-
setMetaData
public final void setMetaData(MapMatrix<java.lang.String,java.lang.Object> metaData)
- Specified by:
setMetaDatain interfaceHasMetaData
-
setMetaData
public final void setMetaData(java.lang.String key, java.lang.Object value)- Specified by:
setMetaDatain interfaceHasMetaData
-
equalsAnnotation
public final boolean equalsAnnotation(java.lang.Object o)
- Specified by:
equalsAnnotationin interfaceBaseMatrixProperties
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfaceBaseMatrixProperties- Overrides:
equalsin classjava.lang.Object
-
equalsContent
public final boolean equalsContent(java.lang.Object o)
- Specified by:
equalsContentin interfaceBaseMatrixProperties
-
toBooleanMatrix
public final BooleanMatrix toBooleanMatrix()
- Specified by:
toBooleanMatrixin interfaceConversions
-
toByteMatrix
public final ByteMatrix toByteMatrix()
- Specified by:
toByteMatrixin interfaceConversions
-
toCharMatrix
public final CharMatrix toCharMatrix()
- Specified by:
toCharMatrixin interfaceConversions
-
toDoubleMatrix
public final DoubleMatrix toDoubleMatrix()
- Specified by:
toDoubleMatrixin interfaceConversions
-
toFloatMatrix
public final FloatMatrix toFloatMatrix()
- Specified by:
toFloatMatrixin interfaceConversions
-
toIntMatrix
public final IntMatrix toIntMatrix()
- Specified by:
toIntMatrixin interfaceConversions
-
toLongMatrix
public final LongMatrix toLongMatrix()
- Specified by:
toLongMatrixin interfaceConversions
-
toBigDecimalMatrix
public final BaseBigDecimalMatrix toBigDecimalMatrix()
- Specified by:
toBigDecimalMatrixin interfaceConversions
-
toBigIntegerMatrix
public final BigIntegerMatrix toBigIntegerMatrix()
- Specified by:
toBigIntegerMatrixin interfaceConversions
-
toObjectMatrix
public final ObjectMatrix toObjectMatrix()
- Specified by:
toObjectMatrixin interfaceConversions
-
toShortMatrix
public final ShortMatrix toShortMatrix()
- Specified by:
toShortMatrixin interfaceConversions
-
toStringMatrix
public final StringMatrix toStringMatrix()
- Specified by:
toStringMatrixin interfaceConversions
-
norm1
public double norm1()
- Specified by:
norm1in interfaceExtendedMatrixProperties
-
norm2
public double norm2()
- Specified by:
norm2in interfaceExtendedMatrixProperties
-
normInf
public double normInf()
- Specified by:
normInfin interfaceExtendedMatrixProperties
-
normF
public double normF()
- Specified by:
normFin interfaceExtendedMatrixProperties
-
toListMatrix
public ListMatrix<?> toListMatrix()
- Specified by:
toListMatrixin interfaceConversions
-
toSetMatrix
public SetMatrix<?> toSetMatrix()
- Specified by:
toSetMatrixin interfaceConversions
-
toMapMatrix
public MapMatrix<?,?> toMapMatrix()
- Specified by:
toMapMatrixin interfaceConversions
-
containsBigInteger
public boolean containsBigInteger(java.math.BigInteger v)
- Specified by:
containsBigIntegerin interfaceExtendedMatrixProperties
-
containsBigDecimal
public boolean containsBigDecimal(java.math.BigDecimal v)
- Specified by:
containsBigDecimalin interfaceExtendedMatrixProperties
-
containsDate
public boolean containsDate(java.util.Date v)
- Specified by:
containsDatein interfaceExtendedMatrixProperties
-
containsObject
public boolean containsObject(java.lang.Object o)
- Specified by:
containsObjectin interfaceExtendedMatrixProperties
-
containsString
public boolean containsString(java.lang.String s)
- Specified by:
containsStringin interfaceExtendedMatrixProperties
-
containsBoolean
public boolean containsBoolean(boolean v)
- Specified by:
containsBooleanin interfaceExtendedMatrixProperties
-
containsByte
public boolean containsByte(byte v)
- Specified by:
containsBytein interfaceExtendedMatrixProperties
-
containsChar
public boolean containsChar(char v)
- Specified by:
containsCharin interfaceExtendedMatrixProperties
-
containsDouble
public boolean containsDouble(double v)
- Specified by:
containsDoublein interfaceExtendedMatrixProperties
-
containsFloat
public boolean containsFloat(float v)
- Specified by:
containsFloatin interfaceExtendedMatrixProperties
-
containsInt
public boolean containsInt(int v)
- Specified by:
containsIntin interfaceExtendedMatrixProperties
-
containsLong
public boolean containsLong(long v)
- Specified by:
containsLongin interfaceExtendedMatrixProperties
-
containsShort
public boolean containsShort(short v)
- Specified by:
containsShortin interfaceExtendedMatrixProperties
-
containsNull
public boolean containsNull()
- Specified by:
containsNullin interfaceExtendedMatrixProperties
-
exportTo
public MatrixExportDestinationSelector exportTo()
-
importFrom
public MatrixImportSourceSelector importFrom()
- Specified by:
importFromin interfaceMatrix
-
getId
public final java.lang.String getId()
Description copied from interface:HasIdReturns the String id of an object.
-
setId
public final void setId(java.lang.String id)
Description copied from interface:HasIdSets the id of an object
-
getDescription
public final java.lang.String getDescription()
- Specified by:
getDescriptionin interfaceHasDescription
-
getLabelObject
public final java.lang.Object getLabelObject()
Description copied from interface:HasLabelReturns the label of an object.- Specified by:
getLabelObjectin interfaceHasLabel- Returns:
- the label
-
setDescription
public final void setDescription(java.lang.String description)
- Specified by:
setDescriptionin interfaceHasDescription
-
share
public final void share(java.lang.String hostname, int port) throws java.net.UnknownHostException, java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG