multi_iter.rst 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. multi_iter
  2. ==========
  3. .. contents :: Table of Contents
  4. A ``multi_iter`` is a Python object, intended to be used as an iterator It should generally only be used in loops.
  5. ``<boost/python/numpy/ufunc.hpp>`` contains the class definitions for ``multi_iter``
  6. synopsis
  7. --------
  8. ::
  9. namespace boost
  10. {
  11. namespace python
  12. {
  13. namespace numpy
  14. {
  15. class multi_iter : public object
  16. {
  17. public:
  18. void next();
  19. bool not_done() const;
  20. char * get_data(int n) const;
  21. int const get_nd() const;
  22. Py_intptr_t const * get_shape() const;
  23. Py_intptr_t const shape(int n) const;
  24. };
  25. multi_iter make_multi_iter(object const & a1);
  26. multi_iter make_multi_iter(object const & a1, object const & a2);
  27. multi_iter make_multi_iter(object const & a1, object const & a2, object const & a3);
  28. }
  29. }
  30. }
  31. constructors
  32. ------------
  33. ::
  34. multi_iter make_multi_iter(object const & a1);
  35. multi_iter make_multi_iter(object const & a1, object const & a2);
  36. multi_iter make_multi_iter(object const & a1, object const & a2, object const & a3);
  37. :Returns: A Python iterator object broadcasting over one, two or three sequences as supplied
  38. accessors
  39. ---------
  40. ::
  41. void next();
  42. :Effects: Increments the iterator
  43. ::
  44. bool not_done() const;
  45. :Returns: boolean value indicating whether the iterator is at its end
  46. ::
  47. char * get_data(int n) const;
  48. :Returns: a pointer to the element of the nth broadcasted array.
  49. ::
  50. int const get_nd() const;
  51. :Returns: the number of dimensions of the broadcasted array expression
  52. ::
  53. Py_intptr_t const * get_shape() const;
  54. :Returns: the shape of the broadcasted array expression as an array of integers.
  55. ::
  56. Py_intptr_t const shape(int n) const;
  57. :Returns: the shape of the broadcasted array expression in the nth dimension.