CUDA
C/C++    Fortran   

Matrix multiply, dot product, BLAS

Functions

template<typename ty >
ty dot (const array &x, const array &y)
 Scalar dot product between two vectors.

enum  matopts { All_Defaults = 0, A_transpose = 1, B_transpose = 2 }
 

Multiply two arrays together.

More...
array matmul (const array &, const array &, matopts=All_Defaults)
array matmul (const array &, const array &, const array &)
 Multiply three arrays together.
array matmul (const array &, const array &, const array &, const array &)
 Multiply four arrays together.

Enumeration Type Documentation

enum matopts

Multiply two arrays together.

matrix multiply

   array a,b;
   array c = matmul(a,b); //c = a x b
   array d = matmul(a,b,A_transpose); // d = a' x b
   array e = matmul(a,b,B_transpose); // e = a  x b'
   array f = matmul(a,b,A_transpose | B_transpose); // f = (b x a)'
Enumerator:
All_Defaults 
A_transpose 
B_transpose 

Function Documentation

array dot ( const array &  x,
const array &  y 
)

Scalar dot product between two vectors.

Also referred to as the inner product.

    // compute scalar dot product
    array x = randu(100), y = randu(100);
    printf("dot(x,y) = %g\n", dot<float>(x,y));
Parameters:
[in]x
[in]y
Returns:
scalar dot product
See also:
matmul()
array af::matmul ( const array &  ,
const array &  ,
const array &   
)

Multiply three arrays together.

   array a,b,c;
   array d = 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,b,c,d;
   array e = matmul(a,b,c,d); //e = a x b x c x d