-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Labels
Description
DMatrixRMaj can be converted from a double-dimensional array (doulbe[][]) but not the other way around. Can we natively provide an interface for easier testing?
To be more specific, a DMatrixRMaj can be converted from a single-dimensional array or a double-dimensional array, as we can see from the constructors. One use case is asserting the exported matrix is the same as the input matrix. We also have convenience methods to process a Java Matrix or DenseMatrix following processing a DMatrixRMaj.
| public DMatrixRMaj( double[][] data ) { |
public class DMatrixRMaj extends DMatrix1Row {
public DMatrixRMaj(double[][] data) {
this(1, 1);
this.set(data);
}
public DMatrixRMaj(double[] data) {
this.data = (double[])data.clone();
this.numRows = this.data.length;
this.numCols = 1;
}
A DMatrixRMaj can export a single-dimensional array, as this is how the data is stored internally. But shouldn't we support all types from input to output as well?
| return data; |
public abstract class DMatrixD1 implements ReshapeMatrix, DMatrix {
public double[] getData() {
return this.data;
}
Reactions are currently unavailable