numericalMethods.algebra.linear
Class MatrixOperations

java.lang.Object
  |
  +--numericalMethods.algebra.linear.MatrixOperations

public final class MatrixOperations
extends java.lang.Object

This class handles the basic operations with matrices . A matrix is a two dimensional array. Rows relate to the first index, columns to the second. Thus a matrix is an array of row vectors which have all the same length. All methods assume that the passed data have sensible sizes, which, due to performance reasons, is never checked. So be careful!


Method Summary
static void assign(double[][] A, double value)
          Assigns all entries of matrix A with value.
static void assign(double[][] A, double[][] B)
          Assign matrix B to matrix A.
static void assign(int[][] A, double[][] B)
          Assign matrix B to matrix A.
static void assign(int[][] A, int value)
          Assigns all entries of matrix A with value.
static void assign(int[][] A, int[][] B)
          Assign matrix B to matrix A.
static void assignCol(double[][] A, double[] v, int colNum)
          Assigns the column of matrix A with vector v.
static void assignCol(double[][] A, int[] v, int colNum)
          Assigns the column of matrix A with vector v.
static void assignCol(int[][] A, int[] v, int colNum)
          Assigns the column of matrix A with vector v.
static void assignDiagonal(double[][] A, double v)
          Assigns the diagonal of matrix A with v.
static void assignDiagonal(double[][] A, double[] v)
          Assigns the diagonal of matrix A with v.
static void assignDiagonal(double[][] A, int[] v)
          Assigns the diagonal of matrix A with v.
static void assignDiagonal(int[][] A, int v)
          Assigns the diagonal of matrix A with v.
static void assignDiagonal(int[][] A, int[] v)
          Assigns the diagonal of matrix A with v.
static void assignId(double[][] A)
          Makes matrix A to id.
static void assignId(int[][] A)
          Makes matrix A to id.
static void assignRow(double[][] A, double[] v, int rowNum)
          Assigns the row of matrix A with vector v.
static void assignRow(double[][] A, int[] v, int rowNum)
          Assigns the row of matrix A with vector v.
static void assignRow(int[][] A, int[] v, int rowNum)
          Assigns the row of matrix A with vector v.
static void assignZero(double[][] A)
          Assigns all entries of matrix A with zero.
static void assignZero(int[][] A)
          Assigns all entries of matrix A with zero.
static double[][] copy(double[][] A)
          Returns a copy of matrix A.
static int[][] copy(int[][] A)
          Returns a copy of matrix A.
static void divide(double[][] ARe, double[][] AIm, double bRe, double bIm, double[][] CRe, double[][] CIm)
          Performs A / b = C.
static void divide(double[][] A, double b, double[][] C)
          Performs A / b = C.
static void divide(double b, double[][] A, double[][] C)
          Performs b / A = C.
static void divide(double b, double[][] Are, double[][] Aim, double[][] Cre, double[][] Cim)
          Performs b / (Are+i*Aim) = (Cre+i*Cim).
static void divide(double b, int[][] A, double[][] C)
          Performs b / A = C.
static void divide(int[][] A, double b, double[][] C)
          Performs A / b = C.
static void divide(int[][] A, int b, int[][] C)
          Performs A / b = C.
static void divide(int b, int[][] A, int[][] C)
          Performs b / A = C.
static void floor(double[][] A, double[][] B)
          Floors matrix A and stores result in B.
static void floor(double[][] A, int[][] B)
          Floors matrix A and stores result in B.
static void getCol(double[][] A, double[] v, int colNum)
          Assigns the column of matrix A in vector v.
static void getCol(int[][] A, int[] v, int colNum)
          Assigns the column of matrix A in vector v.
static void getDiagonal(double[][] A, double[] v)
          Stores the diagonal of matrix A to v.
static void getDiagonal(int[][] A, int[] v)
          Stores the diagonal of matrix A to v.
static void getRow(double[][] A, double[] v, int rowNum)
          Stores the row of matrix A in vector v.
static void getRow(int[][] A, int[] v, int rowNum)
          Stores the row of matrix A in vector v.
static int[] maxAbs(double[][] re)
          Locates the entry with the greatest absolute value.
static int[] maxAbs(double[][] re, double[][] im)
          Locates the entry with the greatest absolute value.
