This section lists the exception types that may be thrown by classes in the Extreme
Optimization Mathematics Library for .NET.
In addition to the exceptions listed below, many standard exceptions may also be thrown. For instance, when the
index for a vector or matrix is out of range, an ArgumentOutOfRangeException is thrown. When a
user tries to obtain the result from a descendant of ManagedIterativeAlgorithm<(Of <(<'T>)>)> before the algorithm has terminated, an
InvalidOperationException is thrown. This behavior is consistent with Microsoft's guidelines for
This exception indicates that an algorithm failed to converge. This exception is only thrown if the
ThrowExceptionOnFailure property is set to true. See the ManagedIterativeAlgorithm<(Of <(<'T>)>)> interface for details.
In some rare cases, round-off error can cause the result of an operation to have no correct significant digits at
all. When this happens, an exception of type TotalLossOfPrecisionException is thrown.
Round-off errors are the result of the finite precision of floating-point numbers. Only a few numbers can be
represented exactly. The main contributing factor to total loss of precision is when two numbers of approximately
equal size are subtracted.
Many matrices have a clearly defined structure. For example, all elements above the diagonal of a lower triangular
matrix are zero. If the matrix is also unit diagonal, then its diagonal elements have the fixed value of 1.
Changing the value of one of these elements would cause the vector or matrix to lose its structure. This is not
allowed. In this case, a ComponentReadOnlyException is thrown.
There are many reasons why a DimensionMismatchException may be thrown. In every case, the
dimensions of some or all of the Vector or DenseMatrix objects involved in an operation are not
compatible. Some examples of requirements that may be violated, resulting in a
- A method requires a Matrix to be square. The
matrix that was supplied is rectangular.
- An operation on two Vector objects requires that the two vectors have the same length. Most
operations on vectors have this requirement.
- A multiplication of a Matrix and a Vector requires that either the number of
rows or the number of columns in the matrix equals the length of the vector.
- A multiplication of two matrices requires that the 'inner' dimensions are the same.
This exception type has four properties that give more information about the cause of the problem:
The DimensionType of the first parameter involved in the operation.
The name of the first parameter involved in the operation.
The DimensionType of the second parameter involved in the operation. If there was only one parameter
involved, this property equals DimensionType.Unknown.
The name of the second parameter involved in the operation. If there was only one parameter
involved, the value of this property is an empty string.
The DimensionType enumeration can have the following values:
The mismatched dimension is unknown.
The number of rows of a Matrix is
The number of columns of a Matrix is
The length of a Vector is mismatched.
A matrix is positive definite when all its eigenvalues are greater than or equal to zero. A
MatrixNotPositiveDefiniteException is thrown when a computation cannot be completed because a
DenseMatrix is not positive definite. In particular,
for the Cholesky Decomposition of a symmetrical matrix to exist, the matrix must be positive definite.
A MatrixSingularException is thrown when a computation cannot be completed because a DenseMatrix is singular.