Browse Source

added missing commit

la-knuth
Marcus Cuda 16 years ago
parent
commit
03f613852e
  1. 7
      src/MathNet.Numerics.5.0.ReSharper
  2. 17
      src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.cs
  3. 3
      src/Numerics/Properties/Resources.resx

7
src/MathNet.Numerics.5.0.ReSharper

@ -11,7 +11,12 @@
<Name>en-US</Name> <Name>en-US</Name>
<CaseSensitive>false</CaseSensitive> <CaseSensitive>false</CaseSensitive>
<UserWords>pointwise <UserWords>pointwise
Frobenius</UserWords> Frobenius
indices
ipiv
blocksize
Dont
Cholesky</UserWords>
</CustomDictionary> </CustomDictionary>
</Dictionaries> </Dictionaries>
</CustomDictionaries> </CustomDictionaries>

17
src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.cs

@ -1037,7 +1037,8 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
if (work.Length < rRows * rRows) if (work.Length < rRows * rRows)
{ {
throw new ArgumentException(Resources.ArgumentArraysSameLength, "work"); work[0] = rRows * rRows;
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
} }
CommonParallel.For(0, rRows, i => q[(i * rRows) + i] = 1.0); CommonParallel.For(0, rRows, i => q[(i * rRows) + i] = 1.0);
@ -1502,9 +1503,8 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
if (work.Length < aRows) if (work.Length < aRows)
{ {
// TODO: Actually "work = new double[aRows]" is acceptable size of work array. I set size proposed in method description work[0] = aRows;
work[0] = Math.Max((3 * Math.Min(aRows, aColumns)) + Math.Max(aRows, aColumns), 5 * Math.Min(aRows, aColumns)); throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
return;
} }
const int Maxiter = 1000; const int Maxiter = 1000;
@ -2172,8 +2172,8 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
if (work.Length < aRows) if (work.Length < aRows)
{ {
work[0] = Math.Max(3 * Math.Min(aRows, aColumns) + Math.Max(aRows, aColumns), 5 * Math.Min(aRows, aColumns)); work[0] = aRows;
return; throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
} }
const int Maxiter = 1000; const int Maxiter = 1000;
@ -2965,9 +2965,8 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
if (work.Length < aRows) if (work.Length < aRows)
{ {
// TODO: Actually "work = new double[aRows]" is acceptable size of work array. I set size proposed in method description work[0] = aRows;
work[0] = Math.Max((3 * Math.Min(aRows, aColumns)) + Math.Max(aRows, aColumns), 5 * Math.Min(aRows, aColumns)); throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
return;
} }
SingularValueDecomposition(true, a, aRows, aColumns, s, u, vt, work); SingularValueDecomposition(true, a, aRows, aColumns, s, u, vt, work);

3
src/Numerics/Properties/Resources.resx

@ -309,4 +309,7 @@
<data name="SingularVectorsNotComputed" xml:space="preserve"> <data name="SingularVectorsNotComputed" xml:space="preserve">
<value>The singular vectors were not computed.</value> <value>The singular vectors were not computed.</value>
</data> </data>
<data name="WorkArrayTooSmall" xml:space="preserve">
<value>The given work array is too small. Check work[0] for the corret size.</value>
</data>
</root> </root>
Loading…
Cancel
Save