|
|
|
@ -132,7 +132,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var x = new DenseVector(new[] { new Complex32(1, 1), new Complex32(2, 1), new Complex32(3, 1) }); |
|
|
|
Vector<Complex32> y = new DenseVector(4); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.Multiply(x, y)); |
|
|
|
Assert.That(() => matrix.Multiply(x, y), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -210,7 +210,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var result = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.Multiply(2.3f, result)); |
|
|
|
Assert.That(() => matrix.Multiply(2.3f, result), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -221,7 +221,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var result = CreateMatrix(matrix.RowCount, matrix.ColumnCount + 1); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.Multiply(2.3f, result)); |
|
|
|
Assert.That(() => matrix.Multiply(2.3f, result), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -255,7 +255,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var other = TestMatrices["Tall3x2"]; |
|
|
|
Assert.Throws<ArgumentOutOfRangeException>(() => matrix.Add(other)); |
|
|
|
Assert.That(() => matrix.Add(other), Throws.TypeOf<ArgumentOutOfRangeException>()); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -266,7 +266,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var other = TestMatrices["Wide2x3"]; |
|
|
|
Assert.Throws<ArgumentOutOfRangeException>(() => matrix.Add(other)); |
|
|
|
Assert.That(() => matrix.Add(other), Throws.TypeOf<ArgumentOutOfRangeException>()); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -344,7 +344,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var other = TestMatrices["Tall3x2"]; |
|
|
|
Assert.Throws<ArgumentOutOfRangeException>(() => matrix.Subtract(other)); |
|
|
|
Assert.That(() => matrix.Subtract(other), Throws.TypeOf<ArgumentOutOfRangeException>()); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -355,7 +355,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var other = TestMatrices["Wide2x3"]; |
|
|
|
Assert.Throws<ArgumentOutOfRangeException>(() => matrix.Subtract(other)); |
|
|
|
Assert.That(() => matrix.Subtract(other), Throws.TypeOf<ArgumentOutOfRangeException>()); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -498,7 +498,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var other = TestMatrices["Tall3x2"]; |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.TransposeAndMultiply(other)); |
|
|
|
Assert.That(() => matrix.TransposeAndMultiply(other), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -638,7 +638,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var x = new DenseVector(new[] { new Complex32(1, 1), new Complex32(2, 1), new Complex32(3, 1) }); |
|
|
|
Vector<Complex32> y = new DenseVector(4); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.TransposeThisAndMultiply(x, y)); |
|
|
|
Assert.That(() => matrix.TransposeThisAndMultiply(x, y), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -675,7 +675,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Wide2x3"]; |
|
|
|
var other = TestMatrices["Singular3x3"]; |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.TransposeThisAndMultiply(other)); |
|
|
|
Assert.That(() => matrix.TransposeThisAndMultiply(other), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -763,7 +763,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var target = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.Negate(target)); |
|
|
|
Assert.That(() => matrix.Negate(target), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -774,7 +774,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Singular3x3"]; |
|
|
|
var target = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.Negate(target)); |
|
|
|
Assert.That(() => matrix.Negate(target), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -849,7 +849,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
[Test] |
|
|
|
public void NormalizeColumnsWithWrongParameterThrowsArgumentOutOfRangeException() |
|
|
|
{ |
|
|
|
Assert.Throws<ArgumentOutOfRangeException>(() => TestMatrices["Square4x4"].NormalizeColumns(-4)); |
|
|
|
Assert.That(() => TestMatrices["Square4x4"].NormalizeColumns(-4), Throws.TypeOf<ArgumentOutOfRangeException>()); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -874,7 +874,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
[Test] |
|
|
|
public void NormalizeRowsWithWrongParameterThrowsArgumentOutOfRangeException() |
|
|
|
{ |
|
|
|
Assert.Throws<ArgumentOutOfRangeException>(() => TestMatrices["Square4x4"].NormalizeRows(-4)); |
|
|
|
Assert.That(() => TestMatrices["Square4x4"].NormalizeRows(-4), Throws.TypeOf<ArgumentOutOfRangeException>()); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -916,7 +916,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
var matrix = TestMatrices["Wide2x3"]; |
|
|
|
var other = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount); |
|
|
|
var result = matrix.Clone(); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.PointwiseMultiply(other, result)); |
|
|
|
Assert.That(() => matrix.PointwiseMultiply(other, result), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -928,7 +928,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
var matrix = TestMatrices["Wide2x3"]; |
|
|
|
var other = matrix.Clone(); |
|
|
|
var result = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.PointwiseMultiply(other, result)); |
|
|
|
Assert.That(() => matrix.PointwiseMultiply(other, result), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -968,7 +968,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
var matrix = TestMatrices["Wide2x3"]; |
|
|
|
var other = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount); |
|
|
|
var result = matrix.Clone(); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.PointwiseDivide(other, result)); |
|
|
|
Assert.That(() => matrix.PointwiseDivide(other, result), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -980,7 +980,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
var matrix = TestMatrices["Wide2x3"]; |
|
|
|
var other = matrix.Clone(); |
|
|
|
var result = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount); |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.PointwiseDivide(other, result)); |
|
|
|
Assert.That(() => matrix.PointwiseDivide(other, result), Throws.ArgumentException); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -991,7 +991,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
[TestCase(-2)] |
|
|
|
public void RandomWithNonPositiveNumberOfRowsThrowsArgumentException(int numberOfRows) |
|
|
|
{ |
|
|
|
Assert.Throws<ArgumentOutOfRangeException>(() => DenseMatrix.CreateRandom(numberOfRows, 4, new ContinuousUniform())); |
|
|
|
Assert.That(() => DenseMatrix.CreateRandom(numberOfRows, 4, new ContinuousUniform()), Throws.TypeOf<ArgumentOutOfRangeException>()); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -1012,7 +1012,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32 |
|
|
|
public void TraceOfNonSquareMatrixThrowsArgumentException() |
|
|
|
{ |
|
|
|
var matrix = TestMatrices["Wide2x3"]; |
|
|
|
Assert.Throws<ArgumentException>(() => matrix.Trace()); |
|
|
|
Assert.That(() => matrix.Trace(), Throws.ArgumentException); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|