Because sparce vectors do not have most value set, they can have their length increased, and sometimes decreased, without any effort. The length can always be extended. The length can be reduced down to the size of the largest non zero element. @param length the new length of this vector
(int length)
| 169 | * @param length the new length of this vector |
| 170 | */ |
| 171 | public void setLength(int length) |
| 172 | { |
| 173 | if(used > 0 && length < indexes[used-1]) |
| 174 | throw new RuntimeException("Can not set the length to a value less then an index already in use"); |
| 175 | this.length = length; |
| 176 | } |
| 177 | |
| 178 | @Override |
| 179 | public int nnz() |
no outgoing calls