numal.lowprecision
Class Basic

java.lang.Object
  extended by numal.lowprecision.Basic

public class Basic
extends Object

A library of basic operations between matrices and vectrors. These methods make use of lower and upper indices; which allows vectors to be 0-index or 1-index (i.e. a[0...n-1] or a[1...n])


Constructor Summary
Basic()
           
 
Method Summary
static void dupvec(int l, int u, int shift, float[] a, float[] b)
          Compute a constant multiple (xb.
static void elmcol(int l, int u, int i, int j, float[][] a, float[][] b, float x)
          Adds a constant multiple (x) of part of a column of a rectangular matrix b to part of a column of a rectangular matrix a Method originally from class numal.Basic - Lau (2004) section 1.7.B Real vector and matrix - Elimination p.22.
static void elmrow(int l, int u, int i, int j, float[][] a, float[][] b, float x)
          Adds a constant multiple (x) of part of a row of a rectangular matrix b to part of a row of a rectangular matrix a Method originally from class numal.Basic - Lau (2004) section 1.7.B Real vector and matrix - Elimination p.22.
static float matmat(int l, int u, int i, int j, float[][] a, float[][] b)
          Get the inner product of part of a row of a rectangular matrix a and the corresponding part of a column of a rectangular matrix b.
static float mattam(int l, int u, int i, int j, float[][] a, float[][] b)
          Compute the inner product of part of a row of a rectangular matrix a and the corresponding part of a row of a rectangular matrix b.
static float matvec(int l, int u, int i, float[][] a, float[] b)
          Compute the inner product of part of a row of a rectangular matrix a and the corresponding part of a vector b.
static void mulcol(int l, int u, int i, int j, float[][] a, float[][] b, float x)
          Replace a column sequence of elements of a rectangular matrix a by a constant multiple (xb.
static void rotcol(int l, int u, int i, int j, float[][] a, float c, float s)
          Rotates two columns of a rectangular matrix using two parameters a[k][i] = c * a[k][i] + s * a[k][j] (where k = l to u) a[k][j] = c * a[k][j] - s * a[k][i] Method originally from class numal.Basic - Lau (2004) section 1.9.A Real vector and matrix - Rotation p.30.
static float tammat(int l, int u, int i, int j, float[][] a, float[][] b)
          Compute the inner product of part of a column of a rectangular matrix a and the corresponding part of a column of a rectangular matrix b.
static float tamvec(int l, int u, int i, float[][] a, float[] b)
          Method originally from class numal.Basic - Lau (2004) section 1.4.B Real Vector Vector products p.12.
static float vecvec(int l, int u, int shift, float[] a, float[] b)
          Compute the inner product of part of a vector a and part of a vector b A subset of the inner product can be computed by choosing suitable lower and upper bounds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Basic

public Basic()
Method Detail

dupvec

public static void dupvec(int l,
                          int u,
                          int shift,
                          float[] a,
                          float[] b)
Compute a constant multiple (xb. Method originally from class numal.LinearAlgebra - Lau (2004) section 1.2.A Real vector and matrix - Duplication p.6.

Parameters:
l - lower row bound index
u - upper row bound index
shift - index shifting parameter
a - rectangular output matrix
b - rectangular input matrix

mulcol

public static void mulcol(int l,
                          int u,
                          int i,
                          int j,
                          float[][] a,
                          float[][] b,
                          float x)
Replace a column sequence of elements of a rectangular matrix a by a constant multiple (xb. Method originally from class numal.LinearAlgebra - Lau (2004) section 1.3.C Real vector and matrix - Multiplication p.9.

Parameters:
l - lower row bound
u - upper row bound
i - column index of a
j - column index of b
a - rectangular matrix
b - rectangular matrix
x - multiplication factor

vecvec

public static float vecvec(int l,
                           int u,
                           int shift,
                           float[] a,
                           float[] b)
Compute the inner product of part of a vector a and part of a vector b A subset of the inner product can be computed by choosing suitable lower and upper bounds. Method originally from class numal.Basic - Lau (2004) section 1.4.A Real vector vector products p.10.

Parameters:
l - lower bound
u - upper bound
shift - index-shifting parameter of vector b
a - vector
b - vector
Returns:
the inner product of vector a and vector b

matvec

public static float matvec(int l,
                           int u,
                           int i,
                           float[][] a,
                           float[] b)
Compute the inner product of part of a row of a rectangular matrix a and the corresponding part of a vector b. A subset of the inner product can be computed by choosing suitable lower and upper column bounds. Method originally from class numal.Basic - Lau (2004) section 1.4.B Real Vector Vector products p.11.

Parameters:
l - lower bound
u - upper bound
i - row index of a
a - rectangular matrix
b - vector
Returns:
inner product of row i of matrix a with vector b

tamvec

public static float tamvec(int l,
                           int u,
                           int i,
                           float[][] a,
                           float[] b)
Method originally from class numal.Basic - Lau (2004) section 1.4.B Real Vector Vector products p.12.

Parameters:
l - lower bound
u - upper bound
i - column index of a
a - rectangular matrix with column [l-u][j] defined
b - vector with entries [l-u] defined

matmat

public static float matmat(int l,
                           int u,
                           int i,
                           int j,
                           float[][] a,
                           float[][] b)
Get the inner product of part of a row of a rectangular matrix a and the corresponding part of a column of a rectangular matrix b.

Parameters:
l - lower row bound
u - upper row bound
i - row index of a
j - column index of b
a - rectangular matrix with row [i][l-u] defined
b - rectangular matrix with column [l-u][j] defined
Returns:
inner product of a and b

tammat

public static float tammat(int l,
                           int u,
                           int i,
                           int j,
                           float[][] a,
                           float[][] b)
Compute the inner product of part of a column of a rectangular matrix a and the corresponding part of a column of a rectangular matrix b. Method originally from class numal.Basic - Lau (2004) section 1.4.E Real Vector Vector products p.13.

Parameters:
l - lower row bound
u - upper row bound
i - column index of a
j - column index of b
a - rectangular matrix with column [l-u][i] defined
b - rectangular matrix with column [l-u][j] defined

mattam

public static float mattam(int l,
                           int u,
                           int i,
                           int j,
                           float[][] a,
                           float[][] b)
Compute the inner product of part of a row of a rectangular matrix a and the corresponding part of a row of a rectangular matrix b. Method originally from class numal.LinearAlgebra - Lau (2004) section 1.4.F Real Vector Vector products p.13

Parameters:
l - lower column bound
u - upper column bound
i - row index of a
j - row index of b
a - rectangular matrix
b - rectangular matrix
Returns:
inner product of row i of a and row j of b

elmcol

public static void elmcol(int l,
                          int u,
                          int i,
                          int j,
                          float[][] a,
                          float[][] b,
                          float x)
Adds a constant multiple (x) of part of a column of a rectangular matrix b to part of a column of a rectangular matrix a Method originally from class numal.Basic - Lau (2004) section 1.7.B Real vector and matrix - Elimination p.22.

Parameters:
l - lower row bound
u - upper row bound
i - column index of a
j - column index of b
a - rectangular matrix
b - rectangular matrix
x - multiplication factor

elmrow

public static void elmrow(int l,
                          int u,
                          int i,
                          int j,
                          float[][] a,
                          float[][] b,
                          float x)
Adds a constant multiple (x) of part of a row of a rectangular matrix b to part of a row of a rectangular matrix a Method originally from class numal.Basic - Lau (2004) section 1.7.B Real vector and matrix - Elimination p.22.

Parameters:
l - lower row bound
u - upper row bound
i - column index of a
j - column index of b
a - rectangular matrix
b - rectangular matrix
x - multiplication factor

rotcol

public static void rotcol(int l,
                          int u,
                          int i,
                          int j,
                          float[][] a,
                          float c,
                          float s)
Rotates two columns of a rectangular matrix using two parameters Method originally from class numal.Basic - Lau (2004) section 1.9.A Real vector and matrix - Rotation p.30.

Parameters:
l - lower row bound
u - upper row bound
i - column index of a
j - column index of a
a - rectangular matrix
c - cosine multiplication parameter
s - sine multiplication parameter