Java Code Examples for cern.colt.matrix.DoubleMatrix1D#viewSorted()

The following examples show how to use cern.colt.matrix.DoubleMatrix1D#viewSorted() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestMatrix2D.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 */
public static void doubleTest31(int size) {

System.out.println("\ninit");
DoubleMatrix1D a = Factory1D.dense.descending(size);
DoubleMatrix1D b = new WrapperDoubleMatrix1D(a);
DoubleMatrix1D c = b.viewPart(2,3);
DoubleMatrix1D d = c.viewFlip();
//DoubleMatrix1D c = b.viewFlip();
//DoubleMatrix1D d = c.viewFlip();
d.set(0,99);
b = b.viewSorted();
System.out.println("a = "+a);
System.out.println("b = "+b);
System.out.println("c = "+c);
System.out.println("d = "+d);

System.out.println("done");

}
 
Example 2
Source File: TestMatrix2D.java    From jAudioGIT with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 */
public static void doubleTest31(int size) {

System.out.println("\ninit");
DoubleMatrix1D a = Factory1D.dense.descending(size);
DoubleMatrix1D b = new WrapperDoubleMatrix1D(a);
DoubleMatrix1D c = b.viewPart(2,3);
DoubleMatrix1D d = c.viewFlip();
//DoubleMatrix1D c = b.viewFlip();
//DoubleMatrix1D d = c.viewFlip();
d.set(0,99);
b = b.viewSorted();
System.out.println("a = "+a);
System.out.println("b = "+b);
System.out.println("c = "+c);
System.out.println("d = "+d);

System.out.println("done");

}
 
Example 3
Source File: TestMatrix2D.java    From database with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Title:        Aero3D<p>
 * Description:  A Program to analyse aeroelestic evects in transonic wings<p>
 * Copyright:    Copyright (c) 1999 CERN - European Organization for Nuclear Research.
 * Company:      PIERSOL Engineering Inc.<p>
 * @author John R. Piersol
 * @version
 */
public static void doubleTest36() {
	double[] testSort = new double[5];
	testSort[0] = 5;
	testSort[1] = Double.NaN;
	testSort[2] = 2;
	testSort[3] = Double.NaN;
	testSort[4] = 1;
	DoubleMatrix1D doubleDense = new DenseDoubleMatrix1D(testSort);
	System.out.println("orig = "+doubleDense);
	doubleDense = doubleDense.viewSorted();
	doubleDense.toArray(testSort);
	System.out.println("sort = "+doubleDense);
	System.out.println("done\n");
}
 
Example 4
Source File: TestMatrix2D.java    From jAudioGIT with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Title:        Aero3D<p>
 * Description:  A Program to analyse aeroelestic evects in transonic wings<p>
 * Copyright:    Copyright (c) 1998<p>
 * Company:      PIERSOL Engineering Inc.<p>
 * @author John R. Piersol
 * @version
 */
public static void doubleTest36() {
	double[] testSort = new double[5];
	testSort[0] = 5;
	testSort[1] = Double.NaN;
	testSort[2] = 2;
	testSort[3] = Double.NaN;
	testSort[4] = 1;
	DoubleMatrix1D doubleDense = new DenseDoubleMatrix1D(testSort);
	System.out.println("orig = "+doubleDense);
	doubleDense = doubleDense.viewSorted();
	doubleDense.toArray(testSort);
	System.out.println("sort = "+doubleDense);
	System.out.println("done\n");
}