Table of Contents

NAME

QccMatrixIntAlloc, QccMatrixIntFree, QccMatrixIntZero, QccMatrixIntResize, QccMatrixIntCopy, QccMatrixIntMaxValue, QccMatrixIntMinValue, QccMatrixIntPrint, QccMatrixIntTranpose, QccMatrixIntAdd, QccMatrixIntSubtract, QccMatrixIntMean, - miscellaneous integer-matrix routines

SYNOPSIS

#include "libQccPack.h"

QccMatrixInt QccMatrixIntAlloc(int num_rows, int num_cols);

void QccMatrixIntFree(QccMatrixInt matrix, int num_rows);

int QccMatrixIntZero(QccMatrixInt matrix, int num_rows, int num_cols);

QccMatrixInt QccMatrixIntResize(QccMatrixInt matrix, int num_rows, int num_cols, int new_num_rows, int new_num_cols);

int QccMatrixIntCopy(QccMatrixInt matrix1, const QccMatrixInt matrix2, int num_rows, int num_cols);

int QccMatrixIntMaxValue(const QccMatrixInt matrix, int num_rows, int num_cols);

int QccMatrixIntMinValue(const QccMatrixInt matrix, int num_rows, int num_cols);

int QccMatrixIntPrint(const QccMatrixInt matrix, int num_rows, int num_cols);

int QccMatrixIntTranspose(const QccMatrixInt matrix1, QccMatrixInt matrix2, int num_rows, int num_cols);

int QccMatrixIntAdd(QccMatrixInt matrix1, const QccMatrixInt matrix2, int num_rows, int num_cols);

int QccMatrixIntSubtract(QccMatrixInt matrix1, const QccMatrixInt matrix2, int num_rows, int num_cols);

double QccMatrixIntMean(const QccMatrixInt matrix, int num_rows, int num_cols);

double QccMatrixIntVariance(const QccMatrixInt matrix, int num_rows, int num_cols);

DESCRIPTION

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

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

QccMatrixIntFree() frees a QccMatrixInt previously allocated by QccMatrixIntAlloc().

QccMatrixIntZero() makes each element of matrix zero.

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

QccMatrixIntCopy() copies matrix2 to matrix1.

QccMatrixIntMaxValue() returns the largest element in matrix.

QccMatrixIntMinValue() returns the smallest element in matrix.

QccMatrixIntPrint() prints the elements of matrix to stdout.

QccMatrixIntTranspose() 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).

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

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

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

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

SEE ALSO

QccVectorInt(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