public class Matrix extends FunctionParameter
| Modifier and Type | Class and Description |
|---|---|
static class |
Matrix.ValueType |
FunctionParameter.FunctionParameterType| Constructor and Description |
|---|
Matrix(long rows,
long cols,
Matrix.ValueType vType)
This constructor invokes Matrix(String path, long rows, long cols, ValueType vType)
with a default filename of ExternalFunctionProgramBlockCP and hence, should only
be used by CP external functions.
|
Matrix(String path,
long rows,
long cols,
Matrix.ValueType vType)
Constructor that takes matrix file path, num rows, num cols, and matrix
value type as parameters.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getFilePath()
Method to get file path for matrix.
|
double[][] |
getMatrixAsDoubleArray()
Method to get matrix as double array.
|
org.apache.sysml.runtime.controlprogram.caching.MatrixObject |
getMatrixObject() |
long |
getNumCols()
Method to get the number of cols in the matrix.
|
long |
getNumRows()
Method to get the number of rows in the matrix.
|
Matrix.ValueType |
getValueType()
Method to get value type for this matrix.
|
void |
setMatrixDoubleArray(double[] data)
Method to set matrix as double array.
|
void |
setMatrixDoubleArray(double[][] data)
Method to set matrix as double array.
|
void |
setMatrixDoubleArray(MatrixBlock mb,
OutputInfo oinfo,
InputInfo iinfo)
Method to set matrix as double array.
|
void |
setMatrixObject(org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo) |
getTypepublic Matrix(long rows,
long cols,
Matrix.ValueType vType)
rows - number of rowscols - number of columnsvType - value typepublic Matrix(String path, long rows, long cols, Matrix.ValueType vType)
path - file pathrows - number of rowscols - number of columnsvType - value typepublic void setMatrixObject(org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo)
public org.apache.sysml.runtime.controlprogram.caching.MatrixObject getMatrixObject()
public String getFilePath()
public long getNumRows()
public long getNumCols()
public Matrix.ValueType getValueType()
public double[][] getMatrixAsDoubleArray()
throws DMLRuntimeException,
IOException
DMLRuntimeException - if DMLRuntimeException occursIOException - if IOException occurspublic void setMatrixDoubleArray(double[][] data)
throws IOException,
DMLRuntimeException
data - matrix as 2-dimensional double arrayIOException - if IOException occursDMLRuntimeException - if DMLRuntimeException occurspublic void setMatrixDoubleArray(double[] data)
throws IOException,
DMLRuntimeException
data - matrix as double arrayIOException - if IOException occursDMLRuntimeException - if DMLRuntimeException occurspublic void setMatrixDoubleArray(MatrixBlock mb, OutputInfo oinfo, InputInfo iinfo) throws IOException
mb - matrix blockoinfo - output infoiinfo - input infoIOException - if IOException occursCopyright © 2017 The Apache Software Foundation. All rights reserved.