"array(shape, dtype) -> new n-dimensional blitz::Array\n\
\n\
An N-dimensional blitz::Array<T,N> pythonic representation\n\
\n\
Constructor parameters:\n\
\n\
shape\n\
An iterable, indicating the shape of the array to be constructed\n\
\n\
The implementation current supports a maximum of 4 dimensions.\n\
Building an array with more dimensions will raise a \n\
:py:class:`TypeError`. There are no explicit limits for the size in\n\
each dimension, except for the machine's maximum address size.\n\
\n\
dtype\n\
A :py:class:`numpy.dtype` or ``dtype`` convertible object that\n\
specified the type of elements in this array.\n\
\n\
The following numpy data types are supported by this library:\n\
\n\
* :py:class:`numpy.bool_`\n\
* :py:class:`numpy.int8`\n\
* :py:class:`numpy.int16`\n\
* :py:class:`numpy.int32`\n\
* :py:class:`numpy.int64`\n\
* :py:class:`numpy.uint8`\n\
* :py:class:`numpy.uint16`\n\
* :py:class:`numpy.uint32`\n\
* :py:class:`numpy.uint64`\n\
* :py:class:`numpy.float32`\n\
* :py:class:`numpy.float64`\n\
* :py:class:`numpy.float128` (if this architecture suppports it)\n\
* :py:class:`numpy.complex64`\n\
* :py:class:`numpy.complex128`\n\
* :py:class:`numpy.complex256` (if this architecture suppports it)\n\
\n\
Objects of this class hold a pointer to C++ ``blitz::Array<T,N>``.\n\
The C++ data type ``T`` is mapped to a :py:class:`numpy.dtype` object,\n\
while the extents and number of dimensions ``N`` are mapped to a shape,\n\
similar to what is done for :py:class:`numpy.ndarray` objects.\n\
\n\
Objects of this class can be wrapped in :py:class:`numpy.ndarray`\n\
quite efficiently, so that flexible numpy-like operations are possible\n\
on its contents. You can also deploy objects of this class wherever\n\
:py:class:`numpy.ndarray`'s may be input.\n\
"
autoarray_doc=bob::extension::ClassDoc(
BOB_EXT_MODULE_PREFIX".array",
"A pythonic representation of an N-dimensional ``blitz::Array<T,N>``",
"Objects of this class hold a pointer to C++ ``blitz::Array<T,N>``. "
"The C++ data type ``T`` is mapped to a :py:class:`numpy.dtype` object, while the extents and number of dimensions ``N`` are mapped to a shape, similar to what is done for :py:class:`numpy.ndarray` objects.\n\n"
"Objects of this class can be wrapped in :py:class:`numpy.ndarray` quite efficiently, so that flexible numpy-like operations are possible on its contents. "
"You can also deploy objects of this class wherever :py:class:`numpy.ndarray`'s may be input."
).add_constructor(
bob::extension::FunctionDoc(
"array",
"Constructs a new :py:class:`bob.blitz.array`",
"The implementation current supports a maximum of 4 dimensions. "
"Building an array with more dimensions will raise a :py:class:`TypeError`. "
"There are no explicit limits for the size in each dimension, except for the machine's maximum address size.\n\n"
"The following numpy data types are supported by this library:\n\n"
" * :py:class:`numpy.bool_`\n"
" * :py:class:`numpy.int8`\n"
" * :py:class:`numpy.int16`\n"
" * :py:class:`numpy.int32`\n"
" * :py:class:`numpy.int64`\n"
" * :py:class:`numpy.uint8`\n"
" * :py:class:`numpy.uint16`\n"
" * :py:class:`numpy.uint32`\n"
" * :py:class:`numpy.uint64`\n"
" * :py:class:`numpy.float32`\n"
" * :py:class:`numpy.float64`\n"
" * :py:class:`numpy.float128` (if this architecture suppports it)\n"
" * :py:class:`numpy.complex64`\n"
" * :py:class:`numpy.complex128`\n"
" * :py:class:`numpy.complex256` (if this architecture suppports it)\n",
true
)
.add_prototype("shape, dtype","")
.add_parameter("shape","iterable","An iterable, indicating the shape of the array to be constructed")
.add_parameter("dtype",":py:class:`numpy.dtype` or ``dtype`` convertible object","The data type of the object to be created")
numpy.ndarray). If ``dtype`` is given and the current data type\n\
is not the same, then forces the creation of a copy conforming\n\
to the require data type, if possible.\n\
");
autoas_ndarray=bob::extension::FunctionDoc(
"as_ndarray",
":py:class:`numpy.ndarray` accessor",
"This function wraps this array as a :py:class:`numpy.ndarray`. "
"If ``dtype`` is given and the current data type is not the same, then forces the creation of a copy conforming to the require data type, if possible.",
true
)
.add_prototype("[dtype]","array")
.add_parameter("dtype",":py:class:`numpy.dtype` or dtype convertible object","[optional] The data type of the array to create")
.add_return("array",":py:class:`numpy.ndarray`","This array converted to a :py:class`numpy.ndarray`")
"Converts any compatible python object into a shallow :py:class:`"BOB_EXT_MODULE_PREFIX".array`",
"This function works by first converting the input object ``x`` into a :py:class:`numpy.ndarray` and then shallow wrapping that ``ndarray`` into a new :py:class:`"BOB_EXT_MODULE_PREFIX".array`. "
"You can access the converted ``ndarray`` using the returned value's :py:meth:`"BOB_EXT_MODULE_PREFIX".array.base` attribute. "
"If the ``ndarray`` cannot be shallow-wrapped, a :py:class:`ValueError` is raised.\n\n"
"In the case the input object ``x`` is already a behaved (C-style, memory-aligned, contiguous) :py:class:`numpy.ndarray`, then this function only shallow wrap's it into a :py:class:`"BOB_EXT_MODULE_PREFIX".array` skin."
)
.add_prototype("x","array")
.add_parameter("x","object","Any object convertible into a :py:class:`numpy.ndarray`")