|
From: <in...@dn...> - 2006-01-25 03:51:13
|
Author: patrick
Date: 2006-01-24 22:50:51 -0500 (Tue, 24 Jan 2006)
New Revision: 184
Added:
trunk/UnitTests/LinearAlgebra/DenseMatrixTest.cs
trunk/UnitTests/LinearAlgebra/SparseMatrixTest.cs
trunk/UnitTests/LinearAlgebra/SparseVectorTest.cs
Removed:
trunk/UnitTests/LinearAlgebra/DenesMatrixTest.cs
trunk/UnitTests/LinearAlgebra/DoubleSparseMatrixTest.cs
trunk/UnitTests/LinearAlgebra/DoubleSparseVectorTest.cs
Modified:
trunk/LinearAlgebra/SparseMatrix.cs
trunk/LinearAlgebra/SparseVector.cs
trunk/LinearAlgebra/VectorBuilder.cs
trunk/NumericalLibrary.csproj
Log:
- Fixed up the SparseVector which should now be complete.
- Fixed up the compile errors in the SparseMatrix. Needs implementation of methods.
- Fixed up the SparseVectorTest.
- Added the SparseVector to the VectorBuilder.
Modified: trunk/LinearAlgebra/SparseMatrix.cs
===================================================================
--- trunk/LinearAlgebra/SparseMatrix.cs 2006-01-25 02:46:17 UTC (rev 183)
+++ trunk/LinearAlgebra/SparseMatrix.cs 2006-01-25 03:50:51 UTC (rev 184)
@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
+using dnAnalytics.Exceptions;
using dnAnalytics.LinearAlgebra;
namespace dnAnalytics.LinearAlgebra
@@ -17,7 +18,7 @@
/// In the current implementation the <c>SparseMatrix</c> uses a
/// compressed row storage system.
/// </remarks>
- public sealed class SparseMatrix : IMatrix
+ public sealed class SparseMatrix : Matrix
{
// UPGRADE NOTE: Could create an iternal class that
// holds the sparse data structure. That way we can interchange
@@ -48,14 +49,6 @@
/// </summary>
internal readonly int[] mRowIndices = new int[0];
/// <summary>
- /// The number of rows in the matrix.
- /// </summary>
- private readonly int mRowCount = -1;
- /// <summary>
- /// The number of columns in the matrix.
- /// </summary>
- private readonly int mColumnCount = -1;
- /// <summary>
/// The total number of non-zero values in the matrix.
/// </summary>
/// <remarks>
@@ -85,9 +78,9 @@
/// <param name="columns">The number of columns in the matrix.</param>
public SparseMatrix(int rows, int columns)
{
- mRowCount = rows;
+ Rows = rows;
mRowIndices = new int[rows];
- mColumnCount = columns;
+ Columns = columns;
}
/// <summary>
@@ -101,14 +94,14 @@
/// non-zero values.
/// </remarks>
/// <param name="source">
- /// The <see cref="IMatrix"/> from which the data will
+ /// The <see cref="Matrix"/> from which the data will
/// be copied to the new instance.
/// </param>
- public SparseMatrix(IMatrix source)
+ public SparseMatrix(Matrix source)
{
- mRowCount = source.Rows;
- mRowIndices = new int[mRowCount];
- mColumnCount = source.Columns;
+ Rows = source.Rows;
+ mRowIndices = new int[Rows];
+ Columns = source.Columns;
for (int i = 0; i < source.Rows; i++)
{
@@ -128,12 +121,12 @@
/// </param>
public SparseMatrix(SparseMatrix source)
{
- mRowCount = source.mRowCount;
+ Rows = source.Rows;
// copy the row indices
mRowIndices = new int[source.mRowIndices.Length];
Buffer.BlockCopy(source.mRowIndices, 0, mRowIndices, 0, mRowIndices.Length * Constants.SizeOfInt);
- mColumnCount = source.mColumnCount;
+ Columns = source.Columns;
// copy the colum indices. Only copy the actual data items. Note that the array
// may be bigger than the number of items we copy.
mColumnIndices = new int[source.mColumnIndices.Length];
@@ -160,9 +153,9 @@
/// copied to the new instance.</param>
public SparseMatrix(double[,] source)
{
- mRowCount = source.GetLength(0);
- mRowIndices = new int[mRowCount];
- mColumnCount = source.GetLength(1);
+ Rows = source.GetLength(0);
+ mRowIndices = new int[Rows];
+ Columns= source.GetLength(1);
for (int i = 0; i < source.GetLength(0); i++)
{
@@ -179,15 +172,15 @@
/// <param name="row">The row index.</param>
/// <param name="column">The column index.</param>
/// <returns>A requested element from the matrix.</returns>
- public double this[int row, int column]
+ public override double this[int row, int column]
{
get
{
- if ((row < 0) || (row > mRowCount - 1))
+ if ((row < 0) || (row > Rows - 1))
{
throw new ArgumentOutOfRangeException("rowIndex", row, "Row index was outside the bounds of the matrix");
}
- if ((column < 0) || (column > mColumnCount - 1))
+ if ((column < 0) || (column > Columns - 1))
{
throw new ArgumentOutOfRangeException("columnIndex", column, "Column index was outside the bounds of the matrix");
}
@@ -201,11 +194,11 @@
}
set
{
- if ((row < 0) || (row > mRowCount - 1))
+ if ((row < 0) || (row > Rows - 1))
{
throw new ArgumentOutOfRangeException("rowIndex", row, "Row index was outside the bounds of the matrix");
}
- if ((column < 0) || (column > mColumnCount - 1))
+ if ((column < 0) || (column > Columns - 1))
{
throw new ArgumentOutOfRangeException("columnIndex", column, "Column index was outside the bounds of the matrix");
}
@@ -478,7 +471,7 @@
/// <returns>The value at the given indices.</returns>
/// <exception cref="IndexOutOfRangeException">Depending on the implementation, an <see cref="IndexOutOfRangeException"/>
/// may be thrown if one of the indices is outside the dimensions of the matrix.</exception>
- public double ValueAt(int row, int column)
+ public override double ValueAt(int row, int column)
{
throw new NotImplementedException();
}
@@ -493,34 +486,12 @@
/// <param name="value">The value to set.</param>
/// <exception cref="IndexOutOfRangeException">Depending on the implementation, an <see cref="IndexOutOfRangeException"/>
/// may be thrown if one of the indices is outside the dimensions of the matrix.</exception>
- public void ValueAt(int row, int column, double value)
+ public override void ValueAt(int row, int column, double value)
{
throw new NotImplementedException();
}
/// <summary>
- /// The number of columns.
- /// </summary>
- public int Columns
- {
- get
- {
- return mColumnCount;
- }
- }
-
- /// <summary>
- /// The numbers of rows.
- /// </summary>
- public int Rows
- {
- get
- {
- return mRowCount;
- }
- }
-
- /// <summary>
/// Returns the number of non zero elements in the matrix.
/// </summary>
/// <value>The number of non zero elements.</value>
@@ -534,46 +505,36 @@
/// <summary>Calculates the Frobenius norm of this matrix.</summary>
/// <returns>The Frobenius norm of this matrix.</returns>
- public double FrobeniusNorm()
+ public override double FrobeniusNorm()
{
throw new NotImplementedException();
}
/// <summary>Calculates the infinity norm of this matrix.</summary>
/// <returns>The infinity norm of this matrix.</returns>
- public double InfinityNorm()
+ public override double InfinityNorm()
{
throw new NotImplementedException();
}
/// <summary>Calculates the L1 norm of this matrix.</summary>
/// <returns>The L1 norm of this matrix.</returns>
- public double L1Norm()
+ public override double L1Norm()
{
throw new NotImplementedException();
}
/// <summary>Calculates the L2 norm of this matrix.</summary>
/// <returns>The L2 norm of this matrix.</returns>
- public double L2Norm()
+ public override double L2Norm()
{
throw new NotImplementedException();
}
/// <summary>
- /// Calculates the P norm of this matrix.
- /// </summary>
- /// <param name="p">The n-th norm to calculate.</param>
- /// <returns>The P norm of the this matrix.</returns>
- public double PNorm(double p)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
/// Sets all values to zero.
/// </summary>
- public void Clear()
+ public override void Clear()
{
mValueCount = 0;
}
@@ -583,7 +544,7 @@
/// </summary>
/// <param name="index">The column to copy.</param>
/// <returns>A vector containing the copied elements.</returns>
- public IVector Column(int index)
+ public override Vector Column(int index)
{
throw new NotImplementedException();
}
@@ -594,7 +555,7 @@
/// <param name="index">The column to copy.</param>
/// <param name="result">The vector to copy the column into.</param>
/// <exception cref="ArgumentNullException">If the result matrix is null.</exception>
- public void Column(int index, IVector result)
+ public override void Column(int index, Vector result)
{
throw new NotImplementedException();
}
@@ -605,7 +566,7 @@
/// <param name="index">The column to copy.</param>
/// <param name="range">The <see cref="Range"/> of elements to copy.</param>
/// <returns>A vector containing the copied elements.</returns>
- public IVector Column(int index, Range range)
+ public override Vector Column(int index, Range range)
{
throw new NotImplementedException();
}
@@ -615,7 +576,7 @@
/// </summary>
/// <param name="range">The <see cref="Range"/> of columns to enumerate over.</param>
/// <returns>An <see cref="IEnumerator"/> that enumerates over a given <see cref="Range"/> of columns of this matrix.</returns>
- public IEnumerator<KeyValuePair<int, IVector>> ColumnEnumerator(Range range)
+ public override IEnumerator<KeyValuePair<int, Vector>> ColumnEnumerator(Range range)
{
throw new NotImplementedException();
}
@@ -624,7 +585,7 @@
/// Returns an <see cref="IEnumerator"/> that enumerates the columns of this matrix.
/// </summary>
/// <returns>An <see cref="IEnumerator"/> that enumerates over the columns of this matrix.</returns>
- public IEnumerator<KeyValuePair<int, IVector>> ColumnEnumerator()
+ public override IEnumerator<KeyValuePair<int, Vector>> ColumnEnumerator()
{
throw new NotImplementedException();
}
@@ -634,7 +595,7 @@
/// </summary>
/// <param name="index">The row to copy.</param>
/// <returns>A vector containing the copied elements.</returns>
- public IVector Row(int index)
+ public override Vector Row(int index)
{
throw new NotImplementedException();
}
@@ -645,7 +606,7 @@
/// <param name="index">The row to copy.</param>
/// <param name="result">The vector to copy the row into.</param>
/// <exception cref="ArgumentNullException">If the result vector is <c>null</c>.</exception>
- public void Row(int index, IVector result)
+ public override void Row(int index, Vector result)
{
throw new NotImplementedException();
}
@@ -656,7 +617,7 @@
/// <param name="index">the column to copy.</param>
/// <param name="range">the <see cref="Range"/> of elements to copy.</param>
/// <returns>a vector containing the copied elements.</returns>
- public IVector Row(int index, Range range)
+ public override Vector Row(int index, Range range)
{
throw new NotImplementedException();
}
@@ -666,7 +627,7 @@
/// </summary>
/// <param name="range">the <see cref="Range"/> of rows to enumerate over.</param>
/// <returns>an <see cref="IEnumerator"/> that enumerates over a given <see cref="Range"/> of rowss of this matrix.</returns>
- public IEnumerator<KeyValuePair<int, IVector>> RowEnumerator(Range range)
+ public override IEnumerator<KeyValuePair<int, Vector>> RowEnumerator(Range range)
{
throw new NotImplementedException();
}
@@ -675,7 +636,7 @@
/// Returns an <see cref="IEnumerator"/> that enumerates the rows of this matrix.
/// </summary>
/// <returns>an <see cref="IEnumerator"/> that enumerates over the rows of this matrix.</returns>
- public IEnumerator<KeyValuePair<int, IVector>> RowEnumerator()
+ public override IEnumerator<KeyValuePair<int, Vector>> RowEnumerator()
{
throw new NotImplementedException();
}
@@ -683,7 +644,7 @@
///<summary>Calculates the condition number of this matrix.</summary>
///<returns>the condition number of the matrix.</returns>
///<exception cref="dnAnalytics.Exceptions.NotSquareMatrixException">if the matrix is not square.</exception>
- public double ConditionNumber()
+ public override double ConditionNumber()
{
throw new NotImplementedException();
}
@@ -694,7 +655,7 @@
/// <param name="target">The matrix to copy values into.</param>
/// <exception cref="ArgumentNullException">if target is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if target is not the same size as this matrix.</exception>
- public void CopyTo(IMatrix target)
+ public override void CopyTo(Matrix target)
{
throw new NotImplementedException();
}
@@ -702,7 +663,7 @@
/// <summary>Computes the determinant of this matrix.</summary>
/// <returns>The determinant of this matrix.</returns>
/// <exception cref="dnAnalytics.Exceptions.NotSquareMatrixException">the matrix is not square.</exception>
- public double Determinant()
+ public override double Determinant()
{
throw new NotImplementedException();
}
@@ -713,7 +674,7 @@
/// <param name="vector">the vector to copy the diagonal elements into.</param>
/// <exception cref="ArgumentNullException">if vector is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the size of the vector is not Min(this.Rows, this.Columns).</exception>
- public void Diagonal(IVector vector)
+ public override void Diagonal(Vector vector)
{
throw new NotImplementedException();
}
@@ -722,7 +683,7 @@
/// Returns the elements on the diagonal in a vector with dense storage.
/// </summary>
/// <returns>the elements on the diagonal.</returns>
- public IVector Diagonal()
+ public override Vector Diagonal()
{
throw new NotImplementedException();
}
@@ -731,7 +692,7 @@
/// Returns the transpose of this matrix.
/// </summary>
/// <returns>the transpose of this matrix.</returns>
- public IMatrix GetTranspose()
+ public override Matrix GetTranspose()
{
throw new NotImplementedException();
}
@@ -739,7 +700,7 @@
/// <summary>
/// Transposes this matrix, overwriting its values.
/// </summary>
- public void Transpose()
+ public override void Transpose()
{
throw new NotImplementedException();
}
@@ -750,7 +711,7 @@
/// <param name="result">the result of the transpose.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not this.Columns x this.Rows.</exception>
- public void Transpose(IMatrix result)
+ public override void Transpose(Matrix result)
{
throw new NotImplementedException();
}
@@ -760,7 +721,7 @@
/// </summary>
/// <returns>The inverse of this matrix.</returns>
/// <exception cref="dnAnalytics.Exceptions.NotSquareMatrixException">if this matrix is not square.</exception>
- public IMatrix Inverse()
+ public override Matrix Inverse()
{
throw new NotImplementedException();
}
@@ -771,7 +732,7 @@
/// <param name="result">A matrix to hold the inverse of this matrix.</param>
/// <exception cref="ArgumentNullException">If the result matrix is <c>null</c>.</exception>
/// <exception cref="NotSquareMatrixException">If this matrix is not square.</exception>
- public void Inverse(IMatrix result)
+ public override void Inverse(Matrix result)
{
throw new NotImplementedException();
}
@@ -780,7 +741,7 @@
/// Inverts this matrix using LU decomposition.
/// </summary>
/// <exception cref="dnAnalytics.Exceptions.NotSquareMatrixException">if this matrix is not square.</exception>
- public void Invert()
+ public override void Invert()
{
throw new NotImplementedException();
}
@@ -792,7 +753,7 @@
/// <param name="columns">number of columns to resize the matrix to.</param>
/// <remarks>If the current dimensions are the same as the given dimensions, nothing is done (the matrix is not
/// cleared).</remarks>
- public void Resize(int rows, int columns)
+ public override void Resize(int rows, int columns)
{
throw new NotImplementedException();
}
@@ -804,7 +765,7 @@
/// <param name="columns">number of columns to resize the matrix to.</param>
/// <remarks>Will maintain the matrix values for those elements that are within the new dimensions.
/// New elements are set zero.</remarks>
- public void ResizeCopy(int rows, int columns)
+ public override void ResizeCopy(int rows, int columns)
{
throw new NotImplementedException();
}
@@ -818,7 +779,7 @@
/// number of rows in this matrix, then min( rows, source.Count )
/// elements are copied.</remarks>
/// <exception cref="ArgumentNullException">if source is null.</exception>
- public void SetColumn(int index, IVector source)
+ public override void SetColumn(int index, Vector source)
{
throw new NotImplementedException();
}
@@ -832,7 +793,7 @@
/// number of rows in this matrix, then min( rows, source.Count )
/// elements are copied.</remarks>
/// <exception cref="ArgumentNullException">if source is null.</exception>
- public void SetColumn(int index, double[] source)
+ public override void SetColumn(int index, double[] source)
{
throw new NotImplementedException();
}
@@ -845,7 +806,7 @@
/// length of the diagonal, then the min(rows, columns, source.Count)
/// elements are copied.</remarks>
/// <exception cref="ArgumentNullException">if source is null.</exception>
- public void SetDiagonal(IVector source)
+ public override void SetDiagonal(Vector source)
{
throw new NotImplementedException();
}
@@ -858,7 +819,7 @@
/// length of the diagonal, then the min(rows, columns, source.Length)
/// elements are copied.</remarks>
/// <exception cref="ArgumentNullException">if source is null.</exception>
- public void SetDiagonal(double[] source)
+ public override void SetDiagonal(double[] source)
{
throw new NotImplementedException();
}
@@ -872,7 +833,7 @@
/// number of rows in this matrix, then min( columns, source.Count )
/// elements are copied.</remarks>
/// <exception cref="ArgumentNullException">if source is null.</exception>
- public void SetRow(int index, IVector source)
+ public override void SetRow(int index, Vector source)
{
throw new NotImplementedException();
}
@@ -886,7 +847,7 @@
/// number of rows in this matrix, then min( columns, source.Length )
/// elements are copied.</remarks>
/// <exception cref="ArgumentNullException">if source is null.</exception>
- public void SetRow(int index, double[] source)
+ public override void SetRow(int index, double[] source)
{
throw new NotImplementedException();
}
@@ -895,7 +856,7 @@
/// Returns a new matrix containing the lower triangle of this matrix.
/// </summary>
/// <returns>the lower triangle of this matrix.</returns>
- public IMatrix LowerTriangle()
+ public override Matrix LowerTriangle()
{
throw new NotImplementedException();
}
@@ -906,7 +867,7 @@
/// <param name="result">where to store the the lower triangle.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void LowerTriangle(IMatrix result)
+ public override void LowerTriangle(Matrix result)
{
throw new NotImplementedException();
}
@@ -916,7 +877,7 @@
/// does not contain the diagonal elements of this matrix.
/// </summary>
/// <returns>the lower trinagle of this matrix.</returns>
- public IMatrix StrictlyLowerTriangle()
+ public override Matrix StrictlyLowerTriangle()
{
throw new NotImplementedException();
}
@@ -928,7 +889,7 @@
/// <param name="result">where to store the the lower triangle.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void StrictlyLowerTriangle(IMatrix result)
+ public override void StrictlyLowerTriangle(Matrix result)
{
throw new NotImplementedException();
}
@@ -939,7 +900,7 @@
/// <param name="result">where to store the the upper triangle.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void UpperTriangle(IMatrix result)
+ public override void UpperTriangle(Matrix result)
{
throw new NotImplementedException();
}
@@ -948,7 +909,7 @@
/// Returns a new matrix containing the upper triangle of this matrix.
/// </summary>
/// <returns>the upper triangle of this matrix.</returns>
- public IMatrix UpperTriangle()
+ public override Matrix UpperTriangle()
{
throw new NotImplementedException();
}
@@ -958,7 +919,7 @@
/// does not contain the diagonal elements of this matrix.
/// </summary>
/// <returns>the upper trinagle of this matrix.</returns>
- public IMatrix StrictlyUpperTriangle()
+ public override Matrix StrictlyUpperTriangle()
{
throw new NotImplementedException();
}
@@ -970,7 +931,7 @@
/// <param name="result">where to store the the upper triangle.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void StrictlyUpperTriangle(IMatrix result)
+ public override void StrictlyUpperTriangle(Matrix result)
{
throw new NotImplementedException();
}
@@ -982,7 +943,7 @@
/// <param name="rowRange">The <see cref="Range"/> of rows to copy into the new matrix.</param>
/// <param name="columnRange">The <see cref="Range"/> of columns to copy into the new matrix.</param>
/// <returns>a sub-matrix of this matrix for the given ranges.</returns>
- public IMatrix SubMatrix(Range rowRange, Range columnRange)
+ public override Matrix SubMatrix(Range rowRange, Range columnRange)
{
throw new NotImplementedException();
}
@@ -995,7 +956,7 @@
/// <param name="result">The matrix to copy the sub-matrix into.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as those defined by the <c>Ranges</c>.</exception>
- public void SubMatrix(Range rowRange, Range columnRange, IMatrix result)
+ public override void SubMatrix(Range rowRange, Range columnRange, Matrix result)
{
throw new NotImplementedException();
}
@@ -1004,7 +965,7 @@
/// Returns this matrix as a multidimensional array.
/// </summary>
/// <returns>a multidimensional containing the values of this matrix.</returns>
- public double[,] ToArray()
+ public override double[,] ToArray()
{
throw new NotImplementedException();
}
@@ -1015,7 +976,7 @@
/// </summary>
/// <param name="format">the format to use on each element.</param>
/// <returns>a string representation of the matrix.</returns>
- public string ToString(string format)
+ public override string ToString(string format)
{
throw new NotImplementedException();
}
@@ -1024,7 +985,7 @@
/// Adds a scalar to each element in the matrix overwriting the values of this matrix.
/// </summary>
/// <param name="scalar">the scalar to add.</param>
- public void Add(double scalar)
+ public override void Add(double scalar)
{
throw new NotImplementedException();
}
@@ -1036,7 +997,7 @@
/// <param name="result">the results of the addition.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void Add(double scalar, IMatrix result)
+ public override void Add(double scalar, Matrix result)
{
throw new NotImplementedException();
}
@@ -1047,7 +1008,7 @@
/// <param name="other">the matrix to add to this matrix.</param>
/// <exception cref="ArgumentNullException">if the other matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the two matrices don't have the same dimensions.</exception>
- public void Add(IMatrix other)
+ public override void Add(Matrix other)
{
throw new NotImplementedException();
}
@@ -1061,7 +1022,7 @@
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the two matrices don't have the same dimensions.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void Add(IMatrix other, IMatrix result)
+ public override void Add(Matrix other, Matrix result)
{
throw new NotImplementedException();
}
@@ -1069,7 +1030,7 @@
/// <summary>
/// Negates each element of this matrix.
/// </summary>
- public void Negate()
+ public override void Negate()
{
throw new NotImplementedException();
}
@@ -1080,7 +1041,7 @@
/// <param name="result">the result of the negation.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void Negate(IMatrix result)
+ public override void Negate(Matrix result)
{
throw new NotImplementedException();
}
@@ -1089,7 +1050,7 @@
/// Subtracts a scalar from each value in the matrix overwriting the values of this matrix.
/// </summary>
/// <param name="scalar">the scalar to subtract.</param>
- public void Subtract(double scalar)
+ public override void Subtract(double scalar)
{
throw new NotImplementedException();
}
@@ -1101,7 +1062,7 @@
/// <param name="result">the result of the subtraction.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void Subtract(double scalar, IMatrix result)
+ public override void Subtract(double scalar, Matrix result)
{
throw new NotImplementedException();
}
@@ -1112,7 +1073,7 @@
/// <param name="other">the matrix to subtract.</param>
/// <exception cref="ArgumentNullException">if the other matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the two matrices don't have the same dimensions.</exception>
- public void Subtract(IMatrix other)
+ public override void Subtract(Matrix other)
{
throw new NotImplementedException();
}
@@ -1126,7 +1087,7 @@
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the two matrices don't have the same dimensions.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void Subtract(IMatrix other, IMatrix result)
+ public override void Subtract(Matrix other, Matrix result)
{
throw new NotImplementedException();
}
@@ -1135,7 +1096,7 @@
/// Multiplies each element of this matrix with a scalar overwriting the values of this matrix.
/// </summary>
/// <param name="scalar">the scalar to multiply with.</param>
- public void Multiply(double scalar)
+ public override void Multiply(double scalar)
{
throw new NotImplementedException();
}
@@ -1147,7 +1108,7 @@
/// <param name="result">the matrix to multiply.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void Multiply(double scalar, IMatrix result)
+ public override void Multiply(double scalar, Matrix result)
{
throw new NotImplementedException();
}
@@ -1158,7 +1119,7 @@
/// <param name="other">the matrix to multiple with.</param>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if this.Columns != other.Rows</exception>
/// <exception cref="ArgumentNullException">if the other matrix is null.</exception>
- public void Multiply(IMatrix other)
+ public override Matrix Multiply(Matrix other)
{
throw new NotImplementedException();
}
@@ -1172,7 +1133,7 @@
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if this.Columns != other.Rows</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the this.Rows x other.Columns.</exception>
- public void Multiply(IMatrix other, IMatrix result)
+ public override void Multiply(Matrix other, Matrix result)
{
throw new NotImplementedException();
}
@@ -1184,7 +1145,7 @@
/// <returns>the result of the multiplication.</returns>
/// <exception cref="ArgumentNullException">if rightSide is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the this.Columns != rightSide.Count.</exception>
- public IVector Multiply(IVector rightSide)
+ public override Vector Multiply(Vector rightSide)
{
throw new NotImplementedException();
}
@@ -1198,7 +1159,7 @@
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result vector size is not rightSide.Count.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the this.Columns != rightSide.Count.</exception>
- public void Multiply(IVector rightSide, IVector result)
+ public override void Multiply(Vector rightSide, Vector result)
{
throw new NotImplementedException();
}
@@ -1210,7 +1171,7 @@
/// <returns>The result of the multiplication.</returns>
/// <exception cref="ArgumentNullException">If leftSide is <c>null</c>.</exception>
/// <exception cref="NotConformableException">If <code>this.Rows != leftSide.Count</code>.</exception>
- public IVector LeftMultiply(IVector leftSide)
+ public override Vector LeftMultiply(Vector leftSide)
{
throw new NotImplementedException();
}
@@ -1224,7 +1185,7 @@
/// <exception cref="ArgumentNullException">If the result matrix is <c>null</c>.</exception>
/// <exception cref="NotConformableException">If <code>result.Count != this.Columns</code>.</exception>
/// <exception cref="NotConformableException">If <code>this.Rows != leftSide.Count</code>.</exception>
- public void LeftMultiply(IVector leftSide, IVector result)
+ public override void LeftMultiply(Vector leftSide, Vector result)
{
throw new NotImplementedException();
}
@@ -1233,7 +1194,7 @@
/// Divides each element of the matrix by a scalar overwriting the valuesof this matrix.
/// </summary>
/// <param name="scalar">the scalar to divide by.</param>
- public void Divide(double scalar)
+ public override void Divide(double scalar)
{
throw new NotImplementedException();
}
@@ -1245,7 +1206,7 @@
/// <param name="result">the result of the division.</param>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not the same as this matrix.</exception>
- public void Divide(double scalar, IMatrix result)
+ public override void Divide(double scalar, Matrix result)
{
throw new NotImplementedException();
}
@@ -1257,7 +1218,7 @@
/// <returns>the combined matrix.</returns>
/// <exception cref="ArgumentNullException">if lower is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if upper.Columns != lower.Columns.</exception>
- public IMatrix Stack(IMatrix lower)
+ public override Matrix Stack(Matrix lower)
{
throw new NotImplementedException();
}
@@ -1271,7 +1232,7 @@
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if upper.Columns != lower.Columns.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not (this.Rows + lower.rows) x this.Columns.</exception>
- public void Stack(IMatrix lower, IMatrix result)
+ public override void Stack(Matrix lower, Matrix result)
{
throw new NotImplementedException();
}
@@ -1283,7 +1244,7 @@
/// <returns>The combined matrix.</returns>
/// <exception cref="ArgumentNullException">If right is <c>null</c>.</exception>
/// <exception cref="NotConformableException">If <code>this.Rows != right.Rows.</code></exception>
- public IMatrix Append(IMatrix right)
+ public override Matrix Append(Matrix right)
{
throw new NotImplementedException();
}
@@ -1297,7 +1258,7 @@
/// <exception cref="ArgumentNullException">If the result matrix is <c>null</c>.</exception>
/// <exception cref="NotConformableException">If <code>this.Rows != right.Rows</code>.</exception>
/// <exception cref="NotConformableException">If the result matrix's dimensions are not this.Rows x (this.Columns + right.Columns).</exception>
- public void Append(IMatrix right, IMatrix result)
+ public override void Append(Matrix right, Matrix result)
{
throw new NotImplementedException();
}
@@ -1310,7 +1271,7 @@
/// <param name="lower">the lower, right matrix.</param>
/// <exception cref="ArgumentNullException">if lower is null.</exception>
/// <returns>the combined matrix</returns>
- public IMatrix DiagonalStack(IMatrix lower)
+ public override Matrix DiagonalStack(Matrix lower)
{
throw new NotImplementedException();
}
@@ -1323,14 +1284,23 @@
/// <exception cref="ArgumentNullException">if lower is null.</exception>
/// <exception cref="ArgumentNullException">if the result matrix is null.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">if the result matrix's dimensions are not (this.Rows + lower.rows) x (this.Columns + lower.Columns).</exception>
- public void DiagonalStack(IMatrix lower, IMatrix result)
+ public override void DiagonalStack(Matrix lower, Matrix result)
{
throw new NotImplementedException();
}
-
- public string ToString(string format, IFormatProvider formatProvider)
+
+ public override string ToString(string format, IFormatProvider formatProvider)
{
throw new NotImplementedException();
}
+
+ /// <summary>
+ /// Returns a deep-copy clone of the <c>Matrix</c>.
+ /// </summary>
+ /// <returns>A deep-copy clone of the <c>Matrix</c>.</returns>
+ public override Matrix Clone()
+ {
+ return new SparseMatrix(this);
+ }
}
}
\ No newline at end of file
Modified: trunk/LinearAlgebra/SparseVector.cs
===================================================================
--- trunk/LinearAlgebra/SparseVector.cs 2006-01-25 02:46:17 UTC (rev 183)
+++ trunk/LinearAlgebra/SparseVector.cs 2006-01-25 03:50:51 UTC (rev 184)
@@ -1,5 +1,4 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Text;
using dnAnalytics.Exceptions;
@@ -10,7 +9,7 @@
/// <summary>
/// A vector class that only stores non-zero values.
/// </summary>
- public sealed class SparseVector : IVector
+ public sealed class SparseVector : Vector
{
/// <summary>
/// The array containing the actual values. Only the non-zero values are stored
@@ -85,9 +84,9 @@
/// <summary>
/// Creates instance of the <see cref="SparseVector" /> class.
/// </summary>
- /// <param name="source">The <see cref="IVector" /> from which the values for the current instance will be copied.</param>
+ /// <param name="source">The <see cref="Vector" /> from which the values for the current instance will be copied.</param>
/// <exception cref="ArgumentNullException">If source is <c>null</c>.</exception>
- public SparseVector(IVector source)
+ public SparseVector(Vector source)
{
if (source == null)
{
@@ -104,7 +103,7 @@
/// <summary>
/// The number of elements in this vector.
/// </summary>
- public int Count
+ public override int Count
{
get { return mSize; }
}
@@ -112,7 +111,7 @@
/// <summary>Indexer gets or sets the value at given index.</summary>
/// <param name="index">The index of the value to get or set.</param>
/// <returns>The value of the vector at the given index.</returns>
- public double this[int index]
+ public override double this[int index]
{
get
{
@@ -378,7 +377,7 @@
/// Calculates the infinity norm of this vector.
/// </summary>
/// <returns>The infinity norm of this vector.</returns>
- public double InfinityNorm()
+ public override double InfinityNorm()
{
double ret = 0;
for (int i = 0; i < mValueCount; i++)
@@ -392,7 +391,7 @@
/// Calculates the L1 norm of this vector.
/// </summary>
/// <returns>the L1 norm of this vector.</returns>
- public double L1Norm()
+ public override double L1Norm()
{
double ret = 0;
for (int i = 0; i < mValueCount; i++)
@@ -406,7 +405,7 @@
/// Calculates the L2 norm of this vector.
/// </summary>
/// <returns>the L2 norm of this vector.</returns>
- public double L2Norm()
+ public override double L2Norm()
{
double ret = 0;
for (int i = 0; i < mValueCount; i++)
@@ -420,7 +419,7 @@
/// Returns the value of the absolute maximum element.
/// </summary>
/// <returns>the value of the absolute maximum element.</returns>
- public double AbsoluteMaximum()
+ public override double AbsoluteMaximum()
{
int internalIndex;
if (FindItem(AbsoluteMaximumIndex(), out internalIndex))
@@ -435,7 +434,7 @@
/// Returns the index of the absolute maximum element.
/// </summary>
/// <returns>The index of absolute maximum element if it exists; otherwise -1.</returns>
- public int AbsoluteMaximumIndex()
+ public override int AbsoluteMaximumIndex()
{
int index = -1;
double max = 0.0;
@@ -455,7 +454,7 @@
/// Returns the value of the absolute minimum element.
/// </summary>
/// <returns>The value of the absolute minimum element.</returns>
- public double AbsoluteMinimum()
+ public override double AbsoluteMinimum()
{
int internalIndex;
if (FindItem(AbsoluteMinimumIndex(), out internalIndex))
@@ -476,7 +475,7 @@
/// element with that value.
/// </remarks>
/// <returns>The index of absolute minimum element.</returns>
- public int AbsoluteMinimumIndex()
+ public override int AbsoluteMinimumIndex()
{
if (mSize > mValueCount)
{
@@ -525,7 +524,7 @@
/// Returns the value of maximum element.
/// </summary>
/// <returns>The value of maximum element.</returns>
- public double Maximum()
+ public override double Maximum()
{
int internalIndex;
if (FindItem(MaximumIndex(), out internalIndex))
@@ -541,7 +540,7 @@
/// Returns the index of the absolute maximum element.
/// </summary>
/// <returns>The index of absolute maximum element.</returns>
- public int MaximumIndex()
+ public override int MaximumIndex()
{
int index = -1;
double max = double.NegativeInfinity;
@@ -561,7 +560,7 @@
/// Returns the value of the minimum element.
/// </summary>
/// <returns>The value of the minimum element.</returns>
- public double Minimum()
+ public override double Minimum()
{
int internalIndex;
if (FindItem(MinimumIndex(), out internalIndex))
@@ -577,7 +576,7 @@
/// Returns the index of the minimum element.
/// </summary>
/// <returns>The index of minimum element.</returns>
- public int MinimumIndex()
+ public override int MinimumIndex()
{
int index = -1;
double max = double.PositiveInfinity;
@@ -596,7 +595,7 @@
/// <summary>
/// Sets the each element to zero.
/// </summary>
- public void Clear()
+ public override void Clear()
{
mValueCount = 0;
}
@@ -607,7 +606,7 @@
/// <param name="target">The vector to copy elements into.</param>
/// <exception cref="ArgumentNullException">If target is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If target is not the same size as this vector.</exception>
- public void CopyTo(IVector target)
+ public override void CopyTo(Vector target)
{
if (target == null)
{
@@ -629,7 +628,7 @@
/// Computes the dot product of this vector with itself.
/// </summary>
///<returns>The dot product of this vector and itself.</returns>
- public double DotProduct()
+ public override double DotProduct()
{
double result = 0;
for (int i = 0; i < mValueCount; i++)
@@ -647,7 +646,7 @@
/// <returns>The dot product of this vector and other.</returns>
/// <exception cref="ArgumentNullException">If the other vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and <paramref name="other"/> are not the same size.</exception>
- public double DotProduct(IVector other)
+ public override double DotProduct(Vector other)
{
if (other == null)
{
@@ -668,7 +667,7 @@
return result;
}
- public IEnumerator<KeyValuePair<int,double>> GetEnumerator()
+ public override IEnumerator<KeyValuePair<int,double>> GetEnumerator()
{
// Iterate over the vector size and return each value.
for (int i = 0; i < mSize; i++)
@@ -690,11 +689,15 @@
}
/// <summary>
- /// Returns an enumerator over a <paramref name="Range"/> of this vector.
+ /// Returns an <see cref="IEnumerator{T}"/> over a <see cref="Range"/> of this vector.
/// </summary>
- /// <param name="range">The range of values to enumerate over.</param>
- /// <returns>An enumerator over a range of this vector.</returns>
- public IEnumerator<KeyValuePair<int,double>> GetEnumerator(Range range)
+ /// <param name="range">The range of elements to enumerate over.</param>
+ /// <returns>An <see cref="IEnumerator{T}"/> over a range of this vector.</returns>
+ /// <exception cref="ArgumentOutOfRangeException">If <paramref name="range"/> specifies a range
+ /// outside the vector's range. </exception>
+ /// <remarks>The enumerator returns a <seealso cref="KeyValuePair{T,K}"/> with the key being the element index and the value
+ /// being the value of the element at that index.</remarks>
+ public override IEnumerator<KeyValuePair<int,double>> GetEnumerator(Range range)
{
if (range.End > mSize || range.Start > mSize)
{
@@ -715,33 +718,13 @@
}
}
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (int i = 0; i < mSize; i++)
- {
- // See if the item exists. If so then return the value otherwise
- // return zero.
- // NOTE: we could potentially keep track of the last 'real' index
- // that we used. That way we wouldn't have to do a search.
- int internalIndex;
- if (FindItem(i, out internalIndex))
- {
- yield return new KeyValuePair<int, double>(i, mValues[internalIndex]);
- }
- else
- {
- yield return new KeyValuePair<int, double>(i, 0.0);
- }
- }
- }
-
/// <summary>
/// Resizes the current vector to the given size and clears its values.
/// </summary>
/// <param name="count">Number of items to resize the vector to.</param>
/// <remarks>If the current count is the same as the given count, nothing is done (the vector is not
/// cleared).</remarks>
- public void Resize(int count)
+ public override void Resize(int count)
{
if (mSize != count)
{
@@ -756,7 +739,7 @@
/// <param name="count">Number of items to resize the vector to.</param>
/// <remarks>Will maintain the vector values for those elements that are with in the new size.
/// New elements are set to zero.</remarks>
- public void ResizeCopy(int count)
+ public override void ResizeCopy(int count)
{
if (count < mSize)
{
@@ -781,12 +764,12 @@
}
/// <summary>
- /// Creates a vector containing copy of elements for the given <paramref name="Range"/>.
+ /// Creates a vector containing copy of elements for the given <paramref name="range"/>.
/// </summary>
- /// <param name="range">The <paramref name="Range"/> of elements to create a new vector from.</param>
- /// <returns>A vector containing a copy of elements for the given <paramref name="Range"/>.</returns>
+ /// <param name="range">The <paramref name="range"/> of elements to create a new vector from.</param>
+ /// <returns>A vector containing a copy of elements for the given <paramref name="range"/>.</returns>
/// <exception cref="ArgumentOutOfRangeException">If the range is outside the size of the vector.</exception>
- public IVector SubVector(Range range)
+ public override Vector SubVector(Range range)
{
if (range.End > mSize || range.Start > mSize)
{
@@ -810,7 +793,7 @@
/// Computes the sum of the elements of this vector.
/// </summary>
/// <returns>The sum of the elements of this vector.</returns>
- public double Sum()
+ public override double Sum()
{
double ret = 0;
for (int i = 0; i < mValueCount; i++)
@@ -824,7 +807,7 @@
/// Computes the sum of the absolute value of the elements of this vector.
/// </summary>
/// <returns>The sum of the absolute value of the elements of this vector.</returns>
- public double SumMagnitudes()
+ public override double SumMagnitudes()
{
double ret = 0;
for (int i = 0; i < mValueCount; i++)
@@ -840,7 +823,7 @@
/// <param name="other">The vector to swap date with.</param>
/// <exception cref="ArgumentNullException">If the other vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and other are not the same size.</exception>
- public void Swap(IVector other)
+ public override void Swap(Vector other)
{
if (other == null)
{
@@ -863,7 +846,7 @@
/// Returns the data contained in the vector as an array.
/// </summary>
/// <returns>The data as an array.</returns>
- public double[] ToArray()
+ public override double[] ToArray()
{
double[] ret = new double[mSize];
for (int i = 0; i < mSize; i++)
@@ -880,7 +863,7 @@
/// <param name="values">The array containing the values to use.</param>
/// <exception cref="ArgumentNullException">If <paramref name="values"/> is <c>null</c>.</exception>
/// <exception cref="NotConformableException">If <paramref name="values"/> is not the same size as this vector.</exception>
- public void SetValues(double[] values)
+ public override void SetValues(double[] values)
{
if (values == null)
{
@@ -916,7 +899,7 @@
/// </summary>
/// <param name="format">The format to use.</param>
/// <returns>A string representation of this DenseVector.</returns>
- public string ToString(string format)
+ public override string ToString(string format)
{
return ToString(format, null);
}
@@ -927,7 +910,7 @@
/// </summary>
/// <param name="formatProvider">The format provider to use.</param>
/// <returns>A string representation of this DenseVector.</returns>
- public string ToString(IFormatProvider formatProvider)
+ public override string ToString(IFormatProvider formatProvider)
{
return ToString(null, formatProvider);
}
@@ -939,7 +922,7 @@
/// <param name="format">The format to use.</param>
/// <param name="formatProvider">The format provider to use.</param>
/// <returns>A string representation of this DenseVector.</returns>
- public string ToString(string format, IFormatProvider formatProvider)
+ public override string ToString(string format, IFormatProvider formatProvider)
{
StringBuilder sb = new StringBuilder("Count: ");
sb.Append(Count).Append(Environment.NewLine);
@@ -959,7 +942,7 @@
/// Adds a scalar to each element of the vector.
/// </summary>
/// <param name="scalar">The scalar to add.</param>
- public void Add(double scalar)
+ public override void Add(double scalar)
{
for (int i = 0; i < mSize; i++)
{
@@ -974,7 +957,7 @@
/// <param name="result">The vector to store the result of the addition.</param>
/// <exception cref="ArgumentNullException">If the result vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and result are not the same size.</exception>
- public void Add(double scalar, IVector result)
+ public override void Add(double scalar, Vector result)
{
if (result == null)
{
@@ -997,7 +980,7 @@
/// <param name="other">The vector to add to this one.</param>
/// <exception cref="ArgumentNullException">If the other vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and other are not the same size.</exception>
- public void Add(IVector other)
+ public override void Add(Vector other)
{
if (other == null)
{
@@ -1023,7 +1006,7 @@
/// <exception cref="ArgumentNullException">If the result vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and <paramref name="other"/> are not the same size.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and <paramref name="result"/> are not the same size.</exception>
- public void Add(IVector other, IVector result)
+ public override void Add(Vector other, Vector result)
{
if (other == null)
{
@@ -1052,7 +1035,7 @@
/// <summary>
/// Negates the values of this vector.
/// </summary>
- public void Negate()
+ public override void Negate()
{
for (int i = 0; i < mValueCount; i++)
{
@@ -1065,7 +1048,7 @@
/// </summary>
/// <exception cref="ArgumentNullException">If the result vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and <paramref name="other"/> are not the same size.</exception>
- public void Negate(IVector result)
+ public override void Negate(Vector result)
{
CopyTo(result);
result.Negate();
@@ -1075,7 +1058,7 @@
/// Subtracts a scalar from each element of the vector.
/// </summary>
/// <param name="scalar">The scalar to subtract.</param>
- public void Subtract(double scalar)
+ public override void Subtract(double scalar)
{
Add(-scalar);
}
@@ -1087,7 +1070,7 @@
/// <param name="result">The vector to store the result of the subtraction.</param>
/// <exception cref="ArgumentNullException">If the result vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and <paramref name="result"/> are not the same size.</exception>
- public void Subtract(double scalar, IVector result)
+ public override void Subtract(double scalar, Vector result)
{
Add(-scalar, result);
}
@@ -1098,7 +1081,7 @@
/// <param name="other">The vector to subtract from this one.</param>
/// <exception cref="ArgumentNullException">If the other vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and <paramref name="other"/> are not the same size.</exception>
- public void Subtract(IVector other)
+ public override void Subtract(Vector other)
{
if (other == null)
{
@@ -1124,7 +1107,7 @@
/// <exception cref="ArgumentNullException">If the result vector is <c>null</c>.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and <paramref name="other"/> are not the same size.</exception>
/// <exception cref="dnAnalytics.Exceptions.NotConformableException">If this vector and <paramref name="result"/> are not the same size.</exception>
- public void Subtract(IVector other, IVector result)
+ public override void Subtract(Vector other, Vector result)
{
if (other == null)
{
@@ -1154,7 +1137,7 @@
/// Divides this vector by scalar.
/// </summary>
/...
[truncated message content] |