#ifndef _MATRIXMATH_H
#define _MATRIXMATH_H

#include "../pnheaders/matrix.h"

#define MULTIPLYVECTOR_ARRAY		-1
/*This is a control constaint used by the MultiplyVector function to indicate 
that one of the matrix pointers passed to it is fact a pointer to an array of 
integers.*/

void TransposeMatrix(matrix* m);
/*This function transposes the matrix m. It is very fast right now because 
transposition means merely changing the tranpose bit in
the matrix structure.*/

matrix AddMatrix(const matrix* addA, const matrix* addB, matrix* dst);
/* This function adds two matrices together element-by-element and stores the 
result in the matrix pointed to by dst. If dst is a valid pointer the matrix to 
which it points is used as the destination. If dst is null, the function 
allocates a new matrix of the type determined by AllocateMatrix. If dst is an 
integer between 1 and 3 inclusive, the function allocates a new matrix of that 
type number.*/

matrix SubtractMatrix(const matrix* add, const matrix* sub, matrix* dst);
/* SubtractMatrix does an element-by-element subtraction. The elements of the 
matrix pointed to by sub are subtracted from the elements of the matrix pointed 
to by add. The results are stored in the matrix pointed to by dst.If dst is a 
valid pointer the matrix to which it points is used as the destination. If dst 
is null, the function allocates a new matrix of the type determined by 
AllocateMatrix. If dst is an integer between 1 and 3 inclusive, the function 
allocates a new matrix of that type number.*/

matrix MultiplyMatrix(const matrix* left, const matrix* right, matrix* dst);
/* MultiplyMatrix does a matrix multiplication of the matrices pointed to by 
left and right and stores the results in the matrix pointed to by dst. If dst is 
a valid pointer the matrix to which it points is used as the destination. If dst 
is null, the function allocates a new matrix of the type determined by 
AllocateMatrix. If dst is an integer between 1 and 3 inclusive, the function 
allocates a new matrix of that type number.*/

void ShowMatrix(const matrix* m, const char* title);
/*ShowMatrix is a debugging function that dumps the contents of a matrix to the 
screen in a human-readable format.*/

int MultiplyVector(matrix* left, matrix* right, int Row, int Col, int Length);
/*This function multiplies a particular row of the left matrix by a particular 
column of the right matrix. If the row or column index is a negative constaint, 
the pointer to the corresponding matrix is interpreted as a pointer to an array 
of integers. If both primary parameters are arrays of integers, then Length 
holds the length of the arrays. Otherwise it is ignored.*/

int MatrixEqualMatrix(matrix* A, matrix* B);
/*MatrixEqualMatrix tests the equality of matrices A and B. It returns nonzero
if the matrices are equal and zero if they are different.*/

#endif


