36#ifndef VIGRA_NUMPY_ARRAY_HXX
37#define VIGRA_NUMPY_ARRAY_HXX
39#ifndef NPY_NO_DEPRECATED_API
40# define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
46#include <numpy/arrayobject.h>
47#include "multi_array.hxx"
48#include "array_vector.hxx"
49#include "python_utility.hxx"
50#include "numpy_array_traits.hxx"
51#include "numpy_array_taggedshape.hxx"
58static inline void import_vigranumpy()
61 if(_import_array() < 0)
62 pythonToCppException(0);
66 char const * load_vigra =
68 "if 'vigra.vigranumpycore' not in sys.modules:\n"
70 pythonToCppException(PyRun_SimpleString(load_vigra) == 0);
80class MultibandVectorAccessor
91 typedef Multiband<T> value_type;
95 typedef T component_type;
97 typedef VectorElementAccessor<MultibandVectorAccessor<T> > ElementAccessor;
102 template <
class ITERATOR>
103 component_type
const & getComponent(ITERATOR
const & i,
int idx)
const
105 return *(&*i+idx*stride_);
113 template <
class V,
class ITERATOR>
114 void setComponent(V
const & value, ITERATOR
const & i,
int idx)
const
116 *(&*i+idx*stride_) = detail::RequiresExplicitCast<component_type>::cast(value);
122 template <
class ITERATOR,
class DIFFERENCE>
123 component_type
const & getComponent(ITERATOR
const & i, DIFFERENCE
const & diff,
int idx)
const
125 return *(&i[diff]+idx*stride_);
133 template <
class V,
class ITERATOR,
class DIFFERENCE>
135 setComponent(V
const & value, ITERATOR
const & i, DIFFERENCE
const & diff,
int idx)
const
137 *(&i[diff]+idx*stride_) = detail::RequiresExplicitCast<component_type>::cast(value);
149template <
class TYPECODE>
152constructArray(TaggedShape tagged_shape, TYPECODE typeCode,
bool init,
153 python_ptr arraytype = python_ptr());
157template <
class Shape>
158void numpyParseSlicing(Shape
const & shape, PyObject * idx, Shape & start, Shape & stop)
160 int N = shape.
size();
161 for(
int k=0; k<N; ++k)
167 python_ptr index(idx);
168 if(!PySequence_Check(index))
170 index = python_ptr(PyTuple_Pack(1, index.ptr()), python_ptr::new_nonzero_reference);
172 int lindex = PyTuple_Size(index);
174 for(; kindex<lindex; ++kindex)
176 if(PyTuple_GET_ITEM((PyTupleObject *)index.ptr(), kindex) == Py_Ellipsis)
179 if(kindex == lindex && lindex < N)
181 python_ptr ellipsis = python_ptr(PyTuple_Pack(1, Py_Ellipsis), python_ptr::new_nonzero_reference);
182 index = python_ptr(PySequence_Concat(index, ellipsis), python_ptr::new_nonzero_reference);
186 for(
int k=0; k < N; ++k)
188 PyObject * item = PyTuple_GET_ITEM((PyTupleObject *)index.ptr(), kindex);
189#if PY_MAJOR_VERSION < 3
190 if(PyInt_Check(item))
194 if(PyLong_Check(item))
200 start[k] += shape[k];
204 else if(PySlice_Check(item))
206 Py_ssize_t sstart, sstop, step;
207#if PY_MAJOR_VERSION < 3
208 if(PySlice_GetIndices((PySliceObject *)item, shape[k], &sstart, &sstop, &step) != 0)
210 if(PySlice_GetIndices(item, shape[k], &sstart, &sstop, &step) != 0)
212 pythonToCppException(0);
213 vigra_precondition(step == 1,
214 "numpyParseSlicing(): only unit steps are supported.");
219 else if(item == Py_Ellipsis)
228 vigra_precondition(
false,
229 "numpyParseSlicing(): unsupported index object.");
262 static python_ptr getArrayTypeObject()
264 return detail::getArrayTypeObject();
267 static std::string defaultOrder(std::string
defaultValue =
"C")
272 static python_ptr defaultAxistags(
int ndim, std::string order =
"")
274 return detail::defaultAxistags(
ndim, order);
277 static python_ptr emptyAxistags(
int ndim)
279 return detail::emptyAxistags(
ndim);
294 "NumpyAnyArray(obj, createCopy, type): type must be numpy.ndarray or a subclass thereof.");
298 vigra_precondition(
makeReference(
obj, type),
"NumpyAnyArray(obj): obj isn't a numpy array.");
311 "NumpyAnyArray(obj, createCopy, type): type must be numpy.ndarray or a subclass thereof.");
334 vigra_precondition(other.
hasData(),
335 "NumpyArray::operator=(): Cannot assign from empty array.");
337 python_ptr
arraytype = getArrayTypeObject();
338 python_ptr f(pythonFromData(
"_copyValuesImpl"));
342 pyArray_.get(), other.pyArray_.get(),
NULL),
343 python_ptr::keep_count);
344 vigra_postcondition(res.get() != 0,
345 "NumpyArray::operator=(): VigraArray._copyValuesImpl() failed.");
353 pythonToCppException(0);
358 pyArray_ = other.pyArray_;
383 return pythonGetAttr(
pyObject(),
"spatialDimensions",
ndim());
386 bool hasChannelAxis()
const
390 return channelIndex() ==
ndim();
397 return pythonGetAttr(
pyObject(),
"channelIndex",
ndim());
404 return pythonGetAttr(
pyObject(),
"innerNonchannelIndex",
ndim());
487 template <
class Shape>
491 unsigned int size =
ndim();
492 vigra_precondition(start.size() == size && stop.
size() == size,
493 "NumpyAnyArray::getitem(): shape has wrong dimension.");
497 python_ptr index(
PyTuple_New(size), python_ptr::new_nonzero_reference);
498 for(
unsigned int k=0;
k<size; ++
k)
504 vigra_precondition(0 <= start[
k] && start[
k] <= stop[
k] && stop[
k] <= s[
k],
505 "NumpyAnyArray::getitem(): slice out of bounds.");
507 if(start[
k] == stop[
k])
509 item = pythonFromData(start[
k]);
513 python_ptr
s0(pythonFromData(start[
k]));
514 python_ptr s1(pythonFromData(stop[
k]));
517 pythonToCppException(
item);
520 python_ptr func(pythonFromData(
"__getitem__"));
522 python_ptr::new_nonzero_reference);
536 python_ptr key(pythonFromData(
"axistags"));
558 return pyArray_.get();
576 "NumpyAnyArray::makeReference(obj, type): type must be numpy.ndarray or a subclass thereof.");
578 pythonToCppException(
obj);
593 "NumpyAnyArray::makeCopy(obj): obj is not an array.");
595 "NumpyAnyArray::makeCopy(obj, type): type must be numpy.ndarray or a subclass thereof.");
597 pythonToCppException(array);
606 return pyArray_ != 0;
619nontrivialPermutation(ArrayVector<npy_intp>
const & p)
621 for(
unsigned int k=0; k<p.size(); ++k)
629template <
class TYPECODE>
632constructArray(TaggedShape tagged_shape, TYPECODE typeCode,
bool init, python_ptr arraytype)
634 ArrayVector<npy_intp> shape = finalizeTaggedShape(tagged_shape);
635 PyAxisTags axistags(tagged_shape.axistags);
637 int ndim = (int)shape.size();
638 ArrayVector<npy_intp> inverse_permutation;
644 arraytype = NumpyAnyArray::getArrayTypeObject();
646 inverse_permutation = axistags.permutationFromNormalOrder();
647 vigra_precondition(ndim == (
int)inverse_permutation.size(),
648 "axistags.permutationFromNormalOrder(): permutation has wrong size.");
652 arraytype = python_ptr((PyObject*)&PyArray_Type);
658 python_ptr array(PyArray_New((PyTypeObject *)arraytype.get(), ndim, shape.begin(),
659 typeCode, 0, 0, 0, order, 0),
660 python_ptr::keep_count);
661 pythonToCppException(array);
663 if(detail::nontrivialPermutation(inverse_permutation))
665 PyArray_Dims permute = { inverse_permutation.begin(), ndim };
666 array = python_ptr(PyArray_Transpose((PyArrayObject*)array.get(), &permute),
667 python_ptr::keep_count);
668 pythonToCppException(array);
671 if(arraytype != (PyObject*)&PyArray_Type && axistags)
672 pythonToCppException(PyObject_SetAttrString(array,
"axistags", axistags.axistags) != -1);
675 PyArray_FILLWBYTE((PyArrayObject *)array.get(), 0);
677 return array.release();
681template <
class TINY_VECTOR>
683python_ptr constructNumpyArrayFromData(
684 TINY_VECTOR
const & shape, npy_intp *strides,
685 NPY_TYPES typeCode,
void *data)
687 ArrayVector<npy_intp> pyShape(shape.begin(), shape.end());
689#ifndef NPY_ARRAY_WRITEABLE
690# define NPY_ARRAY_WRITEABLE NPY_WRITEABLE
693 python_ptr array(PyArray_New(&PyArray_Type, shape.size(), pyShape.begin(),
694 typeCode, strides, data, 0, NPY_ARRAY_WRITEABLE, 0),
695 python_ptr::keep_count);
696 pythonToCppException(array);
715template <
unsigned int N,
class T,
class Str
ide = Str
idedArrayTag>
717:
public MultiArrayView<N, typename NumpyArrayTraits<N, T, Stride>::value_type, Stride>,
722 typedef typename ArrayTraits::dtype dtype;
723 typedef T pseudo_value_type;
725 static NPY_TYPES const typeCode = ArrayTraits::typeCode;
731 enum { actual_dimension = view_type::actual_dimension };
792 void setupArrayView();
795 std::string
const & order =
"")
797 vigra_precondition(order ==
"" || order ==
"C" || order ==
"F" ||
798 order ==
"V" || order ==
"A",
799 "NumpyArray.init(): order must be in ['C', 'F', 'V', 'A', ''].");
800 return python_ptr(constructArray(ArrayTraits::taggedShape(
shape, order), typeCode, init),
801 python_ptr::keep_count);
829 "NumpyArray(obj): Cannot construct from incompatible array.");
854 template <
class U,
class S>
859 vigra_postcondition(
makeReference(init(other.shape(),
false)),
860 "NumpyArray(MultiArrayView): Python constructor did not produce a compatible array.");
861 view_type::operator=(other);
874 "NumpyArray(shape): Python constructor did not produce a compatible array.");
886 "NumpyArray(tagged_shape): Python constructor did not produce a compatible array.");
901 "NumpyArray(NumpyAnyArray): Cannot construct from incompatible or empty array.");
915 view_type::operator=(other);
929 template <
class U,
class S>
934 vigra_precondition(
shape() == other.shape(),
935 "NumpyArray::operator=(): shape mismatch.");
936 view_type::operator=(other);
938 else if(other.hasData())
941 copy.reshapeIfEmpty(other.taggedShape(),
942 "NumpyArray::operator=(): reshape failed unexpectedly.");
955 template <
class U,
class S>
960 vigra_precondition(
shape() == other.shape(),
961 "NumpyArray::operator=(): shape mismatch.");
962 view_type::operator=(other);
964 else if(other.hasData())
967 copy.reshapeIfEmpty(other.shape(),
968 "NumpyArray::operator=(): reshape failed unexpectedly.");
995 vigra_precondition(
false,
996 "NumpyArray::operator=(): Cannot assign from incompatible array.");
1010 "NumpyArray::permuteLikewise(): array has no data.");
1013 ArrayTraits::permuteLikewise(this->pyArray_,
data, res);
1021 template <
class U,
int K>
1026 "NumpyArray::permuteLikewise(): array has no data.");
1029 ArrayTraits::permuteLikewise(this->pyArray_,
data, res);
1042 "NumpyArray::permuteLikewise(): array has no data.");
1046 ArrayTraits::permuteLikewise(this->pyArray_,
data, res);
1058#if VIGRA_CONVERTER_DEBUG
1059 std::cerr <<
"class " <<
typeid(
NumpyArray).name() <<
" got " <<
obj->ob_type->tp_name <<
"\n";
1060 std::cerr <<
"using traits " <<
typeid(
ArrayTraits).name() <<
"\n";
1061 std::cerr<<
"isArray: "<< ArrayTraits::isArray(
obj)<<std::endl;
1062 std::cerr<<
"isShapeCompatible: "<< ArrayTraits::isShapeCompatible((
PyArrayObject *)
obj)<<std::endl;
1065 return ArrayTraits::isArray(
obj) &&
1077 return ArrayTraits::isArray(
obj) &&
1097 for(
unsigned int k=0;
k<N; ++
k)
1151 vigra_precondition(!
hasData(),
1152 "makeUnsafeReference(): cannot replace existing view with given buffer");
1155 python_ptr array(ArrayTraits::unsafeConstructorFromData(
multiArrayView.shape(),
1170#if VIGRA_CONVERTER_DEBUG
1175 std::cerr <<
"for " <<
typeid(*this).name() <<
"\n";
1178 "NumpyArray::makeCopy(obj): Cannot copy an incompatible array.");
1196 "NumpyArray.reshape(shape): Python constructor did not produce a compatible array.");
1222 vigra_precondition(
tagged_shape.compatible(taggedShape()), message.c_str());
1226 python_ptr array(constructArray(
tagged_shape, typeCode,
true),
1227 python_ptr::keep_count);
1229 "NumpyArray.reshapeIfEmpty(): Python constructor did not produce a compatible array.");
1233 TaggedShape taggedShape()
const
1235 return ArrayTraits::taggedShape(this->
shape(), PyAxisTags(this->
axistags(),
true));
1240template <
unsigned int N,
class T,
class Str
ide>
1241void NumpyArray<N, T, Stride>::setupArrayView()
1246 ArrayTraits::permutationToSetupOrder(this->pyArray_,
permute);
1248 vigra_precondition(abs((
int)
permute.size() - actual_dimension) <= 1,
1249 "NumpyArray::setupArrayView(): got array of incompatible shape (should never happen).");
1256 if((
int)
permute.size() == actual_dimension - 1)
1258 this->m_shape[actual_dimension-1] = 1;
1259 this->m_stride[actual_dimension-1] =
sizeof(
value_type);
1264 for(
int k=0;
k<actual_dimension; ++
k)
1266 if(this->m_stride[
k] == 0)
1268 vigra_precondition(this->m_shape[
k] == 1,
1269 "NumpyArray::setupArrayView(): only singleton axes may have zero stride.");
1270 this->m_stride[
k] = 1;
1274 this->m_ptr =
reinterpret_cast<pointer
>(
PyArray_DATA(pyArray()));
1275 vigra_precondition(this->checkInnerStride(Stride()),
1276 "NumpyArray<..., UnstridedArrayTag>::setupArrayView(): First dimension of given array is not unstrided (should never happen).");
1286typedef NumpyArray<2, float > NumpyFArray2;
1287typedef NumpyArray<3, float > NumpyFArray3;
1288typedef NumpyArray<4, float > NumpyFArray4;
1289typedef NumpyArray<2, Singleband<float> > NumpyFImage;
1290typedef NumpyArray<3, Singleband<float> > NumpyFVolume;
1291typedef NumpyArray<2, RGBValue<float> > NumpyFRGBImage;
1292typedef NumpyArray<3, RGBValue<float> > NumpyFRGBVolume;
1293typedef NumpyArray<3, Multiband<float> > NumpyFMultibandImage;
1294typedef NumpyArray<4, Multiband<float> > NumpyFMultibandVolume;
1302template <
class PixelType,
class Str
ide>
1303inline triple<ConstStridedImageIterator<PixelType>,
1304 ConstStridedImageIterator<PixelType>,
1305 MultibandVectorAccessor<PixelType> >
1306srcImageRange(NumpyArray<3, Multiband<PixelType>, Stride>
const & img)
1308 ConstStridedImageIterator<PixelType>
1309 ul(img.data(), 1, img.stride(0), img.stride(1));
1310 return triple<ConstStridedImageIterator<PixelType>,
1311 ConstStridedImageIterator<PixelType>,
1312 MultibandVectorAccessor<PixelType> >
1313 (ul, ul + Size2D(img.shape(0), img.shape(1)), MultibandVectorAccessor<PixelType>(img.shape(2), img.stride(2)));
1316template <
class PixelType,
class Str
ide>
1317inline pair< ConstStridedImageIterator<PixelType>,
1318 MultibandVectorAccessor<PixelType> >
1319srcImage(NumpyArray<3, Multiband<PixelType>, Stride>
const & img)
1321 ConstStridedImageIterator<PixelType>
1322 ul(img.data(), 1, img.stride(0), img.stride(1));
1323 return pair<ConstStridedImageIterator<PixelType>, MultibandVectorAccessor<PixelType> >
1324 (ul, MultibandVectorAccessor<PixelType>(img.shape(2), img.stride(2)));
1327template <
class PixelType,
class Str
ide>
1328inline triple< StridedImageIterator<PixelType>,
1329 StridedImageIterator<PixelType>,
1330 MultibandVectorAccessor<PixelType> >
1331destImageRange(NumpyArray<3, Multiband<PixelType>, Stride> & img)
1333 StridedImageIterator<PixelType>
1334 ul(img.data(), 1, img.stride(0), img.stride(1));
1335 return triple<StridedImageIterator<PixelType>,
1336 StridedImageIterator<PixelType>,
1337 MultibandVectorAccessor<PixelType> >
1338 (ul, ul + Size2D(img.shape(0), img.shape(1)),
1339 MultibandVectorAccessor<PixelType>(img.shape(2), img.stride(2)));
1342template <
class PixelType,
class Str
ide>
1343inline pair< StridedImageIterator<PixelType>,
1344 MultibandVectorAccessor<PixelType> >
1345destImage(NumpyArray<3, Multiband<PixelType>, Stride> & img)
1347 StridedImageIterator<PixelType>
1348 ul(img.data(), 1, img.stride(0), img.stride(1));
1349 return pair<StridedImageIterator<PixelType>, MultibandVectorAccessor<PixelType> >
1350 (ul, MultibandVectorAccessor<PixelType>(img.shape(2), img.stride(2)));
1353template <
class PixelType,
class Str
ide>
1354inline pair< ConstStridedImageIterator<PixelType>,
1355 MultibandVectorAccessor<PixelType> >
1356maskImage(NumpyArray<3, Multiband<PixelType>, Stride>
const & img)
1358 ConstStridedImageIterator<PixelType>
1359 ul(img.data(), 1, img.stride(0), img.stride(1));
1360 return pair<ConstStridedImageIterator<PixelType>, MultibandVectorAccessor<PixelType> >
1361 (ul, MultibandVectorAccessor<PixelType>(img.shape(2), img.stride(2)));
Base class for, and view to, vigra::MultiArray.
Definition multi_array.hxx:705
difference_type strideOrdering() const
Definition multi_array.hxx:1619
vigra::detail::MultiIteratorChooser< StrideTag >::template Traverser< actual_dimension, T, Tconst &, Tconst * >::type const_traverser
Definition multi_array.hxx:769
const value_type * const_pointer
Definition multi_array.hxx:735
MultiArrayIndex difference_type_1
Definition multi_array.hxx:751
T value_type
Definition multi_array.hxx:719
bool hasData() const
Definition multi_array.hxx:1915
const difference_type & shape() const
Definition multi_array.hxx:1650
MultiArrayView & init(const U &init)
Definition multi_array.hxx:1208
void copy(const MultiArrayView &rhs)
Definition multi_array.hxx:1218
value_type & reference
Definition multi_array.hxx:723
pointer data() const
Definition multi_array.hxx:1900
vigra::detail::MultiIteratorChooser< StrideTag >::template Traverser< actual_dimension, T, T &, T * >::type traverser
Definition multi_array.hxx:764
value_type * pointer
Definition multi_array.hxx:731
const value_type & const_reference
Definition multi_array.hxx:727
Definition numpy_array.hxx:253
difference_type strideOrdering() const
Definition numpy_array.hxx:422
difference_type shape() const
Definition numpy_array.hxx:411
NumpyAnyArray getitem(Shape start, Shape stop) const
Definition numpy_array.hxx:489
bool hasData() const
Definition numpy_array.hxx:604
ArrayVector< npy_intp > difference_type
difference type
Definition numpy_array.hxx:260
PyObject * pyObject() const
Definition numpy_array.hxx:556
MultiArrayIndex ndim() const
Definition numpy_array.hxx:367
NumpyAnyArray & operator=(NumpyAnyArray const &other)
Definition numpy_array.hxx:330
void makeCopy(PyObject *obj, PyTypeObject *type=0)
Definition numpy_array.hxx:590
python_ptr axistags() const
Definition numpy_array.hxx:531
int dtype() const
Definition numpy_array.hxx:477
PyArrayObject * pyArray() const
Definition numpy_array.hxx:547
NumpyAnyArray(NumpyAnyArray const &other, bool createCopy=false, PyTypeObject *type=0)
Definition numpy_array.hxx:306
bool makeReference(PyObject *obj, PyTypeObject *type=0)
Definition numpy_array.hxx:569
MultiArrayIndex spatialDimensions() const
Definition numpy_array.hxx:379
NumpyAnyArray(PyObject *obj=0, bool createCopy=false, PyTypeObject *type=0)
Definition numpy_array.hxx:289
Definition numpy_array.hxx:719
difference_type strideOrdering() const
Definition multi_array.hxx:1619
void makeUnsafeReference(const view_type &multiArrayView)
Definition numpy_array.hxx:1149
static bool isStrictlyCompatible(PyObject *obj)
Definition numpy_array.hxx:1084
view_type::const_traverser const_traverser
Definition numpy_array.hxx:775
view_type::const_reference const_reference
Definition numpy_array.hxx:751
ArrayVector< U > permuteLikewise(ArrayVector< U > const &data) const
Definition numpy_array.hxx:1007
bool hasData() const
Definition multi_array.hxx:1915
static difference_type standardStrideOrdering()
Definition numpy_array.hxx:1094
TinyVector< npy_intp, K > permuteLikewise() const
Definition numpy_array.hxx:1039
NumpyArray(const MultiArrayView< N, U, S > &other)
Definition numpy_array.hxx:855
NumpyArray & operator=(const NumpyAnyArray &other)
Definition numpy_array.hxx:983
NumpyArray(PyObject *obj=0, bool createCopy=false)
Definition numpy_array.hxx:821
view_type::size_type size_type
Definition numpy_array.hxx:755
void reshapeIfEmpty(difference_type const &shape, std::string message="")
Definition numpy_array.hxx:1204
static bool isCopyCompatible(PyObject *obj)
Definition numpy_array.hxx:1056
static bool isReferenceCompatible(PyObject *obj)
Definition numpy_array.hxx:1075
NumpyArray & operator=(const NumpyArray< N, U, S > &other)
Definition numpy_array.hxx:930
bool makeReference(PyObject *obj, bool=false)
Definition numpy_array.hxx:1120
view_type::iterator iterator
Definition numpy_array.hxx:779
view_type::difference_type_1 difference_type_1
Definition numpy_array.hxx:763
view_type::const_pointer const_pointer
Definition numpy_array.hxx:743
const difference_type & shape() const
Definition multi_array.hxx:1650
TinyVector< U, K > permuteLikewise(TinyVector< U, K > const &data) const
Definition numpy_array.hxx:1023
view_type::difference_type difference_type
Definition numpy_array.hxx:759
view_type::pointer pointer
Definition numpy_array.hxx:739
view_type::reference reference
Definition numpy_array.hxx:747
void reshape(difference_type const &shape)
Definition numpy_array.hxx:1193
void makeReferenceUnchecked(PyObject *obj)
Definition numpy_array.hxx:1107
MultiArrayView< N, typename ArrayTraits::value_type, Stride > view_type
Definition numpy_array.hxx:729
NumpyArray(difference_type const &shape, std::string const &order="")
Definition numpy_array.hxx:871
void makeCopy(PyObject *obj, bool strict=false)
Definition numpy_array.hxx:1168
view_type::const_iterator const_iterator
Definition numpy_array.hxx:783
NumpyAnyArray::difference_type permutation_type
Definition numpy_array.hxx:767
NumpyArray(TaggedShape const &tagged_shape)
Definition numpy_array.hxx:883
void reshapeIfEmpty(TaggedShape tagged_shape, std::string message="")
Definition numpy_array.hxx:1216
bool makeReference(const NumpyAnyArray &array, bool strict=false)
Definition numpy_array.hxx:1134
NumpyArray & operator=(const MultiArrayView< N, U, S > &other)
Definition numpy_array.hxx:956
NumpyArray(const NumpyAnyArray &other, bool createCopy=false)
Definition numpy_array.hxx:893
view_type::traverser traverser
Definition numpy_array.hxx:771
view_type::value_type value_type
Definition numpy_array.hxx:735
NumpyArray(const NumpyArray &other, bool createCopy=false)
Definition numpy_array.hxx:839
NumpyArray & operator=(const NumpyArray &other)
Definition numpy_array.hxx:912
Class for a single RGB value.
Definition rgbvalue.hxx:128
RGBValue()
Definition rgbvalue.hxx:209
Base::value_type value_type
Definition rgbvalue.hxx:141
size_type size() const
Definition tinyvector.hxx:913
void linearSequence(Iterator first, Iterator last, Value start, Value step)
Fill an array with a sequence of numbers.
Definition algorithm.hxx:208
std::ptrdiff_t MultiArrayIndex
Definition multi_fwd.hxx:60
void applyPermutation(IndexIterator index_first, IndexIterator index_last, InIterator in, OutIterator out)
Sort an array according to the given index permutation.
Definition algorithm.hxx:456