Пример #1
0
 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;
 }
Пример #2
0
 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;
 }
Пример #3
0
 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);
   }
 }
Пример #4
0
 public synchronized void setQuick(int row, int column, long value) {
   content.setQuick(row, column, value);
 }
Пример #5
0
 public LongMatrix1D like1D(int size) {
   return content.like1D(size);
 }
Пример #6
0
 public LongMatrix2D like(int rows, int columns) {
   return content.like(rows, columns);
 }
Пример #7
0
 public synchronized long getQuick(int row, int column) {
   return content.getQuick(row, column);
 }
Пример #8
0
 public Object elements() {
   return content.elements();
 }