aimstil  5.0.5
TExpr.h
Go to the documentation of this file.
1 #ifndef TIL_TEXPR_H
2 #define TIL_TEXPR_H
3 
8 
9 // NB: I think the reason to rewrite placeholders was that standard placeholders would
10 // be a bit cumbersome to use with image iterators. More precisely, when we pass an image
11 // iterator to a functor like _1 += 10, we would like _1 to be actually interpreted as
12 // *(iterator), i.e. the value of this point. But we also would like to write more advanced
13 // stuff by binding the iterator to some image measure, say bind(isIsolatedPoint, _1), to test
14 // whether current pixel is isolated. Now, what is passed to this function is not
15 // the value of the pixel anymore, but truely the iterator, that has access to all of its
16 // neighbors.
17 
18 
19 // includes from STL
20 #include <algorithm>
21 #include <functional>
22 
23 // includes from TIL library
24 #include "til/til_common.h"
25 #include "til/templateTools.h"
26 #include "til/TExprBasicFunctors.h"
27 #include "til/TExprConcatenation.h"
28 #include "til/TExprPlaceHolders.h"
29 #include "til/TExprMacros.h"
30 
31 
32 namespace til {
33 
35  namespace expr {
36 
37 
38  //---------------------------------------------------------------------------------------------------
39 
40  //-----------------//
41  // TExprConstant //
42  //-----------------//
43 
44 
46  // TODO: I wonder if declaring a 'const T' brings any possible compiler optimization here...
47  // On the other hand, it might bring us some painful headaches when composed with other TExpr's?
48  // Well, let's keep it till it breaks :/
49  template < typename T >
51  {
52  public: // typedefs
53 
54  EXPR_RESULT_TYPE(const T);
55 
56  public: // constuctors
57 
58  TExprConstant(T value) : m_value(value) {}
59 
60  public: // operators
61 
62  // I am not using the macros here to avoid painful warnings on the lines 'unused variable i1'
63  template < class Iterator1 >
64  typename TypeStruct<Iterator1>::Type
65  operator()(Iterator1 &)
66  { return m_value; }
67 
68  template < class Iterator1, class Iterator2>
69  typename TypeStruct<Iterator1, Iterator2>::Type
70  operator()(Iterator1 &, Iterator2 &)
71  { return m_value; }
72 
73  template < class Iterator1, class Iterator2, class Iterator3 >
74  typename TypeStruct<Iterator1, Iterator2, Iterator3>::Type
75  operator()(Iterator1 &, Iterator2 &, Iterator3 &)
76  { return m_value; }
77 
78  /*
79  EXPRFUNC_1ARG(operator(), return m_value;);
80  EXPRFUNC_2ARG(operator(), return m_value;);
81  EXPRFUNC_3ARG(operator(), return m_value;);
82  */
83 
84  private: // data
85 
86  const T m_value;
87  };
88 
89 
90  //---------------------------------------------------------------------------------------------------
91 
92  //---------//
93  // TExpr //
94  //---------//
95 
96 
97 
98 #define TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR(name, functor) \
99 TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR_EXPR(name, functor) \
100 TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR_VALUE(name, functor) \
101 
102 // NB: to be undefined after the definition of TExpr
103 #define TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR_EXPR(name, functor) \
104 template < typename Expr2 > \
105 TExpr<TExprBinaryOperator_NoRes<Expr, Expr2, functor> > \
106 name (const TExpr<Expr2> &e) const \
107 { \
108  typedef TExprBinaryOperator_NoRes< Expr, Expr2, functor > TExprRet; \
109  return TExpr<TExprRet>(TExprRet(this->getExpr(), e.getExpr(), functor ())); \
110 } \
111 
112 
113 #define TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR_VALUE(name, functor) \
114 template < typename T > \
115 TExpr<TExprBinaryOperator_NoRes<Expr, TExprConstant<T>, functor> > \
116 name (const T & value) const \
117 { \
118  typedef TExprBinaryOperator_NoRes< Expr, TExprConstant<T>, functor > TExprRet; \
119  return TExpr<TExprRet>(TExprRet(this->getExpr(), TExprConstant<T>(value), functor ())); \
120 } \
121 
122 
127  template < class Expr >
128  class TExpr
129  {
130  public: // typedefs
131 
132  typedef void IsATExpr;
133 
134  EXPR_RESULT_TYPE(typename Expr::template TypeStruct<Iterator1 TIL_COMMA Iterator2 TIL_COMMA Iterator3>::Type);
135 
136  public: // constructors & destructor
137 
138  explicit TExpr() : m_e() {}
139  TExpr(const Expr &e) : m_e(e) {}
140 
141  public: // set & get
142  const Expr & getExpr() const { return m_e; }
143 
144  public: // functions
145 
146  EXPRFUNC_1ARG(operator(), return m_e(i1););
147  EXPRFUNC_2ARG(operator(), return m_e(i1, i2););
148  EXPRFUNC_3ARG(operator(), return m_e(i1, i2, i3););
149 
150  public: // operators
151 
153  template < typename Expr2 >
154  //TExpr< TExprAssign< Expr, Expr2 > >
156  operator=(const TExpr<Expr2> &e2) const
157  {
159  return TExpr<TExprRet>(TExprRet(this->getExpr(), e2.getExpr(), functor::Assign()));
160  }
161 
163  template < typename T >
165  operator=(const T &value) const
166  {
168  return TExpr<TExprRet>(TExprRet(this->getExpr(), TExprConstant<T>(value), functor::Assign()));
169  }
170 
171  template < typename Expr2 >
173  operator()(const TExpr<Expr2> & e2) const
174  {
176  return TExpr<TExprRet>(TExprRet(this->getExpr(), e2.getExpr(), functor::Call()));
177  }
178 
179  public: // self-arithmetic operators
180 
185 
186  private: // data
187  Expr m_e;
188  };
189 
190 #undef TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR
191 #undef TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR_EXPR
192 #undef TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR_VALUE
193 
194 
195  //---------------------------------------------------------------------------------------------------
196 
197  //--------------------------//
198  // Placeholders instances //
199  //--------------------------//
200 
201  // TODO: is it really bad to have const instead of singletons? I think
202  // in case of a stateless operator, this does not really matter, so simpler is
203  // probably better.
210 
211 
212  //---------------------------------------------------------------------------------------------------
213 
214  //--------------//
215  // TExprValue //
216  //--------------//
217 
221  // depraciated
222  template < int N, typename T >
224  {
225  public: // typdefs
226  //typedef const T Type;
227 
228  template < typename Iterator1, typename Iterator2 = Iterator1, typename Iterator3 = Iterator1 >
229  struct TypeStruct
230  {
231  typedef const T Type;
232  };
233 
234 
235  public:
236 
237  /*
238  EXPRFUNC_1ARG(operator(), return N; );
239  EXPRFUNC_2ARG(operator(), return N; );
240  EXPRFUNC_3ARG(operator(), return N; );
241  */
242  EXPRFUNC_1ARG_ARG(operator(), return N;, );
243  EXPRFUNC_2ARG_ARG(operator(), return N;, , );
244  EXPRFUNC_3ARG_ARG(operator(), return N;, , , );
245 
246  };
247 
248  //---------------------------------------------------------------------------------------------------
249 
250  //---------------//
251  // TExprLValue //
252  //---------------//
253 
255  template < typename T >
257  {
258  public: // typedefs
259  EXPR_RESULT_TYPE( T & );
260 
261  public: // constructors & destructor
262  TExprLValue(T & lvalue) : m_pvalue(lvalue) {}
263 
264  public: // functions
265 
266  /*
267  EXPRFUNC_1ARG( operator(), return m_pvalue; );
268  EXPRFUNC_2ARG( operator(), return m_pvalue; );
269  EXPRFUNC_3ARG( operator(), return m_pvalue; );
270  */
271 
272  EXPRFUNC_1ARG_ARG( operator(), return m_pvalue;, );
273  EXPRFUNC_2ARG_ARG( operator(), return m_pvalue;, , );
274  EXPRFUNC_3ARG_ARG( operator(), return m_pvalue;, , , );
275 
276  private: // data
277 
278  T & m_pvalue;
279  };
280 
281  /*
282  template < typename T >
283  class TExprLValue
284  {
285  public: // typedefs
286  EXPR_RESULT_TYPE( T );
287 
288  public: // constructors & destructor
289  TExprLValue(T & lvalue) : m_lvalue(lvalue) {}
290 
291  public: // functions
292 
293  EXPRFUNC_1ARG( operator(), return m_lvalue; );
294  EXPRFUNC_2ARG( operator(), return m_lvalue; );
295  EXPRFUNC_3ARG( operator(), return m_lvalue; );
296 
297  EXPRFUNC_1ARG_RET( getLValue, return m_lvalue; , T & );
298  EXPRFUNC_2ARG_RET( getLValue, return m_lvalue; , T & );
299  EXPRFUNC_3ARG_RET( getLValue, return m_lvalue; , T & );
300 
301 
302  private: // data
303 
304  T &m_lvalue;
305  };
306  */
307 
308 
309  //---------------------------------------------------------------------------------------------------
310 
311  //----------------------//
312  // TExprFunctorHelper //
313  //----------------------//
314 
315  // NB: this is not technically a TExpr (it has no TypeStruct and its operator() are non standard).
316  // It is just an overwrap over functors to redefine their operator(). Some kind of automatic
317  // binding.
318  template < typename TFunctor >
320  {
321  public:
322  TExprFunctorHelper(TFunctor f) : m_functor(f) {}
323 
324  public:
325  template < typename Expr1 >
328  {
329  typedef TExprUnaryOperator<Expr1, TFunctor> TExprRet;
330  return TExpr<TExprRet>(TExprRet(e.getExpr(), m_functor));
331  }
332 
333  template < typename Expr1, typename Expr2 >
336  {
338  return TExpr<TExprRet>(TExprRet(e1.getExpr(), e2.getExpr(), m_functor));
339  }
340 
341  private:
342  TFunctor m_functor;
343  };
344 
345  } // namespace expr
346 
347 
348  //---------------------------------------------------------------------------------------------------
349 
350  //------------------//
351  // loop functions //
352  //------------------//
353 
354  template < typename Functor, typename TIterator >
355  void floop(Functor & functor, TIterator iIm)
356  { for (; !iIm.isAtEnd(); ++iIm) functor(iIm); }
357 
358  template < typename Functor, typename TIterator >
359  void floop(Functor functor, TIterator iIm)
360  { for (; !iIm.isAtEnd(); ++iIm) functor(iIm); }
361 
362  template < typename Functor, typename TIterator >
363  void floop2(TIterator iIm)
364  { for (; !iIm.isAtEnd(); ++iIm) Functor::compute(*iIm); }
365 
366  template < typename Expr, typename TIterator1 >
367  //typename boost::enable_if<is_ImageIterator<TIterator1> >::type
368  void
369  loop(expr::TExpr<Expr> & expr, TIterator1 iIm1)
370  {
371  for (; !iIm1.isAtEnd(); ++iIm1)
372  {
373  expr(iIm1);
374  }
375  }
376 
377  template < typename Expr, typename TIterator1 >
378  //typename boost::enable_if<is_ImageIterator<TIterator1> >::type
379  void
380  loop(expr::TExpr<Expr> expr, TIterator1 iIm1)
381  {
382  for (; !iIm1.isAtEnd(); ++iIm1)
383  {
384  expr(iIm1);
385  }
386  }
387 
388  namespace detail
389  {
390  template < typename Expr, typename TIterator >
391  void
392  loop_c(expr::TExpr<Expr> expr, TIterator start, const TIterator & end)
393  {
394  for (; start != end; ++start)
395  {
396  expr(start);
397  }
398  }
399 
400  template < typename Expr, typename TContainer >
401  void
402  loop_x(expr::TExpr<Expr> expr, TContainer & c)
403  {
404  loop_c(expr, c.begin(), c.end());
405  }
406 
407 
408  template < typename Expr, typename TIterator1, typename TIterator2, typename TIterator3 >
409  void
410  loop_xxx(expr::TExpr<Expr> expr, TIterator1 start1, const TIterator1 end1, TIterator2 start2, TIterator3 start3)
411  {
412  for (; start1 != end1; ++start1, ++start2, ++start3)
413  {
414  expr(start1, start2, start3);
415  }
416  }
417 
418  template < typename Expr, typename TContainer1, typename TContainer2, typename TContainer3 >
419  void
420  loop_xxx(expr::TExpr<Expr> expr, TContainer1 & c1, TContainer2 & c2, TContainer3 & c3)
421  {
422  loop_xxx(expr, c1.begin(), c1.end(), c2.begin(), c3.begin());
423  }
424 
425  template < typename Expr, typename TIterator1, typename TIterator2 >
426  void
427  loop_xx(expr::TExpr<Expr> expr, TIterator1 start1, const TIterator1 end1, TIterator2 start2)
428  {
429  for (; start1 != end1; ++start1, ++start2)
430  {
431  expr(start1, start2);
432  }
433  }
434 
435  template < typename Expr, typename TContainer1, typename TContainer2 >
436  void
437  loop_xx(expr::TExpr<Expr> expr, TContainer1 & c1, TContainer2 & c2)
438  {
439  loop_xx(expr, c1.begin(), c1.end(), c2.begin());
440  }
441  }
442 
443  template < int N, typename Expr, typename TIterator1, typename TIterator2 >
444  void
445  depth_loop(expr::TExpr<Expr> expr, TIterator1 begin1, TIterator1 end1, TIterator2 begin2)
446  {
447  if (N==1)
448  {
449  detail::loop_xx(expr, begin1, end1, begin2);
450  }
451  else
452  {
453  for (; begin1 != end1; ++begin1, ++begin2)
454  {
455  depth_loop<N-1>(begin1->begin(), begin1->end(), begin2->begin());
456  }
457  }
458  }
459 
460  template < int N, typename Expr, typename TContainer1, typename TContainer2 >
461  void
462  depth_loop(expr::TExpr<Expr> expr, TContainer1 & c1, TContainer2 & c2)
463  {
464  depth_loop<N>(expr, c1.begin(), c1.end(), c2.begin());
465  }
466 
467  template < typename Functor, typename TIterator >
468  void
469  loopboost(Functor &functor, TIterator iIm)
470  {
471  for (; !iIm.isAtEnd(); ++iIm) { functor(iIm); }
472  }
473 
474 
475  // TODO: Actually, all these test, that we might want to keep for example for performance comparison,
476  // could be put in a special namespace, perhaps with special compilation flags.
477  template < typename Expr, typename TIterator1 >
478  void
479  loop2(expr::TExpr<Expr> & expr, TIterator1 iIm1)
480  {
481  do
482  {
483  expr(iIm1);
484  }
485  while (iIm1.next());
486  }
487 
488  template < typename Expr, typename TIterator1 >
489  void
490  loop2(expr::TExpr<Expr> expr, TIterator1 iIm1)
491  {
492  do
493  {
494  expr(iIm1);
495  }
496  while (iIm1.next());
497  }
498 
499  /*
500  template < typename Expr, typename TIterator1, typename TIterator2 >
501  typename enable_if_c<
502  is_ImageIterator<TIterator1>::value &&
503  is_ImageIterator<TIterator2>::value
504  >::type
505  loop(expr::TExpr<Expr> & expr, TIterator1 iIm1, TIterator2 iIm2)
506  { for (; !iIm1.isAtEnd(); ++iIm1, ++iIm2) expr(iIm1, iIm2); }
507  */
508 
509  template < typename Expr, typename TIterator1, typename TIterator2 >
510  typename enable_if_c<
511  is_ImageIterator<TIterator1>::value &&
512  is_ImageIterator<TIterator2>::value,
514  >::type
515  loop(expr::TExpr<Expr> expr, TIterator1 iIm1, TIterator2 iIm2)
516  {
517  for (; !iIm1.isAtEnd(); ++iIm1, ++iIm2) expr(iIm1, iIm2);
518  return expr;
519  }
520 
521  template < typename TFunctor, typename TRange >
522  inline void loop_r(TFunctor f, TRange r)
523  {
524  for (; r.ok(); ++r)
525  {
526  f(*r);
527  }
528  }
529 
530  /*
531  template < typename Expr, typename TImage1, typename TImage2 >
532  typename enable_if_c<is_Image<TImage1>::value && is_Image<TImage2>::value>::type
533  loop(expr::TExpr<Expr> &expr, TImage1 &im1, TImage2 &im2)
534  {
535  loop(expr, itlin(im1), itlin(im2));
536  }
537  */
538 
539 
540  template < typename Expr, typename TIterator1, typename TIterator2, typename TIterator3 >
541  typename enable_if_c<
542  is_ImageIterator<TIterator1>::value &&
543  is_ImageIterator<TIterator2>::value &&
544  is_ImageIterator<TIterator3>::value,
546  >::type
547  loop(expr::TExpr<Expr> expr, TIterator1 iIm1, TIterator2 iIm2, TIterator3 iIm3)
548  {
549  for (; !iIm1.isAtEnd(); ++iIm1, ++iIm2, ++iIm3) expr(iIm1, iIm2, iIm3);
550  return expr;
551  }
552 
553  /*
554  template < typename Expr, typename TImage1, typename TImage2, typename TImage3 >
555  typename enable_if_c<is_Image<TImage1>::value && is_Image<TImage2>::value && is_Image<TImage3>::value>::type
556  loop_iii(expr::TExpr<Expr> &expr, TImage1 &im1, TImage2 &im2, TImage3 &im3)
557  {
558  loop(expr, itlin(im1), itlin(im2), itlin(im3));
559  }
560  */
561 
562 
563  //---------------------------------------------------------------------------------------------------
564 
565  //---------//
566  // check //
567  //---------//
568 
569  // use std::equal instead
570  /*
571  template < typename TPredicate, typename TIterator, typename TIterator2 >
572  inline bool check(TIterator begin, TIterator end, TIterator2 begin2, TPredicate f)
573  {
574  for (; begin != end; ++begin, ++begin2)
575  {
576  if (!f(*begin, *begin2)) return false;
577  return true;
578  }
579  }
580 
581  template < typename TPredicate, typename TRange1, typename TRange2 >
582  inline bool check(TPredicate f, TRange1 r1, TRange2 r2)
583  {
584  for (; r1.ok(); ++r1, ++r2)
585  {
586  if (!f(*r1,*r2)) return false;
587  return true;
588  }
589  }
590  */
591 
592  /*
593  template < typename TPredicate, typename TContainer1, typename TContainer2 >
594  inline bool check(TPredicate f, const TContainer1 & x, const TContainer2 & y)
595  {
596  typedef typename oprange<TContainer1,TContainer2>::first_range Range1;
597  typedef typename oprange<TContainer1,TContainer2>::second_range Range2;
598  check(f, whole_range<Range1>(x), whole_range<Range2>(y));
599  }
600  */
601 
602  /*
603  template < typename ImageFunctor, typename Expr>
604  typename enable_if<is_ImageFunctor<ImageFunctor>,
605  expr::TExpr<expr::TExprImageFunctor<ImageFunctor, Expr> >
606  >::type
607  bind(const ImageFunctor &functor, const expr::TExpr<Expr> &e)
608  {
609  typedef expr::TExprImageFunctor<ImageFunctor, Expr> TExprRet;
610  return expr::TExpr<TExprRet>(TExprRet(functor, e.getExpr()));
611  }
612  */
613 
614 
615  /*
617  template < typename TFunctor, typename Expr>
618  typename boost::enable_if<
619  is_detemplated_functor<TFunctor>
620  ,
621  expr::TExpr<expr::TExprUnaryOperator<Expr, TFunctor> >
622  >::type
623  //bind(TFunctor & functor, const expr::TExpr<Expr> & e)
624  bind(TFunctor & functor, expr::TExpr<Expr> e)
625  {
626  typedef expr::TExprUnaryOperator<Expr, TFunctor> TExprRet;
627  return expr::TExpr<TExprRet>(TExprRet(e.getExpr(), functor));
628  }
629 
631  // NB: e is const, (1) because it can: we make copy and return a different functor
632  // anyway, (2) because it must: bind should accept const texpr such as placeholders.
633  template < typename TFunctor, typename Expr>
634  typename boost::disable_if<
635  is_detemplated_functor<TFunctor>
636  ,
637  expr::TExpr<expr::TExprUnaryOperator<Expr, expr::functor::Wrap<TFunctor> > >
638  >::type
639  bind(TFunctor & functor, expr::TExpr<Expr> e)
640  //bind(TFunctor & functor, const expr::TExpr<Expr> & e)
641  {
642  typedef expr::TExprUnaryOperator<Expr, expr::functor::Wrap<TFunctor> > TExprRet;
643  return expr::TExpr<TExprRet>(TExprRet(e.getExpr(), expr::functor::Wrap<TFunctor>(functor)));
644  }
645  */
646 
647 } // namespace til
648 
649 
650 // Package includes
651 #include "til/TExprOperators.h"
652 #include "til/TExprFunctions.h"
653 
654 #endif
TypeStruct< Iterator1, Iterator2, Iterator3 >::Type operator()(Iterator1 &, Iterator2 &, Iterator3 &)
Definition: TExpr.h:75
Apply a binary numerical functor to two template expressions.
DetemplateOperator2< til::functor::Call > Call
const TExpr< expr::ThirdArgument > _3
Placeholder for the third argument.
Definition: TExpr.h:209
TExpr< TExprBinaryOperator< Expr1, Expr2, TFunctor > > operator()(TExpr< Expr1 > e1, TExpr< Expr2 > e2)
Definition: TExpr.h:335
DetemplateAssignOperator1< til::functor::Assign > Assign
TypeStruct< Iterator1 >::Type operator()(Iterator1 &)
Definition: TExpr.h:65
A template expression class for constant values.
Definition: TExpr.h:50
TExpr< TExprBinaryOperator_NoRes< Expr, TExprConstant< T >, functor::Assign > > operator=(const T &value) const
Assignement to a constant.
Definition: TExpr.h:165
TExpr(const Expr &e)
Definition: TExpr.h:139
#define EXPRFUNC_2ARG(name, body)
Definition: TExprMacros.h:13
#define EXPRFUNC_3ARG_ARG(name, body, arg1, arg2, arg3)
Definition: TExprMacros.h:26
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition: Accumulator.h:10
void loop_x(expr::TExpr< Expr > expr, TContainer &c)
Definition: TExpr.h:402
void loop_r(TFunctor f, TRange r)
Definition: TExpr.h:522
Represent a constant in template expression.
Definition: TExpr.h:223
#define EXPRFUNC_2ARG_ARG(name, body, arg1, arg2)
Definition: TExprMacros.h:25
#define EXPRFUNC_1ARG_ARG(name, body, arg1)
Definition: TExprMacros.h:24
A wrapper class of a template expression.
Definition: TExpr.h:128
TExprLValue(T &lvalue)
Definition: TExpr.h:262
General macros, definitions and functions.
void floop(Functor &functor, TIterator iIm)
Definition: TExpr.h:355
TypeStruct< Iterator1, Iterator2 >::Type operator()(Iterator1 &, Iterator2 &)
Definition: TExpr.h:70
void depth_loop(expr::TExpr< Expr > expr, TIterator1 begin1, TIterator1 end1, TIterator2 begin2)
Definition: TExpr.h:445
Detemplation of assignment functors taking one template parameter.
TExpr< TExprBinaryOperator< Expr, Expr2, functor::Call > > operator()(const TExpr< Expr2 > &e2) const
Definition: TExpr.h:173
A template expression class for left-values.
Definition: TExpr.h:256
void loop_xx(expr::TExpr< Expr > expr, TIterator1 start1, const TIterator1 end1, TIterator2 start2)
Definition: TExpr.h:427
const TExpr< expr::SecondArgument > _2
Placeholder for the second argument.
Definition: TExpr.h:207
void floop2(TIterator iIm)
Definition: TExpr.h:363
const TExpr< expr::FirstArgument > _1
Placeholder for the first argument.
Definition: TExpr.h:205
void loopboost(Functor &functor, TIterator iIm)
Definition: TExpr.h:469
void loop_xxx(expr::TExpr< Expr > expr, TContainer1 &c1, TContainer2 &c2, TContainer3 &c3)
Definition: TExpr.h:420
TExpr< TExprUnaryOperator< Expr1, TFunctor > > operator()(TExpr< Expr1 > e)
Definition: TExpr.h:327
void loop2(expr::TExpr< Expr > &expr, TIterator1 iIm1)
Definition: TExpr.h:479
void loop_xx(expr::TExpr< Expr > expr, TContainer1 &c1, TContainer2 &c2)
Definition: TExpr.h:437
TExpr< TExprBinaryOperator_NoRes< Expr, Expr2, functor::Assign > > operator=(const TExpr< Expr2 > &e2) const
Assignement to one expression.
Definition: TExpr.h:156
Some macros to ease the otherwise tedious and unreadable declaration of template expression classes...
boost::enable_if_c< is_container< TContainer >::value &&!is_container< T >::value >::type loop(TContainer &c, T v, TBinaryFunctor f)
Apply a binary functor to a collection and a constant.
Definition: loop.h:32
Collects template tools used for library implementation.
Apply a unary numerical functor to a template expression.
A class to "detemplate" a pure functor with two template arguments.
TExprConstant(T value)
Definition: TExpr.h:58
void loop_c(expr::TExpr< Expr > expr, TIterator start, const TIterator &end)
Definition: TExpr.h:392
#define EXPRFUNC_3ARG(name, body)
Definition: TExprMacros.h:14
void IsATExpr
Definition: TExpr.h:132
#define EXPRFUNC_1ARG(name, body)
Definition: TExprMacros.h:12
#define TIL_DEFINE_TEXPR_ARITHMETIC_OPERATOR(name, functor)
Definition: TExpr.h:98
Template tool to enable a template specialization under some condition.
TExprFunctorHelper(TFunctor f)
Definition: TExpr.h:322
const Expr & getExpr() const
Definition: TExpr.h:142