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