public void setQuick(int row, int column, double value) {
int i=row;
int j=column;
int k=-1;
IntArrayList indexList = indexes[i];
if (indexList != null) k = indexList.binarySearch(j);
if (k>=0) { // found
if (value==0) {
DoubleArrayList valueList = values[i];
indexList.remove(k);
valueList.remove(k);
int s = indexList.size();
if (s>2 && s*3 < indexList.elements().length) {
indexList.setSize(s*3/2);
indexList.trimToSize();
indexList.setSize(s);
valueList.setSize(s*3/2);
valueList.trimToSize();
valueList.setSize(s);
}
}
else {
values[i].setQuick(k,value);
}
}
else { // not found
if (value==0) return;
k = -k-1;
if (indexList == null) {
indexes[i] = new IntArrayList(3);
values[i] = new DoubleArrayList(3);
}
indexes[i].beforeInsert(k,j);
values[i].beforeInsert(k,value);
}