/// <summary> /// Gets or sets the matrix cell value at coordinate <i>[row,column]</i>. /// /// <p>Provided with invalid parameters this method may return invalid objects without throwing any exception. /// <b>You should only use this method when you are absolutely sure that the coordinate is within bounds.</b> /// Precondition (unchecked): <i>0 <= column < columns() && 0 <= row < rows()</i>. /// </summary> /// <param name="row">the index of the row-coordinate.</param> /// <param name="column">the index of the column-coordinate.</param> /// <returns>the value at the specified coordinate.</returns> public override double this[int row, int column] { get { int k = Indexes.BinarySearchFromTo(column, Starts[row], Starts[row + 1] - 1); double v = 0; if (k >= 0) { v = Values[k]; } return(v); } set { int k = Indexes.BinarySearchFromTo(column, Starts[row], Starts[row + 1] - 1); if (k >= 0) { // found if (value == 0) { Remove(row, k); } else { Values[k] = value; } return; } if (value != 0) { k = -k - 1; Insert(row, column, k, value); } } }