|
|
|
@ -392,9 +392,10 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers |
|
|
|
public void StopSolve() |
|
|
|
{ |
|
|
|
_hasBeenStopped = true; |
|
|
|
if (_currentSolver != null) |
|
|
|
var currentSolver = _currentSolver; |
|
|
|
if (currentSolver != null) |
|
|
|
{ |
|
|
|
_currentSolver.StopSolve(); |
|
|
|
currentSolver.StopSolve(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -407,11 +408,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers |
|
|
|
/// <returns>The result vector, <c>x</c>.</returns>
|
|
|
|
public Vector<Numerics.Complex32> Solve(Matrix<Numerics.Complex32> matrix, Vector<Numerics.Complex32> vector) |
|
|
|
{ |
|
|
|
if (vector == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException(); |
|
|
|
} |
|
|
|
|
|
|
|
var result = new DenseVector(matrix.RowCount); |
|
|
|
Solve(matrix, vector, result); |
|
|
|
return result; |
|
|
|
@ -432,27 +428,11 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers |
|
|
|
_hasBeenStopped = false; |
|
|
|
_currentSolver = null; |
|
|
|
|
|
|
|
// Error checks
|
|
|
|
if (matrix == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("matrix"); |
|
|
|
} |
|
|
|
|
|
|
|
if (matrix.RowCount != matrix.ColumnCount) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentMatrixSquare, "matrix"); |
|
|
|
} |
|
|
|
|
|
|
|
if (input == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("input"); |
|
|
|
} |
|
|
|
|
|
|
|
if (result == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("result"); |
|
|
|
} |
|
|
|
|
|
|
|
if (result.Count != input.Count) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength); |
|
|
|
@ -568,16 +548,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers |
|
|
|
/// <returns>The result matrix, <c>X</c>.</returns>
|
|
|
|
public Matrix<Numerics.Complex32> Solve(Matrix<Numerics.Complex32> matrix, Matrix<Numerics.Complex32> input) |
|
|
|
{ |
|
|
|
if (matrix == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("matrix"); |
|
|
|
} |
|
|
|
|
|
|
|
if (input == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("input"); |
|
|
|
} |
|
|
|
|
|
|
|
var result = matrix.CreateMatrix(input.RowCount, input.ColumnCount); |
|
|
|
Solve(matrix, input, result); |
|
|
|
return result; |
|
|
|
@ -592,21 +562,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers |
|
|
|
/// <param name="result">The result matrix, <c>X</c></param>
|
|
|
|
public void Solve(Matrix<Numerics.Complex32> matrix, Matrix<Numerics.Complex32> input, Matrix<Numerics.Complex32> result) |
|
|
|
{ |
|
|
|
if (matrix == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("matrix"); |
|
|
|
} |
|
|
|
|
|
|
|
if (input == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("input"); |
|
|
|
} |
|
|
|
|
|
|
|
if (result == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("result"); |
|
|
|
} |
|
|
|
|
|
|
|
if (matrix.RowCount != input.RowCount || input.RowCount != result.RowCount || input.ColumnCount != result.ColumnCount) |
|
|
|
{ |
|
|
|
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix, input, result); |
|
|
|
|