}
$declare_function_macro=generate(
- <<'END_OF_DECLARE_FUNCTION_MACRO','ex const & p${N}','p${N}');
+ <<'END_OF_DECLARE_FUNCTION_MACRO','GiNaC::ex const & p${N}','p${N}');
#define DECLARE_FUNCTION_${N}P(NAME) \\
extern unsigned function_index_##NAME; \\
-inline function NAME(${SEQ1}) { \\
- return function(function_index_##NAME, ${SEQ2}); \\
+inline GiNaC::function NAME(${SEQ1}) { \\
+ return GiNaC::function(function_index_##NAME, ${SEQ2}); \\
}
END_OF_DECLARE_FUNCTION_MACRO
: exprseq(${SEQ2}), serial(ser)
{
debugmsg(\"function constructor from unsigned,${N}*ex\",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_FUNCTION;
+ tinfo_key = TINFO_function;
}
END_OF_CONSTRUCTORS_IMPLEMENTATION
$interface=<<END_OF_INTERFACE;
/** \@file function.h
*
- * Interface to abstract class function (new function concept).
- *
+ * Interface to abstract class function (new function concept). */
+
+/*
* This file was generated automatically by function.pl.
* Please do not modify it directly, edit the perl script instead!
* function.pl options: \$maxargs=${maxargs}
#include <string>
#include <vector>
-
-class function;
+#include <ginac/exprseq.h>
// the following lines have been generated for max. ${maxargs} parameters
$declare_function_macro
// end of generated lines
#define REGISTER_FUNCTION(NAME,E,EF,D,S) \\
-unsigned function_index_##NAME=function::register_new(#NAME,E,EF,D,S);
+unsigned function_index_##NAME=GiNaC::function::register_new(#NAME,E,EF,D,S);
#define BEGIN_TYPECHECK \\
bool automatic_typecheck=true;
} else
#define TYPECHECK_INTEGER(VAR) \\
-if (!(VAR).info(info_flags::integer)) { \\
+if (!(VAR).info(GiNaC::info_flags::integer)) { \\
automatic_typecheck=false; \\
} else
return RV.hold(); \\
}
+namespace GiNaC {
+
+class function;
+
typedef ex (* eval_funcp)();
typedef ex (* evalf_funcp)();
typedef ex (* diff_funcp)();
// utility macros
#define is_ex_the_function(OBJ, FUNCNAME) \\
- (is_ex_exactly_of_type(OBJ, function) && static_cast<function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
+ (is_ex_exactly_of_type(OBJ, function) && static_cast<GiNaC::function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
// global constants
extern const function some_function;
extern type_info const & typeid_function;
+} // namespace GiNaC
+
#endif // ndef __GINAC_FUNCTION_H__
END_OF_INTERFACE
$implementation=<<END_OF_IMPLEMENTATION;
/** \@file function.cpp
*
- * Implementation of class function.
- *
+ * Implementation of class function. */
+
+/*
* This file was generated automatically by function.pl.
* Please do not modify it directly, edit the perl script instead!
* function.pl options: \$maxargs=${maxargs}
#include <string>
#include <stdexcept>
-#include "ginac.h"
+#include "function.h"
+#include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
function::function() : serial(0)
{
debugmsg("function default constructor",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_FUNCTION;
+ tinfo_key = TINFO_function;
}
function::~function()
function::function(unsigned ser) : serial(ser)
{
debugmsg("function constructor from unsigned",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_FUNCTION;
+ tinfo_key = TINFO_function;
}
// the following lines have been generated for max. ${maxargs} parameters
function::function(unsigned ser, exprseq const & es) : exprseq(es), serial(ser)
{
debugmsg("function constructor from unsigned,exprseq",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_FUNCTION;
+ tinfo_key = TINFO_function;
}
function::function(unsigned ser, exvector const & v, bool discardable)
: exprseq(v,discardable), serial(ser)
{
debugmsg("function constructor from string,exvector,bool",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_FUNCTION;
+ tinfo_key = TINFO_function;
}
function::function(unsigned ser, exvector * vp)
: exprseq(vp), serial(ser)
{
debugmsg("function constructor from unsigned,exvector *",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_FUNCTION;
+ tinfo_key = TINFO_function;
}
//////////
const function some_function;
type_info const & typeid_function=typeid(some_function);
+} // namespace GiNaC
+
END_OF_IMPLEMENTATION
print "Creating interface file function.h...";