public WrapperLongMatrix2D(LongMatrix2D newContent) { if (newContent != null) try { setUp(newContent.rows(), newContent.columns()); } catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells ! if (!"matrix too large".equals(exc.getMessage())) throw exc; } this.content = newContent; }
public LongMatrix2D assign( final LongMatrix2D y, final cern.colt.function.tlong.LongLongFunction function) { checkShape(y); if (y instanceof WrapperLongMatrix2D) { IntArrayList rowList = new IntArrayList(); IntArrayList columnList = new IntArrayList(); LongArrayList valueList = new LongArrayList(); y.getNonZeros(rowList, columnList, valueList); assign(y, function, rowList, columnList); } else { super.assign(y, function); } return this; }
public boolean equals(long value) { if (content instanceof DiagonalLongMatrix2D) { long[] elements = (long[]) content.elements(); for (int r = 0; r < elements.length; r++) { long x = elements[r]; long diff = value - x; if (diff != 0) { return false; } } return true; } else { return super.equals(value); } }
public synchronized void setQuick(int row, int column, long value) { content.setQuick(row, column, value); }
public LongMatrix1D like1D(int size) { return content.like1D(size); }
public LongMatrix2D like(int rows, int columns) { return content.like(rows, columns); }
public synchronized long getQuick(int row, int column) { return content.getQuick(row, column); }
public Object elements() { return content.elements(); }