Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6539 Discussions

## Is CMKL9.0 provides correct staggered cosine transforms?

Beginner
234 Views

I'm using CMKL 9.0 TT routines of staggered cosine transforms. But currently can not get results I want. The details are:
The matrix of finite difference of 1d three-point approximations Poisson equation with Neumann boundary conditions is:
1,-1,0...
-1,2,-1,...
.....
..... -1,2,-1
......,0,1,-1
Eigenvalues of this matrix is 2-2*cos((i-1)*pi/n), and the Eigenvectors are corresponding to staggered cosine transform. But I found in the example of TT routines d_trig_tforms_bvp.f90 and d_trig_tforms_slae.f90, the eigenvalues seems be given to (2.0D0*dsin(0.25D0*pi*(2*k-1)/n))**2. Am I wrong?

And manuals of different version provide different description to staggered cosine transforms. Should I followthe latest version released in march 2009 to use CMKL 9.0?

Thanks.

1 Solution
Employee
234 Views
Hi,
The current version of TT support only 1D transform, but you could develop it yourself, just call 1D TT in parallel loop. But, if you want to get good performance you need to set ipar[9] by number of threads (more detailes could be found inIntel MKL Reference Manual chapter 13)
With best regards,
9 Replies
Moderator
234 Views
I want to note that 9.0 version is no longer support. We'd recommend you to test the latest version 10.2 Update 6 we released at September this year or evaluate 10.3 beta.
Employee
234 Views
Hi,
Could you check your eigenvector by multyplication on your matrix. The first component of eigenvector you mention is equal zero (if i=1), so from first eqution you will got wrong result. May be "i" greater than 1?
With best regards,
Beginner
234 Views
Ok, I'll try that.
Thanks.
Beginner
234 Views
Hi,
Could you check your eigenvector by multyplication on your matrix. The first component of eigenvector you mention is equal zero (if i=1), so from first eqution you will got wrong result. May be "i" greater than 1?
With best regards,

Yes, the first eigenvalue is zero. This is something concerning singularity of poisson equation with Neumann boundary condition. That means if u is a solution, u+c is also solution. c is a constant.
With best regards.

Employee
234 Views
Hi,
I've understood the rootcase of problem. The matrix you mentioned isn't correspond to staggered cosine transform in our term. This matrix correspond tt_type = MKL_COSINE_TRANSFORM= 1, and eigenvalues of it could be calculated by next equation:
lambda(k)=(2.0D0*dsin(0.5D0*pi*(k-1)/n))**2.
This equation is the same with your2-2*cos((k-1)*pi/n)
With best regards,
Beginner
234 Views
You are so nice and patient.
But I'm afraid that MKL_COSINE_TRANSFORM= 1 correspond to following matrix:
2,-2,0...
-1,2,-1,...
.....
..... -1,2,-1
......,0,2,-2
It's different from our matrix because the first and last row is twice. The eigenvalues and eigenvectors are different between two matrix.
It's so strange that I can use Numerical Recipes cosine transformer codes, cosft2, and get correct results, but cannot using TT routines. Our matrix is educed from three point finite difference of 1d poisson equation in staggered grid.
Best regards!
Beginner
234 Views
I know where the problem is now.
For staggered cosine transform, Forward transform of cosft2 (provided by Numerical Recipes) correspends with Backward transform provieded in MKL.
Another my question is how to do multi-column transform quickly. It seems that TT routines does not support multi-column transform.
Thanks all.
Employee
235 Views
Hi,
The current version of TT support only 1D transform, but you could develop it yourself, just call 1D TT in parallel loop. But, if you want to get good performance you need to set ipar[9] by number of threads (more detailes could be found inIntel MKL Reference Manual chapter 13)
With best regards,