static void minus(double[][] A, double[][] B, double[][] C)
          Performs: A - B = C .
static void minus(double[][] A, double b, double[][] C)
          Performs: A - b = C .
static void minus(double[][] A, int[][] B, double[][] C)
          Performs: A - B = C.
static void minus(double a, double[][] B, double[][] C)
          performs: a - B = C .
static void minus(int[][] A, double[][] B, double[][] C)
          Performs: A - B = C .
static void minus(int[][] A, double b, double[][] C)
          Performs: A - b = C .
static void minus(int[][] A, int[][] B, int[][] C)
          Performs: A - B = C.
static void minus(int[][] A, int b, int[][] C)
          Performs: A - b = C .
static void minus(int a, double[][] B, double[][] C)
          Performs: A - B = C .
static void minus(int a, int[][] B, int[][] C)
          Performs: a - B = C .
static void mod(int[][] A, int b, int[][] C)
          Performs A % b = C.
static void neg(double[][] A, double[][] B)
          Negates matrix A and stores result in B .
static void neg(int[][] A, double[][] B)
          Negates matrix A and stores result in B .
static void neg(int[][] A, int[][] B)
          Negates matrix A and stores result in B .
static double normSqr(double[][] re)
          Return the sum of the squares of all entries.
static double normSqr(int[][] re)
          Return the sum of the squares of all entries.
static void plus(double[][] A, double[][] B, double[][] C)
          Performs: A + B = C.
static void plus(double[][] A, double b, double[][] C)
          Performs: A + b = C .
static void plus(double[][] A, int[][] B, double[][] C)
          Performs: A + B = C .
static void plus(int[][] A, double[][] B, double[][] C)
          Performs: A + B = C .
static void plus(int[][] A, double b, double[][] C)
          Performs: A + b = C .
static void plus(int[][] A, int[][] B, int[][] C)
          Performs: A + B = C .
static void plus(int[][] A, int b, int[][] C)
          Performs: A + b = C .
static void random(double[][] m)
          Assigns random all entries of m.
static void random(int[][] m, int range)
          Assigns random all entries of m.
static void round(double[][] A, double[][] B)
          Rounds matrix A and stores result in B.
static void round(double[][] A, int[][] B)
          Rounds matrix A and stores result in B.
static void times(double[][] A, double[][] B, double[][] C)
          Performs matrix multiplication: A * B = C.
static void times(double[][] ARe, double[][] AIm, double[][] BRe, double[][] BIm, double[][] CRe, double[][] CIm)
          Performs matrix multiplication: A * B = C.
static void times(double[][] MRe, double[][] MIm, double[] VRe, double[] VIm, double[] WRe, double[] WIm)
          Performs matrix - vector multiplication: A * b = c.
static void times(double[][] ARe, double[][] AIm, double bRe, double bIm, double[][] CRe, double[][] CIm)
          Performs A * b = b * A = C.
static void times(double[][] A, double[] b, double[] c)
          Performs matrix - vector multiplication: A * b = c.
static void times(double[][] A, double b, double[][] C)
          Performs A * b = b * A = C.
static void times(double[][] A, int[][] B, double[][] C)
          Performs matrix multiplication: A * B = C.
static void times(double[][] A, int[] b, double[] c)
          Performs matrix - vector multiplication: A * b = c.
static void times(double[] a, double[][] B, double[] c)
          Performs vector - matrix multiplication: a^t * B = c^t.
static void times(double[] a, double[] b, double[][] C)
          Performs vector - vector multiplication: a * b^t = C.
static void times(double[] VRe, double[] VIm, double[][] MRe, double[][] MIm, double[] WRe, double[] WIm)
          Performs matrix - vector multiplication: b * A = c.
static void times(double[] a, int[][] B, double[] c)
          Performs vector - matrix multiplication: a^t * B = c^t.
static void times(double[] a, int[] b, double[][] C)
          Performs vector - vector multiplication: a * b^t = C.
static void times(int[][] A, double[][] B, double[][] C)
          Performs matrix multiplication: A * B = C.
static void times(int[][] A, double[] b, double[] c)
          Performs matrix - vector multiplication: A * b = c.
