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... | |
Perform a matrix multiplication on two matrices.
Detailed description of matmul TODO:
| 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)'
| 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