/** @file ex.h
*
- * Interface to GiNaC's light-weight expression handles.
- *
+ * Interface to GiNaC's light-weight expression handles. */
+
+/*
* GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
#define __GINAC_EX_H__
#include <iostream>
+#include <ginac/basic.h>
+#include <ginac/operators.h>
+
+namespace GiNaC {
class ex;
class expand_options;
#ifdef INLINE_EX_CONSTRUCTORS
: bp(exZERO().bp)
{
- debugmsg("ex default constructor",LOGLEVEL_CONSTRUCT);
ASSERT(exZERO().bp!=0);
ASSERT(exZERO().bp->flags & status_flags::dynallocated);
ASSERT(bp!=0);
~ex()
#ifdef INLINE_EX_CONSTRUCTORS
{
- debugmsg("ex destructor",LOGLEVEL_DESTRUCT);
ASSERT(bp!=0);
ASSERT(bp->flags & status_flags::dynallocated);
if (--bp->refcount == 0) {
#ifdef INLINE_EX_CONSTRUCTORS
: bp(other.bp)
{
- debugmsg("ex copy constructor",LOGLEVEL_CONSTRUCT);
ASSERT(bp!=0);
ASSERT((bp->flags) & status_flags::dynallocated);
++bp->refcount;
ex const & operator=(ex const & other)
#ifdef INLINE_EX_CONSTRUCTORS
{
- debugmsg("ex operator=",LOGLEVEL_ASSIGNMENT);
ASSERT(bp!=0);
ASSERT(bp->flags & status_flags::dynallocated);
ASSERT(other.bp!=0);
ex(basic const & other)
#ifdef INLINE_EX_CONSTRUCTORS
{
- debugmsg("ex constructor from basic",LOGLEVEL_CONSTRUCT);
construct_from_basic(other);
}
#else
public:
basic *bp;
-
};
+// utility functions
+inline bool are_ex_trivially_equal(const ex &e1, const ex &e2)
+{
+ return e1.bp == e2.bp;
+}
+
// wrapper functions around member functions
inline int nops(ex const & thisex)
{ return thisex.nops(); }
inline void swap(ex & e1, ex & e2)
{ e1.swap(e2); }
+} // namespace GiNaC
+
#endif // ndef __GINAC_EX_H__