Test of setLength method, of class SparseVector.
()
| 76 | * Test of setLength method, of class SparseVector. |
| 77 | */ |
| 78 | @Test |
| 79 | public void testSetLength() |
| 80 | { |
| 81 | System.out.println("setLength"); |
| 82 | assertEquals(20, x.length()); |
| 83 | assertEquals(20, y.length()); |
| 84 | |
| 85 | y.setLength(25); |
| 86 | |
| 87 | assertEquals(20, x.length()); |
| 88 | assertEquals(25, y.length()); |
| 89 | |
| 90 | try |
| 91 | { |
| 92 | y.setLength(5); |
| 93 | fail("Set length should have been too small"); |
| 94 | } |
| 95 | catch(Exception ex) |
| 96 | { |
| 97 | |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Test of nnz method, of class SparseVector. |