Table of Contents

NAME

QccMatrixAlloc, QccMatrixFree, QccMatrixZero, QccMatrixResize, QccMatrixCopy, QccMatrixMaxValue, QccMatrixMinValue, QccMatrixPrint, QccMatrixRowExchange, QccMatrixColExchange, QccMatrixIdentity, QccMatrixTranpose, QccMatrixAdd, QccMatrixSubtract, QccMatrixMean, QccMatrixMaxSignalPower - miscellaneous matrix routines

SYNOPSIS

#include "libQccPack.h"

QccMatrix QccMatrixAlloc(int num_rows, int num_cols);

void QccMatrixFree(QccMatrix matrix, int num_rows);

int QccMatrixZero(QccMatrix matrix, int num_rows, int num_cols);

QccMatrix QccMatrixResize(QccMatrix matrix, int num_rows, int num_cols, int new_num_rows, int new_num_cols);

int QccMatrixCopy(QccMatrix matrix1, const QccMatrix matrix2, int num_rows, int num_cols);

double QccMatrixMaxValue(const QccMatrix matrix, int num_rows, int num_cols);

double QccMatrixMinValue(const QccMatrix matrix, int num_rows, int num_cols);

int QccMatrixPrint(const QccMatrix matrix, int num_rows, int num_cols);

int QccMatrixRowExchange(QccMatrix matrix, int num_cols, int row1, int row2);

int QccMatrixColExchange(QccMatrix matrix, int num_rows, int col1, int col2);

int QccMatrixIdentity(QccMatrix matrix, int num_rows, int num_cols);

int QccMatrixTranspose(const QccMatrix matrix1, QccMatrix matrix2, int num_rows, int num_cols);

int QccMatrixAdd(QccMatrix matrix1, const QccMatrix matrix2, int num_rows, int num_cols);

int QccMatrixSubtract(QccMatrix matrix1, const QccMatrix matrix2, int num_rows, int num_cols);

double QccMatrixMean(const QccMatrix matrix, int num_rows, int num_cols);

double QccMatrixVariance(const QccMatrix matrix, int num_rows, int num_cols);

double QccMatrixMaxSignalPower(const QccMatrix matrix, int num_rows, int num_cols);

DESCRIPTION

QccPack library routines use two-dimensional matrices of type QccMatrix which is defined as
typedef QccVector *QccMatrix;

QccMatrixAlloc() allocates a QccMatrix consisting of num_rows vectors; each vector is of type QccVector and has dimension num_cols. QccMatrixAlloc() returns a NULL pointer if the allocation fails.

QccMatrixFree() frees a QccMatrix previously allocated by QccMatrixAlloc().

QccMatrixZero() makes each element of matrix zero.

QccMatrixResize() changes the size of matrix from num_rows x num_cols to new_num_rows x new_num_cols by calling realloc(3) and QccVectorResize(3) . Upon success, the new matrix is returned; a NULL pointer is returned if realloc(3) or QccVectorResize(3) fails. If matrix is NULL, QccMatrixAlloc() is called. In any case, all elements added to matrix are zero.

QccMatrixCopy() copies matrix2 to matrix1.

QccMatrixMaxValue() returns the largest element in matrix.

QccMatrixMinValue() returns the smallest element in matrix.

QccMatrixPrint() prints the elements of matrix to stdout.

QccMatrixRowExchange() exchanges rows row1 and row2 in matrix.

QccMatrixColExchange() exchanges columns col1 and col2 in matrix.

QccMatrixIdentity() sets all entries of matrix to 0, except along the diagonal, where the diagonal entries are set to 1. In the case that num_rows and num_cols are equal (i.e., the matrix is square), matrix will be the num_rows by num_rows identity matrix.

QccMatrixTranspose() computes the transpose of matrix1, storing the result as matrix2, which must be previously allocated. It is assumed that matrix2 is of the proper size (i.e., num_cols rows by num_rows columns).

QccMatrixAdd() adds each component of matrix1 to the corresponding component of matrix2, returning the resulting matrix in matrix1. matrix1 and matrix2 must be the same size.

QccMatrixSubtract() subtracts each component of matrix2 from the corresponding component of matrix1, returning the resulting matrix in matrix1. matrix1 and matrix2 must be the same size.

QccMatrixMean() calculates the mean of the elements in matrix.

QccMatrixVariance() calculates the variance of the elements in matrix.

QccMatrixMaxSignalPower() calculates the squared norm of each row vector in matrix and returns the largest one.

SEE ALSO

QccVector(3) , QccPack(3)

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads