void matmat(double **a, int nra, int nca, double **b, int ncb, double **prod);
Postmultiplies the matrix a[0..nra-1][0..nca-1] by the matrix b[0..nca-1][0..ncb-1] and returns the product in the matrix prod[0..nra-1][0..ncb-1].
Parameters:
a | Left sided matrix. |
---|---|
nra | Number of rows of a. |
nca | Number of columns of a. |
b | Right sided matrix. |
ncb | Number of columns of b. |
prod | Product of a and b. |
Returns:
The product of a and b is returned in prod.
Usage:
double** a; double** b; double** prod; a = dmatrix(0, 3, 0, 4); b = dmatrix(0, 4, 0, 2); prod = dmatrix(0, 3, 0, 2); // initialize a and b elements matmat(a, 4, 5, b, 3, prod); free_dmatrix(a, 0, 3, 0); free_dmatrix(b, 0, 4, 0); free_dmatrix(prod, 0, 3, 0);
Header:
#include "linalg.h"