static void times(int[][] A, double b, double[][] C)
          Performs A * b = b * A = C.
static void times(int[][] A, int[][] B, double[][] C)
          Performs matrix multiplication: A * B = C.
static void times(int[][] A, int[][] B, int[][] C)
          Performs matrix multiplication: A * B = C.
static void times(int[][] A, int[] b, double[] c)
          Performs matrix - vector multiplication: A * b = c.
static void times(int[][] A, int[] b, int[] c)
          Performs matrix - vector multiplication: A * b = c.
static void times(int[][] A, int b, int[][] C)
          Performs A * b = b * A = C.
static void times(int[] a, double[][] B, double[] c)
          Performs vector - matrix multiplication: a^t * B = c^t.
static void times(int[] a, double[] b, double[][] C)
          Performs vector - vector multiplication: a * b^t = C.
static void times(int[] a, int[][] B, double[] c)
          Performs vector - matrix multiplication: a^t * B = c^t.
static void times(int[] a, int[][] B, int[] c)
          Performs vector - matrix multiplication: a^t * B = c^t.
static void times(int[] a, int[] b, int[][] C)
          Performs vector - vector multiplication: a * b^t = C.
static void transpose(double[][] m, double[][] trans)
          Transpose m and store the result in trans matrix.
static void transpose(int[][] m, int[][] trans)
          Transpose m and store the result in trans matrix.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

times

public static final void times(double[][] ARe,
                               double[][] AIm,
                               double[][] BRe,
                               double[][] BIm,
                               double[][] CRe,
                               double[][] CIm)
Performs matrix multiplication: A * B = C. If ARe and/or AIm and/or BRe and/or BIm equals CRe or CIm a temporary copy is assigned, which should be avoided if run times are critical.

Parameters:
ARe - Real part of first multiplicand.
AIm - Imag. part of first multiplicand.
BRe - Real part of second multiplicand.
BIm - Imag. part of second multiplicand.
CRe - Real part of product.
CIm - Imag. part of product.

times

public static final void times(int[][] A,
                               int[][] B,
                               int[][] C)
Performs matrix multiplication: A * B = C. If A and/or B equals C a temporary copy of C is assigned, which should be avoided if run times are critical.

Parameters:
A - First multiplicand.
B - Second multiplicand.
C - Product of both.

times

public static final void times(double[][] A,
                               double[][] B,
                               double[][] C)
Performs matrix multiplication: A * B = C. If A and/or B equals C a temporary copy of C is assigned, which should be avoided if run times are critical.

Parameters:
A - First multiplicand.
B - Second multiplicand.
C - Product of both.

times

public static final void times(int[][] A,
                               double[][] B,
                               double[][] C)
Performs matrix multiplication: A * B = C. If B equals C a temporary copy of C is assigned, which should be avoided if run times are critical.

Parameters:
A - First multiplicand.
B - Second multiplicand.
C - Product of both.

times

public static final void times(double[][] A,
                               int[][] B,
                               double[][] C)
Performs matrix multiplication: A * B = C. If A equals C a temporary copy of C is assigned, which should be avoided if run times are critical.

Parameters:
A - First multiplicand.
B - Second multiplicand.
C - Product of both.

times

public static final void times(int[][] A,
                               int[][] B,
                               double[][] C)
Performs matrix multiplication: A * B = C.
Parameters:
A - First multiplicand.
B - Second multiplicand.
C - Product of both.

divide

public static final void divide(double[][] ARe,
                                double[][] AIm,
                                double bRe,
                                double bIm,
                                double[][] CRe,
                                double[][] CIm)
Performs A / b = C.
Parameters:
ARe - Real part of dividend.
AIm - Imag. part of dividend.
ARe - Real part of divisor.
AIm - Imag. part of divisor.
CRe - Real part of product.
CIm - Imag. part of product.

times

public static final void times(double[][] ARe,
                               double[][] AIm,
                               double bRe,
                               double bIm,
                               double[][] CRe,
                               double[][] CIm)
Performs A * b = b * A = C.
Parameters:
ARe - Real part of first multiplicand.
AIm - Imag. part of first multiplicand.
bRe - Real part of second multiplicand.
bIm - Imag. part of second multiplicand.
CRe - Real part of product.
CIm - Imag. part of product.

