rheolef  6.5
field_expr_ops_make.cc
Go to the documentation of this file.
1 /*
2  example: abbrev
3 
4  int i
5  T t n_scalar=2
6 
7  field<T,M> F
8  field_indirect<T,M> G n_class=3
9  field_indirect_const<T,M> H
10 
11  field_expr<E> E expr
12 
13  => binary matrix profile :
14 
15  iF iG iH iE
16  tF tG tH tE
17 
18  Fi Ft FF FG FH FE
19  Gi Gt GF GG GH GE
20  Hi Ht HF HG HH HE
21 
22  Ei Et EF EG EH EE
23 
24  template:
25  xY Xy => template<T,M> x=i,t X=F,G,H
26  XY => template<T1,T2,M> X,Y=F,G,H
27  iE Ei => template<E> x=i
28  tE Et => template<T,E> x=t
29  XE EX => template<E,T,M> X=F,G,H
30  EE => template<E1,E2>
31 */
32 #include "expr_ops_make.icc"
33 int main() {
34  s expr = "field_expr";
35  s details = "field_detail";
36  s domain = "field_domain";
37  s tag = "is_field";
38 
39  vector<rhs> Rhsclass;
40  Rhsclass.push_back (rhs("field_basic", "&"));
41  Rhsclass.push_back (rhs("field_indirect",""));
42  Rhsclass.push_back (rhs("field_component",""));
43 
44  vector<s> Class;
45  Class.push_back ("field_basic");
46  Class.push_back ("field_indirect");
47  Class.push_back ("field_indirect_const");
48  Class.push_back ("field_component");
49  Class.push_back ("field_component_const");
50 
51  vector<op> Unop;
52  Unop.push_back (op("+", "boost::proto::tag::unary_plus"));
53  Unop.push_back (op("-", "boost::proto::tag::negate"));
54 
55  vector<op> BinopLinear;
56  BinopLinear.push_back (op("+", "boost::proto::tag::plus"));
57  BinopLinear.push_back (op("-", "boost::proto::tag::minus"));
58 
59  vector<op> BinopNonlinear;
60  BinopNonlinear.push_back (op("*", "boost::proto::tag::multiplies"));
61  BinopNonlinear.push_back (op("/", "boost::proto::tag::divides"));
62 
63  vector<aop> AssignopLinear;
64  AssignopLinear.push_back (aop("+=", "plus_assign"));
65  AssignopLinear.push_back (aop("-=", "minus_assign"));
66 
67  vector<aop> AssignopNonlinear;
68  AssignopNonlinear.push_back (aop("*=", "multiplies_assign"));
69  AssignopNonlinear.push_back (aop("/=", "divides_assign"));
70 
71  header("FIELD", "field");
72  all_unops (tag, domain, Unop, Class, expr);
73  all_binops (tag, domain, BinopLinear, Class, expr);
74  all_binops_with_constant (tag, domain, BinopNonlinear, Class, expr);
75  all_assign_ops ("field", "stamp", tag, domain, details, AssignopLinear, Rhsclass, Class, expr);
76  all_assign_ops_with_constant ("field", "stamp", tag, domain, details, AssignopNonlinear, Rhsclass, Class, expr);
77 
78  dot ("dual", "field", Class, expr, "ndof", "scalar_type");
79  footer("FIELD", "field");
80 }
81