basix_doc 0.1
/Users/mourrain/Devel/mmx/basix/glue/glue_syntactic.cpp
Go to the documentation of this file.
00001 
00002 #include <basix/syntactic.hpp>
00003 #include <basix/glue.hpp>
00004 
00005 namespace mmx {
00006   static syntactic
00007   GLUE_1 (const generic &arg_1) {
00008     return as_syntactic (arg_1);
00009   }
00010   
00011   static generic
00012   GLUE_2 (const syntactic &arg_1) {
00013     return as_generic (arg_1);
00014   }
00015   
00016   static string
00017   GLUE_3 (const syntactic &arg_1) {
00018     return as_string (arg_1);
00019   }
00020   
00021   static syntactic
00022   GLUE_4 (const generic &arg_1) {
00023     return flatten (arg_1);
00024   }
00025   
00026   static syntactic
00027   GLUE_5 (const syntactic &arg_1) {
00028     return -arg_1;
00029   }
00030   
00031   static syntactic
00032   GLUE_6 (const syntactic &arg_1) {
00033     return square (arg_1);
00034   }
00035   
00036   static syntactic
00037   GLUE_7 (const syntactic &arg_1, const syntactic &arg_2) {
00038     return arg_1 + arg_2;
00039   }
00040   
00041   static syntactic
00042   GLUE_8 (const syntactic &arg_1, const syntactic &arg_2) {
00043     return arg_1 - arg_2;
00044   }
00045   
00046   static syntactic
00047   GLUE_9 (const syntactic &arg_1, const syntactic &arg_2) {
00048     return arg_1 * arg_2;
00049   }
00050   
00051   static syntactic
00052   GLUE_10 (const syntactic &arg_1, const syntactic &arg_2) {
00053     return arg_1 / arg_2;
00054   }
00055   
00056   static syntactic
00057   GLUE_11 (const syntactic &arg_1, const syntactic &arg_2) {
00058     return pow (arg_1, arg_2);
00059   }
00060   
00061   void
00062   glue_syntactic () {
00063     static bool done = false;
00064     if (done) return;
00065     done = true;
00066     define_type<syntactic > (lit ("Syntactic"));
00067     define ("syntactic", GLUE_1);
00068     define ("as_generic", GLUE_2);
00069     define ("as_string", GLUE_3);
00070     define ("flatten", GLUE_4);
00071     define ("-", GLUE_5);
00072     define ("square", GLUE_6);
00073     define ("+", GLUE_7);
00074     define ("-", GLUE_8);
00075     define ("*", GLUE_9);
00076     define ("/", GLUE_10);
00077     define ("^", GLUE_11);
00078   }
00079 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines