Where is the bottleneck in this code?

Posted by Mikhail on Stack Overflow See other posts from Stack Overflow or by Mikhail
Published on 2012-12-16T10:21:25Z Indexed on 2012/12/16 11:05 UTC
Read the original article Hit count: 232

Filed under:
|
|
|
|

I have the following tight loop that makes up the serial bottle neck of my code. Ideally I would parallelize the function that calls this but that is not possible.

//n is about 60
for (int k = 0;k < n;k++) 
{
    double fone = z[k*n+i+1];
    double fzer = z[k*n+i];
    z[k*n+i+1]= s*fzer+c*fone;
    z[k*n+i] = c*fzer-s*fone;
}

Are there any optimizations that can be made such as vectorization or some evil inline that can help this code?

I am looking into finding eigen solutions of tridiagonal matrices. http://www.cimat.mx/~posada/OptDoglegGraph/DocLogisticDogleg/projects/adjustedrecipes/tqli.cpp.html

© Stack Overflow or respective owner

Related posts about c++

Related posts about c