# LinearAlgebraOperationsExtensions Class

Contains extension methods that perform linear algebra operations on 1D arrays, array slices, and 2D arrays.

## Definition

Namespace: Extreme.Collections
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 9.0.0
C#
``public static class LinearAlgebraOperationsExtensions``
Inheritance
Object  →  LinearAlgebraOperationsExtensions

## Methods

 AbsoluteMaxIndex(ILinearAlgebraOperations, Int32, ReadOnlySpanSlice) Finds the index of element having max. AbsoluteMaxIndex(ILinearAlgebraOperations, Int32, TStorage) Returns the index of the element of a vector with maximum absolute value. BandMultiplyAndAddInPlace(ILinearAlgebraOperations, TransposeOperation, Int32, Int32, Int32, Int32, T, ReadOnlySpan2D, ReadOnlySpanSlice, T, SpanSlice) Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*AT*x + beta*y, where alpha and beta are scalars, x and y are vectors and A is an m by n band matrix, with kl sub-diagonals and ku super-diagonals. BandMultiplyAndAddInPlace(ILinearAlgebraOperations, TransposeOperation, Int32, Int32, Int32, Int32, T, TStorage2D, TStorage, T, TStorage) Sum of the product of a general band matrix and vector and a scaled vector. BandSymmetricMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixTriangle, Int32, Int32, T, ReadOnlySpan2D, ReadOnlySpanSlice, T, SpanSlice) Performs the matrix-vector operation y := alpha*A*x + beta*y, where alpha and beta are scalars, x and y are n element vectors and A is an n by n symmetric band matrix, with k super-diagonals. BandSymmetricMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixTriangle, Int32, Int32, T, TStorage2D, TStorage, T, TStorage) Product of a symmetric band matrix and a vector. BandTriangularMultiplyInPlace(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, Int32, ReadOnlySpan2D, SpanSlice) Performs one of the matrix-vector operations x := A*x, or x := AT*x, where x is an n element vector and A is an n by n unit, or non-unit, upper or lower triangular band matrix, with ( k + 1 ) diagonals. BandTriangularMultiplyInPlace(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, Int32, TStorage2D, TStorage) Product of a triangular band matrix and a vector. BandTriangularSolveInPlace(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, Int32, ReadOnlySpan2D, SpanSlice) Solves one of the systems of equations A*x = b, or AT*x = b, where b and x are n element vectors and A is an n by n unit, or non-unit, upper or lower triangular band matrix, with ( k + 1 ) diagonals. BandTriangularSolveInPlace(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, Int32, TStorage2D, TStorage) Solves a triangular band system of equations. ConjugateDotProduct(ILinearAlgebraOperations, Int32, ReadOnlySpanSlice, ReadOnlySpanSlice) Returns the inner product of two vectors. ConjugateDotProduct(ILinearAlgebraOperations, Int32, TStorage, TStorage) Returns the inner product of two vectors. ConjugateRankUpdate(ILinearAlgebraOperations, Int32, Int32, T, ReadOnlySpanSlice, ReadOnlySpanSlice, Span2D) Performs a rank one update of a matrix. ConjugateRankUpdate(ILinearAlgebraOperations, Int32, Int32, T, TStorage, TStorage, TStorage2D) Performs a rank one update of a matrix. Copy(ILinearAlgebraOperations, Int32, ReadOnlySpanSlice, SpanSlice) Copies a vector, x, to a vector, y. Copy(ILinearAlgebraOperations, MatrixTriangle, Int32, Int32, ReadOnlySpan2D, Span2D) Copies all or part of a two-dimensional matrix A to another matrix B. Copy(ILinearAlgebraOperations, Int32, TStorage, TStorage) Copies a vector. Copy(ILinearAlgebraOperations, MatrixTriangle, Int32, Int32, TStorage2D, TStorage2D) Copies part of a matrix to another. DotProduct(ILinearAlgebraOperations, Int32, ReadOnlySpanSlice, ReadOnlySpanSlice) Forms the dot product of two vectors. DotProduct(ILinearAlgebraOperations, Int32, TStorage, TStorage) Returns the inner product of two vectors. FullMatrixNorm(ILinearAlgebraOperations, MatrixNorm, Int32, Int32, ReadOnlySpan2D) Returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real matrix A. FullMatrixNorm(ILinearAlgebraOperations, MatrixNorm, Int32, Int32, TStorage2D) Computes the norm of a general rectangular matrix. HermitianMatrixNorm(ILinearAlgebraOperations, MatrixNorm, MatrixTriangle, Int32, ReadOnlySpan2D) Computes the norm of a Hermitian matrix. HermitianMatrixNorm(ILinearAlgebraOperations, MatrixNorm, MatrixTriangle, Int32, TStorage2D) Computes the norm of a Hermitian matrix. HermitianMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixTriangle, Int32, T, ReadOnlySpan2D, ReadOnlySpanSlice, T, SpanSlice) Product of a hermitian matrix and a vector. HermitianMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixOperationSide, MatrixTriangle, Int32, Int32, T, ReadOnlySpan2D, ReadOnlySpan2D, T, Span2D) Sum of the product of a hermitian and a general matrix and a scaled matrix. HermitianMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixOperationSide, MatrixTriangle, Int32, Int32, T, TStorage2D, TStorage2D, T, TStorage2D) Sum of the product of a hermitian and a general matrix and a scaled matrix. HermitianMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixTriangle, Int32, T, TStorage2D, TStorage, T, TStorage) Product of a hermitian matrix and a vector. HermitianRankUpdate(ILinearAlgebraOperations, MatrixTriangle, Int32, T, ReadOnlySpanSlice, Span2D) Performs a rank one update of a hermitian. HermitianRankUpdate(ILinearAlgebraOperations, MatrixTriangle, Int32, T, ReadOnlySpanSlice, ReadOnlySpanSlice, Span2D) Performs a hermitian rank two update of a hermitian matrix. HermitianRankUpdate(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, Int32, Int32, T, ReadOnlySpan2D, T, Span2D) Performs a rank k update of a hermitian matrix. HermitianRankUpdate(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, Int32, Int32, T, ReadOnlySpan2D, ReadOnlySpan2D, T, Span2D) Performs a rank 2k update of a hermitian matrix. HermitianRankUpdate(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, Int32, Int32, T, TStorage2D, T, TStorage2D) Performs a rank k update of a hermitian matrix. HermitianRankUpdate(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, Int32, Int32, T, TStorage2D, TStorage2D, T, TStorage2D) Performs a rank 2k update of a hermitian matrix. HermitianRankUpdate(ILinearAlgebraOperations, MatrixTriangle, Int32, T, TStorage, TStorage2D) Performs a rank one update of a hermitian. HermitianRankUpdate(ILinearAlgebraOperations, MatrixTriangle, Int32, T, TStorage, TStorage, TStorage2D) Performs a hermitian rank two update of a hermitian matrix. MultiplyAndAddInPlace(ILinearAlgebraOperations, Int32, T, ReadOnlySpanSlice, SpanSlice) Constant times a vector plus a vector. MultiplyAndAddInPlace(ILinearAlgebraOperations, TransposeOperation, Int32, Int32, T, ReadOnlySpan2D, ReadOnlySpanSlice, T, SpanSlice) Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*AT*x + beta*y, where alpha and beta are scalars, x and y are vectors and A is an m by n matrix. MultiplyAndAddInPlace(ILinearAlgebraOperations, TransposeOperation, TransposeOperation, Int32, Int32, Int32, T, ReadOnlySpan2D, ReadOnlySpan2D, T, Span2D) Performs one of the matrix-matrix operations C := alpha*op( A )*op( B ) + beta*C, where op( X ) is one of op( X ) = X or op( X ) = XT, alpha and beta are scalars, and A, B and C are matrices, with op( A ) an m by k matrix, op( B ) a k by n matrix and C an m by n matrix. MultiplyAndAddInPlace(ILinearAlgebraOperations, Int32, T, TStorage, TStorage) Evaluates a vector plus the product of a scalar and a vector MultiplyAndAddInPlace(ILinearAlgebraOperations, TransposeOperation, TransposeOperation, Int32, Int32, Int32, T, TStorage2D, TStorage2D, T, TStorage2D) Sum of the product of two general matrices and a scaled matrix. MultiplyAndAddInPlace(ILinearAlgebraOperations, TransposeOperation, Int32, Int32, T, TStorage2D, TStorage, T, TStorage) Sum of the product of a general matrix and vector and a scaled vector. MultiplyInPlace(ILinearAlgebraOperations, Int32, T, SpanSlice) Scales a vector by a constant. MultiplyInPlace(ILinearAlgebraOperations, Int32, T, TStorage) Evaluates the product of a scalar and a vector. OneNorm(ILinearAlgebraOperations, Int32, ReadOnlySpanSlice) Takes the sum of the absolute values. OneNorm(ILinearAlgebraOperations, Int32, TStorage) Returns the sum of the absolute values of the elements of a vector. RankUpdate(ILinearAlgebraOperations, Int32, Int32, T, ReadOnlySpanSlice, ReadOnlySpanSlice, Span2D) Performs the rank 1 operation A := alpha*x*y**T + A, where alpha is a scalar, x is an m element vector, y is an n element vector and A is an m by n matrix. RankUpdate(ILinearAlgebraOperations, Int32, Int32, T, TStorage, TStorage, TStorage2D) Performs a rank one update of a matrix. RealOneNorm(ILinearAlgebraOperations, Int32, ReadOnlySpanSlice) Returns the sum of the absolute values of the elements of a vector. RealOneNorm(ILinearAlgebraOperations, Int32, TStorage) Returns the sum of the absolute values of the elements of a vector. Rotate(ILinearAlgebraOperations, Int32, SpanSlice, SpanSlice, T, T) Applies a plane rotation. Rotate(ILinearAlgebraOperations, Int32, TStorage, TStorage, T, T) Applies a Givens plane rotation. Swap(ILinearAlgebraOperations, Int32, SpanSlice, SpanSlice) Swaps the elements of two vectors. Swap(ILinearAlgebraOperations, Int32, TStorage, TStorage) Exchanges the elements of two vectors. SymmetricMatrixNorm(ILinearAlgebraOperations, MatrixNorm, MatrixTriangle, Int32, ReadOnlySpan2D) Returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix A. SymmetricMatrixNorm(ILinearAlgebraOperations, MatrixNorm, MatrixTriangle, Int32, TStorage2D) Computes the norm of a symmetric matrix. SymmetricMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixTriangle, Int32, T, ReadOnlySpan2D, ReadOnlySpanSlice, T, SpanSlice) Performs the matrix-vector operation y := alpha*A*x + beta*y, where alpha and beta are scalars, x and y are n element vectors and A is an n by n symmetric matrix. SymmetricMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixOperationSide, MatrixTriangle, Int32, Int32, T, ReadOnlySpan2D, ReadOnlySpan2D, T, Span2D) Performs one of the matrix-matrix operations C := alpha*A*B + beta*C, or C := alpha*B*A + beta*C, where alpha and beta are scalars, A is a symmetric matrix and B and C are m by n matrices. SymmetricMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixOperationSide, MatrixTriangle, Int32, Int32, T, TStorage2D, TStorage2D, T, TStorage2D) Sum of the product of a symmetric and a general matrix and a scaled matrix. SymmetricMultiplyAndAddInPlace(ILinearAlgebraOperations, MatrixTriangle, Int32, T, TStorage2D, TStorage, T, TStorage) Product of a symmetric matrix and a vector. SymmetricRankUpdate(ILinearAlgebraOperations, MatrixTriangle, Int32, T, ReadOnlySpanSlice, Span2D) Performs the symmetric rank 1 operation A := alpha*x*x**T + A, where alpha is a real scalar, x is an n element vector and A is an n by n symmetric matrix. SymmetricRankUpdate(ILinearAlgebraOperations, MatrixTriangle, Int32, T, ReadOnlySpanSlice, ReadOnlySpanSlice, Span2D) Performs the symmetric rank 2 operation A := alpha*x*y**T + alpha*y*x**T + A, where alpha is a scalar, x and y are n element vectors and A is an n by n symmetric matrix. SymmetricRankUpdate(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, Int32, Int32, T, ReadOnlySpan2D, T, Span2D) Performs one of the symmetric rank k operations C := alpha*A*AT + beta*C, or C := alpha*AT*A + beta*C, where alpha and beta are scalars, C is an n by n symmetric matrix and A is an n by k matrix in the first case and a k by n matrix in the second case. SymmetricRankUpdate(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, Int32, Int32, T, ReadOnlySpan2D, ReadOnlySpan2D, T, Span2D) Performs one of the symmetric rank 2k operations C := alpha*A*BT + alpha*B*AT + beta*C, or C := alpha*AT*B + alpha*BT*A + beta*C, where alpha and beta are scalars, C is an n by n symmetric matrix and A and B are n by k matrices in the first case and k by n matrices in the second case. SymmetricRankUpdate(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, Int32, Int32, T, TStorage2D, T, TStorage2D) Performs a rank k update of a symmetric matrix. SymmetricRankUpdate(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, Int32, Int32, T, TStorage2D, TStorage2D, T, TStorage2D) Performs a rank k update of a symmetric matrix. SymmetricRankUpdate(ILinearAlgebraOperations, MatrixTriangle, Int32, T, TStorage, TStorage2D) Performs a rank one update of a symmetric matrix. SymmetricRankUpdate(ILinearAlgebraOperations, MatrixTriangle, Int32, T, TStorage, TStorage, TStorage2D) Performs a symmetric rank two update of a symmetric matrix. TriangularMatrixNorm(ILinearAlgebraOperations, MatrixNorm, MatrixTriangle, MatrixDiagonal, Int32, Int32, ReadOnlySpan2D) Returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix A. TriangularMatrixNorm(ILinearAlgebraOperations, MatrixNorm, MatrixTriangle, MatrixDiagonal, Int32, Int32, TStorage2D) Computes the norm of a triangular matrix. TriangularMultiplyInPlace(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, ReadOnlySpan2D, SpanSlice) Performs one of the matrix-vector operations x := A*x, or x := AT*x, where x is an n element vector and A is an n by n unit, or non-unit, upper or lower triangular matrix. TriangularMultiplyInPlace(ILinearAlgebraOperations, MatrixOperationSide, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, Int32, T, ReadOnlySpan2D, Span2D) Performs one of the matrix-matrix operations B := alpha*op( A )*B, or B := alpha*B*op( A ), where alpha is a scalar, B is an m by n matrix, A is a unit, or non-unit, upper or lower triangular matrix and op( A ) is one of op( A ) = A or op( A ) = AT. TriangularMultiplyInPlace(ILinearAlgebraOperations, MatrixOperationSide, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, Int32, T, TStorage2D, TStorage2D) Product of a triangular and a general matrix. TriangularMultiplyInPlace(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, TStorage2D, TStorage) Product of a triangular matrix and a vector. TriangularSolveInPlace(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, ReadOnlySpan2D, SpanSlice) Solves one of the systems of equations A*x = b, or AT*x = b, where b and x are n element vectors and A is an n by n unit, or non-unit, upper or lower triangular matrix. TriangularSolveInPlace(ILinearAlgebraOperations, MatrixOperationSide, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, Int32, T, ReadOnlySpan2D, Span2D) Solves one of the matrix equations op( A )*X = alpha*B, or X*op( A ) = alpha*B, where alpha is a scalar, X and B are m by n matrices, A is a unit, or non-unit, upper or lower triangular matrix and op( A ) is one of op( A ) = A or op( A ) = AT. TriangularSolveInPlace(ILinearAlgebraOperations, MatrixOperationSide, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, Int32, T, TStorage2D, TStorage2D) Solution of a triangular linear system with multiple right-hand sides. TriangularSolveInPlace(ILinearAlgebraOperations, MatrixTriangle, TransposeOperation, MatrixDiagonal, Int32, TStorage2D, TStorage) Solves a triangular system of equations. TwoNorm(ILinearAlgebraOperations, Int32, ReadOnlySpanSlice) ``` Returns the euclidean norm of a vector via the function name, so that DNRM2 := sqrt( x'*x ) ``` TwoNorm(ILinearAlgebraOperations, Int32, TStorage) Returns the square root of sum of the squares of the elements of a vector.