Module datarush.analytics
Class PMMLRealMatrix<T extends Number>
java.lang.Object
com.pervasive.datarush.analytics.pmml.PMMLRealMatrix<T>
Object representation of a PMML matrix
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Number>
PMMLRealMatrix<T>Creates a new dense matrixstatic <T extends Number>
PMMLRealMatrix<T>Creates a new diagonal matrix.abstract PMMLRealMatrix<T>ensureSize(int numRows, int numCols) Sizes the matrix to the given number of rows and columnsabstract Tget(int row, int col) Returns the value of the given matrix elementstatic Class<?>getFieldClass(Class<?> clazz, String name) abstract intReturns the number of columns in the matrixabstract intReturns the number of rows in the matrixabstract Class<?>getType()Gets the numeric datatype of this matrix.static <T extends Number>
PMMLRealMatrix<T>Parses the given matrix elementabstract voidSets the value of the given matrix element.static <T extends Number>
PMMLRealMatrix<T>sparse(T diagDefault, T offDiagDefault) Creates a new sparse matrixstatic <T extends Number>
PMMLRealMatrix<T>Creates a new symmetric matrix.abstract voidAdds this matrix element as a child of the given element
-
Constructor Details
-
PMMLRealMatrix
public PMMLRealMatrix()
-
-
Method Details
-
get
Returns the value of the given matrix element- Parameters:
row- the row of the elementcol- the column of the element- Returns:
- the value of the element
-
set
Sets the value of the given matrix element. Setting to a row/column beyond the size of the matrix will automatically resize as-needed.- Parameters:
row- the row of the elementcol- the column of the elementvalue- the value of the element
-
ensureSize
Sizes the matrix to the given number of rows and columns- Parameters:
numRows- the number of rows.numCols- the number of columns- Returns:
- a "this" reference
-
getNumRows
public abstract int getNumRows()Returns the number of rows in the matrix- Returns:
- the number of rows in the matrix
-
getNumColumns
public abstract int getNumColumns()Returns the number of columns in the matrix- Returns:
- the number of columns in the matrix
-
parse
Parses the given matrix element- Parameters:
e- the element- Returns:
- a matrix object
-
toPMML
Adds this matrix element as a child of the given element- Parameters:
parent- the parent element
-
getType
Gets the numeric datatype of this matrix.- Returns:
-
symmetric
Creates a new symmetric matrix. Values set will automatically appear on both sides of the diagonal- Returns:
- a new symmetric matrix
-
diagonal
Creates a new diagonal matrix. Non-zero values may only be specified on the diagonal.- Returns:
- a new diagonal matrix
-
dense
Creates a new dense matrix- Returns:
- a new dense matrix
-
sparse
Creates a new sparse matrix- Parameters:
diagDefault- the default value for values on the diagonaloffDiagDefault- the default value for values not on the diagonal- Returns:
- a new sparse matrix
-
getFieldClass
-