matvec

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:
aLeft sided matrix.
nraNumber of rows of a.
ncaNumber of columns of a.
xRight sided vector.
bProduct 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"