Package cern.colt.matrix

Examples of cern.colt.matrix.ObjectMatrix1D


  if (isNoView && other.isNoView) { // quickest
    System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
    return this;
  }
  if (haveSharedCells(other)) {
    ObjectMatrix1D c = other.copy();
    if (! (c instanceof DenseObjectMatrix1D)) { // should not happen
      return super.assign(source);
    }
    other = (DenseObjectMatrix1D) c;
  }
View Full Code Here


  if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));

  int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
  for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;

  final ObjectMatrix1D col = matrix.viewColumn(column);
  IntComparator comp = new IntComparator() { 
    public int compare(int a, int b) {
      Comparable av = (Comparable) (col.getQuick(a));
      Comparable bv = (Comparable) (col.getQuick(b));
      int r = av.compareTo(bv);
      return r<0 ? -1 : (r>0 ? 1 : 0);
    }
  };
View Full Code Here

  if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));

  int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
  for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;

  final ObjectMatrix1D sliceView = matrix.viewRow(row).viewColumn(column);
  IntComparator comp = new IntComparator() { 
    public int compare(int a, int b) {
      Comparable av = (Comparable) (sliceView.getQuick(a));
      Comparable bv = (Comparable) (sliceView.getQuick(b));
      int r = av.compareTo(bv);
      return r<0 ? -1 : (r>0 ? 1 : 0);
    }
  };
View Full Code Here

      int tmp = g[b]; g[b] = g[c]; g[c] = tmp;
    }
  };
 
  // compare splitter[a] with columnView[rowIndexes[b]]
  final ObjectMatrix1D columnView = matrix.viewColumn(column)
  IntComparator comp = new IntComparator() {
    public int compare(int a, int b) {
      Comparable av = (Comparable) (splitters[a]);
      Comparable bv = (Comparable) (columnView.getQuick(g[b]));
      int r = av.compareTo(bv);
      return r<0 ? -1 : (r==0 ? 0 : 1);
    }
  };

  // compare columnView[rowIndexes[a]] with columnView[rowIndexes[b]]
  IntComparator comp2 = new IntComparator() {
    public int compare(int a, int b) {
      Comparable av = (Comparable) (columnView.getQuick(g[a]));
      Comparable bv = (Comparable) (columnView.getQuick(g[b]));
      int r = av.compareTo(bv);
      return r<0 ? -1 : (r==0 ? 0 : 1);
    }
  };
View Full Code Here

  if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));

  int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
  for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;

  final ObjectMatrix1D col = matrix.viewColumn(column);
  IntComparator comp = new IntComparator() {
    public int compare(int a, int b) {
      Comparable av = (Comparable) (col.getQuick(a));
      Comparable bv = (Comparable) (col.getQuick(b));
      int r = av.compareTo(bv);
      return r<0 ? -1 : (r>0 ? 1 : 0);
    }
  };
View Full Code Here

  if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));

  int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
  for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;

  final ObjectMatrix1D sliceView = matrix.viewRow(row).viewColumn(column);
  IntComparator comp = new IntComparator() {
    public int compare(int a, int b) {
      Comparable av = (Comparable) (sliceView.getQuick(a));
      Comparable bv = (Comparable) (sliceView.getQuick(b));
      int r = av.compareTo(bv);
      return r<0 ? -1 : (r>0 ? 1 : 0);
    }
  };
View Full Code Here

      int tmp = g[b]; g[b] = g[c]; g[c] = tmp;
    }
  };
 
  // compare splitter[a] with columnView[rowIndexes[b]]
  final ObjectMatrix1D columnView = matrix.viewColumn(column);
  IntComparator comp = new IntComparator() {
    public int compare(int a, int b) {
      Comparable av = (Comparable) (splitters[a]);
      Comparable bv = (Comparable) (columnView.getQuick(g[b]));
      int r = av.compareTo(bv);
      return r<0 ? -1 : (r==0 ? 0 : 1);
    }
  };

  // compare columnView[rowIndexes[a]] with columnView[rowIndexes[b]]
  IntComparator comp2 = new IntComparator() {
    public int compare(int a, int b) {
      Comparable av = (Comparable) (columnView.getQuick(g[a]));
      Comparable bv = (Comparable) (columnView.getQuick(g[b]));
      int r = av.compareTo(bv);
      return r<0 ? -1 : (r==0 ? 0 : 1);
    }
  };
View Full Code Here

  if (isNoView && other.isNoView) { // quickest
    System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
    return this;
  }
  if (haveSharedCells(other)) {
    ObjectMatrix1D c = other.copy();
    if (! (c instanceof DenseObjectMatrix1D)) { // should not happen
      return super.assign(source);
    }
    other = (DenseObjectMatrix1D) c;
  }
View Full Code Here

TOP

Related Classes of cern.colt.matrix.ObjectMatrix1D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.