Line data Source code
1 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 : !!!! !!!!
4 : !!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5 : !!!! !!!!
6 : !!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7 : !!!! !!!!
8 : !!!! This file is part of the ParaMonte library. !!!!
9 : !!!! !!!!
10 : !!!! LICENSE !!!!
11 : !!!! !!!!
12 : !!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13 : !!!! !!!!
14 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15 : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16 :
17 : !> \brief
18 : !> This file contains the implementation details of the routines under
19 : !> the generic interfaces of module [pm_complexDiv](@ref pm_complexDiv).
20 : !>
21 : !> \finmain
22 : !>
23 : !> \author
24 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
25 :
26 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 :
28 : #if getDiv_CK_ENABLED
29 : real(CKC) :: r, d
30 4002 : CHECK_ASSERTION(__LINE__, divisor /= (0._CKC, 0._CKC), SK_"@getDiv(): The condition `divisor /= (0._CKC, 0._CKC)` must hold. divisor = "//getStr(divisor))
31 4002 : if (abs(divisor%re) < abs(divisor%im)) then
32 475 : r = divisor%re / divisor%im
33 475 : d = divisor%im + r * divisor%re
34 475 : quotient%re = (dividend%re * r + dividend%im) / d
35 475 : quotient%im = (dividend%im * r - dividend%re) / d
36 : else
37 3527 : r = divisor%im / divisor%re
38 3527 : d = divisor%re + r * divisor%im
39 3527 : quotient%re = (dividend%re + dividend%im * r) / d
40 3527 : quotient%im = (dividend%im - dividend%re * r) / d
41 : end if
42 : #else
43 : #error "Unrecognized interface."
44 : #endif
45 :
46 :
|