- #1
missfangula
- 32
- 0
Homework Statement
I wrote a program to run the dgemul subroutine on my mac to find the matrix product for matrix a and matrix b, outputted as matrix c, just like the reference manual told me to. Being a mac user, I added the accelerate framework to the file which contain all the lapack stuff, but it does not recognize 'dgemul' as a function. Can someone please enlighten me as to what I am doing wrong? Below is the completed program.
Homework Equations
The Attempt at a Solution
#import <Foundation/Foundation.h>
#include <Accelerate/Accelerate.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main ()
{
double a[16] =
{
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0,
1.0, 2.0, 3.0, 4.0
};
double b[16] =
{
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0,
5.0, 4.0, 3.0, 2.0
};
double c[16] =
{
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0
};
int lda = 4;
int ldb = 4;
char transa = 'N';
char transb = 'N';
int ldc = 4;
int l = 4;
int m = 4;
int n = 4;
dgemul(a, lda, transa, b, ldb, transb, c, ldc, l, m, n);
int i;
for (i=0; i<16; ++i) printf("%5.10f\n", c);
return 0;
}
Thank you!
-miss fangula