diff --git a/src/Numerics/LinearAlgebra/Generic/Matrix.Arithmetic.cs b/src/Numerics/LinearAlgebra/Generic/Matrix.Arithmetic.cs
index 48734d47..d93b8ec9 100644
--- a/src/Numerics/LinearAlgebra/Generic/Matrix.Arithmetic.cs
+++ b/src/Numerics/LinearAlgebra/Generic/Matrix.Arithmetic.cs
@@ -73,7 +73,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to add to this matrix.
/// The matrix to store the result of the addition.
- /// If the other matrix is .
/// If the two matrices don't have the same dimensions.
protected abstract void DoAdd(Matrix other, Matrix result);
@@ -198,7 +197,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to add.
/// The result of the addition.
- /// If the other matrix is .
/// If the two matrices don't have the same dimensions.
public Matrix Add(T scalar)
{
@@ -217,15 +215,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to add.
/// The matrix to store the result of the addition.
- /// If the other matrix is .
/// If the two matrices don't have the same dimensions.
public void Add(T scalar, Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != RowCount || result.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, result, "result");
@@ -245,15 +237,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to add to this matrix.
/// The result of the addition.
- /// If the other matrix is .
/// If the two matrices don't have the same dimensions.
public virtual Matrix Add(Matrix other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (other.RowCount != RowCount || other.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, other);
@@ -269,20 +255,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to add to this matrix.
/// The matrix to store the result of the addition.
- /// If the other matrix is .
/// If the two matrices don't have the same dimensions.
public void Add(Matrix other, Matrix result)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (other.RowCount != RowCount || other.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, other, "other");
@@ -318,15 +293,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to subtract.
/// The matrix to store the result of the subtraction.
- /// If the result matrix is .
/// If this matrix and are not the same size.
public void Subtract(T scalar, Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != RowCount || result.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, result, "result");
@@ -358,15 +327,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to subtract from.
/// The matrix to store the result of the subtraction.
- /// If the result matrix is .
/// If this matrix and are not the same size.
public void SubtractFrom(T scalar, Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != RowCount || result.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, result, "result");
@@ -380,15 +343,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to subtract.
/// The result of the subtraction.
- /// If the other matrix is .
/// If the two matrices don't have the same dimensions.
public virtual Matrix Subtract(Matrix other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (other.RowCount != RowCount || other.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, other);
@@ -404,20 +361,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to subtract.
/// The matrix to store the result of the subtraction.
- /// If the other matrix is .
/// If the two matrices don't have the same dimensions.
public void Subtract(Matrix other, Matrix result)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (other.RowCount != RowCount || other.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, other, "other");
@@ -458,15 +404,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to multiply the matrix with.
/// The matrix to store the result of the multiplication.
- /// If the result matrix is .
/// If the result matrix's dimensions are not the same as this matrix.
public void Multiply(T scalar, Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != RowCount)
{
throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, "result");
@@ -519,15 +459,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to divide the matrix with.
/// The matrix to store the result of the division.
- /// If the result matrix is .
/// If the result matrix's dimensions are not the same as this matrix.
public void Divide(T scalar, Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != RowCount)
{
throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, "result");
@@ -569,15 +503,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to divide.
/// The matrix to store the result of the division.
- /// If the result matrix is .
/// If the result matrix's dimensions are not the same as this matrix.
public void DivideByThis(T scalar, Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != RowCount)
{
throw new ArgumentException(Resources.ArgumentMatrixSameRowDimension, "result");
@@ -596,15 +524,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to multiply with.
/// The result of the multiplication.
- /// If is .
/// If this.ColumnCount != rightSide.Count.
public Vector Multiply(Vector rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
if (ColumnCount != rightSide.Count)
{
throw DimensionsDontMatch(this, rightSide, "rightSide");
@@ -620,27 +542,15 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to multiply with.
/// The result of the multiplication.
- /// If is .
- /// If is .
/// If result.Count != this.RowCount.
/// If this.ColumnCount != .Count.
public virtual void Multiply(Vector rightSide, Vector result)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
if (ColumnCount != rightSide.Count)
{
throw DimensionsDontMatch(this, rightSide, "rightSide");
}
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (RowCount != result.Count)
{
throw DimensionsDontMatch(this, result, "result");
@@ -663,15 +573,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to multiply with.
/// The result of the multiplication.
- /// If is .
/// If this.RowCount != .Count.
public Vector LeftMultiply(Vector leftSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
if (RowCount != leftSide.Count)
{
throw DimensionsDontMatch(this, leftSide, "leftSide");
@@ -687,27 +591,15 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to multiply with.
/// The result of the multiplication.
- /// If is .
- /// If the result matrix is .
/// If result.Count != this.ColumnCount.
/// If this.RowCount != .Count.
public virtual void LeftMultiply(Vector leftSide, Vector result)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
if (RowCount != leftSide.Count)
{
throw DimensionsDontMatch(this, leftSide, "leftSide");
}
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (ColumnCount != result.Count)
{
throw DimensionsDontMatch(this, result, "result");
@@ -740,22 +632,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to multiply with.
/// The result of the multiplication.
- /// If the other matrix is .
- /// If the result matrix is .
/// If this.Columns != other.Rows.
/// If the result matrix's dimensions are not the this.Rows x other.Columns.
public virtual void Multiply(Matrix other, Matrix result)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (ColumnCount != other.RowCount || result.RowCount != RowCount || result.ColumnCount != other.ColumnCount)
{
throw DimensionsDontMatch(this, other, result);
@@ -778,15 +658,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to multiply with.
/// If this.Columns != other.Rows.
- /// If the other matrix is .
/// The result of the multiplication.
public virtual Matrix Multiply(Matrix other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (ColumnCount != other.RowCount)
{
throw DimensionsDontMatch(this, other);
@@ -802,22 +676,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to multiply with.
/// The result of the multiplication.
- /// If the other matrix is .
- /// If the result matrix is .
/// If this.Columns != other.ColumnCount.
/// If the result matrix's dimensions are not the this.RowCount x other.RowCount.
public virtual void TransposeAndMultiply(Matrix other, Matrix result)
- {
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
+ {
if (ColumnCount != other.ColumnCount || result.RowCount != RowCount || result.ColumnCount != other.RowCount)
{
throw DimensionsDontMatch(this, other, result);
@@ -840,15 +702,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to multiply with.
/// If this.Columns != other.ColumnCount.
- /// If the other matrix is .
/// The result of the multiplication.
public virtual Matrix TransposeAndMultiply(Matrix other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (ColumnCount != other.ColumnCount)
{
throw DimensionsDontMatch(this, other);
@@ -864,15 +720,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to multiply with.
/// The result of the multiplication.
- /// If is .
/// If this.RowCount != rightSide.Count.
public Vector TransposeThisAndMultiply(Vector rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
if (RowCount != rightSide.Count)
{
throw DimensionsDontMatch(this, rightSide, "rightSide");
@@ -888,22 +738,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to multiply with.
/// The result of the multiplication.
- /// If is .
- /// If is .
/// If result.Count != this.ColumnCount.
/// If this.RowCount != .Count.
public void TransposeThisAndMultiply(Vector rightSide, Vector result)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (RowCount != rightSide.Count)
{
throw DimensionsDontMatch(this, rightSide, "rightSide");
@@ -931,22 +769,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to multiply with.
/// The result of the multiplication.
- /// If the other matrix is .
- /// If the result matrix is .
/// If this.Rows != other.RowCount.
/// If the result matrix's dimensions are not the this.ColumnCount x other.ColumnCount.
public void TransposeThisAndMultiply(Matrix other, Matrix result)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (RowCount != other.RowCount || result.RowCount != ColumnCount || result.ColumnCount != other.ColumnCount)
{
throw DimensionsDontMatch(this, other, result);
@@ -969,15 +795,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to multiply with.
/// If this.Rows != other.RowCount.
- /// If the other matrix is .
/// The result of the multiplication.
public Matrix TransposeThisAndMultiply(Matrix other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (RowCount != other.RowCount)
{
throw DimensionsDontMatch(this, other);
@@ -1003,15 +823,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Negate each element of this matrix and place the results into the result matrix.
///
/// The result of the negation.
- /// If the result matrix is .
/// if the result matrix's dimensions are not the same as this matrix.
public void Negate(Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != RowCount || result.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, result);
@@ -1035,15 +849,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Complex conjugate each element of this matrix and place the results into the result matrix.
///
/// The result of the conjugation.
- /// If the result matrix is .
/// if the result matrix's dimensions are not the same as this matrix.
public void Conjugate(Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != RowCount || result.ColumnCount != ColumnCount)
{
throw DimensionsDontMatch(this, result);
@@ -1071,11 +879,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Matrix to store the results in.
public void Modulus(T divisor, Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (ColumnCount != result.ColumnCount || RowCount != result.RowCount)
{
throw DimensionsDontMatch(this, result);
@@ -1103,11 +906,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Matrix to store the results in.
public void ModulusByThis(T dividend, Matrix result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (ColumnCount != result.ColumnCount || RowCount != result.RowCount)
{
throw DimensionsDontMatch(this, result);
@@ -1120,16 +918,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Pointwise multiplies this matrix with another matrix.
///
/// The matrix to pointwise multiply with this one.
- /// If the other matrix is .
/// If this matrix and are not the same size.
/// A new matrix that is the pointwise multiplication of this matrix and .
public Matrix PointwiseMultiply(Matrix other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (ColumnCount != other.ColumnCount || RowCount != other.RowCount)
{
throw DimensionsDontMatch(this, other, "other");
@@ -1145,22 +937,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The matrix to pointwise multiply with this one.
/// The matrix to store the result of the pointwise multiplication.
- /// If the other matrix is .
- /// If the result matrix is .
/// If this matrix and are not the same size.
/// If this matrix and are not the same size.
public void PointwiseMultiply(Matrix other, Matrix result)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (ColumnCount != result.ColumnCount || RowCount != result.RowCount || ColumnCount != other.ColumnCount || RowCount != other.RowCount)
{
throw DimensionsDontMatch(this, other, result);
@@ -1173,16 +953,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Pointwise divide this matrix by another matrix.
///
/// The pointwise denominator matrix to use.
- /// If the other matrix is .
/// If this matrix and are not the same size.
/// A new matrix that is the pointwise division of this matrix and .
public Matrix PointwiseDivide(Matrix divisor)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
if (ColumnCount != divisor.ColumnCount || RowCount != divisor.RowCount)
{
throw DimensionsDontMatch(this, divisor);
@@ -1198,22 +972,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The pointwise denominator matrix to use.
/// The matrix to store the result of the pointwise division.
- /// If the other matrix is .
- /// If the result matrix is .
/// If this matrix and are not the same size.
/// If this matrix and are not the same size.
public void PointwiseDivide(Matrix divisor, Matrix result)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (ColumnCount != result.ColumnCount || RowCount != result.RowCount || ColumnCount != divisor.ColumnCount || RowCount != divisor.RowCount)
{
throw DimensionsDontMatch(this, divisor, result);
@@ -1226,16 +988,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Pointwise modulus this matrix by another matrix.
///
/// The pointwise denominator matrix to use.
- /// If the other matrix is .
/// If this matrix and are not the same size.
/// A new matrix that is the pointwise modulus of this matrix and .
public Matrix PointwiseModulus(Matrix divisor)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
if (ColumnCount != divisor.ColumnCount || RowCount != divisor.RowCount)
{
throw DimensionsDontMatch(this, divisor);
@@ -1251,22 +1007,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The pointwise denominator matrix to use.
/// The matrix to store the result of the pointwise modulus.
- /// If the other matrix is .
- /// If the result matrix is .
/// If this matrix and are not the same size.
/// If this matrix and are not the same size.
public void PointwiseModulus(Matrix divisor, Matrix result)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (ColumnCount != result.ColumnCount || RowCount != result.RowCount || ColumnCount != divisor.ColumnCount || RowCount != divisor.RowCount)
{
throw DimensionsDontMatch(this, divisor, result);
@@ -1328,15 +1072,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// with M = this.Rows * lower.Rows and N = this.Columns * lower.Columns.
///
/// The other matrix.
- /// If other is .
/// The kronecker product of the two matrices.
public virtual Matrix KroneckerProduct(Matrix other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
var result = CreateMatrix(RowCount * other.RowCount, ColumnCount * other.ColumnCount);
KroneckerProduct(other, result);
return result;
@@ -1348,21 +1086,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The other matrix.
/// The kronecker product of the two matrices.
- /// If other is .
- /// If the result matrix is .
/// If the result matrix's dimensions are not (this.Rows * lower.rows) x (this.Columns * lower.Columns).
public virtual void KroneckerProduct(Matrix other, Matrix result)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (result.RowCount != (RowCount * other.RowCount) || result.ColumnCount != (ColumnCount * other.ColumnCount))
{
throw DimensionsDontMatch(this, other, result);
diff --git a/src/Numerics/LinearAlgebra/Generic/Matrix.Operators.cs b/src/Numerics/LinearAlgebra/Generic/Matrix.Operators.cs
index 73c779b3..d5fde258 100644
--- a/src/Numerics/LinearAlgebra/Generic/Matrix.Operators.cs
+++ b/src/Numerics/LinearAlgebra/Generic/Matrix.Operators.cs
@@ -46,11 +46,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator +(Matrix rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.Clone();
}
@@ -62,11 +57,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator -(Matrix rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.Negate();
}
@@ -83,11 +73,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static Matrix operator +(Matrix leftSide, Matrix rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Add(rightSide);
}
@@ -102,11 +87,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator +(Matrix leftSide, T rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Add(rightSide);
}
@@ -121,11 +101,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator +(T leftSide, Matrix rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.Add(leftSide);
}
@@ -142,11 +117,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static Matrix operator -(Matrix leftSide, Matrix rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Subtract(rightSide);
}
@@ -162,11 +132,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static Matrix operator -(Matrix leftSide, T rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Subtract(rightSide);
}
@@ -182,11 +147,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static Matrix operator -(T leftSide, Matrix rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.SubtractFrom(leftSide);
}
@@ -199,11 +159,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator *(Matrix leftSide, T rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Multiply(rightSide);
}
@@ -216,11 +171,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator *(T leftSide, Matrix rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.Multiply(leftSide);
}
@@ -237,11 +187,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If the dimensions of or don't conform.
public static Matrix operator *(Matrix leftSide, Matrix rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Multiply(rightSide);
}
@@ -254,11 +199,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static Vector operator *(Matrix leftSide, Vector rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Multiply(rightSide);
}
@@ -271,11 +211,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static Vector operator *(Vector leftSide, Matrix rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.LeftMultiply(leftSide);
}
@@ -288,11 +223,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator /(T dividend, Matrix divisor)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
return divisor.DivideByThis(dividend);
}
@@ -305,11 +235,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator /(Matrix dividend, T divisor)
{
- if (dividend == null)
- {
- throw new ArgumentNullException("dividend");
- }
-
return dividend.Divide(divisor);
}
@@ -322,11 +247,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator %(Matrix dividend, T divisor)
{
- if (dividend == null)
- {
- throw new ArgumentNullException("dividend");
- }
-
return dividend.Modulus(divisor);
}
@@ -339,11 +259,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator %(T dividend, Matrix divisor)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("dividend");
- }
-
return divisor.ModulusByThis(dividend);
}
@@ -357,11 +272,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Matrix operator %(Matrix dividend, Matrix divisor)
{
- if (dividend == null)
- {
- throw new ArgumentNullException("dividend");
- }
-
return dividend.PointwiseModulus(divisor);
}
diff --git a/src/Numerics/LinearAlgebra/Generic/Vector.Arithmetic.cs b/src/Numerics/LinearAlgebra/Generic/Vector.Arithmetic.cs
index 116fcbcd..121ce867 100644
--- a/src/Numerics/LinearAlgebra/Generic/Vector.Arithmetic.cs
+++ b/src/Numerics/LinearAlgebra/Generic/Vector.Arithmetic.cs
@@ -171,15 +171,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to add.
/// The vector to store the result of the addition.
- /// If the result vector is .
/// If this vector and are not the same size.
public void Add(T scalar, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -199,15 +193,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to add to this one.
/// A new vector containing the sum of both vectors.
- /// If the other vector is .
/// If this vector and are not the same size.
public Vector Add(Vector other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (Count != other.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "other");
@@ -223,17 +211,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to add to this one.
/// The vector to store the result of the addition.
- /// If the other vector is .
- /// If the result vector is .
/// If this vector and are not the same size.
/// If this vector and are not the same size.
public void Add(Vector other, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -264,15 +245,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to subtract.
/// The vector to store the result of the subtraction.
- /// If the result vector is .
/// If this vector and are not the same size.
public void Subtract(T scalar, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -304,15 +279,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to subtract from.
/// The vector to store the result of the subtraction.
- /// If the result vector is .
/// If this vector and are not the same size.
public void SubtractFrom(T scalar, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -339,11 +308,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Target vector
public void Negate(Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -357,15 +321,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to subtract from this one.
/// A new vector containing the subtraction of the the two vectors.
- /// If the other vector is .
/// If this vector and are not the same size.
public Vector Subtract(Vector other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (Count != other.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "other");
@@ -381,17 +339,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to subtract from this one.
/// The vector to store the result of the subtraction.
- /// If the other vector is .
- /// If the result vector is .
/// If this vector and are not the same size.
/// If this vector and are not the same size.
public void Subtract(Vector other, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -417,11 +368,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Target vector
public void Conjugate(Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -457,15 +403,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to multiply.
/// The vector to store the result of the multiplication.
- /// If the result vector is .
/// If this vector and are not the same size.
public void Multiply(T scalar, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -492,14 +432,8 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// The other vector to add.
/// The result of the addition.
/// If is not of the same size.
- /// If is .
public T DotProduct(Vector other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (Count != other.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "other");
@@ -530,15 +464,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to divide with.
/// The vector to store the result of the division.
- /// If the result vector is .
/// If this vector and are not the same size.
public void Divide(T scalar, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -570,15 +498,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The scalar to divide.
/// The vector to store the result of the division.
- /// If the result vector is .
/// If this vector and are not the same size.
public void DivideByThis(T scalar, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -606,11 +528,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// A vector to store the results in.
public void Modulus(T divisor, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -638,11 +555,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// A vector to store the results in.
public void ModulusByThis(T dividend, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
if (Count != result.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result");
@@ -656,15 +568,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to pointwise multiply with this one.
/// A new vector which is the pointwise multiplication of the two vectors.
- /// If the other vector is .
/// If this vector and are not the same size.
public Vector PointwiseMultiply(Vector other)
{
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (Count != other.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "other");
@@ -680,22 +586,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The vector to pointwise multiply with this one.
/// The vector to store the result of the pointwise multiplication.
- /// If the other vector is .
- /// If the result vector is .
/// If this vector and are not the same size.
/// If this vector and are not the same size.
public void PointwiseMultiply(Vector other, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
- if (other == null)
- {
- throw new ArgumentNullException("other");
- }
-
if (Count != other.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "other");
@@ -714,15 +608,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The pointwise denominator vector to use.
/// A new vector which is the pointwise division of the two vectors.
- /// If the other vector is .
/// If this vector and are not the same size.
public Vector PointwiseDivide(Vector divisor)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
if (Count != divisor.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "divisor");
@@ -738,22 +626,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The pointwise denominator vector to use.
/// The vector to store the result of the pointwise division.
- /// If the other vector is .
- /// If the result vector is .
/// If this vector and are not the same size.
/// If this vector and are not the same size.
public void PointwiseDivide(Vector divisor, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
if (Count != divisor.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "divisor");
@@ -772,15 +648,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The pointwise denominator vector to use.
/// A new vector which is the pointwise modulus of the two vectors.
- /// If the other vector is .
/// If this vector and are not the same size.
public Vector PointwiseModulus(Vector divisor)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
if (Count != divisor.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "divisor");
@@ -796,22 +666,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
///
/// The pointwise denominator vector to use.
/// The vector to store the result of the pointwise modulus.
- /// If the other vector is .
- /// If the result vector is .
/// If this vector and are not the same size.
/// If this vector and are not the same size.
public void PointwiseModulus(Vector divisor, Vector result)
{
- if (result == null)
- {
- throw new ArgumentNullException("result");
- }
-
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
if (Count != divisor.Count)
{
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "divisor");
@@ -831,20 +689,8 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// First vector
/// Second vector
/// Matrix M[i,j] = u[i]*v[j]
- /// If the u vector is .
- /// If the v vector is .
public static Matrix OuterProduct(Vector u, Vector v)
{
- if (u == null)
- {
- throw new ArgumentNullException("u");
- }
-
- if (v == null)
- {
- throw new ArgumentNullException("v");
- }
-
var matrix = u.CreateMatrix(u.Count, v.Count);
for (var i = 0; i < u.Count; i++)
diff --git a/src/Numerics/LinearAlgebra/Generic/Vector.Operators.cs b/src/Numerics/LinearAlgebra/Generic/Vector.Operators.cs
index 275d397c..701aa422 100644
--- a/src/Numerics/LinearAlgebra/Generic/Vector.Operators.cs
+++ b/src/Numerics/LinearAlgebra/Generic/Vector.Operators.cs
@@ -44,11 +44,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator +(Vector rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.Clone();
}
@@ -60,11 +55,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator -(Vector rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.Negate();
}
@@ -78,11 +68,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static Vector operator +(Vector leftSide, Vector rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Add(rightSide);
}
@@ -95,11 +80,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator +(Vector leftSide, T rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Add(rightSide);
}
@@ -112,11 +92,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator +(T leftSide, Vector rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.Add(leftSide);
}
@@ -130,11 +105,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static Vector operator -(Vector leftSide, Vector rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Subtract(rightSide);
}
@@ -147,11 +117,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator -(Vector leftSide, T rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Subtract(rightSide);
}
@@ -164,11 +129,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator -(T leftSide, Vector rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.SubtractFrom(leftSide);
}
@@ -181,11 +141,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator *(Vector leftSide, T rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.Multiply(rightSide);
}
@@ -198,11 +153,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator *(T leftSide, Vector rightSide)
{
- if (rightSide == null)
- {
- throw new ArgumentNullException("rightSide");
- }
-
return rightSide.Multiply(leftSide);
}
@@ -216,11 +166,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If or is .
public static T operator *(Vector leftSide, Vector rightSide)
{
- if (leftSide == null)
- {
- throw new ArgumentNullException("leftSide");
- }
-
return leftSide.DotProduct(rightSide);
}
@@ -233,11 +178,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator /(T dividend, Vector divisor)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
return divisor.DevideByThis(dividend);
}
@@ -250,11 +190,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator /(Vector dividend, T divisor)
{
- if (dividend == null)
- {
- throw new ArgumentNullException("dividend");
- }
-
return dividend.Divide(divisor);
}
@@ -268,11 +203,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator /(Vector dividend, Vector divisor)
{
- if (dividend == null)
- {
- throw new ArgumentNullException("dividend");
- }
-
return dividend.PointwiseDivide(divisor);
}
@@ -285,11 +215,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator %(Vector dividend, T divisor)
{
- if (dividend == null)
- {
- throw new ArgumentNullException("dividend");
- }
-
return dividend.Modulus(divisor);
}
@@ -302,11 +227,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator %(T dividend, Vector divisor)
{
- if (divisor == null)
- {
- throw new ArgumentNullException("divisor");
- }
-
return divisor.ModulusByThis(dividend);
}
@@ -320,11 +240,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// If is .
public static Vector operator %(Vector dividend, Vector divisor)
{
- if (dividend == null)
- {
- throw new ArgumentNullException("dividend");
- }
-
return dividend.PointwiseModulus(divisor);
}
diff --git a/src/UnitTests/LinearAlgebraTests/Complex/DenseVectorTests.cs b/src/UnitTests/LinearAlgebraTests/Complex/DenseVectorTests.cs
index 1c104339..6bdf2ed0 100644
--- a/src/UnitTests/LinearAlgebraTests/Complex/DenseVectorTests.cs
+++ b/src/UnitTests/LinearAlgebraTests/Complex/DenseVectorTests.cs
@@ -320,17 +320,5 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
}
-
- ///
- /// Outer product for null dense vectors throws ArgumentNullException.
- ///
- [Test]
- public void OuterProductForNullDenseVectorsThrowsArgumentNullException()
- {
- DenseVector vector1 = null;
- var vector2 = CreateVector(Data);
- Assert.Throws(() => Vector.OuterProduct(vector1, vector2));
- Assert.Throws(() => Vector.OuterProduct(vector2, vector1));
- }
}
}
diff --git a/src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs b/src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs
index e1117706..1d848d1c 100644
--- a/src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs
+++ b/src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs
@@ -122,18 +122,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Multiply with vector into result fails when result is null.
- ///
- [Test]
- public void MultiplyWithVectorIntoNullResultThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Singular3x3"];
- var x = new DenseVector(new[] { new Complex(1, 1), new Complex(2, 1), new Complex(3, 1) });
- Vector y = null;
- Assert.Throws(() => matrix.Multiply(x, y));
- }
-
///
/// Multiply with a vector into too large result throws ArgumentException.
///
@@ -213,17 +201,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Multiply with a scalar into null result throws ArgumentNullException.
- ///
- [Test]
- public void MultiplyWithScalarIntoNullResultThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Singular3x3"];
- Matrix result = null;
- Assert.Throws(() => matrix.Multiply(2.3, result));
- }
-
///
/// Multiply with a scalar when result has more rows throws ArgumentException.
///
@@ -246,26 +223,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
Assert.Throws(() => matrix.Multiply(2.3, result));
}
- ///
- /// Operator left multiply with a scalar when matrix is null throws ArgumentNullException.
- ///
- [Test]
- public void OperatorLeftMultiplyWithScalarWhenMatrixIsNullThrowsArgumentNullException()
- {
- Matrix matrix = null;
- Assert.Throws(() => { var result = 2.3 * matrix; });
- }
-
- ///
- /// Operator right multiply with a scalar when matrix is null throws ArgumentNullException.
- ///
- [Test]
- public void OperatorRightMultiplyWithScalarWhenMatrixIsNullThrowsArgumentNullException()
- {
- Matrix matrix = null;
- Assert.Throws(() => { var result = matrix * 2.3; });
- }
-
///
/// Can add a matrix.
///
@@ -289,17 +246,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Adding a matrix when argument is null throws ArgumentNullException.
- ///
- [Test]
- public void AddNullMatrixThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Singular4x4"];
- Matrix other = null;
- Assert.Throws(() => matrix.Add(other));
- }
-
///
/// Adding a matrix with fewer columns throws ArgumentOutOfRangeException.
///
@@ -344,28 +290,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Add operator when left side is null throws ArgumentNullException.
- ///
- [Test]
- public void AddOperatorWhenLeftSideIsNullThrowsArgumentNullException()
- {
- Matrix matrix = null;
- var other = TestMatrices["Singular3x3"];
- Assert.Throws(() => { var result = matrix + other; });
- }
-
- ///
- /// Add operator when right side is null throws ArgumentNullException.
- ///
- [Test]
- public void AddOperatorWhenRightSideIsNullThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Singular3x3"];
- Matrix other = null;
- Assert.Throws(() => { var result = matrix + other; });
- }
-
///
/// Add operator when right side has fewer columns throws ArgumentOutOfRangeException.
///
@@ -411,17 +335,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Subtract null matrix throws ArgumentNullException.
- ///
- [Test]
- public void SubtractNullMatrixThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Singular4x4"];
- Matrix other = null;
- Assert.Throws(() => matrix.Subtract(other));
- }
-
///
/// Subtract a matrix when right side has fewer columns throws ArgumentOutOfRangeException.
///
@@ -466,28 +379,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Subtract operator when left side is null throws ArgumentNullException.
- ///
- [Test]
- public void SubtractOperatorWhenLeftSideIsNullThrowsArgumentNullException()
- {
- Matrix matrix = null;
- var other = TestMatrices["Singular3x3"];
- Assert.Throws(() => { var result = matrix - other; });
- }
-
- ///
- /// Subtract operator when right side is null throws ArgumentNullException.
- ///
- [Test]
- public void SubtractOperatorWhenRightSideIsNullThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Singular3x3"];
- Matrix other = null;
- Assert.Throws(() => { var result = matrix - other; });
- }
-
///
/// Subtract operator when right side has fewer columns throws ArgumentOutOfRangeException
///
@@ -609,17 +500,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
Assert.Throws(() => matrix.TransposeAndMultiply(other));
}
- ///
- /// Transpose and multiply a matrix with null matrix throws ArgumentNullException.
- ///
- [Test]
- public void TransposeAndMultiplyMatrixWithNullMatrixThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Wide2x3"];
- Matrix other = null;
- Assert.Throws(() => matrix.TransposeAndMultiply(other));
- }
-
///
/// Can transpose and multiply a matrix with matrix into a result matrix.
///
@@ -658,28 +538,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
Assert.Throws(() => { var result = matrix * other; });
}
- ///
- /// Multiply null matrix with matrix throws ArgumentNullException.
- ///
- [Test]
- public void MultiplyNullMatrixWithMatrixThrowsArgumentNullException()
- {
- Matrix matrix = null;
- var other = TestMatrices["Wide2x3"];
- Assert.Throws(() => { var result = matrix * other; });
- }
-
- ///
- /// Multiply a matrix with null matrix throws ArgumentNullException.
- ///
- [Test]
- public void MultiplyMatrixWithNullMatrixThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Wide2x3"];
- Matrix other = null;
- Assert.Throws(() => { var result = matrix * other; });
- }
-
///
/// Can multiply a matrix with matrix into a result matrix.
///
@@ -770,18 +628,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Multiply transposed matrix with vector into result fails when result is null.
- ///
- [Test]
- public void TransposeThisAndMultiplyWithVectorIntoNullResultThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Singular3x3"];
- var x = new DenseVector(new[] { new Complex(1, 1), new Complex(2, 1), new Complex(3, 1) });
- Vector y = null;
- Assert.Throws(() => matrix.TransposeThisAndMultiply(x, y));
- }
-
///
/// Multiply transposed matrix with a vector into too large result throws ArgumentException.
///
@@ -831,17 +677,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
Assert.Throws(() => matrix.TransposeThisAndMultiply(other));
}
- ///
- /// Multiply the transpose of matrix with another matrix null matrix throws ArgumentNullException.
- ///
- [Test]
- public void TransposeThisAndMultiplyMatrixWithNullMatrixThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Wide2x3"];
- Matrix other = null;
- Assert.Throws(() => matrix.TransposeThisAndMultiply(other));
- }
-
///
/// Multiply transpose of this matrix with another matrix into a result matrix.
///
@@ -919,17 +754,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Negate into null result throws ArgumentNullException.
- ///
- [Test]
- public void NegateIntoNullResultThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Singular3x3"];
- Matrix copy = null;
- Assert.Throws(() => matrix.Negate(copy));
- }
-
///
/// Negate into a result matrix with more rows throws ArgumentException.
///
@@ -1086,29 +910,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Pointwise multiply null matrices into a result throws ArgumentNullException.
- ///
- [Test]
- public void PointwiseMultiplyNullIntoResultThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Wide2x3"];
- Matrix other = null;
- var result = matrix.Clone();
- Assert.Throws(() => matrix.PointwiseMultiply(other, result));
- }
-
- ///
- /// Pointwise multiply matrices into null result throws ArgumentNullException.
- ///
- [Test]
- public void PointwiseMultiplyIntoNullResultThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Wide2x3"];
- var other = matrix.Clone();
- Assert.Throws(() => matrix.PointwiseMultiply(other, null));
- }
-
///
/// Pointwise multiply matrices with invalid dimensions into a result throws ArgumentException.
///
@@ -1161,29 +962,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
}
}
- ///
- /// Pointwise divide null matrices into a result throws ArgumentNullException.
- ///
- [Test]
- public void PointwiseDivideNullIntoResultThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Wide2x3"];
- Matrix other = null;
- var result = matrix.Clone();
- Assert.Throws(() => matrix.PointwiseDivide(other, result));
- }
-
- ///
- /// Pointwise divide matrices into null result throws ArgumentNullException.
- ///
- [Test]
- public void PointwiseDivideIntoNullResultThrowsArgumentNullException()
- {
- var matrix = TestMatrices["Wide2x3"];
- var other = matrix.Clone();
- Assert.Throws(() => matrix.PointwiseDivide(other, null));
- }
-
///
/// Pointwise divide matrices with invalid dimensions into a result throws