are cublasDdot function just related to the diagonal elements

  algebra, c++, cuda, matrix

I have two matrices

A = 
0.326 , 0.154 , -0.000954 , -0.00016 , -0.000472 , 0.0315 , 0.0315 ,
0.154 , 0.326 , -0.012 , -0.00202 , -0.00596 , 0.285 , 0.291 ,
-0.000954 , -0.012 , 0.326 , 8.09e-05 , 0.000239 , 0.213 , -0.143 ,
-0.00016 , -0.00202 , 8.09e-05 , 0.325 , 4e-05 , -0.102 , -0.0993 ,
-0.000472 , -0.00596 , 0.000239 , 4e-05 , 0.325 , -0.000148 , 0.177 ,
0.0315 , 0.285 , 0.213 , -0.102 , -0.000148 , 0.311 , 0.135 ,
0.0315 , 0.291 , -0.143 , -0.0993 , 0.177 , 0.135 , 0.33 ,


B = 
-0.326 , -0.0771 , 0.000477 , 8e-05 , 0.000236 , -0.0158 , -0.0158 ,
-0.0771 , -0.326 , 0.00602 , 0.00101 , 0.00298 , -0.142 , -0.146 ,
0.000477 , 0.00602 , -0.326 , -4.04e-05 , -0.00012 , -0.107 , 0.0716 ,
8e-05 , 0.00101 , -4.04e-05 , -0.325 , -2e-05 , 0.0509 , 0.0497 ,
0.000236 , 0.00298 , -0.00012 , -2e-05 , -0.325 , 7.35e-05 , -0.0884 ,
-0.0158 , -0.142 , -0.107 , 0.0509 , 7.35e-05 , -0.311 , -0.0673 ,
-0.0158 , -0.146 , 0.0716 , 0.0497 , -0.0884 , -0.0673 , -0.33 ,

these two matrix should cancel each other in my calculation, but as you can see except diagonal elements, the rest of the elements of the matrix A is two times more than matrix B, so they are not canceling each other! but if we imagin C = A+B
then

cublasDdot(blas_handle, n * n,
                     D, 1,
                     C, 1, &E);

give me some result which is like these A and B are canceling each other,
while for some other matrices that the diagonal elements are not canceling each other but the rest are almost in the same value! but the result is so far as expected!

I was wondering If this cublasDdot are just related to the diagonal elements?

Source: Windows Questions C++

LEAVE A COMMENT