times

public static final void times(int[][] A,
                               int b,
                               int[][] C)
Performs A * b = b * A = C.
Parameters:
A - First multiplicand.
b - Scalar.
C - Product.

divide

public static final void divide(int[][] A,
                                int b,
                                int[][] C)
Performs A / b = C.
Parameters:
A - Dividend.
b - Divisor.
C - Product.

divide

public static final void divide(int[][] A,
                                double b,
                                double[][] C)
Performs A / b = C.
Parameters:
A - Dividend.
b - Divisor.
C - Product.

divide

public static final void divide(int b,
                                int[][] A,
                                int[][] C)
Performs b / A = C.
Parameters:
A - Dividend.
b - Divisor.
C - Product.

divide

public static final void divide(double b,
                                double[][] A,
                                double[][] C)
Performs b / A = C.
Parameters:
A - Dividend.
b - Divisor.
C - Product.

divide

public static final void divide(double b,
                                double[][] Are,
                                double[][] Aim,
                                double[][] Cre,
                                double[][] Cim)
Performs b / (Are+i*Aim) = (Cre+i*Cim).
Parameters:
A - Dividend.
b - Divisor.
C - Product.

divide

public static final void divide(double b,
                                int[][] A,
                                double[][] C)
Performs b / A = C.
Parameters:
A - Dividend.
b - Divisor.
C - Product.

divide

public static final void divide(double[][] A,
                                double b,
                                double[][] C)
Performs A / b = C.
Parameters:
A - Dividend.
b - Divisor.
C - Product.

times

public static final void times(double[][] A,
                               double b,
                               double[][] C)
Performs A * b = b * A = C.
Parameters:
A - First multiplicand.
b - Scalar.
C - Product.

times

public static final void times(int[][] A,
                               double b,
                               double[][] C)
Performs A * b = b * A = C.
Parameters:
A - First multiplicand.
b - Scalar.
C - Product.

times

public static final void times(double[][] MRe,
                               double[][] MIm,
                               double[] VRe,
                               double[] VIm,
                               double[] WRe,
                               double[] WIm)
Performs matrix - vector multiplication: A * b = c. If b equals c a temporary clone of c is created, which should be avoided if run times are critical.
Parameters:
MRe - Real part of matrix.
MIm - Imag. part of matrix.
VRe - Real part of vector.
VIm - Imag. part of vector.
WRe - Real part of product.
WIm - Imag. part of product.

times

public static final void times(double[] VRe,
                               double[] VIm,
                               double[][] MRe,
                               double[][] MIm,
                               double[] WRe,
                               double[] WIm)
Performs matrix - vector multiplication: b * A = c. If b equals c a temporary clone of c is created, which should be avoided if run times are critical.
Parameters:
MRe - Real part of matrix.
MIm - Imag. part of matrix.
VRe - Real part of vector.
VIm - Imag. part of vector.
WRe - Real part of product.
WIm - Imag. part of product.

times

public static final void times(int[][] A,
                               int[] b,
                               int[] c)
Performs matrix - vector multiplication: A * b = c. If b equals c a temporary clone of c is created, which should be avoided if run times are critical
Parameters:
A - Matrix.
b - Vector.
c - Product.

times

public static final void times(int[][] A,
                               int[] b,
                               double[] c)
Performs matrix - vector multiplication: A * b = c.
Parameters:
A - Matrix.
b - Vector.
c - Product.

times

public static final void times(double[][] A,
                               double[] b,
                               double[] c)
Performs matrix - vector multiplication: A * b = c. If b equals c a temporary clone of c is created, which should be avoided if run times are critical.
Parameters:
A - Matrix.
b - Vector.
c - Product.

times

public static final void times(int[][] A,
                               double[] b,
                               double[] c)
Performs matrix - vector multiplication: A * b = c. If b equals c a temporary clone of c is created, which should be avoided if run times are critical.
Parameters:
A - Matrix.
b - Vector.
c - Product.

times

public static final void times(double[][] A,
                               int[] b,
                               double[] c)
Performs matrix - vector multiplication: A * b = c.
Parameters:
A - Matrix.
b - Vector.
c - Product.

times

public static final void times(int[] a,
                               int[][] B,
                               int[] c)
