Many of the better-known C++ libraries in computational science such as Eigen, Trilinos, and deal.II use the standard C++ template header library object, std::complex<>, to represent complex floating-point numbers.
In Jack Poulson's answer to a question about default constructors, he points out that he has his own implementation of std::complex in Elemental "for a number of reasons". What are those reasons? What are the advantages and disadvantages to this approach?
zis an lvalue expression of type cvstd::complex<T>thenreinterpret_cast<cv T(&)[2]>(z)andreinterpret_cast<cv T(&)[2]>(z)[0]shall designate the real part ofz, andreinterpret_cast<cv T(&)[2]>(z)[1]shall designate the imaginary part ofz. Arrays of complex numbers are also addressed. – James Custer Apr 21 '12 at 16:07