Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matrix Math

Status
Not open for further replies.

pantherboy

Programmer
Feb 13, 2004
1
US
Is there a quick way to compute the multiplation of two matrixes in c?
 
There is no standard API routine to do that, if that's what you mean.


--
 
Nothing but the usual matrix multiplication function you create by yourself
this is multiplies A and B yielding product matrix C with the dimension in order

void mat_prod(double c[M][P], double a[M][N],
double b[N][P])
{
int i,j,k;
for (i=0; i<M; ++i)
for (j=0; j<P; ++j)
{ c{i][j] = 0;
for (k=0; k<N; ++k)
c[j] += a[k] * b[k][j];
}
}

 
There's a de facto standard library for linear algegra called BLAS (Basic Linear Algebra Subroutines, I think).

I know has an implementation of BLAS called uBLAS. I'm sure there are others out there, too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top