Performs vector - matrix multiplication: a^t * B = c^t. If a equals c a temporary clone of c is created, which should be avoided if run times are critical.
Parameters:
B - Matrix.
a - Vector.
c - Product.

times

public static final void times(int[] a,
                               int[][] B,
                               double[] c)
Performs vector - matrix multiplication: a^t * B = c^t.
Parameters:
B - Matrix.
a - Vector.
c - Product.

times

public static final void times(double[] a,
                               double[][] B,
                               double[] c)
Performs vector - matrix multiplication: a^t * B = c^t. If a equals c a temporary clone of c is created, which should be avoided if run times are critical.
Parameters:
B - Matrix.
a - Vector.
c - Product.

times

public static final void times(int[] a,
                               double[][] B,
                               double[] c)
Performs vector - matrix multiplication: a^t * B = c^t.
Parameters:
B - Matrix.
a - Vector.
c - Product.

times

public static final void times(double[] a,
                               int[][] B,
                               double[] c)
Performs vector - matrix multiplication: a^t * B = c^t. If a equals c a temporary clone of c is created, which should be avoided if run times are critical.
Parameters:
B - Matrix.
a - Vector.
c - Product.

times

public static final void times(int[] a,
                               int[] b,
                               int[][] C)
Performs vector - vector multiplication: a * b^t = C.
Parameters:
a - First Vector.
b - Second Vector.
C - The resulted matrix.

times

public static final void times(double[] a,
                               double[] b,
                               double[][] C)
Performs vector - vector multiplication: a * b^t = C.
Parameters:
a - First Vector.
b - Second Vector.
C - The resulted matrix.

times

public static final void times(int[] a,
                               double[] b,
                               double[][] C)
Performs vector - vector multiplication: a * b^t = C.
Parameters:
a - First Vector.
b - Second Vector.
C - The resulted matrix.

times

public static final void times(double[] a,
                               int[] b,
                               double[][] C)
Performs vector - vector multiplication: a * b^t = C.
Parameters:
a - First Vector.
b - Second Vector.
C - The resulted matrix.

plus

public static final void plus(int[][] A,
                              int[][] B,
                              int[][] C)
Performs: A + B = C .
Parameters:
A - First summend.
B - Second summend.
C - Sum.

plus

public static final void plus(double[][] A,
                              double[][] B,
                              double[][] C)
Performs: A + B = C.
Parameters:
A - First summend.
B - Second summend.
C - Sum.

plus

public static final void plus(double[][] A,
                              int[][] B,
                              double[][] C)
Performs: A + B = C .
Parameters:
A - First summend.
B - Second summend.
C - Sum.

plus

public static final void plus(int[][] A,
                              double[][] B,
                              double[][] C)
Performs: A + B = C .
Parameters:
A - First summend.
B - Second summend.
C - Sum.

plus

public static final void plus(int[][] A,
                              int b,
                              int[][] C)
Performs: A + b = C .
Parameters:
A - First summend.
b - Second summend.
C - Sum.

plus

public static final void plus(double[][] A,
                              double b,
                              double[][] C)
Performs: A + b = C .
Parameters:
A - First summend.
b - Second summend.
C - Sum.

plus

public static final void plus(int[][] A,
                              double b,
                              double[][] C)
Performs: A + b = C .
Parameters:
A - First summend.
b - Second summend.
C - Sum.

minus

public static final void minus(int[][] A,
                               int[][] B,
                               int[][] C)
Performs: A - B = C.
Parameters:
B - The subtrahend.
C - The Product.

minus

public static final void minus(double[][] A,
                               double[][] B,
                               double[][] C)
Performs: A - B = C .
Parameters:
B - The subtrahend.
C - The Product.

minus

public static final void minus(double[][] A,
                               int[][] B,
                               double[][] C)
Performs: A - B = C.
Parameters:
B - The subtrahend.
C - The Product.

minus

public static final void minus(int[][] A,
                               double[][] B,
                               double[][] C)
Performs: A - B = C .
Parameters:
B - The subtrahend.
C - The Product.

minus

public static final void minus(int[][] A,
                               int b,
                               int[][] C)
Performs: A - b = C .
Parameters:
b - The subtrahend.
C - The Product.

minus

