$number_of_members=$#MEMBERS+1;
$constructor_arglist=generate('ex tmp_${MEMBER}',', ');
-$member_access_functions=generate(' ex const & ${MEMBER}(void) { return m_${MEMBER}; }',"\n");
+$member_access_functions=generate(' const ex & ${MEMBER}(void) { return m_${MEMBER}; }',"\n");
$op_access_indices_decl=generate(' static unsigned op_${MEMBER};',"\n");
$op_access_indices_def=generate('unsigned ${STRUCTURE}::op_${MEMBER}=${N}-1;',"\n");
$members=generate(' ex m_${MEMBER}; ${COMMENT}',"\n");
* This file was generated automatically by structure.pl.
* Please do not modify it directly, edit the perl script instead!
*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef __GINAC_${STRUCTURE_UC}_H__
#define __GINAC_${STRUCTURE_UC}_H__
-#include <ginac/structure.h>
+#include "structure.h"
+#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
+#endif // ndef NO_NAMESPACE_GINAC
class ${STRUCTURE} : public structure
{
void print(ostream & os, unsigned upper_precedence=0) const;
void printtree(ostream & os, unsigned indent) const;
int nops() const;
- ex & let_op(int const i);
+ ex & let_op(int i);
ex expand(unsigned options=0) const;
- bool has(ex const & other) const;
+ bool has(const ex & other) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
- ex diff(symbol const & s) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex diff(const symbol & s) const;
+ ex subs(const lst & ls, const lst & lr) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
// new virtual functions which can be overridden by derived classes
// global constants
extern const ${STRUCTURE} some_${STRUCTURE};
-extern type_info const & typeid_${STRUCTURE};
+extern const type_info & typeid_${STRUCTURE};
extern const unsigned tinfo_${STRUCTURE};
// macros
#define ex_to_${STRUCTURE}(X) (static_cast<${STRUCTURE} const &>(*(X).bp))
+#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
+#endif // ndef NO_NAMESPACE_GINAC
#endif // ndef _${STRUCTURE_UC}_H_
* This file was generated automatically by STRUCTURE.pl.
* Please do not modify it directly, edit the perl script instead!
*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "${STRUCTURE}.h"
+#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
+#endif // ndef NO_NAMESPACE_GINAC
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
return ${number_of_members};
}
-ex & ${STRUCTURE}::let_op(int const i)
+ex & ${STRUCTURE}::let_op(int i)
{
- ASSERT(i>=0);
- ASSERT(i<nops());
+ GINAC_ASSERT(i>=0);
+ GINAC_ASSERT(i<nops());
switch (i) {
${let_op_statements}
// a ${STRUCTURE} 'has' an expression if it is this expression itself or a child 'has' it
-bool ${STRUCTURE}::has(ex const & other) const
+bool ${STRUCTURE}::has(const ex & other) const
{
- ASSERT(other.bp!=0);
+ GINAC_ASSERT(other.bp!=0);
if (is_equal(*other.bp)) return true;
${has_statements}
return false;
/** ${STRUCTURE}::diff() differentiates the children.
there is no need to check for triavially equal, since diff usually
does not return itself unevaluated. */
-ex ${STRUCTURE}::diff(symbol const & s) const
+ex ${STRUCTURE}::diff(const symbol & s) const
{
${diff_statements}
return ${STRUCTURE}(${temporary_arglist});
}
-ex ${STRUCTURE}::subs(lst const & ls, lst const & lr) const
+ex ${STRUCTURE}::subs(const lst & ls, const lst & lr) const
{
bool all_are_trivially_equal=true;
${subs_statements}
// protected
-int ${STRUCTURE}::compare_same_type(basic const & other) const
+int ${STRUCTURE}::compare_same_type(const basic & other) const
{
- ASSERT(is_of_type(other,${STRUCTURE}));
+ GINAC_ASSERT(is_of_type(other,${STRUCTURE}));
${STRUCTURE} const & o=static_cast<${STRUCTURE} const &>
(const_cast<basic &>(other));
int cmpval;
return 0;
}
-bool ${STRUCTURE}::is_equal_same_type(basic const & other) const
+bool ${STRUCTURE}::is_equal_same_type(const basic & other) const
{
- ASSERT(is_of_type(other,${STRUCTURE}));
+ GINAC_ASSERT(is_of_type(other,${STRUCTURE}));
${STRUCTURE} const & o=static_cast<${STRUCTURE} const &>
(const_cast<basic &>(other));
${is_equal_statements}
//////////
const ${STRUCTURE} some_${STRUCTURE};
-type_info const & typeid_${STRUCTURE}=typeid(some_${STRUCTURE});
+const type_info & typeid_${STRUCTURE}=typeid(some_${STRUCTURE});
const unsigned tinfo_${STRUCTURE}=structure::register_new("${STRUCTURE}");
+#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
+#endif // ndef NO_NAMESPACE_GINAC
END_OF_IMPLEMENTATION