Skip to content

Commit

Permalink
Xml comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikasoukhov committed Feb 18, 2025
1 parent 629d6c8 commit b809ccc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
22 changes: 19 additions & 3 deletions MathLight/LinearAlgebra/LUDecomposition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ namespace Ecng.MathLight.LinearAlgebra
/// </summary>
public class LUDecomposition
{
public double[,] L { private set; get; }
public double[,] U { private set; get; }
/// <summary>
/// The lower triangular matrix.
/// </summary>
public double[,] L { private set; get; }
/// <summary>
/// The upper triangular matrix.
/// </summary>
public double[,] U { private set; get; }

private readonly int[] _permutation;
private readonly double[] _rowBuffer;
Expand Down Expand Up @@ -80,7 +86,12 @@ public LUDecomposition(double[,] matrix)
}
}

public double[,] Solve(double[,] matrix)
/// <summary>
/// Solve the system of linear equations.
/// </summary>
/// <param name="matrix">The matrix.</param>
/// <returns>The value.</returns>
public double[,] Solve(double[,] matrix)
{
if (matrix.Rows() != L.Rows())
{
Expand Down Expand Up @@ -109,6 +120,11 @@ public LUDecomposition(double[,] matrix)
return ret;
}

/// <summary>
/// Solve the system of linear equations.
/// </summary>
/// <param name="vector">The vector.</param>
/// <returns>The value.</returns>
[CLSCompliant(false)]
public double[] Solve(double[] vector)
{
Expand Down
5 changes: 4 additions & 1 deletion MathLight/LinearAlgebra/PolyFit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

namespace Ecng.MathLight.LinearAlgebra
{
public class PolyFit
/// <summary>
/// Implements simple Matrix functions needed for polynomial fitting
/// </summary>
public class PolyFit
{
/// <summary>
/// Coefficients of a polynomial starting at the constant coefficient
Expand Down
16 changes: 15 additions & 1 deletion MathLight/Normal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

using System;

/// <summary>
/// The normal distribution.
/// </summary>
public static class Normal
{
// MathNet.Numerics
Expand Down Expand Up @@ -35,11 +38,17 @@ public static class Normal
private static readonly double[] ErfImpNn = [-7.892247039787227E-06, 6.22088451660987E-07, 1.457284456768824E-08, 6.0371550554271534E-11];
private static readonly double[] ErfImpNd = [1.0, 0.037532884635629371, 0.00046791953597462532, 1.9384703927584565E-06];

/// <summary>
/// Evaluate the polynomial.
/// </summary>
/// <param name="z">The z.</param>
/// <param name="coefficients">The coefficients.</param>
/// <returns>The result.</returns>
public static double Evaluate(double z, params double[] coefficients)
{
if (coefficients == null)
{
throw new ArgumentNullException("coefficients");
throw new ArgumentNullException(nameof(coefficients));
}

int num = coefficients.Length;
Expand All @@ -58,6 +67,11 @@ public static double Evaluate(double z, params double[] coefficients)
return num2;
}

/// <summary>
/// The cumulative distribution.
/// </summary>
/// <param name="x">The x.</param>
/// <returns>The cumulative distribution.</returns>
public static double CumulativeDistribution(double x)
{
static double ErfImp(double z, bool invert)
Expand Down

0 comments on commit b809ccc

Please sign in to comment.