Examples of viewRow()


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

DoubleMatrix2D A = Factory2D.make(size,size);
double value = 5;
for (int i=size; --i >= 0; ) {
  A.setQuick(i,i, value);
}
A.viewRow(0).assign(value);

//DoubleMatrix2D A = Factory2D.makeIdentity(size,size);


//DoubleMatrix2D A = Factory2D.makeAscending(size,size).assign(new cern.jet.random.engine.MersenneTwister());
View Full Code Here

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

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);
DoubleMatrix1D view2 = view1.viewPart(0,3);
System.out.println("view2="+view2);

view2.viewPart(0,2).assign(-1);
View Full Code Here

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

  DoubleMatrix2D X = B.copy();
  int nx = B.columns();
 
  // precompute and cache some views to avoid regenerating them time and again
  DoubleMatrix1D[] Xrows = new DoubleMatrix1D[n];
  for (int k = 0; k < n; k++) Xrows[k] = X.viewRow(k);
 
  // Solve L*Y = B;
  for (int k = 0; k < n; k++) {
    for (int i = k+1; i < n; i++) {
      // X[i,j] -= X[k,j]*L[i,k]
 
View Full Code Here

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

 
  for (int r = rowIndexes.length; --r >= 0; ) {
    int row = rowIndexes[r];
    if (row < 0 || row >= rows)
      throw new IndexOutOfBoundsException("Illegal Index");
    sub.viewRow(r).assign(A.viewRow(row));
  }
  return sub;
}
/**
* Copies the rows of the indicated columns into a new sub matrix.
View Full Code Here

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

* Returns a string representation of the given matrix.
* @param matrix the matrix to convert.
*/
public String toString(DoubleMatrix1D matrix) {
  DoubleMatrix2D easy = matrix.like2D(1,matrix.size());
  easy.viewRow(0).assign(matrix);
  return toString(easy);
}
/**
* Returns a string representation of the given matrix.
* @param matrix the matrix to convert.
View Full Code Here

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

  // a bit clumsy, because Statistic.aggregate(...) is defined on columns, so we need to transpose views
  DoubleMatrix2D tmp = matrix.like(1,matrix.rows());
  hep.aida.bin.BinFunction1D[] func = {aggregate};
  Statistic.aggregate(matrix.viewDice(), func, tmp);
  double[] aggr = tmp.viewRow(0).toArray();
  return sort(matrix,aggr);
}
/**
Sorts the matrix slices into ascending order, according to the <i>natural ordering</i> of the matrix values in the given <tt>[row,column]</tt> position.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.
View Full Code Here

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

* Returns a string representation of the given matrix.
* @param matrix the matrix to convert.
*/
public String toString(DoubleMatrix1D matrix) {
  DoubleMatrix2D easy = matrix.like2D(1,matrix.size());
  easy.viewRow(0).assign(matrix);
  return toString(easy);
}
/**
* Returns a string representation of the given matrix.
* @param matrix the matrix to convert.
View Full Code Here

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

  // a bit clumsy, because Statistic.aggregate(...) is defined on columns, so we need to transpose views
  DoubleMatrix2D tmp = matrix.like(1,matrix.rows());
  hep.aida.bin.BinFunction1D[] func = {aggregate};
  Statistic.aggregate(matrix.viewDice(), func, tmp);
  double[] aggr = tmp.viewRow(0).toArray();
  return sort(matrix,aggr);
}
/**
Sorts the matrix slices into ascending order, according to the <i>natural ordering</i> of the matrix values in the given <tt>[row,column]</tt> position.
The returned view is backed by this matrix, so changes in the returned view are reflected in this matrix, and vice-versa.
View Full Code Here

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

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);
DoubleMatrix1D view2 = view1.viewPart(0,3);
System.out.println("view2="+view2);

view2.viewPart(0,2).assign(-1);
View Full Code Here

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

DoubleMatrix2D A = Factory2D.make(size,size);
double value = 5;
for (int i=size; --i >= 0; ) {
  A.setQuick(i,i, value);
}
A.viewRow(0).assign(value);

//DoubleMatrix2D A = Factory2D.makeIdentity(size,size);


//DoubleMatrix2D A = Factory2D.makeAscending(size,size).assign(new cern.jet.random.engine.MersenneTwister());
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.