SyFi  0.3
swig Namespace Reference

Classes

class  SwigPtr_PyObject
struct  SwigVar_PyObject
struct  stop_iteration
struct  SwigPyIterator
struct  noconst_traits
struct  noconst_traits< const Type >
struct  pointer_category
struct  value_category
struct  traits
struct  traits_info
struct  traits< Type * >
struct  traits_as
struct  traits_check
struct  traits_from_ptr
struct  traits_from
struct  traits_from< Type * >
struct  traits_from< const Type * >
struct  traits_asptr
struct  traits_asval
struct  traits_asval< Type * >
struct  traits_as< Type, value_category >
struct  traits_as< Type, pointer_category >
struct  traits_as< Type *, pointer_category >
struct  traits_check< Type, value_category >
struct  traits_check< Type, pointer_category >
struct  traits< PyObject * >
struct  traits_asval< PyObject * >
struct  traits_check< PyObject *, value_category >
struct  traits_from< PyObject * >
class  SwigPyIterator_T
struct  from_oper
class  SwigPyIteratorOpen_T
class  SwigPyIteratorClosed_T
struct  SwigPySequence_Ref
struct  SwigPySequence_ArrowProxy
struct  SwigPySequence_InputIterator
struct  SwigPySequence_Cont
struct  traits< GiNaC::ex >
struct  traits_asptr_stdseq
struct  traits_from_stdseq
struct  traits_asptr< std::vector< T > >
struct  traits_from< std::vector< T > >
struct  traits< std::vector< GiNaC::ex, std::allocator< GiNaC::ex > > >
struct  traits_asptr< std::pair< T, U > >
struct  traits_from< std::pair< T, U > >
struct  traits< std::pair< GiNaC::ex, GiNaC::ex > >
struct  from_key_oper
struct  from_value_oper
struct  SwigPyMapIterator_T
struct  SwigPyMapKeyIterator_T
struct  SwigPyMapValueITerator_T
struct  traits_asptr< std::map< K, T, Compare, Alloc > >
struct  traits_from< std::map< K, T, Compare, Alloc > >
struct  traits< std::map< GiNaC::ex, GiNaC::ex, GiNaC::ex_is_less, std::allocator< std::pair< GiNaC::ex const, GiNaC::ex > > > >
struct  traits< int >
struct  traits_asval< int >
struct  traits_from< int >
struct  traits< std::pair< GiNaC::ex, int > >
struct  traits< std::map< GiNaC::ex, int, GiNaC::ex_is_less, std::allocator< std::pair< GiNaC::ex const, int > > > >
struct  traits< GiNaC::symbol >
struct  traits< std::pair< GiNaC::symbol, GiNaC::ex > >
struct  traits_asptr< std::list< T > >
struct  traits_from< std::list< T > >
struct  traits< std::list< std::pair< GiNaC::symbol, GiNaC::ex >, std::allocator< std::pair< GiNaC::symbol, GiNaC::ex > > > >
struct  traits< std::list< GiNaC::ex, std::allocator< GiNaC::ex > > >
struct  traits_asptr< std::set< T > >
struct  traits_from< std::set< T > >
struct  traits< std::set< GiNaC::ex, GiNaC::ex_is_less, std::allocator< GiNaC::ex > > >

Functions

