composed_routine_rep Class Reference

Inheritance diagram for composed_routine_rep:
routine_rep rep_struct

List of all members.

Public Member Functions

Public Attributes


Detailed Description

Definition at line 123 of file routine.cpp.


Constructor & Destructor Documentation

composed_routine_rep ( const routine fun2,
const vector< routine > &  args2 
) [inline]

Definition at line 128 of file routine.cpp.

References ASSERT, mmx::copy(), mmx::N(), and mmx::read().

00128                                                                           :
00129     routine_rep (gen (GEN_COMPOSE, fun2->name, as_generic (flatten (args2)))),
00130     fun (fun2), args (args2)
00131   {
00132     sig= copy (fun->signature ());
00133     if (N(sig) != 0) {
00134       ASSERT (N(sig) == N(args)+1,
00135               "numbers of arguments don't match (composed_routine_rep)");
00136       for (nat i=0; i<N(args); i++) {
00137         const vector<nat> sub_sig= args[i]->signature ();
00138         ASSERT (N(sub_sig) == 2,
00139                 "routine with one argument expected (composed_routine_rep)");
00140         ASSERT (read (sig, i+1) == sub_sig[0] || read (sig, i+1) == 0,
00141                 "type mismatch (composed_routine_rep)");
00142         sig[i+1]= sub_sig[1];
00143       }
00144     }
00145   }
  generic apply (const generic& x) const {


Member Function Documentation

generic apply (  )  const [virtual, inherited]

Reimplemented in nullary_routine_rep< void >, change_signature_routine_rep, and integrate_routine_rep.

Definition at line 37 of file routine.cpp.

Referenced by routine_rep::apply().

00037                           {
00038   return apply (vec<generic> ());
00039 }

generic apply ( const vector< generic > &  v  )  const [inline, virtual]

Reimplemented from routine_rep.

Definition at line 154 of file routine.cpp.

References mmx::apply(), mmx::as_string(), ASSERT, mmx::N(), and n.

00154                                                  {
00155     nat i, n= N(v);
00156     ASSERT (N(args) == n, "arity " * as_string (n) * " expected");
00157     vector<generic> w= fill<generic> (n);
00158     for (i=0; i<n; i++)
00159       w[i]= args[i]->apply (v[i]);
00160     return fun->apply (w);
00161   }

generic apply ( const generic x,
const generic y 
) const [inline, virtual]

Reimplemented from routine_rep.

Definition at line 150 of file routine.cpp.

References mmx::apply(), ASSERT, and mmx::N().

00150                                                            {
00151     ASSERT (N(args) == 2, "arity two expected");
00152     return fun->apply (args[0]->apply (x), args[1]->apply (y));
00153   }

generic apply ( const generic x  )  const [inline, virtual]

Reimplemented from routine_rep.

Definition at line 146 of file routine.cpp.

References mmx::apply(), ASSERT, and mmx::N().

00146                                          {
00147     ASSERT (N(args) == 1, "arity one expected");
00148     return fun->apply (args[0]->apply (x));
00149   }

routine clone (  )  const [virtual, inherited]

Definition at line 91 of file routine.cpp.

References ERROR.

00091                           {
00092   ERROR ("not implemented (clone)");
00093   return routine (this, true);
00094 }

generic function_body (  )  const [virtual, inherited]

Definition at line 81 of file routine.cpp.

00081                                   {
00082   return "native";
00083 }

generic function_type (  )  const [virtual, inherited]

Definition at line 86 of file routine.cpp.

References mmx::gen(), mmx::GEN_FUNCTION_TYPE, routine_rep::signature(), and mmx::type_name().

00086                                   {
00087   return gen (GEN_FUNCTION_TYPE, type_name (signature ()));
00088 }

bool is_overloaded (  )  const [virtual, inherited]

Definition at line 71 of file routine.cpp.

00071                                   {
00072   return false;
00073 }

vector< routine > meanings (  )  const [virtual, inherited]

Definition at line 76 of file routine.cpp.

References ERROR.

00076                              {
00077   ERROR ("not implemented (meanings)");
00078 }

void overload ( const routine fun  )  const [virtual, inherited]

Definition at line 66 of file routine.cpp.

References ERROR.

00066                                                {
00067   ERROR ("not implemented (overload)");
00068 }

vector<nat> signature (  )  const [inline, virtual]

Reimplemented from routine_rep.

Definition at line 162 of file routine.cpp.

00162 { return sig; }


Member Data Documentation

generic name [inherited]

Definition at line 64 of file routine.hpp.

Referenced by routine_rep::apply().

MMX_ALLOCATORS int ref_count [inherited]

Definition at line 164 of file basix.hpp.


The documentation for this class was generated from the following file:

Generated on 6 Dec 2012 for basix by  doxygen 1.6.1