ABSTRACT

Procedure parameters: void inimat (lr,ur,lc,uc,a,x) lr,ur,lc,uc: int; lower and upper row index, and lower and upper column index of

the matrix a, respectively; a: double a[lr:ur,lc:uc]; the matrix to be initialized; x: double; initialization constant. public static void inimat(int lr, int ur, int lc, int uc, double a[][], double x) { int j;

for (; lr<=ur; lr++) for (j=lc; j<=uc; j++) a[lr][j]=x; }

C. inimatd Initializes a forward diagonal sequence of elements of a rectangular matrix a by setting ai,i+shift=x (i=lr,lr+1,...,ur). Procedure parameters: void inimatd (lr,ur,shift,a,x) lr,ur: int; lower and upper row index of the codiagonal to be initialized; shift: int; distance between diagonal and codiagonal; a: double a[lr:ur,lr+shift:ur+shift]; the array to be initialized; x: double; initialization constant. public static void inimatd(int lr, int ur, int shift, double a[][], double x) { for (; lr<=ur; lr++) a[lr][lr+shift]=x; }

D. inisymd Initializes a forward diagonal sequence of elements of a symmetric square matrix b. The upper triangle of b is stored columnwise in a linear array a such that bi,j is a(j-1)j/2+i. Procedure parameters: void inisymd (lr,ur,shift,a,x) lr,ur: int; lower and upper row index of a codiagonal of a symmetric matrix of

order n to be initialized, lr and ur should satisfy: lr ≥ 1, ur ≤ n; shift: distance between diagonal and codiagonal, -n < shift < n;

a: double a[1:n(n+1)/2]; the linear array containing the columnwise stored upper triangle of a symmetric matrix;

x: double; initialization constant. public static void inisymd(int lr, int ur, int shift, double a[], double x) { shift=Math.abs(shift); ur += shift+1; shift += lr; lr += ((shift-3)*shift)/2; lr += shift; while (shift < ur) { a[lr]=x; shift++; lr += shift; } }

E. inisymrow Initializes part of a row of a symmetric square matrix b. The upper triangle of b is stored columnwise in a linear array a such that bi,j is a(j-1)j/2+i. Procedure parameters: void inisymrow (l,u,i,a,x) l,u: int; lower and upper index of row-element of a codiagonal of a symmetric

matrix of order n to be initialized, l and u should satisfy: 1 ≤ l ≤ n, 1 ≤ u ≤ n; i: row index, 1 ≤ i ≤ n; a: double a[1:n(n+1)/2]; the linear array containing the columnwise stored

upper triangle of a symmetric matrix; x: double; initialization constant. public static void inisymrow(int l, int u, int i, double a[], double x) { int k;

if (l <= i) { k=((i-1)*i)/2; l += k; k += (u<i) ? u : i; for (; l<=k; l++) a[l]=x; l=i+1; } if (u > i) { k=((l-1)*l)/2+i; do { a[k]=x;

l++; k += l-1; } while (l <= u); } }

A. dupvec Duplicates part of a vector b by setting ai=bi,i+shift (i=l,l+1,...,u). Procedure parameters: void dupvec (l,u,shift,a,b) l,u: int; lower and upper vector-index, respectively; shift: int; index-shifting parameter; a,b: double a[l:u], b[l+shift:u+shift]; the array b is copied into a. public static void dupvec(int l, int u, int shift, double a[], double b[]) { for (; l<=u; l++) a[l]=b[l+shift]; }

B. dupvecrow Duplicates part of a row vector of a rectangular matrix b by setting aj=bi,j (j=l,l+1,...,u). Procedure parameters: void dupvecrow (l,u,i,a,b) l,u: int; lower and upper vector-index, respectively; i: int; row index of the matrix b; a,b: double a[l:u], b[i:i,l:u]; b is copied into a.