Matrix Operations

Back to: Main contents.

Contents

The Plus suite
The Minus suite
The Times suite
The H suite

Core matrices in Jampack participate in the core matrix operations. They are: addition, subtraction, multiplication by a scalar, matrix multiplication, and (conjugate) transposition. Jampack provides four suites of static methods (Plus, Minus, Times, and H) to perform these operations. The core matrix operations are implemented for all combinations of the core matrix classes. Most of these methods have the generic name "o" and are distinguished from one another by the types in their argument lists.

The Plus suite

Back to: Main contents, Top of section.

The Plus suite implements matrix-matrix addition. The methods all throw a JampackException for nonconformity of dimensions.

public static Zmat o(Zmat A, Zmat B)
Returns A + B.

public static Zmat o(Zmat A, Zdiagmat D)
Returns A + D.

public static Zmat o(Zdiagmat D, Zmat B)
Returns D + B.

public static Zdiagmat o(Zdiagmat D1, Zdiagmat D2 )
Returns D1 + D2.

The Minus suite

Back to: Main contents, Top of section.

The Minus suite implements unary minus and matrix-matrix subtraction. The methods for matrix-matrix subtraction throw a JampackException for nonconformity of dimensions.

public static Zmat o(Zmat A)
Returns -A.

public static Zdiagmat o(Zdiagmat D)
Returns -D.

public static Zmat o(Zmat A, Zmat B)
Returns A - B.

public static Zmat o(Zmat A, Zdiagmat D)
Returns A - D.

public static Zmat o(Zdiagmat D, Zmat B)
Returns D - B.

public static Zdiagmat o(Zdiagmat D1, Zdiagmat D2 )
Returns D1 - D2.

The Times suite

Back to: Main contents, Top of section.

The Times suite implements scalar-matrix and matrix-matrix multiplication. The methods for matrix-matrix multiplication throw a Jampack exception for nonconformity of dimensions. Two special methods (Times.aha and Times.aah) return AHA and AAH as a Zpsdmat.

public static Zmat o(Z z, Zmat A)
Returns zA.

public static Zdiagmat o(Z z, Zdiagmat D)
Returns zD.

public static Zmat o(Zmat A, Zmat B)
Returns AB.

public static Zmat o(Zdiagmat D, Zmat A)
Returns DA.

public static Zmat o(Zmat A, Zdiagmat D)
Returns AD.

public static Zdiagmat o(Zdiagmat D1, Zdiagmat D2)
Returns D1D2.

public static Zpsdmat aha(Zmat A)
Returns AHA.

public static Zpsdmat aah(Zmat A)
Returns AAH.

The H suite

Back to: Main contents, Top of section.

The H suite implements the conjugate transpose of a matrix. It has two generic methods.

public static Zmat o(Zmat A)
Returns AH.

public static Zdiagmat o(Zdiagmat D)
Returns DH.

The method trans computes the transpose of a Zmat.

public static Zmat trans(Zmat A)
Returns AT.