Matrix functions

Back to: Main contents.

Contents

The matrix inverse (the Inv suite)
The Norm suite
The trace

In this section we treat a miscellany of classes that compute scalar or matrix valued functions of a matrix. Currently, there are only three functions: the inverse, the Frobenius norm, and the trace. But there is great room for expansion.

The matrix inverse (Inv suite)

Back to: Main contents, Top of section.

The matrix inverse is computed by the methods of the Inv suite. There are five versions of the generic inverse function. Before using these methods see the admonitions about computing inverses in Linear Systems.

public static Zmat o(Zmat A)
Returns the inverse of A.
Throws JampackException if A is not square.

public static Zpdmat o(Zpdmat A)
Returns the inverse of A.
Throws JampackException if A is not square.

public static Zltmat o(Zltmat L)
Returns the inverse of L.
Throws JampackException if L is not square.
Throws JampackException if L is singular.

public static Zutmat o(Zutmat U)
Returns the inverse of U.
Throws JampackException if U is not square.
Throws JampackException if U is singular.

public static Zdiagmat o(Zdiagmat D)
Returns the inverse of D.
Throws Jampack exception if D is singular.

The first four functions may throw a Jampack exception from the Solve suite if the matrix is singular.

The norm suite

Back to: Main contents, Top of section.

There are a number of useful matrix norms, in particular the one, two, and infinity norms along with the Frobenius norm. Currently the Norm suite only provides methods for the Frobenius norm.

public static double fro(Zmat A)
Returns the Frobenius norm of A.

public static double fro(Zmat A, int i1, int i2, int j1, int j2)
Returns the Frobenius norm of A(i1:i2, j1:j2).

public static double fro(Zdiagmat D)
Returns the Frobenius norm of D.

public static double fro(Z1 u)
Returns the Frobenius norm of u.

The trace

Back to: Main contents, Top of section.

The trace of a matrix is the sum of its diagonal elements. The suite Trace has the following two methods for computing the trace.

public static Z o(Zmat A)
Returns the trace of A.

public static Z o(Zdiagmat D)
Returns the trace of D.