File tree Expand file tree Collapse file tree 5 files changed +12
-0
lines changed
include/Rcpp/sugar/functions Expand file tree Collapse file tree 5 files changed +12
-0
lines changed Original file line number Diff line number Diff line change
1
+ 2017-01-07 James J Balamuta <
[email protected] >
2
+
3
+ * inst/include/Rcpp/sugar/functions/complex.h: Added Arg() function
4
+ * inst/unitTests/runit.sugar.R: Added Arg() unit test to complex list
5
+ * inst/unitTests/cpp/sugar.cpp: Idem
6
+
1
7
2017-01-06 Dirk Eddelbuettel <
[email protected] >
2
8
3
9
* DESCRIPTION (Version, Date): Mark new minor version
Original file line number Diff line number Diff line change 18
18
\itemize {
19
19
\item Added new Sugar function \code {sample()} (Nathan Russell in
20
20
\ghpr {610 }).
21
+ \item Added new Sugar function \code {Arg()} (James Balamuta in
22
+ \ghpr {626 } addressing \ghit {625 }).
21
23
}
22
24
\item Changes in Rcpp unit tests
23
25
\itemize {
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ inline double complex__Re( Rcomplex x){ return x.r ; }
68
68
y.i = -x.i ;
69
69
return y ;
70
70
}
71
+ inline double complex__Arg ( Rcomplex x ){ return ::atan2 (x.i , x.r ); }
71
72
// TODO: this does not use HAVE_C99_COMPLEX as in R, perhaps it should
72
73
inline Rcomplex complex__exp ( Rcomplex x){
73
74
Rcomplex y ;
@@ -249,6 +250,7 @@ inline Rcomplex complex__tanh(Rcomplex z)
249
250
RCPP_SUGAR_COMPLEX ( Re, double )
250
251
RCPP_SUGAR_COMPLEX ( Im, double )
251
252
RCPP_SUGAR_COMPLEX ( Mod, double )
253
+ RCPP_SUGAR_COMPLEX ( Arg, double )
252
254
RCPP_SUGAR_COMPLEX ( Conj, Rcomplex )
253
255
RCPP_SUGAR_COMPLEX ( exp, Rcomplex )
254
256
RCPP_SUGAR_COMPLEX ( log, Rcomplex )
Original file line number Diff line number Diff line change @@ -402,6 +402,7 @@ List runit_complex( ComplexVector cx ){
402
402
_[" Im" ] = Im ( cx ),
403
403
_[" Conj" ] = Conj ( cx ),
404
404
_[" Mod" ] = Mod ( cx ),
405
+ _[" Arg" ] = Arg ( cx ),
405
406
_[" exp" ] = exp ( cx ),
406
407
_[" log" ] = log ( cx ),
407
408
_[" sqrt" ] = sqrt ( cx ),
Original file line number Diff line number Diff line change @@ -441,6 +441,7 @@ if (.runThisTest) {
441
441
Im = Im(x ),
442
442
Conj = Conj(x ),
443
443
Mod = Mod(x ),
444
+ Arg = Arg(x ),
444
445
exp = exp(x ),
445
446
log = log(x ),
446
447
sqrt = sqrt(x ),
You can’t perform that action at this time.
0 commit comments