/** {@inheritDoc} */ public void setSubVector(int index, T[] v) throws MatrixIndexException { checkIndex(index); checkIndex(index + v.length - 1); for (int i = 0; i < v.length; i++) { setEntry(i + index, v[i]); } }
/** {@inheritDoc} */ public void setSubVector(int index, T[] v) throws MatrixIndexException { checkIndex(index); checkIndex(index + v.length - 1); for (int i = 0; i < v.length; i++) { setEntry(i + index, v[i]); } }
/** {@inheritDoc} */ public void setEntry(int index, T value) throws MatrixIndexException { checkIndex(index); entries.put(index, value); }
/** {@inheritDoc} */ public T getEntry(int index) throws MatrixIndexException { checkIndex(index); return entries.get(index); }
/** {@inheritDoc} */ public void setEntry(int index, T value) throws MatrixIndexException { checkIndex(index); entries.put(index, value); }
/** {@inheritDoc} */ public T getEntry(int index) throws MatrixIndexException { checkIndex(index); return entries.get(index); }
/** {@inheritDoc} */ public void setSubVector(int index, FieldVector<T> v) throws MatrixIndexException { checkIndex(index); checkIndex(index + v.getDimension() - 1); setSubVector(index, v.getData()); }
/** {@inheritDoc} */ public void setSubVector(int index, FieldVector<T> v) throws MatrixIndexException { checkIndex(index); checkIndex(index + v.getDimension() - 1); setSubVector(index, v.getData()); }
/** {@inheritDoc} */ public FieldVector<T> getSubVector(int index, int n) throws MatrixIndexException { checkIndex(index); checkIndex(index + n - 1); SparseFieldVector<T> res = new SparseFieldVector<T>(field,n); int end = index + n; OpenIntToFieldHashMap<T>.Iterator iter = entries.iterator(); while (iter.hasNext()) { iter.advance(); int key = iter.key(); if (key >= index && key < end) { res.setEntry(key - index, iter.value()); } } return res; }
/** {@inheritDoc} */ public FieldVector<T> getSubVector(int index, int n) throws MatrixIndexException { checkIndex(index); checkIndex(index + n - 1); SparseFieldVector<T> res = new SparseFieldVector<T>(field,n); int end = index + n; OpenIntToFieldHashMap<T>.Iterator iter = entries.iterator(); while (iter.hasNext()) { iter.advance(); int key = iter.key(); if (key >= index && key < end) { res.setEntry(key - index, iter.value()); } } return res; }