[petsc-users] cusp complex and std complex

Harshad Sahasrabudhe hsahasra at purdue.edu
Thu Sep 5 12:29:38 CDT 2013


Hi Matt,

I have attached a small test case which reproduces the problem. Here is the compilation command with the error:


    gcc -c test.cpp -I/u/sciteam/sahasrab/NEMO5/libs/petsc/include -I/u/sciteam/sahasrab/NEMO5/libs/petsc/arch-linux2-cxx-opt-cplx/include/ -I/opt/cray/mpt/6.0.1/gni/mpich2-
    cray/81/include/ -I/u/sciteam/sahasrab/NEMO5/libs/petsc/cusplibrary-master/ -I/opt/nvidia/cudatoolkit/5.0.35/include/

    test.cpp: In function 'int main()':
    test.cpp:24:27: error: no matching function for call to 'VectorP<std::complex<double> >::dot_product(VectorP<std::complex<double> >&, VectorP<std::complex<double> >&,    
    cusp::complex<double>&)'
       a.dot_product(a, b, p[1]);
                           ^
    test.cpp:24:27: note: candidate is:
    test.cpp:9:8: note: void VectorP<T>::dot_product(VectorP<T>&, VectorP<T>&, T&) [with T = std::complex<double>]
       void dot_product(VectorP<T>& vecA, VectorP<T>& vecB, T& prod)
            ^
    test.cpp:9:8: note:   no known conversion for argument 3 from 'cusp::complex<double>' to 'std::complex<double

My question is, is there no alternative to using VectorP<PetscScalar>?

NOTE: PETSc is compiled with CUSP.

Thanks,
Harshad




    >Are we supposed to guess where this happens? Please send the entire compile error, and if its in your code, send 
    >a simple code that demonstrates the problem. 


    >Matt 

    >-- 
    >What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. 
    >-- Norbert Wiener 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 374 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130905/645bb6c3/attachment.cpp>


More information about the petsc-users mailing list