Documentation

Perform a matrix multiplication on two matrices. More...

 array matmul (const array &, const array &, af_matprop_t=af_none, af_matprop_t=af_none) Multiply two arrays together. More... array matmul (const array &, const array &, const array &) Multiply three arrays together. More... array matmul (const array &, const array &, const array &, const array &) Multiply four arrays together. More...

## Detailed Description

Perform a matrix multiplication on two matrices.

Detailed description of matmul TODO:

## Function Documentation

 array af::matmul ( const array & , const array & , af_matprop_t = af_none, af_matprop_t = af_none )

Multiply two arrays together.

 
array a = array(seq(9), 3, 3);
array b = array(seq(9), 3, 3);
print(a);
print(b);
print(matmul(a, b));                     // c = a x b
print(matmul(a, b, af_trans));           // d = a' x b
print(matmul(a, b, af_none, af_trans));  // e = a  x b'
print(matmul(a, b, af_trans, af_trans)); // f = (b x a)'
 
Examples:
examples/benchmarks/blas.cpp, examples/getting_started/convolve.cpp, examples/getting_started/gfor.cpp, examples/getting_started/lin_algebra.cpp, examples/machine_learning/neuralnetwork.cpp, and examples/multi_device/gemv.cpp.
 array af::matmul ( const array & , const array & , const array & )

Multiply three arrays together.

 
array    a = randu(3, 3),
b = randu(3, 3),
c = randu(3, 3);
print(matmul(a,b,c)); //d = a x b x c
 
 array af::matmul ( const array & , const array & , const array & , const array & )

Multiply four arrays together.

 
array    a = randu(3, 3),
b = randu(3, 3),
c = randu(3, 3),
d = randu(3, 3);
print(matmul(a,b,c,d)); //e = a x b x c x d