Namespaces | Classes | Functions
boost::numpy Namespace Reference

Namespaces

namespace  detail

Classes

struct  as_matrix
 CallPolicies that causes a function that returns a numpy.ndarray to return a numpy.matrix instead. More...
struct  binary_ufunc
 Helps wrap a C++ functor taking a pair of scalar arguments as a broadcasting ufunc-like Python object. More...
class  dtype
 A boost.python "object manager" (subclass of object) for numpy.dtype. More...
class  matrix
 A boost.python "object manager" (subclass of object) for numpy.matrix. More...
class  multi_iter
 A boost.python "object manager" (subclass of object) for PyArray_MultiIter. More...
class  ndarray
 A boost.python "object manager" (subclass of object) for numpy.ndarray. More...
struct  unary_ufunc
 Helps wrap a C++ functor taking a single scalar argument as a broadcasting ufunc-like Python object. More...
class  void_
 A boost.python "object manager" (subclass of object) for numpy.void. More...

Functions

ndarray array (python::object const &obj)
 Construct a new array from an arbitrary Python sequence.
ndarray array (python::object const &obj, dtype const &dt)
ndarray empty (python::tuple const &shape, dtype const &dt)
 Construct a new array with the given shape and data type, with data left uninitialized.
ndarray empty (int nd, Py_intptr_t const *shape, dtype const &dt)
bool equivalent (dtype const &a, dtype const &b)
template<typename Container >
ndarray from_data (void *data, dtype const &dt, Container shape, Container strides, python::object const &owner)
 Construct a new ndarray object from a raw pointer.
template<typename Container >
ndarray from_data (void const *data, dtype const &dt, Container shape, Container strides, python::object const &owner)
 Construct a new ndarray object from a raw pointer.
ndarray from_object (python::object const &obj, dtype const &dt, int nd_min, int nd_max, ndarray::bitflag flags=ndarray::NONE)
 Transform an arbitrary object into a numpy array with the given requirements.
ndarray from_object (python::object const &obj, dtype const &dt, int nd, ndarray::bitflag flags=ndarray::NONE)
ndarray from_object (python::object const &obj, dtype const &dt, ndarray::bitflag flags=ndarray::NONE)
ndarray from_object (python::object const &obj, int nd_min, int nd_max, ndarray::bitflag flags=ndarray::NONE)
ndarray from_object (python::object const &obj, int nd, ndarray::bitflag flags=ndarray::NONE)
ndarray from_object (python::object const &obj, ndarray::bitflag flags=ndarray::NONE)
void initialize (bool register_scalar_converters=true)
 Initialize the Numpy C-API.
template<typename TypeSequence , typename DimSequence , typename Function >
void invoke_matching_array (ndarray const &array_, Function f)
template<typename Sequence , typename Function >
void invoke_matching_dtype (dtype const &dtype_, Function f)
template<typename Sequence , typename Function >
void invoke_matching_nd (int nd, Function f)
multi_iter make_multi_iter (python::object const &a1)
 Construct a multi_iter over a single sequence or scalar object.
multi_iter make_multi_iter (python::object const &a1, python::object const &a2)
 Construct a multi_iter by broadcasting two objects.
multi_iter make_multi_iter (python::object const &a1, python::object const &a2, python::object const &a3)
 Construct a multi_iter by broadcasting three objects.
ndarray::bitflag operator& (ndarray::bitflag a, ndarray::bitflag b)
ndarray::bitflag operator| (ndarray::bitflag a, ndarray::bitflag b)
static void * wrap_import_array ()
ndarray zeros (python::tuple const &shape, dtype const &dt)
 Construct a new array with the given shape and data type, with data initialized to zero.
ndarray zeros (int nd, Py_intptr_t const *shape, dtype const &dt)

Function Documentation

ndarray boost::numpy::array ( python::object const &  obj)

Construct a new array from an arbitrary Python sequence.

Todo:
This does't seem to handle ndarray subtypes the same way that "numpy.array" does in Python.

Definition at line 246 of file src/ndarray.cpp.

ndarray boost::numpy::array ( python::object const &  obj,
dtype const &  dt 
)

Definition at line 252 of file src/ndarray.cpp.

ndarray boost::numpy::empty ( python::tuple const &  shape,
dtype const &  dt 
)

Construct a new array with the given shape and data type, with data left uninitialized.

Definition at line 231 of file src/ndarray.cpp.

ndarray boost::numpy::empty ( int  nd,
Py_intptr_t const *  shape,
dtype const &  dt 
)

Definition at line 240 of file src/ndarray.cpp.

bool boost::numpy::equivalent ( dtype const &  a,
dtype const &  b 
)

This is more permissive than equality tests. For instance, if long and int are the same size, the dtypes corresponding to each will be equivalent, but not equal.

Definition at line 89 of file src/dtype.cpp.

template<typename Container >
ndarray boost::numpy::from_data ( void *  data,
dtype const &  dt,
Container  shape,
Container  strides,
python::object const &  owner 
) [inline]

Construct a new ndarray object from a raw pointer.

Parameters:
[in]dataRaw pointer to the first element of the array.
[in]dtData type descriptor. Often retrieved with dtype::get_builtin().
[in]shapeShape of the array as STL container of integers; must have begin() and end().
[in]stridesShape of the array as STL container of integers; must have begin() and end().
[in]ownerAn arbitray Python object that owns that data pointer. The array object will keep a reference to the object, and decrement it's reference count when the array goes out of scope. Pass None at your own peril.
Todo:
Should probably take ranges of iterators rather than actual container objects.

