List of usage examples for org.apache.commons.math3.linear AbstractRealMatrix AbstractRealMatrix
protected AbstractRealMatrix(final int rowDimension, final int columnDimension) throws NotStrictlyPositiveException
From source file:edu.cmu.tetrad.util.MatrixUtils.java
public static RealMatrix transposeWithoutCopy(final RealMatrix apacheData) { return new AbstractRealMatrix(apacheData.getColumnDimension(), apacheData.getRowDimension()) { @Override/*from w w w .j a v a2 s .c om*/ public int getRowDimension() { return apacheData.getColumnDimension(); } @Override public int getColumnDimension() { return apacheData.getRowDimension(); } @Override public RealMatrix createMatrix(int rowDimension, int columnDimension) throws NotStrictlyPositiveException { return apacheData.createMatrix(rowDimension, columnDimension); } @Override public RealMatrix copy() { throw new IllegalArgumentException("Can't copy"); } @Override public double getEntry(int i, int j) throws OutOfRangeException { // throw new UnsupportedOperationException(); return apacheData.getEntry(j, i); } @Override public void setEntry(int i, int j, double v) throws OutOfRangeException { throw new UnsupportedOperationException(); } }; }