# Namespace Microsoft.ML.Probabilistic.Math

### Classes

#### AllZeroException

Exception type thrown when probability vector = (0,0,0,...,0).

#### ApproximateSparseVector

A one-dimensional vector of double values, optimised for the case where many of the elements share a common value (which need not be zero) within some tolerance.

#### BFGS

This implementation of BFGS is based on Algorithm 6.1 from Nocedal and Wright (Second edition, 2006).

#### BranchAndBound

#### ContinuedFraction

A class for evaluating continued fractions

#### DenseVector

1-dimensional dense container of double precision data that supports vector operations.

#### DerivativeChecker

Class used to check analytic derivatives using finite difference approximation

#### LBFGS

Implements the LBFGS compact Quasi-Newton solver.

#### LBFGSArray

Implements the LBFGS compact Quasi-Newton solver on an array of Vectors (which may be sparse)

#### LineSearch

This line search algorithm is algorithm 3.5/3.6 from Nocedal and Wright (Second edition, 2006). It provides a step length that satisfies the strong Wolfe conditions.

#### LowerTriangularMatrix

Class for lower triangular matrices

#### LuDecomposition

Class for calculating and doing operations with an LU decomposition

#### Matrix

Two-dimensional container of doubles.

#### MatrixMeanVarianceAccumulator

Class for accumulating weighted noisy matrix observations, and computing sample count, mean matrix, and covariance matrix

#### MatrixSingularException

Exception thrown when a singular matrix is encountered.

#### MeanVarianceAccumulator

Class for accumulating weighted noisy scalar observations, and computing sample count, mean, and variance

#### MeanVarianceAccumulator2

Class for accumulating weighted noisy scalar observations, and computing sample count, mean, and variance

#### MeanVarianceAccumulatorSkipNaNs

Decorator of MeanVarianceAccumulator that does not add if any input is NaN.

#### MMath

This class provides mathematical constants and special functions, analogous to System.Math. It cannot be instantiated and consists of static members only.

#### OptimiserIterationEventArgs

Optimiser iteration event

#### PiecewiseVector

A one-dimensional vector of double values, optimised for the case where many contiguous ranges of elements have the same value.

#### PositiveDefiniteMatrix

A subclass of Matrix with extra methods appropriate to positive-definite matrices.

#### PositiveDefiniteMatrixException

Exception thrown when a matrix is not positive definite.

#### Quadrature

Quadrature nodes and weights

#### Rand

This class provides a source of non-uniform random numbers. It cannot be instantiated and consists of only static functions.

#### Region

Represents a hyper-rectangle in arbitrary dimensions.

#### SparseVector

A one-dimensional vector of double values, optimised for the case where many of the elements share a common value (which need not be zero).

#### Sparsity

Defines sparsity settings for vectors. The sparsity handling has been designed to deal with large dimensional distributions such as Discrete and Dirichlet distributions.

#### UpperTriangularMatrix

Upper triangular matrix class

#### Vector

Base class for vectors. DenseVector, SparseVector, and ApproximateSparseVector all inherit from this base class.

#### VectorMeanVarianceAccumulator

Class for accumulating weighted noisy vector observations, and computing sample count, mean vector, and covariance matrix

### Structs

#### ConstantVector

A vector which has a constant value between its start and end indices.

### Interfaces

#### CanSetAllElementsTo<T>

Supports setting all elements to duplicates of the same value

#### Diffable

Supports calculating the maximum difference between this instance and another object (not necessarily of the same type)

#### SettableTo<T>

Supports setting an instance to a value

#### SettableToPower<T>

Supports setting an instance to a value raised to a power

#### SettableToProduct<T>

Supports setting an instance to the product of two values of the same type

#### SettableToProduct<T, U>

Supports setting an instance to the product of two values of different types

#### SettableToRatio<T>

Supports setting an instance to the ratio of two values of the same type

#### SettableToRatio<T, U>

Supports setting an instance to the ratio of two values of different types

#### SettableToWeightedSum<T>

Supports setting an instance to the weighted sum of two values of the same type

#### SettableToWeightedSumExact<T>

Indicates that a distribution can represent weighted sum
of distributions of type `T`

exactly.

### Enums

#### BFGS.ConvergenceCriteria

Convergence criteria:

- Gradient: |grad F|/sqrt(dimensions) <= eps
- Objective: |F(k+1)-F(k)|<=eps*max{|F(k)|,|F(k+1)|,1}

#### StorageType

The type of storage used in a vector, which is specified as part of the Sparsity class.

### Delegates

#### FunctionEval

Delegate type for function evaluation

#### IterationEventHandler

Event delegate for handling iteration event

#### LBFGSArray.FunctionEvalArray

Delegate type for function evaluation

#### LineSearchEval

Delegate type for function evaluation

#### PiecewiseVector.RangeFunc

An action that takes a range and two values.