/// <summary> /// Sanity check for operations requiring two matrices with the same size. /// </summary> /// <param name="b"> /// The second matrix. /// </param> /// <exception cref="ArgumentOutOfRangeException"> /// If <tt>size() != B.size()</tt>. /// </exception> public void CheckSize(AbstractMatrix1D b) { if (Size != b.Size) { throw new ArgumentOutOfRangeException("Incompatible sizes: " + this + " and " + b); } }
/// <summary> /// Returns a string representations of all cells; no alignment considered. /// </summary> /// <param name="vector"> /// The vector. /// </param> /// <returns> /// A string representations of all cells. /// </returns> protected string[] FormatRow(AbstractMatrix1D vector) { Former formatter = null; formatter = factory.Create(formatString); int s = vector.Size; String[] strings = new String[s]; for (int i = 0; i < s; i++) { strings[i] = Form(vector, i, formatter); } return(strings); }
/// <summary> /// Converts a given cell to a String; no alignment considered. /// </summary> protected abstract String Form(AbstractMatrix1D matrix, int index, Former formatter);
/// <summary> /// Returns a short string representation describing the shape of the matrix. /// </summary> /// <param name="matrix"> /// The matrix. /// </param> /// <returns> /// A short string representation describing the shape of the matrix. /// </returns> public static string Shape(AbstractMatrix1D matrix) { return(matrix.Size + " matrix"); }