Examples of viewPart()


Examples of cern.colt.matrix.DoubleMatrix2D.viewPart()

  // turn into strings
  // tmp holds "matrix" plus "colStats" below (needed so that numbers in a columns can be decimal point aligned)
  DoubleMatrix2D tmp = matrix.like(matrix.rows()+aggr.length, matrix.columns());
  tmp.viewPart(0,0,matrix.rows(),matrix.columns()).assign(matrix);
  tmp.viewPart(matrix.rows(),0,aggr.length,matrix.columns()).assign(colStats);
  colStats = null;

  String[][] s1 = format(tmp); align(s1); tmp = null;
  String[][] s2 = format(rowStats); align(s2); rowStats = null;
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D.viewPart()

  B.assign(A);
  timer.stop().display();

  timer.reset().start();
  System.out.print("now copying subrange... ");
  B.viewPart(0,0,rows,columns).assign(A.viewPart(0,0,rows,columns));
  timer.stop().display();
  //System.out.println(A);

  timer.reset().start();
  System.out.print("now copying selected... ");
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D.viewPart()

DoubleMatrix2D flip1 = master.viewColumnFlip();
System.out.println("flip around columns="+flip1);
DoubleMatrix2D flip2 = flip1.viewRowFlip();
System.out.println("further flip around rows="+flip2);

flip2.viewPart(0,0,2,2).assign(3);
System.out.println("master replaced"+master);
System.out.println("flip1 replaced"+flip1);
System.out.println("flip2 replaced"+flip2);

View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D.viewPart()

int rows = 4;
int columns = 5; // make a 4*5 matrix
DoubleMatrix2D master = Factory2D.ascending(rows,columns);
//master.assign(1); // set all cells to 1
System.out.println("\n"+master);
master.viewPart(2,0,2,3).assign(2); // set [2,1] .. [3,3] to 2
System.out.println("\n"+master);

int[] indexes = {0,1,3,0,1,2};
DoubleMatrix1D view1 = master.viewRow(0).viewSelection(indexes);
System.out.println("view1="+view1);
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D.viewPart()

int columns = 5; // make a 4*5 matrix
DoubleMatrix2D master = new DenseDoubleMatrix2D(rows,columns);
System.out.println(master);
master.assign(1); // set all cells to 1
System.out.println("\n"+master);
master.viewPart(2,1,2,3).assign(2); // set [2,1] .. [3,3] to 2
System.out.println("\n"+master);

DoubleMatrix2D copyPart = master.viewPart(2,1,2,3).copy();
copyPart.assign(3); // modify an independent copy
copyPart.set(0,0,4);
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D.viewPart()

int columns = 5; // make a 4*5 matrix
DoubleMatrix2D master = new DenseDoubleMatrix2D(rows,columns);
System.out.println(master);
master.assign(1); // set all cells to 1
System.out.println("\n"+master);
master.viewPart(2,0,2,3).assign(2); // set [2,1] .. [3,3] to 2
System.out.println("\n"+master);

DoubleMatrix2D flip1 = master.viewColumnFlip();
System.out.println("flip around columns="+flip1);
DoubleMatrix2D flip2 = flip1.viewRowFlip();
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D.viewPart()

      for (int j = 0; j < nx; j++) {
        X.setQuick(i,j, X.getQuick(i,j) - X.getQuick(k,j)*QR.getQuick(i,k));
      }
    }
  }
  return X.viewPart(0,0,n,nx);
}
/**
Returns a String with (propertyName, propertyValue) pairs.
Useful for debugging or to quickly get the rough picture.
For example,
View Full Code Here

Examples of org.apache.mahout.math.DenseMatrix.viewPart()

        //System.out.printf("%d\t%d\t%d\t%d\n", i, s0.size(), s5.size(), s9.size());
        if (i > 900) {
          double predict5 = predictSize(m5.viewPart(0, k, 0, 3), i, 0.5);
          assertEquals(predict5, Math.log(s5.size()), 1);

          double predict9 = predictSize(m9.viewPart(0, k, 0, 3), i, 0.9);
          assertEquals(predict9, Math.log(s9.size()), 1);

          //assertEquals(10.5 * Math.log(i) - offset0, s0.size(), 10);
        } else if (i > 50) {
          double x = 10.5 * Math.log(i) - s0.size();
View Full Code Here

Examples of org.apache.mahout.math.DenseVector.viewPart()

    input = readCsv("sgd.csv");

    // regenerate the target variable
    Vector target = new DenseVector(60);
    target.assign(0);
    target.viewPart(30, 30).assign(1);
    return target;
  }

  private static void train(Matrix input, Vector target, OnlineLearner lr) {
    RandomUtils.useTestSeed();
View Full Code Here

Examples of org.apache.mahout.math.DenseVector.viewPart()

      double scale = hColumn.norm(1);

      if (scale != 0.0) {
        // Compute Householder transformation.

        ort.viewPart(m, high - m + 1).assign(hColumn, Functions.plusMult(1 / scale));
        double h = ort.viewPart(m, high - m + 1).getLengthSquared();

        double g = Math.sqrt(h);
        if (ort.getQuick(m) > 0) {
          g = -g;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.