public class Matrix extends FunctionParameter
Modifier and Type | Class and Description |
---|---|
static class |
Matrix.ValueType |
FunctionParameter.FunctionParameterType
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FILENAME |
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(org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo,
Matrix.ValueType vType) |
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) |
getType
public static final String DEFAULT_FILENAME
public 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 Matrix(org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo, Matrix.ValueType vType)
public 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 IOException
IOException
- if IOException occurspublic void setMatrixDoubleArray(double[][] data) throws IOException
data
- matrix as 2-dimensional double arrayIOException
- if IOException occurspublic void setMatrixDoubleArray(double[] data) throws IOException
data
- matrix as double arrayIOException
- if IOException occurspublic void setMatrixDoubleArray(MatrixBlock mb, OutputInfo oinfo, InputInfo iinfo) throws IOException
mb
- matrix blockoinfo
- output infoiinfo
- input infoIOException
- if IOException occursCopyright © 2018 The Apache Software Foundation. All rights reserved.