Test of set method, of class ShiftedVec.
()
| 161 | * Test of set method, of class ShiftedVec. |
| 162 | */ |
| 163 | @Test |
| 164 | public void testSet() |
| 165 | { |
| 166 | System.out.println("set"); |
| 167 | ShiftedVec a = new ShiftedVec(a_base, shift_a); |
| 168 | |
| 169 | Random rand = RandomUtil.getRandom(); |
| 170 | for(int round = 0; round < 100; round++) |
| 171 | { |
| 172 | int indx = rand.nextInt(a.length()); |
| 173 | double tmp = rand.nextDouble(); |
| 174 | a.set(indx, tmp); |
| 175 | assertEquals(tmp, a.get(indx), 1e-10); |
| 176 | assertEquals(tmp-shift_a, a_base.get(indx), 1e-10); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * Test of increment method, of class ShiftedVec. |