1

I want to compute double dot product in Arrayfire. is there any function in arrayfire to use for double dot product. This is my tensor, that I wish to impelment:

AA:(E_iE_i - c^2I)
where, A--> 2D-array ; E_i --> 1D array (defined as col. vec in arrayfire)
c --> scalar/constant ; I --> identity matrix

Any suggestion, reference, plz.

TheCoder
  • 55
  • 1
  • 8

1 Answers1

0

ArrayFire does not provide a double dot product function, but you can define your own.

Assuming a definition of double dot product consistent with the one given here and here, the "double dot product" is the sum of all values after computing an element-wise multiplication of the two matrices. The two matrices must have the same shape:

af::array doubledot(af::array a, af::array b) {
  return af::sum(a * b);
}
Alex Shroyer
  • 3,499
  • 2
  • 28
  • 54