public static final void minus(int a,
                               int[][] B,
                               int[][] C)
Performs: a - B = C .
Parameters:
B - The subtrahend.
C - The Product.

minus

public static final void minus(double[][] A,
                               double b,
                               double[][] C)
Performs: A - b = C .
Parameters:
b - The subtrahend.
C - The Product.

minus

public static final void minus(double a,
                               double[][] B,
                               double[][] C)
performs: a - B = C .
Parameters:
B - The subtrahend.
C - The Product.

minus

public static final void minus(int[][] A,
                               double b,
                               double[][] C)
Performs: A - b = C .
Parameters:
b - The subtrahend.
C - The Product.

minus

public static final void minus(int a,
                               double[][] B,
                               double[][] C)
Performs: A - B = C .
Parameters:
B - The subtrahend.
C - The Product.

assign

public static final void assign(double[][] A,
                                double[][] B)
Assign matrix B to matrix A.

assign

public static final void assign(int[][] A,
                                int[][] B)
Assign matrix B to matrix A.

assign

public static final void assign(int[][] A,
                                double[][] B)
Assign matrix B to matrix A.

copy

public static final int[][] copy(int[][] A)
Returns a copy of matrix A.
Parameters:
A - The matrix to copy.
Returns:
The copy-matrix.

copy

public static final double[][] copy(double[][] A)
Returns a copy of matrix A.
Parameters:
A - The matrix to copy.
Returns:
The copy-matrix.

assign

public static final void assign(double[][] A,
                                double value)
Assigns all entries of matrix A with value.
Parameters:
A - The matrix to assign.
value - The assigned value.

assign

public static final void assign(int[][] A,
                                int value)
Assigns all entries of matrix A with value.
Parameters:
A - The matrix to assign.
value - The assigned value.

assignId

public static final void assignId(int[][] A)
Makes matrix A to id.
Parameters:
A - The matrix to assign.

assignId

public static final void assignId(double[][] A)
Makes matrix A to id.
Parameters:
A - The matrix to assign.

assignZero

public static final void assignZero(int[][] A)
Assigns all entries of matrix A with zero.
Parameters:
A - The matrix to assign.

assignZero

public static final void assignZero(double[][] A)
Assigns all entries of matrix A with zero.
Parameters:
A - The matrix to assign.

getDiagonal

public static final void getDiagonal(int[][] A,
                                     int[] v)
Stores the diagonal of matrix A to v.
Parameters:
A - The matrix.
v - The vector.

assignDiagonal

public static final void assignDiagonal(int[][] A,
                                        int[] v)
Assigns the diagonal of matrix A with v.
Parameters:
A - The matrix to assign.
v - The vector.

assignDiagonal

public static final void assignDiagonal(int[][] A,
                                        int v)
Assigns the diagonal of matrix A with v.
Parameters:
A - The matrix to assign.
v - The value.

assignDiagonal

public static final void assignDiagonal(double[][] A,
                                        double v)
Assigns the diagonal of matrix A with v.
Parameters:
A - The matrix to assign.
v - The value.

assignDiagonal

public static final void assignDiagonal(double[][] A,
                                        double[] v)
Assigns the diagonal of matrix A with v.
Parameters:
A - The matrix to assign.
v - The vector.

getDiagonal

public static final void getDiagonal(double[][] A,
                                     double[] v)
Stores the diagonal of matrix A to v.
Parameters:
A - The matrix.
v - The vector.

assignDiagonal

public static final void assignDiagonal(double[][] A,
                                        int[] v)
Assigns the diagonal of matrix A with v.
Parameters:
A - The matrix to assign.
v - The vector.

assignRow

public static final void assignRow(int[][] A,
                                   int[] v,
                                   int rowNum)
Assigns the row of matrix A with vector v.
Parameters:
A - The matrix to assign.
v - The vector.
rowNum - The number or row to assign.

getRow

public static final void getRow(int[][] A,
                                int[] v,
                                int rowNum)
Stores the row of matrix A in vector v.
Parameters:
A - The matrix.
v - The vector.
rowNum - The number or row to assign.

getRow

public static final void getRow(double[][] A,
                                double[] v,
                                int rowNum)
Stores the row of matrix A in vector v.
Parameters:
A - The matrix.
v - The vector.
rowNum - The number or row to assign.

