## Basic Concepts | Extreme Optimization Numerical Libraries for .NET Professional |

This section provides an overview of the organization of the vector and matrix library and introduces some key concepts.

There are three basic types of objects in the linear algebra library:

A vector is a one-dimensional array of values.
Vectors are represented by the generic
Vector

A matrix is a two-dimensional array of values.
The rows and columns of a matrix are vectors.
Matrices are represented by the generic
Matrix

A decomposition is a representation of a matrix
in terms of other matrices of a specific form.
Decompositions are used as intermediate values in many algorithms.
Each type of decomposition has its own class,
derived from Decomposition

Decomposition classes do not have constructors. Instead, they are created by calling a method on the matrix they are derived from.

Two concepts are important when dealing with arrays. Mutability is the degree to which an array may be modified. There are four levels of mutability, enumerated by the ArrayMutability type:

Value | Description |
---|---|

Immutable | All elements of the array are read-only. |

MutableValues | The structure, size and shape of the array are fixed, but values are writable. |

MutableStructure | The size and shape of the array are fixed, but non-zero structure and values are writable. |

MutableSize | All aspects of the array can be modified: values, structure and size. |

Intent describes the way an array will be used, in particular when accessing parts of a larger parent array (like rows in a matrix). There are two dimensions to intent. First, will the elements only be read, or will they be modified? Second, should the array be a copy of the relevant part of the parent array, or should it be a live view into the parent array?

The possible values for intent are enumerated by the Intent type, and are listed below:

Value | Description |
---|---|

Inherit | Return an array with the same mutability as the array from which it was derived. This is the default. |

ReadOnly | Return a read-only array that may be a live view or a copy. The result depends on the default mutability behavior and the type of array. |

ReadOnlyCopy | The array's values cannot be modified in any way. |

ReadOnlyView | Return an array that is a live view of the parent array's values that cannot be written to. |

WritableCopy | Return a writable copy of the array. Changing values will not affect the parent object's values. Actual copying may be delayed until the array is written to. |

WritableView | Return an array that is a live view of the parent array's values. Changing values also changes values in the parent array. |

As mentioned earlier, the elements of vectors and matrices can be of any type. This includes complex values. Complex arrays work just like their real counterparts.

There are a few instances where the behavior is slightly different. For example, functions like norms return real results for complex arrays. For complex arrays, these functions return complex values with the imaginary part zero.

Conversely, some or all of the eigenvalues of a real matrix may be complex. This is handled by having different types for the eigen-decomposition of real and complex matrices. In most situations, extension methods make it so a decomposition of the correct specific type will be returned. If this doesn't work, then methods exist on the decomposition object to return it in the desired form.

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.