The C# programming language and .NET Framework provide one- and two-dimensional array data types that are well suited to representing linear algebra vectors and matrices. The Perceptrics Linear Algebra .NET class library, **Perceptrics.LinearAlgebra.dll**, provides linear algebra vector/matrix metrics and operations using one-dimensional and two-dimensional, double-precision array objects to represent vectors and matrices, respectively. These metrics and operations are implemented as **LinearAlgebra** class methods using **LAPACK** algorithms.

LAPACK [1,2] is a freely-available, peer-reviewed computational linear algebra software library that provides routines for solving systems of simultaneous linear equations, computing least-squares solutions of linear systems of equations, and computing eigenvalue and singular value decompositions. The associated matrix factorizations (LU, Cholesky, LQ/QR, SVD, Schur, generalized Schur) are also provided, as are related computations such as estimating condition numbers. LAPACK has been used in or as a starting point for implementation of linear algebra computing environments and is a standard by which other libraries and computing environments are often compared.

The Perceptrics Linear Algebra .NET class library provides selected LAPACK linear algebra computations using the public-domain CLAPACK library from the Netlib Repository [3,4]. The CLAPACK library is a machine-translation of the LAPACK Fortran library to C code. The **LinearAlgebra** class methods are implemented using C++ Interop in C++/CLI to wrap the CLAPACK functions so they can be accessed by code that is authored in C# or another .NET Framework language [5].

The **LinearAlgebra** class methods are listed below:

Matrix Creation and Extraction | Methods |
---|---|

Create constant matrix | GenerateConstant() |

Create random matrix | GenerateRandom() |

Create identity matrix | GenerateIdentity() |

Create diagonal matrix | GenerateDiagonal() |

Extract diagonal elements | ExtractDiagonals() |

Extract row vector | ExtractRow() |

Extract column vector | ExtractColumn() |

Extract rows | ExtractRows() |

Extract columns | ExtractColumns() |

Matrix Operations | Methods |
---|---|

Matrix/vector multiply | Multiply() |

Matrix/vector transpose multiply | TransposeMultiply() |

Matrix multiply transpose | MultiplyTranspose() |

Matrix or vector transpose | Transpose() |

Vector/Matrix Norms | Methods |
---|---|

1-norm (column norm) | OneNorm() |

2-norm (spectral norm) | TwoNorm() |

Infinity-norm (row norm) | InfinityNorm() |

Frobenius norm | FrobeniusNorm() |

Other Matrix Metrics | Methods |
---|---|

Vector dot product | Dot() |

Determinant of a square matrix | Determinant() |

Rank | Rank() |

Spectral radius of a square, symmetric matrix | SpectralRadius() |

Trace of a square matrix | Trace() |

1-norm inverse condition number estimate of a square matrix | InverseOneNormConditionNumberEstimate() |

Infinity-norm inverse condition number estimate of a square matrix | InverseInfinityNormConditionNumberEstimate() |

Linear System Solvers | Methods |
---|---|

Square (full-rank) system solver | SolveFullRankLinearSystem(), SolveFullRankLinearSystemEB() |

General (least squares) system solver via a complete orthogonal factorization | SolveLsqLinearSystem(), SolveLsqLinearSystemEB() |

General (least squares) system solver via the singular value decomposition | SolveLsqLinearSystemSvd(), SolveLsqLinearSystemSvdEB() |

Singular Value Decomposition | Methods |
---|---|

Singular values | SingularValues(), SingularValuesEB() |

Singular values and left singular vectors | SingularValuesLeftVectors() |

Singular values and right singular vectors | SingularValuesRightVectors() |

Full singular value decomposition: A = U * Σ * V’ | SingularValueDecomposition() |

Eigenvalues and Eigenvectors | Methods |
---|---|

Eigenvalues | Eigenvalues(), EigenvaluesEB() |

Eigenvalues and right eigenvectors | EigenvaluesRightEigenvectors() |

Cholesky Factorizations | Methods |
---|---|

Lower Cholesky factorization | LowerCholeskyFactorization() |

Upper Cholesky factorization | UpperCholeskyFactorization() |

## Product Release and Download

I have released version 1.1.1 of the Perceptrics Linear Algebra .NET class library. The Windows installation package is available for download and evaluation on the software downloads page.

## References

[1] Anderson, E. et al., LAPACK Users’ Guide, Third Edition (Society for Industrial and Applied Mathematics, Philadelphia, PA, 1999) ISBN 0-89871-447-8.

[2] LAPACK on the Netlib Repository at UTK and ORNL. http://www.netlib.org/lapack/

[3] CLAPACK on the Netlib Repository at UTK and ORNL. http://www.netlib.org/clapack/

[4] CLAPACK for Windows. http://icl.cs.utk.edu/lapack-for-windows/clapack/

[5] How to: Wrap Native Class for Use by C#. https://msdn.microsoft.com/en-us/library/ms235281.aspx