assignRow

public static final void assignRow(double[][] A,
                                   double[] v,
                                   int rowNum)
Assigns the row of matrix A with vector v.
Parameters:
A - The matrix to assign.
v - The vector.
rowNum - The number or row to assign.

assignRow

public static final void assignRow(double[][] A,
                                   int[] v,
                                   int rowNum)
Assigns the row of matrix A with vector v.
Parameters:
A - The matrix to assign.
v - The vector.
rowNum - The number or row to assign.

assignCol

public static final void assignCol(int[][] A,
                                   int[] v,
                                   int colNum)
Assigns the column of matrix A with vector v.
Parameters:
A - The matrix to assign.
v - The vector.
rowNum - The number or column to assign.

getCol

public static final void getCol(int[][] A,
                                int[] v,
                                int colNum)
Assigns the column of matrix A in vector v.
Parameters:
A - The matrix.
v - The vector.
rowNum - The number or column to assign.

getCol

public static final void getCol(double[][] A,
                                double[] v,
                                int colNum)
Assigns the column of matrix A in vector v.
Parameters:
A - The matrix.
v - The vector.
rowNum - The number or column to assign.

assignCol

public static final void assignCol(double[][] A,
                                   double[] v,
                                   int colNum)
Assigns the column of matrix A with vector v.
Parameters:
A - The matrix to assign.
v - The vector.
rowNum - The column or row to assign.

assignCol

public static final void assignCol(double[][] A,
                                   int[] v,
                                   int colNum)
Assigns the column of matrix A with vector v.
Parameters:
A - The matrix to assign.
v - The vector.
rowNum - The number or column to assign.

round

public static final void round(double[][] A,
                               double[][] B)
Rounds matrix A and stores result in B. A and B may coinside.
Parameters:
A - The matrix to round.
B - The rounded matrix.

round

public static final void round(double[][] A,
                               int[][] B)
Rounds matrix A and stores result in B. A and B may coinside.
Parameters:
A - The matrix to round.
B - The rounded matrix.

floor

public static final void floor(double[][] A,
                               double[][] B)
Floors matrix A and stores result in B. A and B may coinside.
Parameters:
A - The matrix to round.
B - The rounded matrix.

floor

public static final void floor(double[][] A,
                               int[][] B)
Floors matrix A and stores result in B. A and B may coinside.
Parameters:
A - The matrix to round.
B - The rounded matrix.

neg

public static final void neg(int[][] A,
                             int[][] B)
Negates matrix A and stores result in B . A and B may coinside.
Parameters:
A - The matrix to negate.
B - The negated matrix.

neg

public static final void neg(double[][] A,
                             double[][] B)
Negates matrix A and stores result in B . A and B may coinside.
Parameters:
A - The matrix to negate.
B - The negated matrix.

neg

public static final void neg(int[][] A,
                             double[][] B)
Negates matrix A and stores result in B . A and B may coinside.
Parameters:
A - The matrix to negate.
B - The negated matrix.

mod

public static final void mod(int[][] A,
                             int b,
                             int[][] C)
Performs A % b = C.

normSqr

public static final double normSqr(int[][] re)
Return the sum of the squares of all entries.

normSqr

public static final double normSqr(double[][] re)
Return the sum of the squares of all entries.

maxAbs

public static final int[] maxAbs(double[][] re)
Locates the entry with the greatest absolute value.
Parameters:
re - real part of matrix
im - imaginary part of matrix
Returns:
int[] with indices of biggest entry ({row, col})

maxAbs

public static final int[] maxAbs(double[][] re,
                                 double[][] im)
Locates the entry with the greatest absolute value.
Parameters:
re - real part of matrix
im - imaginary part of matrix
Returns:
int[] with indices of biggest entry ({row, col})

transpose

public static final void transpose(int[][] m,
                                   int[][] trans)
Transpose m and store the result in trans matrix.

transpose

public static final void transpose(double[][] m,
                                   double[][] trans)
Transpose m and store the result in trans matrix.

random

public static final void random(double[][] m)
Assigns random all entries of m.

random

public static final void random(int[][] m,
                                int range)
Assigns random all entries of m. all entries are from 0 to range.