template<class Type >
const char * type_name ()
template<class Type >
swig_type_infotype_info ()
template<class Type >
PyObject * from (const Type &val)
template<class Type >
PyObject * from_ptr (Type *val, int owner)
template<class Type >
int asptr (PyObject *obj, Type **vptr)
template<class Type >
int asval (PyObject *obj, Type *val)
template<class Type >
Type as (PyObject *obj, bool te=false)
template<class Type >
bool check (PyObject *obj)
template<class Difference >
size_t check_index (Difference i, size_t size, bool insert=false)
template<class Difference >
void slice_adjust (Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert=false)
template<class Sequence , class Difference >
Sequence::iterator getpos (Sequence *self, Difference i)
template<class Sequence , class Difference >
Sequence::const_iterator cgetpos (const Sequence *self, Difference i)
template<class Sequence , class Difference >
Sequence * getslice (const Sequence *self, Difference i, Difference j, Py_ssize_t step)
template<class Sequence , class Difference , class InputSeq >
void setslice (Sequence *self, Difference i, Difference j, Py_ssize_t step, const InputSeq &is=InputSeq())
template<class Sequence , class Difference >
void delslice (Sequence *self, Difference i, Difference j, Py_ssize_t step)
template<typename OutIter >
SwigPyIteratormake_output_iterator (const OutIter &current, const OutIter &begin, const OutIter &end, PyObject *seq=0)
template<typename OutIter >
SwigPyIteratormake_output_iterator (const OutIter &current, PyObject *seq=0)
template<class SwigPySeq , class Seq >
void assign (const SwigPySeq &swigpyseq, Seq *seq)
template<typename OutIter >
SwigPyIteratormake_output_key_iterator (const OutIter &current, const OutIter &begin, const OutIter &end, PyObject *seq=0)
template<typename OutIter >
SwigPyIteratormake_output_value_iterator (const OutIter &current, const OutIter &begin, const OutIter &end, PyObject *seq=0)
template<class SwigPySeq , class K , class T , class Compare , class Alloc >
void assign (const SwigPySeq &swigpyseq, std::map< K, T, Compare, Alloc > *map)
template<class SwigPySeq , class T >
void assign (const SwigPySeq &swigpyseq, std::set< T > *seq)

Function Documentation

template<class Type >
Type swig::as ( PyObject *  obj,
bool  te = false 
) [inline]

Definition at line 4032 of file SyFiPYTHON_wrap.cxx.

                                                 {
    return traits_as<Type, typename traits<Type>::category>::as(obj, te);
  }
template<class SwigPySeq , class Seq >
void swig::assign ( const SwigPySeq &  swigpyseq,
Seq *  seq 
) [inline]

Definition at line 4820 of file SyFiPYTHON_wrap.cxx.

Referenced by _wrap_exlist_assign(), _wrap_exvector_assign(), _wrap_symexlist_assign(), and swig::traits_asptr_stdseq< Seq, T >::asptr().

                                               {
    // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
    typedef typename SwigPySeq::value_type value_type;
    typename SwigPySeq::const_iterator it = swigpyseq.begin();
    for (;it != swigpyseq.end(); ++it) {
      seq->insert(seq->end(),(value_type)(*it));
    }
  }
template<class SwigPySeq , class K , class T , class Compare , class Alloc >
void swig::assign ( const SwigPySeq &  swigpyseq,
std::map< K, T, Compare, Alloc > *  map 
) [inline]

Definition at line 5258 of file SyFiPYTHON_wrap.cxx.

                                                                        {
      typedef typename std::map<K,T,Compare,Alloc >::value_type value_type;
      typename SwigPySeq::const_iterator it = swigpyseq.begin();
      for (;it != swigpyseq.end(); ++it) {
        map->insert(value_type(it->first, it->second));
      }
    }
template<class SwigPySeq , class T >
void swig::assign ( const SwigPySeq &  swigpyseq,
std::set< T > *  seq 
) [inline]

Definition at line 5819 of file SyFiPYTHON_wrap.cxx.

                                                       {
      // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
      typedef typename SwigPySeq::value_type value_type;
      typename SwigPySeq::const_iterator it = swigpyseq.begin();
      for (;it != swigpyseq.end(); ++it) {
        seq->insert(seq->end(),(value_type)(*it));
      }
    }
template<class Type >
int swig::asval ( PyObject *  obj,
Type *  val 
) [inline]
template<class Sequence , class Difference >
Sequence::const_iterator swig::cgetpos ( const Sequence *  self,
Difference  i 
) [inline]
template<class Type >
bool swig::check ( PyObject *  obj) [inline]

Definition at line 4053 of file SyFiPYTHON_wrap.cxx.

                                   {
    return traits_check<Type, typename traits<Type>::category>::check(obj);
  }
template<class Difference >
size_t swig::check_index ( Difference  i,
size_t  size,
bool  insert = false 
) [inline]

Definition at line 4143 of file SyFiPYTHON_wrap.cxx.

Referenced by cgetpos(), and getpos().

                                                              {
    if ( i < 0 ) {
      if ((size_t) (-i) <= size)
        return (size_t) (i + size);
    } else if ( (size_t) i < size ) {
      return (size_t) i;
    } else if (insert && ((size_t) i == size)) {
      return size;
    }
    throw std::out_of_range("index out of range");
  }
template<class Sequence , class Difference >
void swig::delslice ( Sequence *  self,
Difference  i,
Difference  j,
Py_ssize_t  step 
) [inline]

