STK++ 0.9.13
STK_Functors.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff, Université Lille 1, Inria
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact: S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::Functors
27 * created on: 1 oct. 2012
28 * Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 **/
30
36#ifndef STK_FUNCTORS_H
37#define STK_FUNCTORS_H
38
39#include <cmath>
40
41namespace STK
42{
43
44namespace hidden
45{
46
49template< typename Functor, int NbParam_>
51
56template< typename Functor, int NbParam_>
58{
59 private:
60 class Void
61 { class Private {};
62 public:
63 typedef Private Type;
64 };
65 public:
66 typedef typename If< NbParam_ <= Functor::NbParam_
68 , Void>::Result::Type Type;
69};
70
71// specialization, until 4 parameters
72template< typename Functor> struct UsedFunctor<Functor, 1>
73{ typedef typename Functor::param1_type Type;};
74template< typename Functor> struct UsedFunctor<Functor, 2>
75{ typedef typename Functor::param2_type Type;};
76template< typename Functor> struct UsedFunctor<Functor, 3>
77{ typedef typename Functor::param3_type Type;};
78template< typename Functor> struct UsedFunctor<Functor, 4>
79{ typedef typename Functor::param4_type Type;};
80
83template< typename Functor>
85{ typedef typename Functor::result_type result_type;};
86
87
88} // namespace hidden
89
94{
95 enum { NbParam_ = 1 };
96 typedef bool result_type;
97 typedef Char param1_type ;
98 inline TestEndOfLineOp(char* c): last_(c) {}
99
100 inline result_type operator()(Char c) { *last_ = c; return (c == _T('\n'));}
101 private:
103};
104
105//------------------------------------------------------------------------------
106// binary functors:
107//------------------------------------------------------------------------------
111template<class Type1, class Type2 = Type1>
113{
114 enum { NbParam_ = 2 };
115 typedef bool result_type;
118
120 { return value1 == value2;}
121};
125template<class Type1, class Type2 = Type1>
127{
128 enum { NbParam_ = 2 };
129 typedef bool result_type;
132
134 { return value1 != value2;}
135};
139template<class Type1, class Type2 = Type1>
140struct LessOp
141{
142 enum { NbParam_ = 2 };
143 typedef bool result_type;
146
148 { return value1 < value2;}
149};
153template<class Type1, class Type2 = Type1>
155{
156 enum { NbParam_ = 2 };
157 typedef bool result_type;
160
162 { return value1 > value2;}
163};
167template<class Type1, class Type2 = Type1>
168struct LeqOp
169{
170 enum { NbParam_ = 2 };
171 typedef bool result_type;
174
176 { return value1 <= value2;}
177};
181template<class Type1, class Type2 = Type1>
182struct GeqOp
183{
184 enum { NbParam_ = 2 };
185 typedef bool result_type;
188
190 { return value1 >= value2;}
191};
192
196template<class Type1, class Type2 = Type1>
197struct SumOp
198{
199 enum { NbParam_ = 2 };
203
204 inline result_type operator()(param1_type a, param2_type b) const { return a + b;}
205};
209template<class Type1, class Type2 = Type1>
211{
212 enum { NbParam_ = 2 };
216
217 inline result_type operator()(param1_type a, param2_type b) const { return a - b;}
218};
222template<class Type1, class Type2 = Type1>
224{
225 enum { NbParam_ = 2 };
229
230 inline result_type operator()(param1_type a, param2_type b) const { return a * b;}
231};
235template<class Type1, class Type2 = Type1>
237{
238 enum { NbParam_ = 2 };
242
243 inline result_type operator()(param1_type a, param2_type b) const { return a / b;}
244};
248template<class Type1, class Type2 = Type1>
250{
251 enum { NbParam_ = 2 };
255
256 inline result_type operator()(param1_type a, param2_type b) const { return a % b;}
257};
261template<class Type1, class Type2 = Type1>
275template<class Type1, class Type2 = Type1>
289template<class Type1, class Type2 = Type1>
291{
292 enum { NbParam_ = 2 };
293 typedef bool result_type;
296
297 inline result_type operator()(param1_type a, param2_type b) const { return a && b;}
298};
302template<class Type1, class Type2 = Type1>
304{
305 enum { NbParam_ = 2 };
306 typedef bool result_type;
309
310 inline result_type operator()(param1_type a, param2_type b) const { return a || b;}
311};
315template<class Type1, class Type2 = Type1>
317{
318 enum { NbParam_ = 2 };
322
323 inline result_type operator()(param1_type a, param2_type b) const { return a & b;}
324};
328template<class Type1, class Type2 = Type1>
330{
331 enum { NbParam_ = 2 };
335
336 inline result_type operator()(param1_type a, param2_type b) const { return a | b;}
337};
341template<class Type1, class Type2 = Type1>
343{
344 enum { NbParam_ = 2 };
348
349 inline result_type operator()(param1_type a, param2_type b) const { return a ^ b;}
350};
351
352//------------------------------------------------------------------------------
353// unary functors:
354//------------------------------------------------------------------------------
358template<class Type>
359struct IsNaOp
360{
361 enum { NbParam_ = 1 };
362 typedef bool result_type;
364
365 inline result_type operator()(param1_type const& value) const
366 { return Arithmetic<param1_type>::isNA(value);}
367};
371template<class Type>
372struct NegOp
373{
374 enum { NbParam_ = 1 };
375 typedef bool result_type;
377
378 inline result_type operator()(param1_type const& value) const { return !value;}
379};
383template<class Type>
385{
386 enum { NbParam_ = 1 };
387 typedef bool result_type;
389
390 inline result_type operator()(param1_type const& value) const
391 { return Arithmetic<param1_type>::isFinite(value);}
392};
396template<class Type>
398{
399 enum { NbParam_ = 1 };
400 typedef bool result_type;
402
405};
409template<typename Type>
411{
412 enum { NbParam_ = 1 };
413 typedef bool result_type;
415
416 inline EqualWithOp(EqualWithOp const& value): value_(value.value_) {}
417 inline EqualWithOp(Type value): value_(value) {}
418
419 inline result_type operator() (param1_type const& a) const { return a == value_;}
420 private:
422};
426template<typename Type>
428{
429 enum { NbParam_ = 1 };
430 typedef bool result_type;
432
433 inline NotEqualWithOp(NotEqualWithOp const& value): value_(value.value_) {}
434 inline NotEqualWithOp(Type value): value_(value) {}
435
436 inline result_type operator() (param1_type const& a) const { return a != value_;}
437 private:
439};
443template<typename Type>
445{
446 enum { NbParam_ = 1 };
447 typedef bool result_type;
449
450 inline LessThanOp(LessThanOp const& value): value_(value.value_) {}
451 inline LessThanOp(Type value): value_(value) {}
452
453 inline result_type operator() (param1_type const& a) const { return a < value_;}
454 private:
456};
460template<typename Type>
462{
463 enum { NbParam_ = 1 };
464 typedef bool result_type;
466
467 inline GreaterThanOp(GreaterThanOp const& value): value_(value.value_) {}
468 inline GreaterThanOp(Type value): value_(value) {}
469
470 inline result_type operator() (param1_type const& a) const { return a > value_;}
471 private:
473};
477template<typename Type>
479{
480 enum { NbParam_ = 1 };
481 typedef bool result_type;
483
484 inline LeqThanOp(LeqThanOp const& value): value_(value.value_) {}
485 inline LeqThanOp(Type value): value_(value) {}
486
487 inline result_type operator() (param1_type const& a) const { return (a <= value_);}
488 private:
490};
494template<typename Type>
496{
497 enum { NbParam_ = 1 };
498 typedef bool result_type;
500
501 inline GeqThanOp(GeqThanOp const& value): value_(value.value_) {}
502 inline GeqThanOp(Type value): value_(value) {}
503
504 inline result_type operator() (param1_type const& a) const { return a >= value_;}
505 private:
507};
511template<typename Type>
513{
514 enum { NbParam_ = 1 };
515 typedef Type result_type;
517
518 inline SumWithOp(SumWithOp const& value): value_(value.value_) {}
519 inline SumWithOp(Type value): value_(value) {}
520
521 inline result_type operator() (param1_type const& a) const { return a + value_;}
522 private:
524};
528template<typename Type>
530{
531 enum { NbParam_ = 1 };
532 typedef Type result_type;
534
535 inline DifferenceWithOp(DifferenceWithOp const& value): value_(value.value_) {}
536 inline DifferenceWithOp(Type value): value_(value) {}
537
538 inline result_type operator() (param1_type const& a) const { return a - value_;}
539 private:
541};
545template<typename Type>
547{
548 enum { NbParam_ = 1 };
549 typedef Type result_type;
551
552 inline SubstractToOp(SubstractToOp const& value): value_(value.value_) {}
553 inline SubstractToOp(Type value): value_(value) {}
554
555 inline result_type operator() (param1_type const& a) const { return value_ - a;}
556 private:
558};
562template<typename Type>
564{
565 enum { NbParam_ = 1 };
566 typedef Type result_type;
568
569 inline ProductWithOp(Type value): value_(value) {}
570 inline ProductWithOp(ProductWithOp const& value): value_(value.value_) {}
571
572 inline result_type operator() (param1_type const& a) const {return a * value_;}
573 private:
575};
579template<>
581{
582 enum { NbParam_ = 1 };
583 typedef bool const result_type;
584 typedef bool const param1_type;
585
586 inline ProductWithOp(bool value): value_(value) {}
587 inline ProductWithOp( ProductWithOp const& value): value_(value.value_) {}
588
589 inline result_type operator() (param1_type const& a) const {return a && value_;}
590 private:
591 bool const value_;
592};
596template<typename Type, bool IsInt>
598
599template<typename Type>
601{
603 inline DivisionWithBaseOp(const DivisionWithBaseOp& value): value_(value.value_) {}
604 inline DivisionWithBaseOp(param1_type const& value): value_( static_cast<Type>(1) / value) {}
605
606 inline Type const operator() (param1_type const& a) const { return a * value_;}
607 private:
609};
610
611template<typename Type>
613{
615 inline DivisionWithBaseOp( DivisionWithBaseOp const& value): value_(value.value_) {}
616 inline DivisionWithBaseOp( param1_type value): value_(value) {}
617
618 inline Type const operator()( param1_type a) const { return a / value_;}
619 private:
621};
628template<typename Type>
629struct DivisionWithOp: public DivisionWithBaseOp<Type, hidden::IsInt<Type>::yes >
630{
631 enum { NbParam_ = 1 };
632 typedef Type result_type;
634
635 inline DivisionWithOp(param1_type const& value): DivisionWithBaseOp<Type, hidden::IsInt<Type>::yes >(value) {}
636};
640template<typename Type>
642{
643 enum { NbParam_ = 1 };
644 typedef Type result_type;
646
647 inline ModuloWithOp(Type const& value): value_(value) {}
648 inline ModuloWithOp( ModuloWithOp const& value): value_(value.value_) {}
649
650 inline result_type operator() (param1_type const& a) const {return a % value_;}
651 private:
653};
657template<typename Type>
659{
660 enum { NbParam_ = 1 };
661 typedef Type result_type;
663
664 inline MinWithOp(Type const& value): value_(value) {}
665 inline MinWithOp( MinWithOp const& value): value_(value.value_) {}
666
667 inline result_type operator() (param1_type const& a) const {return std::min(a,value_);}
668 private:
670};
674template<typename Type>
676{
677 enum { NbParam_ = 1 };
678 typedef Type result_type;
680
681 inline MaxWithOp(Type const& value): value_(value) {}
682 inline MaxWithOp( MaxWithOp const& value): value_(value.value_) {}
683
684 inline result_type operator() (param1_type const& a) const {return std::max(a,value_);}
685 private:
687};
691template<typename Type>
693{
694 enum { NbParam_ = 1 };
695 typedef bool result_type;
697
698 inline LogicalAndWithOp(LogicalAndWithOp const& value): value_(value.value_) {}
699 inline LogicalAndWithOp(Type value): value_(value) {}
700
701 inline result_type operator() (param1_type const& a) const { return a && value_;}
702 private:
704};
708template<typename Type>
710{
711 enum { NbParam_ = 1 };
712 typedef bool result_type;
714
715 inline LogicalOrWithOp(LogicalOrWithOp const& value): value_(value.value_) {}
716 inline LogicalOrWithOp(Type value): value_(value) {}
717
718 inline result_type operator() (param1_type const& a) const { return a || value_;}
719 private:
721};
725template<typename Type>
727{
728 enum { NbParam_ = 1 };
729 typedef Type result_type;
731
732 inline BitwiseAndWithOp(BitwiseAndWithOp const& value): value_(value.value_) {}
733 inline BitwiseAndWithOp(Type const& value): value_(value) {}
734
735 inline result_type operator() (param1_type const& a) const {return a & value_;}
736 private:
738};
742template<typename Type>
744{
745 enum { NbParam_ = 1 };
746 typedef Type result_type;
748
749 inline BitwiseOrWithOp(BitwiseOrWithOp const& value): value_(value.value_) {}
750 inline BitwiseOrWithOp(Type const& value): value_(value) {}
751
752 inline result_type operator() (param1_type const& a) const {return a | value_;}
753 private:
755};
759template<typename Type>
761{
762 enum { NbParam_ = 1 };
763 typedef Type result_type;
765
766 inline BitwiseXorWithOp(BitwiseXorWithOp const& value): value_(value.value_) {}
767 inline BitwiseXorWithOp(Type const& value): value_(value) {}
768
769 inline result_type operator() (param1_type const& a) const {return a ^ value_;}
770 private:
772};
773
774
775// Functors without value_
779template<class Type>
781{
782 enum { NbParam_ = 1 };
783 typedef Type result_type;
785
786 inline result_type operator()(param1_type const& a) const { return -a;}
787};
791template<class Type>
792struct SafeOp
793{
794 enum { NbParam_ = 1 };
795 typedef Type result_type;
797
798 inline SafeOp(Type const value = Type()): value_(value) {}
799 inline SafeOp( SafeOp const& value): value_(value.value_) {}
800
801 inline result_type operator()(param1_type const& a) const
802 { return Arithmetic<Type>::isFinite(a) ? a: value_;}
803 private:
804 Type const value_;
805};
810template<typename Type>
812{
813 enum { NbParam_ = 1 };
814 typedef Type result_type;
816
818 inline SafeInverseOp( SafeInverseOp const& value): tol_(value.tol_) {}
819
820 inline result_type operator()(param1_type const& a) const
821 { return (std::abs(a)>tol_) ? Type(1)/a: Type(0);}
822 private:
823 Type const tol_;
824};
828template<class Type>
829struct AbsOp
830{
831 enum { NbParam_ = 1 };
832 typedef Type result_type;
834
835 inline result_type operator()(param1_type const& a) const { return std::abs(a);}
836};
840template<class Type>
841struct ExpOp
842{
843 enum { NbParam_ = 1 };
844 typedef Type result_type;
846
847 inline result_type operator()(param1_type const& a) const {return std::exp(a);}
848};
852template<class Type>
853struct LogOp
854{
855 enum { NbParam_ = 1 };
856 typedef Type result_type;
858
859 inline result_type operator()(param1_type const& a) const {return std::log(a);}
860};
864template<typename Type> struct SqrtOp
865{
866 enum { NbParam_ = 1 };
867 typedef Type result_type;
869
870 inline result_type operator()(param1_type const& a) const { return std::sqrt(a);}
871};
875template<typename Type> struct CosOp
876{
877 enum { NbParam_ = 1 };
878 typedef Type result_type;
880
881 inline result_type operator() (param1_type const& a) const { return std::cos(a);}
882};
886template<typename Type> struct SinOp
887{
888 enum { NbParam_ = 1 };
889 typedef Type result_type;
891
892 inline result_type operator() (param1_type const& a) const { return std::sin(a);}
893};
897template<typename Type> struct TanOp
898{
899 enum { NbParam_ = 1 };
900 typedef Type result_type;
902
903 inline result_type operator() (param1_type const& a) const { return std::tan(a);}
904};
908template<typename Type> struct AcosOp
909{
910 enum { NbParam_ = 1 };
911 typedef Type result_type;
913
914 inline result_type operator() (param1_type const& a) const { return std::acos(a);}
915};
919template<typename Type> struct AsinOp
920{
921 enum { NbParam_ = 1 };
922 typedef Type result_type;
924
925 inline result_type operator() (param1_type const& a) const { return std::asin(a);}
926};
930template<typename Type>
931struct PowOp
932{
933 enum { NbParam_ = 1 };
934 typedef Type result_type;
936
937 inline PowOp(PowOp const& value): exponent_(value.exponent_) {}
939
940 inline result_type operator()(param1_type const& a) const { return std::pow(a, exponent_);}
941 private:
942 const Type exponent_;
943};
947template<typename Type>
949{
950 enum { NbParam_ = 1 };
951 typedef Type result_type;
953
954 inline result_type operator() (param1_type const& a) const { return Type(1)/a;}
955};
959template<typename Type>
961{
962 enum { NbParam_ = 1 };
963 typedef Type result_type;
965
966 inline result_type operator() (param1_type const& a) const { return a*a;}
967};
968
972template<typename Type>
973struct CubeOp
974{
975 enum { NbParam_ = 1 };
976 typedef Type result_type;
978
979 inline result_type operator() (param1_type const& a) const { return a*a*a;}
980};
984template<typename Type, typename OtherType>
985struct CastOp
986{
987 enum { NbParam_ = 1 };
990
991 inline result_type operator()(param1_type const& a) const { return static_cast<OtherType>(a);}
992};
993
994} // namespace STK
995
996
997#endif /* STK_FUNCTORS_H */
#define _T(x)
Let x unmodified.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
char Char
STK fundamental type of a Char.
The namespace STK is the main domain space of the Statistical ToolKit project.
Template functor which compute the absolute value of a number.
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &a) const
Template functor which compute the arc cosine of a number.
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &a) const
Arithmetic properties of STK fundamental types.
static bool isFinite(Type const &x)
static bool isInfinite(Type const &x)
static bool isNA(Type const &x)
Template functor which compute the arc sine of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the bitwise and of two numbers.
result_type operator()(param1_type a, param2_type b) const
hidden::RemoveConst< Type1 >::Type const & param1_type
hidden::Promote< Type1, Type2 >::result_type result_type
hidden::RemoveConst< Type2 >::Type const & param2_type
Template functor to compute the bitwise and with a fixed value.
result_type operator()(param1_type const &a) const
BitwiseAndWithOp(Type const &value)
hidden::RemoveConst< Type >::Type param1_type
BitwiseAndWithOp(BitwiseAndWithOp const &value)
param1_type const value_
Template functor which compute the bitwise or of two numbers.
hidden::Promote< Type1, Type2 >::result_type result_type
hidden::RemoveConst< Type1 >::Type const & param1_type
result_type operator()(param1_type a, param2_type b) const
hidden::RemoveConst< Type2 >::Type const & param2_type
Template functor to compute the bitwise or with a fixed value.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
param1_type const value_
BitwiseOrWithOp(Type const &value)
BitwiseOrWithOp(BitwiseOrWithOp const &value)
Template functor which compute the bitwise xor of two numbers.
result_type operator()(param1_type a, param2_type b) const
hidden::RemoveConst< Type1 >::Type const & param1_type
hidden::RemoveConst< Type2 >::Type const & param2_type
hidden::Promote< Type1, Type2 >::result_type result_type
Template functor to compute the bitwise xor with a fixed value.
result_type operator()(param1_type const &a) const
BitwiseXorWithOp(BitwiseXorWithOp const &value)
BitwiseXorWithOp(Type const &value)
param1_type const value_
hidden::RemoveConst< Type >::Type param1_type
Template functor which cast a type to another type.
result_type operator()(param1_type const &a) const
OtherType result_type
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the cosine of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the cube of a number.
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &a) const
Template functor which compute the difference of two numbers.
hidden::RemoveConst< Type2 >::Type const & param2_type
hidden::Promote< Type1, Type2 >::result_type result_type
result_type operator()(param1_type a, param2_type b) const
hidden::RemoveConst< Type1 >::Type const & param1_type
Template functor to add a number to a fixed value.
param1_type const value_
DifferenceWithOp(DifferenceWithOp const &value)
DifferenceWithOp(Type value)
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the division of two numbers.
hidden::RemoveConst< Type1 >::Type const & param1_type
result_type operator()(param1_type a, param2_type b) const
hidden::RemoveConst< Type2 >::Type const & param2_type
hidden::Promote< Type1, Type2 >::result_type result_type
hidden::RemoveConst< Type >::Type param1_type
DivisionWithBaseOp(const DivisionWithBaseOp &value)
DivisionWithBaseOp(param1_type const &value)
Type const operator()(param1_type a) const
DivisionWithBaseOp(DivisionWithBaseOp const &value)
hidden::RemoveConst< Type >::Type param1_type
base class for DivisionWithOp functors
Template functor to divide a number by a fixed value.
DivisionWithOp(param1_type const &value)
hidden::RemoveConst< Type >::Type param1_type
Template functor testing if a number is equal to an other number.
hidden::RemoveConst< Type1 >::Type param1_type
result_type operator()(param1_type const &value1, param2_type value2) const
hidden::RemoveConst< Type2 >::Type const & param2_type
Template functor to test if a number is equal to a fixed value.
result_type operator()(param1_type const &a) const
param1_type const value_
EqualWithOp(Type value)
EqualWithOp(EqualWithOp const &value)
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the exponential of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor testing if a number is greater or equal than an other number.
hidden::RemoveConst< Type1 >::Type param1_type
result_type operator()(param1_type const &value1, param2_type value2) const
hidden::RemoveConst< Type2 >::Type const & param2_type
Template functor to test if a number is greater or equal than a fixed value.
GeqThanOp(GeqThanOp const &value)
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &a) const
GeqThanOp(Type value)
param1_type const value_
Template functor testing if a number is greater than an other number.
hidden::RemoveConst< Type2 >::Type const & param2_type
result_type operator()(param1_type const &value1, param2_type value2) const
hidden::RemoveConst< Type1 >::Type param1_type
Template functor to test if a number is greater than a fixed value.
GreaterThanOp(GreaterThanOp const &value)
GreaterThanOp(Type value)
param1_type const value_
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &a) const
Template functor which compute the inverse of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor testing if a number is a finite value.
result_type operator()(param1_type const &value) const
hidden::RemoveConst< Type >::Type param1_type
Template functor testing if a number is an infinite value.
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &value1) const
Template functor testing if a number is a NA value.
result_type operator()(param1_type const &value) const
hidden::RemoveConst< Type >::Type param1_type
Template functor testing if a number is less or equal than an other number.
hidden::RemoveConst< Type1 >::Type param1_type
result_type operator()(param1_type const &value1, param2_type value2) const
hidden::RemoveConst< Type2 >::Type const & param2_type
Template functor to test if a number is less or equal than a fixed value.
LeqThanOp(Type value)
param1_type const value_
hidden::RemoveConst< Type >::Type param1_type
LeqThanOp(LeqThanOp const &value)
result_type operator()(param1_type const &a) const
Template functor testing if a number is less than an other number.
result_type operator()(param1_type const &value1, param2_type value2) const
hidden::RemoveConst< Type1 >::Type param1_type
hidden::RemoveConst< Type2 >::Type const & param2_type
Template functor to test if a number is less than a fixed value.
param1_type const value_
LessThanOp(Type value)
LessThanOp(LessThanOp const &value)
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the logarithm of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the logical and of two numbers.
hidden::RemoveConst< Type2 >::Type const & param2_type
hidden::RemoveConst< Type1 >::Type const & param1_type
result_type operator()(param1_type a, param2_type b) const
Template functor computing logical and with a fixed value.
param1_type const value_
LogicalAndWithOp(Type value)
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
LogicalAndWithOp(LogicalAndWithOp const &value)
Template functor which compute the logical or of two numbers.
hidden::RemoveConst< Type1 >::Type const & param1_type
hidden::RemoveConst< Type2 >::Type const & param2_type
result_type operator()(param1_type a, param2_type b) const
Template functor computing logical and with a fixed value.
hidden::RemoveConst< Type >::Type param1_type
LogicalOrWithOp(Type value)
LogicalOrWithOp(LogicalOrWithOp const &value)
result_type operator()(param1_type const &a) const
param1_type const value_
Template functor which compute the maximum of two numbers.
hidden::RemoveConst< Type1 >::Type param1_type
hidden::RemoveConst< Type2 >::Type const & param2_type
result_type operator()(param1_type const &value1, param2_type value2) const
hidden::Promote< Type1, Type2 >::result_type result_type
Template functor to compute the minimum with a fixed value.
result_type operator()(param1_type const &a) const
param1_type const value_
hidden::RemoveConst< Type >::Type param1_type
MaxWithOp(MaxWithOp const &value)
MaxWithOp(Type const &value)
Template functor which compute the minimum of two numbers.
result_type operator()(param1_type const &value1, param2_type value2) const
hidden::Promote< Type1, Type2 >::result_type result_type
hidden::RemoveConst< Type1 >::Type param1_type
hidden::RemoveConst< Type2 >::Type const & param2_type
Template functor to compute the minimum between a fixed value.
hidden::RemoveConst< Type >::Type param1_type
MinWithOp(Type const &value)
result_type operator()(param1_type const &a) const
MinWithOp(MinWithOp const &value)
param1_type const value_
Template functor which compute the modulo of two numbers.
hidden::RemoveConst< Type1 >::Type const & param1_type
hidden::RemoveConst< Type2 >::Type const & param2_type
result_type operator()(param1_type a, param2_type b) const
hidden::Promote< Type1, Type2 >::result_type result_type
Template functor to compute the minimum with a fixed value.
param1_type const value_
ModuloWithOp(Type const &value)
result_type operator()(param1_type const &a) const
ModuloWithOp(ModuloWithOp const &value)
hidden::RemoveConst< Type >::Type param1_type
Template functor giving the not value.
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &value) const
Template functor testing if a number is not equal to an other number.
hidden::RemoveConst< Type1 >::Type param1_type
hidden::RemoveConst< Type2 >::Type const & param2_type
result_type operator()(param1_type const &value1, param2_type value2) const
Template functor to test if a number is different than a fixed value.
NotEqualWithOp(Type value)
NotEqualWithOp(NotEqualWithOp const &value)
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
param1_type const value_
Template functor which compute the opposite of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor to raise a number to a power.
const Type exponent_
PowOp(PowOp const &value)
result_type operator()(param1_type const &a) const
PowOp(Type exponent)
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the product of two numbers.
hidden::RemoveConst< Type2 >::Type const & param2_type
hidden::RemoveConst< Type1 >::Type const & param1_type
hidden::Promote< Type1, Type2 >::result_type result_type
result_type operator()(param1_type a, param2_type b) const
ProductWithOp(ProductWithOp const &value)
Template functor computing the product of a number by a fixed value.
ProductWithOp(ProductWithOp const &value)
param1_type const value_
ProductWithOp(Type value)
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &a) const
Template functor which compute safely the inverse of a number.
hidden::RemoveConst< Type >::Type param1_type
SafeInverseOp(SafeInverseOp const &value)
result_type operator()(param1_type const &a) const
SafeInverseOp(Type const &tol=Arithmetic< Type >::epsilon())
Template functor which return a default value if the value is NA.
SafeOp(Type const value=Type())
SafeOp(SafeOp const &value)
Type const value_
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the sine of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the square root of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor which compute the square of a number.
result_type operator()(param1_type const &a) const
hidden::RemoveConst< Type >::Type param1_type
Template functor to subtract a number to a fixed value.
result_type operator()(param1_type const &a) const
SubstractToOp(SubstractToOp const &value)
hidden::RemoveConst< Type >::Type param1_type
SubstractToOp(Type value)
param1_type const value_
Template functor which compute the sum of two numbers.
hidden::Promote< Type1, Type2 >::result_type result_type
result_type operator()(param1_type a, param2_type b) const
hidden::RemoveConst< Type1 >::Type const & param1_type
hidden::RemoveConst< Type2 >::Type const & param2_type
Template functor to add a number to a fixed value.
SumWithOp(Type value)
hidden::RemoveConst< Type >::Type param1_type
SumWithOp(SumWithOp const &value)
param1_type const value_
result_type operator()(param1_type const &a) const
Template functor which compute the tan of a number.
hidden::RemoveConst< Type >::Type param1_type
result_type operator()(param1_type const &a) const
Template functor testing if a Char is an end of line.
result_type operator()(Char c)
produce the Nth parameter type of Functor.
produce the return type of the Functor.
If<(sizeof(Type1)>sizeof(Type2)), Type1, Type2 >::Result result_type
The functor to use.