QDP++
qdp_newops.h
Go to the documentation of this file.
1// -*- C++ -*-
2
6
7#ifndef QDP_NEWOPS_H
8#define QDP_NEWOPS_H
9
10namespace QDP {
11
12//-----------------------------------------------------------------------------
13// Operator tags that are only used for type resolution
14//-----------------------------------------------------------------------------
15
20
25
30
35
40
45
50
55
60
65
70
75
80
85
90
95
100
101
102//-----------------------------------------------------------------------------
103// Operators and tags for accessing elements of a QDP object
104//-----------------------------------------------------------------------------
105
110
115
120
121
124{
126
127 FnPeekColorMatrix(int _row, int _col): row(_row), col(_col) {}
128
129 template<class T>
131 operator()(const T &a) const
132 {
133 return (peekColor(a,row,col));
134 }
135
136private:
137 int row, col;
138};
139
140
142
144template<class T1,class C1>
145inline typename MakeReturn<UnaryNode<FnPeekColorMatrix,
146 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t>,
148peekColor(const QDPType<T1,C1> & l, int row, int col)
149{
151 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t> Tree_t;
154 CreateLeaf<QDPType<T1,C1> >::make(l)));
155}
156
157
158template<class T1,class C1>
160 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t>, C1>::Expression_t
161peekColor(const QDPExpr<T1,C1> & l, int row, int col)
162{
164 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t> Tree_t;
165 typedef typename UnaryReturn<C1,FnPeekColorMatrix >::Type_t Container_t;
167 CreateLeaf<QDPExpr<T1,C1> >::make(l)));
168}
169
170
173{
175
176 FnPeekColorVector(int _row): row(_row) {}
177
178 template<class T>
180 operator()(const T &a) const
181 {
182 return (peekColor(a,row));
183 }
184
185private:
186 int row;
187};
188
189
191
193template<class T1,class C1>
194inline typename MakeReturn<UnaryNode<FnPeekColorVector,
195 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t>,
197peekColor(const QDPType<T1,C1> & l, int row)
198{
200 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t> Tree_t;
203 CreateLeaf<QDPType<T1,C1> >::make(l)));
204}
205
206
207template<class T1,class C1>
209 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t>, C1>::Expression_t
210peekColor(const QDPExpr<T1,C1> & l, int row)
211{
213 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t> Tree_t;
214 typedef typename UnaryReturn<C1,FnPeekColorVector >::Type_t Container_t;
216 CreateLeaf<QDPExpr<T1,C1> >::make(l)));
217}
218
219
222{
224
225 FnPeekSpinMatrix(int _row, int _col): row(_row), col(_col) {}
226
227 template<class T>
229 operator()(const T &a) const
230 {
231 return (peekSpin(a,row,col));
232 }
233
234private:
235 int row, col;
236};
237
239
241template<class T1,class C1>
242inline typename MakeReturn<UnaryNode<FnPeekSpinMatrix,
243 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t>,
245peekSpin(const QDPType<T1,C1> & l, int row, int col)
246{
248 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t> Tree_t;
251 CreateLeaf<QDPType<T1,C1> >::make(l)));
252}
253
254
255template<class T1,class C1>
257 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t>, C1>::Expression_t
258peekSpin(const QDPExpr<T1,C1> & l, int row, int col)
259{
261 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t> Tree_t;
262 typedef typename UnaryReturn<C1,FnPeekSpinMatrix >::Type_t Container_t;
264 CreateLeaf<QDPExpr<T1,C1> >::make(l)));
265}
266
267
270{
272
273 FnPeekSpinVector(int _row): row(_row) {}
274
275 template<class T>
277 operator()(const T &a) const
278 {
279 return (peekSpin(a,row));
280 }
281
282private:
283 int row;
284};
285
286
288
290template<class T1,class C1>
291inline typename MakeReturn<UnaryNode<FnPeekSpinVector,
292 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t>,
294peekSpin(const QDPType<T1,C1> & l, int row)
295{
297 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t> Tree_t;
300 CreateLeaf<QDPType<T1,C1> >::make(l)));
301}
302
303
304template<class T1,class C1>
306 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t>, C1>::Expression_t
307peekSpin(const QDPExpr<T1,C1> & l, int row)
308{
310 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t> Tree_t;
311 typedef typename UnaryReturn<C1,FnPeekSpinVector >::Type_t Container_t;
313 CreateLeaf<QDPExpr<T1,C1> >::make(l)));
314}
315
316
317
318//---------------------------------------
321{
323
324 FnPokeColorMatrix(int _row, int _col): row(_row), col(_col) {}
325
326 template<class T1, class T2>
328 operator()(const T1 &a, const T2 &b) const
329 {
330 pokeColor(const_cast<T1&>(a),b,row,col);
331 return const_cast<T1&>(a);
332 }
333
334private:
335 int row, col;
336};
337
338
340
348template<class T1,class C1,class T2,class C2>
349inline C1&
350pokeColor(QDPType<T1,C1> & l, const QDPType<T2,C2>& r, int row, int col)
351{
352 C1& ll = static_cast<C1&>(l);
354 return ll;
355}
356
357
358template<class T1,class C1,class T2,class C2>
359inline C1&
360pokeColor(QDPType<T1,C1> & l, const QDPExpr<T2,C2>& r, int row, int col)
361{
362 C1& ll = static_cast<C1&>(l);
363 evaluate(ll,FnPokeColorMatrix(row,col),r,all);
364 return ll;
365}
366
367
368template<class T1,class C1,class T2,class C2>
369inline C1
370pokeColor(const QDPSubType<T1,C1>& l, const QDPType<T2,C2>& r, int row, int col)
371{
372 //C1& ll = const_cast<QDPSubType<T1,C1>&>(l).field();
373 C1 ll( l.getF() , 1.0 );
374 const Subset& s = l.subset();
375
376 evaluate(ll,FnPokeColorMatrix(row,col),PETE_identity(r),s);
377 return ll;
378}
379
380
381template<class T1,class C1,class T2,class C2>
382inline C1
383pokeColor(const QDPSubType<T1,C1>& l, const QDPExpr<T2,C2>& r, int row, int col)
384{
385 //C1& ll = const_cast<QDPSubType<T1,C1>&>(l).field();
386 C1 ll( l.getF() , 1.0 );
387 const Subset& s = l.subset();
388
389 evaluate(ll,FnPokeColorMatrix(row,col),r,s);
390 return ll;
391}
392
393
396{
398
399 FnPokeColorVector(int _row): row(_row) {}
400
401 template<class T1, class T2>
403 operator()(const T1 &a, const T2 &b) const
404 {
405 pokeColor(const_cast<T1&>(a),b,row);
406 return const_cast<T1&>(a);
407 }
408
409private:
410 int row;
411};
412
413
414
416
423template<class T1,class C1,class T2,class C2>
424inline C1&
426{
427 C1& ll = static_cast<C1&>(l);
429 return ll;
430}
431
432template<class T1,class C1,class T2,class C2>
433inline C1&
435{
436 C1& ll = static_cast<C1&>(l);
437 evaluate(ll,FnPokeColorVector(row),r,all);
438 return ll;
439}
440
441
442template<class T1,class C1,class T2,class C2>
443inline C1
444pokeColor(const QDPSubType<T1,C1>& l, const QDPType<T2,C2>& r, int row)
445{
446 //C1& ll = const_cast<QDPSubType<T1,C1>&>(l).field();
447 C1 ll( l.getF() , 1.0 );
448
449 const Subset& s = l.subset();
450
452 return ll;
453}
454
455
456template<class T1,class C1,class T2,class C2>
457inline C1
458pokeColor(const QDPSubType<T1,C1>& l, const QDPExpr<T2,C2>& r, int row)
459{
460 //C1& ll = const_cast<QDPSubType<T1,C1>&>(l).field();
461 C1 ll( l.getF() , 1.0 );
462
463 const Subset& s = l.subset();
464
465 evaluate(ll,FnPokeColorVector(row),r,s);
466 return ll;
467}
468
469
472{
474
475 FnPokeSpinMatrix(int _row, int _col): row(_row), col(_col) {}
476
477 template<class T1, class T2>
479 operator()(const T1 &a, const T2 &b) const
480 {
481 pokeSpin(const_cast<T1&>(a),b,row,col);
482 return const_cast<T1&>(a);
483 }
484
485private:
486 int row, col;
487};
488
490
498template<class T1,class C1,class T2,class C2>
499inline C1&
500pokeSpin(QDPType<T1,C1> & l, const QDPType<T2,C2>& r, int row, int col)
501{
502 C1& ll = static_cast<C1&>(l);
504 return ll;
505}
506
507template<class T1,class C1,class T2,class C2>
508inline C1&
509pokeSpin(QDPType<T1,C1> & l, const QDPExpr<T2,C2>& r, int row, int col)
510{
511 C1& ll = static_cast<C1&>(l);
512 evaluate(ll,FnPokeSpinMatrix(row,col),r,all);
513 return ll;
514}
515
516
517template<class T1,class C1,class T2,class C2>
518inline C1
519pokeSpin(const QDPSubType<T1,C1>& l, const QDPType<T2,C2>& r, int row, int col)
520{
521 //C1& ll = const_cast<QDPSubType<T1,C1>&>(l).field();
522 C1 ll( l.getF() , 1.0 );
523
524 const Subset& s = l.subset();
525
526 evaluate(ll,FnPokeSpinMatrix(row,col),PETE_identity(r),s);
527 return ll;
528}
529
530
531template<class T1,class C1,class T2,class C2>
532inline C1
533pokeSpin(const QDPSubType<T1,C1>& l, const QDPExpr<T2,C2>& r, int row, int col)
534{
535 //C1& ll = const_cast<QDPSubType<T1,C1>&>(l).field();
536 C1 ll( l.getF() , 1.0 );
537
538 const Subset& s = l.subset();
539
540 evaluate(ll,FnPokeSpinMatrix(row,col),r,s);
541 return ll;
542}
543
544
545
548{
550
551 FnPokeSpinVector(int _row): row(_row) {}
552
553 template<class T1, class T2>
555 operator()(const T1 &a, const T2 &b) const
556 {
557 pokeSpin(const_cast<T1&>(a),b,row);
558 return const_cast<T1&>(a);
559 }
560
561private:
562 int row;
563};
564
565
567
574template<class T1,class C1,class T2,class C2>
575inline C1&
577{
578 C1& ll = static_cast<C1&>(l);
580 return ll;
581}
582
583template<class T1,class C1,class T2,class C2>
584inline C1&
586{
587 C1& ll = static_cast<C1&>(l);
588 evaluate(ll,FnPokeSpinVector(row),r,all);
589 return ll;
590}
591
592
593template<class T1,class C1,class T2,class C2>
594inline C1
595pokeSpin(const QDPSubType<T1,C1>& l, const QDPType<T2,C2>& r, int row)
596{
597 //C1& ll = const_cast<QDPSubType<T1,C1>&>(l).field();
598 C1 ll( l.getF() , 1.0 );
599
600 const Subset& s = l.subset();
601
603 return ll;
604}
605
606
607template<class T1,class C1,class T2,class C2>
608inline C1
609pokeSpin(const QDPSubType<T1,C1>& l, const QDPExpr<T2,C2>& r, int row)
610{
611 //C1& ll = const_cast<QDPSubType<T1,C1>&>(l).field();
612 C1 ll( l.getF() , 1.0 );
613
614 const Subset& s = l.subset();
615
616 evaluate(ll,FnPokeSpinVector(row),r,s);
617 return ll;
618}
619
620
621
622//-----------------------------------------------------------------------------
623// Additional operator tags
624//-----------------------------------------------------------------------------
625
627{
629 template<class T1, class T2>
631 operator()(const T1 &a, const T2 &b) const
632 {
633 return (a * b);
634 }
635};
636
637
639{
641 template<class T1, class T2>
643 operator()(const T1 &a, const T2 &b) const
644 {
645 return (a * b);
646 }
647};
648
649
650// Member function definition in primgamma.h
652{
654 template<int N, class T>
655 inline T
656 operator()(const GammaType<N>& a, const T &b) const;
657};
658
659
660// Member function definition in primgamma.h
662{
664 template<class T, int N>
665 inline T
666 operator()(const T &a, const GammaType<N>& b) const;
667};
668
669
670//-----------------------------------------------------------------------------
671// Additional operator tags
672//-----------------------------------------------------------------------------
673
675{
677 template<class T1, class T2>
679 operator()(const T1 &a, const T2 &b) const
680 {
681 return (a * b);
682 }
683};
684
685
687{
689 template<class T1, class T2>
691 operator()(const T1 &a, const T2 &b) const
692 {
693 return (a * b);
694 }
695};
696
697
698// Member function definition in primgamma.h
700{
702 template<int N, class T>
703 inline T
704 operator()(const GammaTypeDP<N>& a, const T &b) const;
705};
706
707
708// Member function definition in primgamma.h
710{
712 template<class T, int N>
713 inline T
714 operator()(const T &a, const GammaTypeDP<N>& b) const;
715};
716
717
718//-----------------------------------------------------------------------------
719// Leaf stuff
720//-----------------------------------------------------------------------------
721
722template<int N>
724{
727// typedef Reference<Input_t> Leaf_t;
728
729 inline static
730 Leaf_t make(const Input_t& a) { return Leaf_t(a); }
731};
732
733template<int N>
735{
737 inline static Type_t apply(const GammaType<N> &a, const ElemLeaf &f)
738 {return a;}
739};
740
741template<int N>
743{
745 inline static Type_t apply(const GammaType<N> &a, const EvalLeaf1 &f)
746 {return a;}
747};
748
749
750template<int N, int m>
752{
755
756 inline static
757 Leaf_t make(const Input_t& a) { return Leaf_t(a); }
758};
759
760template<int N, int m>
762{
764 inline static Type_t apply(const GammaConst<N,m> &a, const ElemLeaf &f)
765 {return a;}
766};
767
768template<int N, int m>
770{
772 inline static Type_t apply(const GammaConst<N,m> &a, const EvalLeaf1 &f)
773 {return a;}
774};
775
776
777
778//-----------------------------------------------------------------------------
779// Leaf stuff
780//-----------------------------------------------------------------------------
781
782template<int N>
784{
787// typedef Reference<Input_t> Leaf_t;
788
789 inline static
790 Leaf_t make(const Input_t& a) { return Leaf_t(a); }
791};
792
793template<int N>
795{
797 inline static Type_t apply(const GammaTypeDP<N> &a, const ElemLeaf &f)
798 {return a;}
799};
800
801template<int N>
803{
805 inline static Type_t apply(const GammaTypeDP<N> &a, const EvalLeaf1 &f)
806 {return a;}
807};
808
809
810template<int N, int m>
812{
815
816 inline static
817 Leaf_t make(const Input_t& a) { return Leaf_t(a); }
818};
819
820template<int N, int m>
822{
824 inline static Type_t apply(const GammaConstDP<N,m> &a, const ElemLeaf &f)
825 {return a;}
826};
827
828template<int N, int m>
830{
832 inline static Type_t apply(const GammaConstDP<N,m> &a, const EvalLeaf1 &f)
833 {return a;}
834};
835
836
837
838//-----------------------------------------------------------------------------
839// Additional operators
840//-----------------------------------------------------------------------------
841
843
844template<int N,int m,class T2,class C2>
845inline typename MakeReturn<BinaryNode<OpGammaConstMultiply,
846 typename CreateLeaf<GammaConst<N,m> >::Leaf_t,
847 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t>,
848 typename BinaryReturn<GammaConst<N,m>,C2,OpGammaConstMultiply>::Type_t >::Expression_t
850{
852 typename CreateLeaf<GammaConst<N,m> >::Leaf_t,
853 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t> Tree_t;
854 typedef typename BinaryReturn<GammaConst<N,m>,C2,OpGammaConstMultiply>::Type_t Container_t;
856 CreateLeaf<GammaConst<N,m> >::make(l),
857 CreateLeaf<QDPType<T2,C2> >::make(r)));
858}
859
861template<int N,int m,class T2,class C2>
862inline typename MakeReturn<BinaryNode<OpGammaConstMultiply,
863 typename CreateLeaf<GammaConst<N,m> >::Leaf_t,
864 typename CreateLeaf<QDPExpr<T2,C2> >::Leaf_t>,
865 typename BinaryReturn<GammaConst<N,m>,C2,OpGammaConstMultiply>::Type_t >::Expression_t
867{
869 typename CreateLeaf<GammaConst<N,m> >::Leaf_t,
870 typename CreateLeaf<QDPExpr<T2,C2> >::Leaf_t> Tree_t;
871 typedef typename BinaryReturn<GammaConst<N,m>,C2,OpGammaConstMultiply>::Type_t Container_t;
873 CreateLeaf<GammaConst<N,m> >::make(l),
874 CreateLeaf<QDPExpr<T2,C2> >::make(r)));
875}
876
878
879template<class T1,class C1,int N,int m>
880inline typename MakeReturn<BinaryNode<OpMultiplyGammaConst,
881 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t,
882 typename CreateLeaf<GammaConst<N,m> >::Leaf_t>,
883 typename BinaryReturn<C1,GammaConst<N,m>,OpMultiplyGammaConst>::Type_t >::Expression_t
885{
887 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t,
888 typename CreateLeaf<GammaConst<N,m> >::Leaf_t> Tree_t;
891 CreateLeaf<QDPType<T1,C1> >::make(l),
892 CreateLeaf<GammaConst<N,m> >::make(r)));
893}
894
896template<class T1,class C1,int N,int m>
897inline typename MakeReturn<BinaryNode<OpMultiplyGammaConst,
898 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t,
899 typename CreateLeaf<GammaConst<N,m> >::Leaf_t>,
900 typename BinaryReturn<C1,GammaConst<N,m>,OpMultiplyGammaConst>::Type_t >::Expression_t
902{
904 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t,
905 typename CreateLeaf<GammaConst<N,m> >::Leaf_t> Tree_t;
908 CreateLeaf<QDPExpr<T1,C1> >::make(l),
909 CreateLeaf<GammaConst<N,m> >::make(r)));
910}
911
912
914
915template<int N,class T2,class C2>
916inline typename MakeReturn<BinaryNode<OpGammaTypeMultiply,
917 typename CreateLeaf<GammaType<N> >::Leaf_t,
918 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t>,
919 typename BinaryReturn<GammaType<N>,C2,OpGammaTypeMultiply>::Type_t >::Expression_t
921{
923 typename CreateLeaf<GammaType<N> >::Leaf_t,
924 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t> Tree_t;
925 typedef typename BinaryReturn<GammaType<N>,C2,OpGammaTypeMultiply>::Type_t Container_t;
927 CreateLeaf<GammaType<N> >::make(l),
928 CreateLeaf<QDPType<T2,C2> >::make(r)));
929}
930
932template<int N,class T2,class C2>
933inline typename MakeReturn<BinaryNode<OpGammaTypeMultiply,
934 typename CreateLeaf<GammaType<N> >::Leaf_t,
935 typename CreateLeaf<QDPExpr<T2,C2> >::Leaf_t>,
936 typename BinaryReturn<GammaType<N>,C2,OpGammaTypeMultiply>::Type_t >::Expression_t
938{
940 typename CreateLeaf<GammaType<N> >::Leaf_t,
941 typename CreateLeaf<QDPExpr<T2,C2> >::Leaf_t> Tree_t;
942 typedef typename BinaryReturn<GammaType<N>,C2,OpGammaTypeMultiply>::Type_t Container_t;
944 CreateLeaf<GammaType<N> >::make(l),
945 CreateLeaf<QDPExpr<T2,C2> >::make(r)));
946}
947
949
950template<class T1,class C1,int N>
951inline typename MakeReturn<BinaryNode<OpMultiplyGammaType,
952 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t,
953 typename CreateLeaf<GammaType<N> >::Leaf_t>,
954 typename BinaryReturn<C1,GammaType<N>,OpMultiplyGammaType>::Type_t >::Expression_t
956{
958 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t,
959 typename CreateLeaf<GammaType<N> >::Leaf_t> Tree_t;
960 typedef typename BinaryReturn<C1,GammaType<N>,OpMultiplyGammaType>::Type_t Container_t;
962 CreateLeaf<QDPType<T1,C1> >::make(l),
963 CreateLeaf<GammaType<N> >::make(r)));
964}
965
967template<class T1,class C1,int N>
968inline typename MakeReturn<BinaryNode<OpMultiplyGammaType,
969 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t,
970 typename CreateLeaf<GammaType<N> >::Leaf_t>,
971 typename BinaryReturn<C1,GammaType<N>,OpMultiplyGammaType>::Type_t >::Expression_t
973{
975 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t,
976 typename CreateLeaf<GammaType<N> >::Leaf_t> Tree_t;
977 typedef typename BinaryReturn<C1,GammaType<N>,OpMultiplyGammaType>::Type_t Container_t;
979 CreateLeaf<QDPExpr<T1,C1> >::make(l),
980 CreateLeaf<GammaType<N> >::make(r)));
981}
982
983
984//-----------------------------------------------------------------------------
985// Additional operators
986//-----------------------------------------------------------------------------
987
989
990template<int N,int m,class T2,class C2>
991inline typename MakeReturn<BinaryNode<OpGammaConstDPMultiply,
992 typename CreateLeaf<GammaConstDP<N,m> >::Leaf_t,
993 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t>,
994 typename BinaryReturn<GammaConstDP<N,m>,C2,OpGammaConstDPMultiply>::Type_t >::Expression_t
996{
998 typename CreateLeaf<GammaConstDP<N,m> >::Leaf_t,
999 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t> Tree_t;
1000 typedef typename BinaryReturn<GammaConstDP<N,m>,C2,OpGammaConstDPMultiply>::Type_t Container_t;
1002 CreateLeaf<GammaConstDP<N,m> >::make(l),
1003 CreateLeaf<QDPType<T2,C2> >::make(r)));
1004}
1005
1007template<int N,int m,class T2,class C2>
1008inline typename MakeReturn<BinaryNode<OpGammaConstDPMultiply,
1009 typename CreateLeaf<GammaConstDP<N,m> >::Leaf_t,
1010 typename CreateLeaf<QDPExpr<T2,C2> >::Leaf_t>,
1011 typename BinaryReturn<GammaConstDP<N,m>,C2,OpGammaConstDPMultiply>::Type_t >::Expression_t
1013{
1015 typename CreateLeaf<GammaConstDP<N,m> >::Leaf_t,
1016 typename CreateLeaf<QDPExpr<T2,C2> >::Leaf_t> Tree_t;
1017 typedef typename BinaryReturn<GammaConstDP<N,m>,C2,OpGammaConstDPMultiply>::Type_t Container_t;
1019 CreateLeaf<GammaConstDP<N,m> >::make(l),
1020 CreateLeaf<QDPExpr<T2,C2> >::make(r)));
1021}
1022
1024
1025template<class T1,class C1,int N,int m>
1026inline typename MakeReturn<BinaryNode<OpMultiplyGammaConstDP,
1027 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t,
1028 typename CreateLeaf<GammaConstDP<N,m> >::Leaf_t>,
1029 typename BinaryReturn<C1,GammaConstDP<N,m>,OpMultiplyGammaConstDP>::Type_t >::Expression_t
1031{
1033 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t,
1034 typename CreateLeaf<GammaConstDP<N,m> >::Leaf_t> Tree_t;
1037 CreateLeaf<QDPType<T1,C1> >::make(l),
1038 CreateLeaf<GammaConstDP<N,m> >::make(r)));
1039}
1040
1042template<class T1,class C1,int N,int m>
1043inline typename MakeReturn<BinaryNode<OpMultiplyGammaConstDP,
1044 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t,
1045 typename CreateLeaf<GammaConstDP<N,m> >::Leaf_t>,
1046 typename BinaryReturn<C1,GammaConstDP<N,m>,OpMultiplyGammaConstDP>::Type_t >::Expression_t
1048{
1050 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t,
1051 typename CreateLeaf<GammaConstDP<N,m> >::Leaf_t> Tree_t;
1054 CreateLeaf<QDPExpr<T1,C1> >::make(l),
1055 CreateLeaf<GammaConstDP<N,m> >::make(r)));
1056}
1057
1058
1060
1061template<int N,class T2,class C2>
1062inline typename MakeReturn<BinaryNode<OpGammaTypeDPMultiply,
1063 typename CreateLeaf<GammaTypeDP<N> >::Leaf_t,
1064 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t>,
1065 typename BinaryReturn<GammaTypeDP<N>,C2,OpGammaTypeDPMultiply>::Type_t >::Expression_t
1067{
1069 typename CreateLeaf<GammaTypeDP<N> >::Leaf_t,
1070 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t> Tree_t;
1071 typedef typename BinaryReturn<GammaTypeDP<N>,C2,OpGammaTypeDPMultiply>::Type_t Container_t;
1073 CreateLeaf<GammaTypeDP<N> >::make(l),
1074 CreateLeaf<QDPType<T2,C2> >::make(r)));
1075}
1076
1078template<int N,class T2,class C2>
1079inline typename MakeReturn<BinaryNode<OpGammaTypeDPMultiply,
1080 typename CreateLeaf<GammaTypeDP<N> >::Leaf_t,
1081 typename CreateLeaf<QDPExpr<T2,C2> >::Leaf_t>,
1082 typename BinaryReturn<GammaTypeDP<N>,C2,OpGammaTypeDPMultiply>::Type_t >::Expression_t
1084{
1086 typename CreateLeaf<GammaTypeDP<N> >::Leaf_t,
1087 typename CreateLeaf<QDPExpr<T2,C2> >::Leaf_t> Tree_t;
1088 typedef typename BinaryReturn<GammaTypeDP<N>,C2,OpGammaTypeDPMultiply>::Type_t Container_t;
1090 CreateLeaf<GammaTypeDP<N> >::make(l),
1091 CreateLeaf<QDPExpr<T2,C2> >::make(r)));
1092}
1093
1095
1096template<class T1,class C1,int N>
1097inline typename MakeReturn<BinaryNode<OpMultiplyGammaTypeDP,
1098 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t,
1099 typename CreateLeaf<GammaTypeDP<N> >::Leaf_t>,
1100 typename BinaryReturn<C1,GammaTypeDP<N>,OpMultiplyGammaTypeDP>::Type_t >::Expression_t
1102{
1104 typename CreateLeaf<QDPType<T1,C1> >::Leaf_t,
1105 typename CreateLeaf<GammaTypeDP<N> >::Leaf_t> Tree_t;
1108 CreateLeaf<QDPType<T1,C1> >::make(l),
1109 CreateLeaf<GammaTypeDP<N> >::make(r)));
1110}
1111
1113template<class T1,class C1,int N>
1114inline typename MakeReturn<BinaryNode<OpMultiplyGammaTypeDP,
1115 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t,
1116 typename CreateLeaf<GammaTypeDP<N> >::Leaf_t>,
1117 typename BinaryReturn<C1,GammaTypeDP<N>,OpMultiplyGammaTypeDP>::Type_t >::Expression_t
1119{
1121 typename CreateLeaf<QDPExpr<T1,C1> >::Leaf_t,
1122 typename CreateLeaf<GammaTypeDP<N> >::Leaf_t> Tree_t;
1125 CreateLeaf<QDPExpr<T1,C1> >::make(l),
1126 CreateLeaf<GammaTypeDP<N> >::make(r)));
1127}
1128
1129
1130//-----------------------------------------------------------------------------
1131// Additional operators
1132//-----------------------------------------------------------------------------
1133
1134// Explicit casts
1135template<class T1,class T2,class C2>
1136inline typename MakeReturn<UnaryNode<OpCast<T1>,
1137 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t>,
1139peteCast(const T1&, const QDPType<T2,C2>& l)
1140{
1141 typedef UnaryNode<OpCast<T1>,
1142 typename CreateLeaf<QDPType<T2,C2> >::Leaf_t> Tree_t;
1143 typedef typename UnaryReturn<C2,OpCast<T1> >::Type_t Container_t;
1145 CreateLeaf<QDPType<T2,C2> >::make(l)));
1146}
1147
1148} // namespace QDP
1149
1150#endif
#define PETE_EMPTY_CONSTRUCTORS(CLASS)
Definition PETE.h:58
Expression class for QDP.
Definition qdp_qdpexpr.h:16
QDPSubType - type representing a field living on a subset.
const Subset & subset() const
QDPType - major type class/container for all QDP objects.
Definition qdp_qdptype.h:29
Subsets - controls how lattices are looped.
Definition qdp_subset.h:39
C1 & pokeSpin(QDPType< T1, C1 > &l, const QDPType< T2, C2 > &r, int row)
Insert spin vector components.
Definition qdp_newops.h:576
MakeReturn< UnaryNode< FnPeekColorVector, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnPeekColorVector >::Type_t >::Expression_t peekColor(const QDPType< T1, C1 > &l, int row)
Extract color vector components.
Definition qdp_newops.h:197
C1 & pokeColor(QDPType< T1, C1 > &l, const QDPType< T2, C2 > &r, int row, int col)
Insert color matrix components.
Definition qdp_newops.h:350
MakeReturn< UnaryNode< FnPeekColorMatrix, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnPeekColorMatrix >::Type_t >::Expression_t peekColor(const QDPType< T1, C1 > &l, int row, int col)
Extract color matrix components.
Definition qdp_newops.h:148
C1 & pokeSpin(QDPType< T1, C1 > &l, const QDPType< T2, C2 > &r, int row, int col)
Insert spin matrix components.
Definition qdp_newops.h:500
C1 & pokeColor(QDPType< T1, C1 > &l, const QDPType< T2, C2 > &r, int row)
Insert color vector components.
Definition qdp_newops.h:425
MakeReturn< UnaryNode< FnPeekSpinVector, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnPeekSpinVector >::Type_t >::Expression_t peekSpin(const QDPType< T1, C1 > &l, int row)
Extract spin vector components.
Definition qdp_newops.h:294
MakeReturn< UnaryNode< FnPeekSpinMatrix, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnPeekSpinMatrix >::Type_t >::Expression_t peekSpin(const QDPType< T1, C1 > &l, int row, int col)
Extract spin matrix components.
Definition qdp_newops.h:245
void evaluate(OLattice< DCol > &d, const OpAssign &op, const QDPExpr< BinaryNode< OpMultiply, Reference< QDPType< DCol, OLattice< DCol > > >, Reference< QDPType< DCol, OLattice< DCol > > > >, OLattice< DCol > > &rhs, const Subset &s)
Subset all
Default all subset.
Definition qdp_subset.cc:16
Yet another random number generator.
MakeReturn< UnaryNode< FnPeekColorMatrix, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, C1 >::Expression_t peekColor(const QDPExpr< T1, C1 > &l, int row, int col)
Definition qdp_newops.h:161
MakeReturn< BinaryNode< OpMultiply, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpMultiply >::Type_t >::Expression_t operator*(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2588
MakeReturn< UnaryNode< OpIdentity, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, OpIdentity >::Type_t >::Expression_t PETE_identity(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5531
C1 & pokeColor(QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r, int row, int col)
Definition qdp_newops.h:360
MakeReturn< UnaryNode< FnPeekSpinMatrix, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, C1 >::Expression_t peekSpin(const QDPExpr< T1, C1 > &l, int row, int col)
Definition qdp_newops.h:258
MakeReturn< UnaryNode< OpCast< T1 >, typenameCreateLeaf< QDPType< T2, C2 > >::Leaf_t >, typenameUnaryReturn< C2, OpCast< T1 > >::Type_t >::Expression_t peteCast(const T1 &, const QDPType< T2, C2 > &l)
C1 & pokeSpin(QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r, int row, int col)
Definition qdp_newops.h:509
Promote< T1, T2 >::Type_t Type_t
Definition qdp.h:377
static Leaf_t make(const Input_t &a)
Definition qdp_newops.h:817
static Leaf_t make(const Input_t &a)
Definition qdp_newops.h:757
static Leaf_t make(const Input_t &a)
Definition qdp_newops.h:790
static Leaf_t make(const Input_t &a)
Definition qdp_newops.h:730
Scalar< T > Leaf_t
Definition qdp.h:97
Structure for extracting color matrix components.
Definition qdp_newops.h:124
UnaryReturn< T, FnPeekColorMatrix >::Type_t operator()(const T &a) const
Definition qdp_newops.h:131
FnPeekColorMatrix(int _row, int _col)
Definition qdp_newops.h:127
Structure for extracting color vector components.
Definition qdp_newops.h:173
FnPeekColorVector(int _row)
Definition qdp_newops.h:176
UnaryReturn< T, FnPeekColorVector >::Type_t operator()(const T &a) const
Definition qdp_newops.h:180
Structure for extracting spin matrix components.
Definition qdp_newops.h:222
FnPeekSpinMatrix(int _row, int _col)
Definition qdp_newops.h:225
UnaryReturn< T, FnPeekSpinMatrix >::Type_t operator()(const T &a) const
Definition qdp_newops.h:229
Structure for extracting spin vector components.
Definition qdp_newops.h:270
UnaryReturn< T, FnPeekSpinVector >::Type_t operator()(const T &a) const
Definition qdp_newops.h:277
FnPeekSpinVector(int _row)
Definition qdp_newops.h:273
Structure for inserting color matrix components.
Definition qdp_newops.h:321
FnPokeColorMatrix(int _row, int _col)
Definition qdp_newops.h:324
BinaryReturn< T1, T2, FnPokeColorMatrix >::Type_t operator()(const T1 &a, const T2 &b) const
Definition qdp_newops.h:328
Structure for inserting color vector components.
Definition qdp_newops.h:396
BinaryReturn< T1, T2, FnPokeColorVector >::Type_t operator()(const T1 &a, const T2 &b) const
Definition qdp_newops.h:403
FnPokeColorVector(int _row)
Definition qdp_newops.h:399
Structure for inserting spin matrix components.
Definition qdp_newops.h:472
FnPokeSpinMatrix(int _row, int _col)
Definition qdp_newops.h:475
BinaryReturn< T1, T2, FnPokeSpinMatrix >::Type_t operator()(const T1 &a, const T2 &b) const
Definition qdp_newops.h:479
Structure for inserting spin vector components.
Definition qdp_newops.h:548
BinaryReturn< T1, T2, FnPokeSpinVector >::Type_t operator()(const T1 &a, const T2 &b) const
Definition qdp_newops.h:555
FnPokeSpinVector(int _row)
Definition qdp_newops.h:551
static Type_t apply(const GammaConstDP< N, m > &a, const ElemLeaf &f)
Definition qdp_newops.h:824
static Type_t apply(const GammaConstDP< N, m > &a, const EvalLeaf1 &f)
Definition qdp_newops.h:832
static Type_t apply(const GammaConst< N, m > &a, const ElemLeaf &f)
Definition qdp_newops.h:764
static Type_t apply(const GammaConst< N, m > &a, const EvalLeaf1 &f)
Definition qdp_newops.h:772
static Type_t apply(const GammaTypeDP< N > &a, const ElemLeaf &f)
Definition qdp_newops.h:797
static Type_t apply(const GammaTypeDP< N > &a, const EvalLeaf1 &f)
Definition qdp_newops.h:805
static Type_t apply(const GammaType< N > &a, const ElemLeaf &f)
Definition qdp_newops.h:737
static Type_t apply(const GammaType< N > &a, const EvalLeaf1 &f)
Definition qdp_newops.h:745
static Expression_t make(const T &a)
Definition qdp_qdpexpr.h:66
BinaryReturn< T1, T2, OpGammaConstDPMultiply >::Type_t operator()(const T1 &a, const T2 &b) const
Definition qdp_newops.h:679
BinaryReturn< T1, T2, OpGammaConstMultiply >::Type_t operator()(const T1 &a, const T2 &b) const
Definition qdp_newops.h:631
T operator()(const GammaTypeDP< N > &a, const T &b) const
T operator()(const GammaType< N > &a, const T &b) const
BinaryReturn< T1, T2, OpMultiplyGammaConstDP >::Type_t operator()(const T1 &a, const T2 &b) const
Definition qdp_newops.h:691
BinaryReturn< T1, T2, OpMultiplyGammaConst >::Type_t operator()(const T1 &a, const T2 &b) const
Definition qdp_newops.h:643
T operator()(const T &a, const GammaTypeDP< N > &b) const
T operator()(const T &a, const GammaType< N > &b) const