Synopsis

PDX_MSGT mth_FullMatrixToBanded(long option, double full[], long row_len, long n, long *sbw, double **bandmat)

Purpose

Convert 2D matrix to banded form.

Description

This routine converts a 2D array representation of a square banded matrix into a 1D array 'banded' form. Memory for the banded representation is allocated in this routine.

Input

option

Not used.

full

The 2D form of the banded matrix.

row_len

Row length of the 2D array, as declared in the calling program.

n

Number of rows/columns in the square matrix.

sbw

If *sbw > 0 (on input), then it is the semi-bandwidth of the matrix, ie. full[i][j] = 0 if |i-j| > *sbw. If *sbw <= 0, then this routine computes and returns the semi-bandwidth in sbw.

Output

sbw

The semi-bandwidth of the matrix.

bandmat

A pointer to the 1D banded array form of the matrix.

Return

      MTH_NOERR
      MTH_NOMEMORY
      Low level error return
      .fi