(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

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.

2. Relevant equations

3. 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

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: How to run dgemms subroutine on mac computer

**Physics Forums | Science Articles, Homework Help, Discussion**