Esempio n. 1
0
 public void testSlice() {
   DenseMatrix A = rand(5, 8);
   DenseMatrix B = rand(5, 12);
   DenseMatrix C = rand(4, 8);
   DenseMatrix AB = A.concatRight(B);
   assertTrue(A.equals(AB.cols(0, 8)));
   assertTrue(B.equals(AB.cols(8, 20)));
   DenseMatrix AC = A.concatDown(C);
   assertTrue(A.equals(AC.rows(0, 5)));
   assertTrue(C.equals(AC.rows(5, 9)));
 }
Esempio n. 2
0
 public void testColsIndexeddense() {
   DenseMatrix A = new DenseMatrix("1 5 3; 2 8 5; 1 9 4; 2 5 3").t();
   DenseMatrix indexes = new DenseMatrix("2; 1; 1");
   DenseMatrix B = A.cols(indexes);
   System.out.println(B);
   assertTrue(B.equals(new DenseMatrix("1 9 4; 2 8 5; 2 8 5").t()));
 }