Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Blog
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference
  • Extreme Optimization
    • Features
    • Solutions
    • Documentation
    • QuickStart Samples
    • Sample Applications
    • Downloads
    • Technical Support
    • Download trial
    • How to buy
    • Blog
    • Company
    • Resources
  • Documentation
    • Introduction
    • Deployment Guide
    • Nuget packages
    • Configuration
    • Using Parallelism
    • Mathematics Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Data Access Library User's Guide
    • Reference
  • Mathematics Library User's Guide
    • General Classes
    • Mathematical Functions
    • Complex Numbers
    • Arbitrary Precision Arithmetic
    • Automatic Differentiation
    • Curves and Interpolation
    • Curve Fitting
    • Solving Equations
    • Optimization
    • Calculus
    • Fast Fourier Transforms
    • Random Numbers
    • Generic Arithmetic
    • Appendices
  • Appendices
    • Enumeration Types
    • Exception Types
  • Exception Types

Exception Types

Extreme Optimization Numerical Libraries for .NET Professional

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 ManagedIterativeAlgorithmT before the algorithm has terminated, an InvalidOperationException is thrown. This behavior is consistent with Microsoft's guidelines for throwing exceptions.

ConvergenceException

This exception indicates that an algorithm failed to converge. This exception is only thrown if the ThrowExceptionOnFailure property is set to true. See the ManagedIterativeAlgorithmT interface for details.

TotalLossOfPrecisionException

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.

ComponentReadOnlyException

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.

The exception is also thrown when a vector or matrix is marked as read-only and an attempt is made to set one or more elements.

DimensionMismatchException

There are many reasons why a DimensionMismatchException may be thrown. In every case, the dimensions of some or all of the VectorT or MatrixT objects involved in an operation are not compatible. Some examples of requirements that may be violated, resulting in a DimensionMismatchException, are:

  • A method requires a MatrixT 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:

Property

Description

FirstDimensionType

The DimensionType of the first parameter involved in the operation.

FirstParameterName

The name of the first parameter involved in the operation.

SecondDimensionType

The DimensionType of the second parameter involved in the operation. If there was only one parameter involved, this property equals DimensionType.Unknown.

SecondParameterName

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:

Member Name

Description

Unknown

The mismatched dimension is unknown.

Row

The number of rows of a MatrixT is mismatched.

Column

The number of columns of a MatrixT is mismatched.

Length

The length of a VectorT is mismatched.

MatrixNotPositiveDefiniteException

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 MatrixT is not positive definite. In particular, for the Cholesky Decomposition of a symmetrical or Hermitian matrix to exist, the matrix must be positive definite.

MatrixSingularException

A MatrixSingularException is thrown when a computation cannot be completed because a MatrixT is singular.

Copyright (c) 2004-2021 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2021, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.