Browse Source

tweaked work[0] return value

la-knuth
Marcus Cuda 16 years ago
parent
commit
95fe9321db
  1. 7
      src/Numerics/Algorithms/LinearAlgebra/ManagedLinearAlgebraProvider.cs
  2. 9
      src/Numerics/Properties/Resources.Designer.cs

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

@ -1053,6 +1053,8 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra
{ {
ComputeQR(work, i, q, rRows, i, rRows - 1, i, rRows - 1); ComputeQR(work, i, q, rRows, i, rRows - 1, i, rRows - 1);
} }
work[0] = rRows * rRows;
} }
#region QR Factor Helper functions #region QR Factor Helper functions
@ -1265,11 +1267,14 @@ 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");
} }
QRFactor(r, rRows, rColumns, q, work); QRFactor(r, rRows, rColumns, q, work);
QRSolveFactored(q, r, rRows, rColumns, b, bColumns, x); QRSolveFactored(q, r, rRows, rColumns, b, bColumns, x);
work[0] = rRows * rRows;
} }
/// <summary> /// <summary>

9
src/Numerics/Properties/Resources.Designer.cs

@ -635,5 +635,14 @@ namespace MathNet.Numerics.Properties {
return ResourceManager.GetString("UserDefinedProviderNotSpecified", resourceCulture); return ResourceManager.GetString("UserDefinedProviderNotSpecified", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to The given work array is too small. Check work[0] for the corret size..
/// </summary>
internal static string WorkArrayTooSmall {
get {
return ResourceManager.GetString("WorkArrayTooSmall", resourceCulture);
}
}
} }
} }

Loading…
Cancel
Save