Definition at line 209 of file ndarray.hpp.

template<typename Container >
ndarray boost::numpy::from_data ( void const *  data,
dtype const &  dt,
Container  shape,
Container  strides,
python::object const &  owner 
) [inline]

Construct a new ndarray object from a raw pointer.

Parameters:
[in]dataRaw pointer to the first element of the array.
[in]dtData type descriptor. Often retrieved with dtype::get_builtin().
[in]shapeShape of the array as STL container of integers; must have begin() and end().
[in]stridesShape of the array as STL container of integers; must have begin() and end().
[in]ownerAn arbitray Python object that owns that data pointer. The array object will keep a reference to the object, and decrement it's reference count when the array goes out of scope. Pass None at your own peril.

This overload takes a const void pointer and sets the "writeable" flag of the array to false.

Todo:
Should probably take ranges of iterators rather than actual container objects.

Definition at line 234 of file ndarray.hpp.

ndarray boost::numpy::from_object ( python::object const &  obj,
dtype const &  dt,
int  nd_min,
int  nd_max,
ndarray::bitflag  flags = ndarray::NONE 
)

Transform an arbitrary object into a numpy array with the given requirements.

Parameters:
[in]objAn arbitrary python object to convert. Arrays that meet the requirements will be passed through directly.
[in]dtData type descriptor. Often retrieved with dtype::get_builtin().
[in]nd_minMinimum number of dimensions.
[in]nd_maxMaximum number of dimensions.
[in]flagsBitwise OR of flags specifying additional requirements.

Definition at line 258 of file src/ndarray.cpp.

ndarray boost::numpy::from_object ( python::object const &  obj,
dtype const &  dt,
int  nd,
ndarray::bitflag  flags = ndarray::NONE 
) [inline]

Definition at line 256 of file ndarray.hpp.

ndarray boost::numpy::from_object ( python::object const &  obj,
dtype const &  dt,
ndarray::bitflag  flags = ndarray::NONE 
) [inline]

Definition at line 262 of file ndarray.hpp.

ndarray boost::numpy::from_object ( python::object const &  obj,
int  nd_min,
int  nd_max,
ndarray::bitflag  flags = ndarray::NONE 
)

Definition at line 269 of file src/ndarray.cpp.

ndarray boost::numpy::from_object ( python::object const &  obj,
int  nd,
ndarray::bitflag  flags = ndarray::NONE 
) [inline]

Definition at line 270 of file ndarray.hpp.

ndarray boost::numpy::from_object ( python::object const &  obj,
ndarray::bitflag  flags = ndarray::NONE 
) [inline]

Definition at line 275 of file ndarray.hpp.

void boost::numpy::initialize ( bool  register_scalar_converters = true)

Initialize the Numpy C-API.

This must be called before using anything in boost.numpy; It should probably be the first line inside BOOST_PYTHON_MODULE.

Definition at line 25 of file numpy.cpp.

template<typename TypeSequence , typename DimSequence , typename Function >
void boost::numpy::invoke_matching_array ( ndarray const &  array_,
Function  f 
)

Definition at line 181 of file invoke_matching.hpp.

template<typename Sequence , typename Function >
void boost::numpy::invoke_matching_dtype ( dtype const &  dtype_,
Function  f 
)

Definition at line 135 of file invoke_matching.hpp.

template<typename Sequence , typename Function >
void boost::numpy::invoke_matching_nd ( int  nd,
Function  f 
)

Definition at line 125 of file invoke_matching.hpp.

multi_iter boost::numpy::make_multi_iter ( python::object const &  a1)

Construct a multi_iter over a single sequence or scalar object.

Definition at line 23 of file src/ufunc.cpp.

multi_iter boost::numpy::make_multi_iter ( python::object const &  a1,
python::object const &  a2 
)

Construct a multi_iter by broadcasting two objects.

Definition at line 28 of file src/ufunc.cpp.

multi_iter boost::numpy::make_multi_iter ( python::object const &  a1,
python::object const &  a2,
python::object const &  a3 
)

Construct a multi_iter by broadcasting three objects.

Definition at line 33 of file src/ufunc.cpp.

ndarray::bitflag boost::numpy::operator& ( ndarray::bitflag  a,
ndarray::bitflag  b 
) [inline]

Definition at line 285 of file ndarray.hpp.

ndarray::bitflag boost::numpy::operator| ( ndarray::bitflag  a,
ndarray::bitflag  b 
) [inline]

Definition at line 280 of file ndarray.hpp.

static void* boost::numpy::wrap_import_array ( ) [static]

Definition at line 20 of file numpy.cpp.

ndarray boost::numpy::zeros ( python::tuple const &  shape,
dtype const &  dt 
)

Construct a new array with the given shape and data type, with data initialized to zero.

Definition at line 216 of file src/ndarray.cpp.

ndarray boost::numpy::zeros ( int  nd,
Py_intptr_t const *  shape,
dtype const &  dt 
)

Definition at line 225 of file src/ndarray.cpp.



boost_numpy
Author(s): Jim Bosch, Ankit Daftery
autogenerated on Fri Aug 28 2015 10:10:40