File:  [CENS] / python / pyGiNaC / wrappers4 / fderivative.cpp
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Fri Aug 24 07:55:42 2001 UTC (16 years, 3 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Updated for GiNaC pre 0.9.4 (ex_to stuff, patch for function class)

/*
  This file is part of the PyGiNaC package.
  http://cens.ioc.ee/projects/pyginac/

  $Revision: 1.2 $
  $Id: fderivative.cpp,v 1.2 2001-08-24 07:55:42 pearu Exp $
 
  Copyright 2001 Pearu Peterson all rights reserved,
  Pearu Peterson <pearu@cens.ioc.ee>
  Permission to use, modify, and distribute this software is given under the
  terms of the LGPL.  See http://www.fsf.org
 
  NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
*/

#ifndef PYGINAC_FDERIVATIVE_CPP
#define PYGINAC_FDERIVATIVE_CPP
/* prototypes */
GiNaC::ex fderivative(unsigned,const GiNaC::paramset &, const GiNaC::exvector &,bool);
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
GiNaC::fderivative & from_python(PyObject* o, py::type<GiNaC::fderivative &>);
const GiNaC::fderivative & from_python(PyObject* o, py::type<const GiNaC::fderivative &>);
BOOST_PYTHON_END_CONVERSION_NAMESPACE
#else
#ifndef PYGINAC_FDERIVATIVE_CPP_1
#define PYGINAC_FDERIVATIVE_CPP_1
/* definitions */
this_module.def(fderivative,"fderivative");
#else
/* implementation */
GiNaC::ex fderivative(unsigned serial,
		      const GiNaC::paramset &params,
		      const GiNaC::exvector &args,
		      bool hold) {
  if (hold)
    return GiNaC::fderivative(serial, params, args).hold();
  return GiNaC::fderivative(serial, params, args);
}
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
GiNaC::fderivative & from_python(PyObject* o, py::type<GiNaC::fderivative &>) {
  if (PYOBJ_IS_EX(o)) {
    GiNaC::ex & e = pyobj_get_ex_nonconst(o);
    if (GiNaC::is_a<GiNaC::fderivative>(e))
      return GiNaC::ex_to_nonconst<GiNaC::fderivative>(e);
  }
  PyErr_SetString(PyExc_TypeError,(std::string("from_python(fderivative) expected fderivative but got ")+PyString_AsString(PyObject_Repr(PyObject_Type(o)))).c_str());
  throw py::error_already_set();
}
const GiNaC::fderivative & from_python(PyObject* o, py::type<const GiNaC::fderivative &>) {
  return from_python(o, py::type<GiNaC::fderivative &>());
}
BOOST_PYTHON_END_CONVERSION_NAMESPACE
#endif
#endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>