Skip to content

Commit 66e6678

Browse files
cmdougprj-
authored andcommitted
Add various basic c++ functions
1 parent 0b0d635 commit 66e6678

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

src/fflib/AFunction.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ template<class T> inline T Max (const T &a,const T & b,const T & c){return Max(M
139139
template<class T> inline T Min (const T &a,const T & b,const T & c){return Min(Min(a,b),c);}
140140
template<class T> inline T Min (const T &a,const T & b,const T & c,const T & d){return Min(Min(a,b),Min(c,d));}
141141
template<class T> inline T Max (const T &a,const T & b,const T & c,const T & d){return Max(Max(a,b),Max(c,d));}
142-
142+
template<class T> inline T Fma (const T &a,const T & b,const T & c){return fma(a,b,c);}
143143
template<class T> inline T Square (const T &a){return a*a;}
144144

145145
struct SubArray2 {
@@ -1550,7 +1550,6 @@ void Init_map_type()
15501550
TheOperators->Add("[]",new OneOperator_array );
15511551
TheOperators->Add("[border]",new OneOperator_border );
15521552

1553-
Global.Add("cos","(",new OneOperator1<double>(cos,2));
15541553
Global.Add("square","(",new OneOperator1<long,long,E_F_F0<long,const long &> >(Square));// add FH Mai 2011
15551554
Global.Add("square","(",new OneOperator1<double,double,E_F_F0<double,const double &> >(Square));
15561555
Global.Add("square","(",new OneOperator1<Complex,Complex,E_F_F0<Complex,const Complex &> >(Square));// add FH Mai 2011
@@ -1569,11 +1568,17 @@ void Init_map_type()
15691568
Global.Add("lround","(",new OneOperator1<long,Complex>(lroundc)); // add aout 2020
15701569

15711570
Global.Add("sin","(",new OneOperator1<double>(sin,2));
1571+
Global.Add("cos","(",new OneOperator1<double>(cos,2));
15721572
Global.Add("tan","(",new OneOperator1<double>(tan,2));
1573+
Global.Add("asin","(",new OneOperator1<double>(asin));
1574+
Global.Add("acos","(",new OneOperator1<double>(acos));
15731575
Global.Add("atan","(",new OneOperator1<double>(atan,2));
15741576
Global.Add("sinh","(",new OneOperator1<double>(sinh,2));
15751577
Global.Add("cosh","(",new OneOperator1<double>(cosh,2));
15761578
Global.Add("tanh","(",new OneOperator1<double>(tanh,2));
1579+
Global.Add("asinh","(",new OneOperator1<double>(asinh));
1580+
Global.Add("acosh","(",new OneOperator1<double>(acosh));
1581+
Global.Add("atanh","(",new OneOperator1<double>(atanh));
15771582

15781583
Global.Add("atoi","(",new OneOperator1<long,string*>(atoi));// add march 2010
15791584
Global.Add("atol","(",new OneOperator1<long,string*>(atoi));// add march 2010
@@ -1583,11 +1588,6 @@ void Init_map_type()
15831588
Global.Add("strtol","(",new OneOperator2<long,string*,long>(ffstrtol));// add march 2017
15841589
Global.Add("strtod","(",new OneOperator1<double,string*>(ffstrtod));// add march 2017
15851590

1586-
Global.Add("atanh","(",new OneOperator1<double>(atanh));
1587-
Global.Add("asin","(",new OneOperator1<double>(asin));
1588-
Global.Add("acos","(",new OneOperator1<double>(acos));
1589-
Global.Add("asinh","(",new OneOperator1<double>(asinh));
1590-
Global.Add("acosh","(",new OneOperator1<double>(acosh));
15911591
#ifdef HAVE_ERFC
15921592
Global.Add("erf","(",new OneOperator1<double>(erf));
15931593
Global.Add("erfc","(",new OneOperator1<double>(erfc));
@@ -1606,8 +1606,12 @@ void Init_map_type()
16061606
Global.Add("yn","(",new OneOperator2<double,long,double>(myyn));
16071607
#endif
16081608
Global.Add("exp","(",new OneOperator1<double>(exp));
1609+
Global.Add("exp2","(",new OneOperator1<double>(exp2));
1610+
Global.Add("expm1","(",new OneOperator1<double>(expm1));
16091611
Global.Add("log","(",new OneOperator1<double>(log));
16101612
Global.Add("log10","(",new OneOperator1<double>(log10));
1613+
Global.Add("log1p","(",new OneOperator1<double>(log1p));
1614+
Global.Add("log2","(",new OneOperator1<double>(log2));
16111615
// Global.Add("pow","(",new OneOperator2<double,double>(pow));
16121616
Global.Add("pow","(",new OneBinaryOperator<Op2_pow<double,double,double> >);
16131617
Global.Add("pow","(",new OneBinaryOperator<Op2_pow<long,long,long> >);
@@ -1636,6 +1640,7 @@ void Init_map_type()
16361640
Global.Add("atan2","(",new OneOperator2<double>(atan2));
16371641
Global.Add("fmod","(",new OneOperator2<double>(fmod));// add sep 2017
16381642
Global.Add("fdim","(",new OneOperator2<double>(fdim));// add sep 2017
1643+
Global.Add("fma","(",new OneOperator3_<double, double, double>(Fma));
16391644
Global.Add("fmax","(",new OneOperator2<double>(fmax));// add sep 2017
16401645
Global.Add("fmin","(",new OneOperator2<double>(fmin));// add sep 2017
16411646

src/fflib/array_real.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ void initArrayOperatordouble() {
4848
Global.Add("fabs", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>, K, KK, KN_<K> >(fabs));
4949
Global.Add("abs", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>, K, KK, KN_<K> >(fabs));
5050
Global.Add("cbrt","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(cbrt));
51-
Global.Add("acos", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>, K, KK, KN_<K> >(acos));
52-
Global.Add("asin", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>, K, KK, KN_<K> >(asin));
53-
Global.Add("atan", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>,K, KK, KN_<K> >(atan));
5451
Global.Add("floor", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>,K, KK, KN_<K> >(floor));
5552
Global.Add("ceil", "(", new OneOperator1F_KN_<F_KN_<K, K, K, KK>,K, KK, KN_<K> >(ceil));
5653

src/fflib/array_tlp.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,12 +1991,15 @@ void ArrayOperatorF()
19911991
Global.Add("sin","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(sin));
19921992
Global.Add("cos","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(cos));
19931993
Global.Add("tan","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(tan));
1994-
Global.Add("cosh","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(cosh));
19951994
Global.Add("sinh","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(sinh));
1995+
Global.Add("cosh","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(cosh));
19961996
Global.Add("tanh","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(tanh));
1997-
// Global.Add("acos","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(acos));
1998-
// Global.Add("asin","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(asin));
1999-
// Global.Add("atan","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(atan));
1997+
Global.Add("asin","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(asin));
1998+
Global.Add("acos","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(acos));
1999+
Global.Add("atan","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(atan));
2000+
Global.Add("asinh","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(asinh));
2001+
Global.Add("acosh","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(acosh));
2002+
Global.Add("atanh","(",new OneOperator1F_KN_<F_KN_<K,K,K,KK>,K,KK,KN_<K> >(atanh));
20002003

20012004
TheOperators->Add("=",new OneBinaryOperator<set_eq_array<KN_<K> ,F_KN_<K,K,K,KK> > > ); // add FH juin 2005
20022005
TheOperators->Add("+=",new OneBinaryOperator<set_eq_array_add<KN_<K> ,F_KN_<K,K,K,KK> > > ); // add FH juin 2005

0 commit comments

Comments
 (0)