basix_doc 0.1
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().

                                                                          :
    routine_rep (gen (GEN_COMPOSE, fun2->name, as_generic (flatten (args2)))),
    fun (fun2), args (args2)
  {
    sig= copy (fun->signature ());
    if (N(sig) != 0) {
      ASSERT (N(sig) == N(args)+1,
              "numbers of arguments don't match (composed_routine_rep)");
      for (nat i=0; i<N(args); i++) {
        const vector<nat> sub_sig= args[i]->signature ();
        ASSERT (N(sub_sig) == 2,
                "routine with one argument expected (composed_routine_rep)");
        ASSERT (read (sig, i+1) == sub_sig[0] || read (sig, i+1) == 0,
                "type mismatch (composed_routine_rep)");
        sig[i+1]= sub_sig[1];
      }
    }
  }

Member Function Documentation

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().

                                         {
    ASSERT (N(args) == 1, "arity one expected");
    return fun->apply (args[0]->apply (x));
  }
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().

                                                           {
    ASSERT (N(args) == 2, "arity two expected");
    return fun->apply (args[0]->apply (x), args[1]->apply (y));
  }
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().

                          {
  return apply (vec<generic> ());
}
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.

                                                 {
    nat i, n= N(v);
    ASSERT (N(args) == n, "arity " * as_string (n) * " expected");
    vector<generic> w= fill<generic> (n);
    for (i=0; i<n; i++)
      w[i]= args[i]->apply (v[i]);
    return fun->apply (w);
  }
routine clone ( ) const [virtual, inherited]

Definition at line 91 of file routine.cpp.

References ERROR.

                          {
  ERROR ("not implemented (clone)");
  return routine (this, true);
}
generic function_body ( ) const [virtual, inherited]

Definition at line 81 of file routine.cpp.

                                  {
  return "native";
}
generic function_type ( ) const [virtual, inherited]
bool is_overloaded ( ) const [virtual, inherited]

Definition at line 71 of file routine.cpp.

                                  {
  return false;
}
vector< routine > meanings ( ) const [virtual, inherited]

Definition at line 76 of file routine.cpp.

References ERROR.

                             {
  ERROR ("not implemented (meanings)");
}
void overload ( const routine fun) const [virtual, inherited]

Definition at line 66 of file routine.cpp.

References ERROR.

                                               {
  ERROR ("not implemented (overload)");
}
vector<nat> signature ( ) const [inline, virtual]

Reimplemented from routine_rep.

Definition at line 162 of file routine.cpp.

{ 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 138 of file basix.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines