|
JINRLIB Program LibraryCPX - complex number utilityAuthors: Mihai Tiberiu Dima, Maria Dima |
|
Highlights The class fields an embodiment of complex numbers in a high performance slimline templated polymorphic package - part of the NXV4 "Math_on_Paper Software" concept, allowing users to work with the computer almost as with pen on paper. Example
cpx<int> i(0,1) ; double + cpx<int> = cpx<double> The class is move-semantix compliant, for superior speed, and slim (all strictly non-class members being implemented as friend operators and functions - for a total of over 27+1205 instantiations of the usual algebraic/logical operators). The class overloads the cout operator to display complex numbers in a pedantic manner. Example cout << boolalpha << i << endl ; (1+i).cpx<double> 1+i The class implements the correct foliage of the sqrt and log functions, as well as exponentiation of complex to the power of complex - together with the full complement of algebraic and logical operators.
This project was realised in the framework of the 05-6-1119-2014/2023 "New Investigation Tools in Computational Physics" research theme, of the Meshcheryakov Laboratory of Information Technologies JINR. |