Definition at line 4318 of file SyFiPYTHON_wrap.cxx.

References test_syfi::debug::c, and slice_adjust().

Referenced by std_list_Sl_GiNaC_ex_Sg____delitem____SWIG_1(), std_list_Sl_GiNaC_ex_Sg____delslice__(), std_list_Sl_GiNaC_ex_Sg____setitem____SWIG_1(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg____delitem____SWIG_1(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg____delslice__(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg____setitem____SWIG_1(), std_vector_Sl_GiNaC_ex_Sg____delitem____SWIG_1(), std_vector_Sl_GiNaC_ex_Sg____delslice__(), and std_vector_Sl_GiNaC_ex_Sg____setitem____SWIG_1().

                                                                        {
    typename Sequence::size_type size = self->size();
    Difference ii = 0;
    Difference jj = 0;
    swig::slice_adjust(i, j, step, size, ii, jj, true);
    if (step > 0) {
      if (jj > ii) {
        typename Sequence::iterator sb = self->begin();
        std::advance(sb,ii);
        if (step == 1) {
          typename Sequence::iterator se = self->begin();
          std::advance(se,jj);
          self->erase(sb,se);
        } else {
          typename Sequence::iterator it = sb;
          size_t delcount = (jj - ii + step - 1) / step;
          while (delcount) {
            it = self->erase(it);
            for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c)
              it++;
            delcount--;
          }
        }
      }
    } else {
      if (ii > jj) {
        typename Sequence::reverse_iterator sb = self->rbegin();
        std::advance(sb,size-ii-1);
        typename Sequence::reverse_iterator it = sb;
        size_t delcount = (ii - jj - step - 1) / -step;
        while (delcount) {
          it = typename Sequence::reverse_iterator(self->erase((++it).base()));
          for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c)
            it++;
          delcount--;
        }
      }
    }
  }
template<class Type >
PyObject* swig::from_ptr ( Type *  val,
int  owner 
) [inline]

Definition at line 3904 of file SyFiPYTHON_wrap.cxx.

References from().

                                                  {
    return traits_from_ptr<Type>::from(val, owner);
  }
template<class Sequence , class Difference >
Sequence::iterator swig::getpos ( Sequence *  self,
Difference  i 
) [inline]
template<class Sequence , class Difference >
Sequence* swig::getslice ( const Sequence *  self,
Difference  i,
Difference  j,
Py_ssize_t  step 
) [inline]

Definition at line 4209 of file SyFiPYTHON_wrap.cxx.

References test_syfi::debug::c, and slice_adjust().

Referenced by std_list_Sl_GiNaC_ex_Sg____getitem____SWIG_0(), std_list_Sl_GiNaC_ex_Sg____getslice__(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg____getitem____SWIG_0(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg____getslice__(), std_vector_Sl_GiNaC_ex_Sg____getitem____SWIG_0(), and std_vector_Sl_GiNaC_ex_Sg____getslice__().

                                                                              {
    typename Sequence::size_type size = self->size();
    Difference ii = 0;
    Difference jj = 0;
    swig::slice_adjust(i, j, step, size, ii, jj);

    if (step > 0) {
      typename Sequence::const_iterator sb = self->begin();
      typename Sequence::const_iterator se = self->begin();
      std::advance(sb,ii);
      std::advance(se,jj);
      if (step == 1) {
        return new Sequence(sb, se);
      } else {
        Sequence *sequence = new Sequence();
        typename Sequence::const_iterator it = sb;
        while (it!=se) {
          sequence->push_back(*it);
          for (Py_ssize_t c=0; c<step && it!=se; ++c)
            it++;
        }
        return sequence;
      } 
    } else {
      Sequence *sequence = new Sequence();
      if (ii > jj) {
        typename Sequence::const_reverse_iterator sb = self->rbegin();
        typename Sequence::const_reverse_iterator se = self->rbegin();
        std::advance(sb,size-ii-1);
        std::advance(se,size-jj-1);
        typename Sequence::const_reverse_iterator it = sb;
        while (it!=se) {
          sequence->push_back(*it);
          for (Py_ssize_t c=0; c<-step && it!=se; ++c)
            it++;
        }
      }
      return sequence;
    }
  }
template<typename OutIter >
SwigPyIterator* swig::make_output_iterator ( const OutIter &  current,
const OutIter &  begin,
const OutIter &  end,
PyObject *  seq = 0 
) [inline]

Definition at line 4561 of file SyFiPYTHON_wrap.cxx.

Referenced by _wrap_ex_int_map_begin(), _wrap_ex_int_map_end(), _wrap_ex_int_map_find(), _wrap_ex_int_map_lower_bound(), _wrap_ex_int_map_rbegin(), _wrap_ex_int_map_rend(), _wrap_ex_int_map_upper_bound(), _wrap_exlist_begin(), _wrap_exlist_end(), _wrap_exlist_erase__SWIG_0(), _wrap_exlist_erase__SWIG_1(), _wrap_exlist_insert__SWIG_0(), _wrap_exlist_rbegin(), _wrap_exlist_rend(), _wrap_exmap_begin(), _wrap_exmap_end(), _wrap_exmap_find(), _wrap_exmap_lower_bound(), _wrap_exmap_rbegin(), _wrap_exmap_rend(), _wrap_exmap_upper_bound(), _wrap_exset_begin(), _wrap_exset_end(), _wrap_exset_equal_range(), _wrap_exset_find(), _wrap_exset_insert(), _wrap_exset_lower_bound(), _wrap_exset_rbegin(), _wrap_exset_rend(), _wrap_exset_upper_bound(), _wrap_exvector_begin(), _wrap_exvector_end(), _wrap_exvector_erase__SWIG_0(), _wrap_exvector_erase__SWIG_1(), _wrap_exvector_insert__SWIG_0(), _wrap_exvector_rbegin(), _wrap_exvector_rend(), _wrap_symexlist_begin(), _wrap_symexlist_end(), _wrap_symexlist_erase__SWIG_0(), _wrap_symexlist_erase__SWIG_1(), _wrap_symexlist_insert__SWIG_0(), _wrap_symexlist_rbegin(), _wrap_symexlist_rend(), std_list_Sl_GiNaC_ex_Sg__iterator(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg__iterator(), std_map_Sl_GiNaC_ex_Sc_GiNaC_ex_Sc_GiNaC_ex_is_less_Sg__iterator(), std_map_Sl_GiNaC_ex_Sc_int_Sc_GiNaC_ex_is_less_Sg__iterator(), std_set_Sl_GiNaC_ex_Sc_GiNaC_ex_is_less_Sg__iterator(), and std_vector_Sl_GiNaC_ex_Sg__iterator().

  {
    return new SwigPyIteratorClosed_T<OutIter>(current, begin, end, seq);
  }
template<typename OutIter >
SwigPyIterator* swig::make_output_iterator ( const OutIter &  current,
PyObject *  seq = 0 
) [inline]

Definition at line 4568 of file SyFiPYTHON_wrap.cxx.

  {
    return new SwigPyIteratorOpen_T<OutIter>(current, seq);
  }
template<typename OutIter >
SwigPyIterator* swig::make_output_key_iterator ( const OutIter &  current,
const OutIter &  begin,
const OutIter &  end,
PyObject *  seq = 0 
) [inline]

Definition at line 5230 of file SyFiPYTHON_wrap.cxx.

Referenced by std_map_Sl_GiNaC_ex_Sc_GiNaC_ex_Sc_GiNaC_ex_is_less_Sg__key_iterator(), and std_map_Sl_GiNaC_ex_Sc_int_Sc_GiNaC_ex_is_less_Sg__key_iterator().

    {
      return new SwigPyMapKeyIterator_T<OutIter>(current, begin, end, seq);
    }
template<typename OutIter >
SwigPyIterator* swig::make_output_value_iterator ( const OutIter &  current,
const OutIter &  begin,
const OutIter &  end,
PyObject *  seq = 0 
) [inline]

Definition at line 5248 of file SyFiPYTHON_wrap.cxx.

Referenced by std_map_Sl_GiNaC_ex_Sc_GiNaC_ex_Sc_GiNaC_ex_is_less_Sg__value_iterator(), and std_map_Sl_GiNaC_ex_Sc_int_Sc_GiNaC_ex_is_less_Sg__value_iterator().

    {
      return new SwigPyMapValueITerator_T<OutIter>(current, begin, end, seq);
    }
template<class Sequence , class Difference , class InputSeq >
void swig::setslice ( Sequence *  self,
Difference  i,
Difference  j,
Py_ssize_t  step,
const InputSeq &  is = InputSeq() 
) [inline]

Definition at line 4252 of file SyFiPYTHON_wrap.cxx.

References test_syfi::debug::c, and slice_adjust().

Referenced by std_list_Sl_GiNaC_ex_Sg____setitem____SWIG_0(), std_list_Sl_GiNaC_ex_Sg____setslice____SWIG_0(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg____setitem____SWIG_0(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg____setslice____SWIG_0(), std_vector_Sl_GiNaC_ex_Sg____setitem____SWIG_0(), and std_vector_Sl_GiNaC_ex_Sg____setslice____SWIG_0().

                                                                                                         {
    typename Sequence::size_type size = self->size();
    Difference ii = 0;
    Difference jj = 0;
    swig::slice_adjust(i, j, step, size, ii, jj, true);
    if (step > 0) {
      if (jj < ii)
        jj = ii;
      if (step == 1) {
        size_t ssize = jj - ii;
        if (ssize <= is.size()) {
          // expanding/staying the same size
          typename Sequence::iterator sb = self->begin();
          typename InputSeq::const_iterator isit = is.begin();
          std::advance(sb,ii);
          std::advance(isit, jj - ii);
          self->insert(std::copy(is.begin(), isit, sb), isit, is.end());
        } else {
          // shrinking
          typename Sequence::iterator sb = self->begin();
          typename Sequence::iterator se = self->begin();
          std::advance(sb,ii);
          std::advance(se,jj);
          self->erase(sb,se);
          sb = self->begin();
          std::advance(sb,ii);
          self->insert(sb, is.begin(), is.end());
        }
      } else {
        size_t replacecount = (jj - ii + step - 1) / step;
        if (is.size() != replacecount) {
          char msg[1024];
          sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount);
          throw std::invalid_argument(msg);
        }
        typename Sequence::const_iterator isit = is.begin();
        typename Sequence::iterator it = self->begin();
        std::advance(it,ii);
        for (size_t rc=0; rc<replacecount; ++rc) {
          *it++ = *isit++;
          for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c)
            it++;
        }
      }
    } else {
      if (jj > ii)
        jj = ii;
      size_t replacecount = (ii - jj - step - 1) / -step;
      if (is.size() != replacecount) {
        char msg[1024];
        sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount);
        throw std::invalid_argument(msg);
      }
      typename Sequence::const_iterator isit = is.begin();
      typename Sequence::reverse_iterator it = self->rbegin();
      std::advance(it,size-ii-1);
      for (size_t rc=0; rc<replacecount; ++rc) {
        *it++ = *isit++;
        for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c)
          it++;
      }
    }
  }
template<class Difference >
void swig::slice_adjust ( Difference  i,
Difference  j,
Py_ssize_t  step,
size_t  size,
Difference &  ii,
Difference &  jj,
bool  insert = false 
)

Definition at line 4157 of file SyFiPYTHON_wrap.cxx.

Referenced by delslice(), getslice(), and setslice().

                                                                                                                              {
    if (step == 0) {
      throw std::invalid_argument("slice step cannot be zero");
    } else if (step > 0) {
      // Required range: 0 <= i < size, 0 <= j < size
      if (i < 0) {
        ii = 0;
      } else if (i < (Difference)size) {
        ii = i;
      } else if (insert && (i >= (Difference)size)) {
        ii = (Difference)size;
      }
      if ( j < 0 ) {
        jj = 0;
      } else {
        jj = (j < (Difference)size) ? j : (Difference)size;
      }
    } else {
      // Required range: -1 <= i < size-1, -1 <= j < size-1
      if (i < -1) {
        ii = -1;
      } else if (i < (Difference) size) {
        ii = i;
      } else if (i >= (Difference)(size-1)) {
        ii = (Difference)(size-1);
      }
      if (j < -1) {
        jj = -1;
      } else {
        jj = (j < (Difference)size ) ? j : (Difference)(size-1);
      }
    }
  }
template<class Type >
swig_type_info* swig::type_info ( ) [inline]

Definition at line 3840 of file SyFiPYTHON_wrap.cxx.

template<class Type >
const char* swig::type_name ( ) [inline]

Definition at line 3823 of file SyFiPYTHON_wrap.cxx.

                                 {
    return traits<typename noconst_traits<Type >::noconst_type >::type_name();
  }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines