MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / getslice

Method getslice

src/python/PyImath/PyImathFixedArray.h:432–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430 }
431
432 FixedArray getslice(::PyObject *index) const
433 {
434 size_t start=0, end=0, slicelength=0;
435 Py_ssize_t step;
436 extract_slice_indices(index,start,end,step,slicelength);
437 FixedArray f(slicelength);
438
439 if (isMaskedReference())
440 {
441 for (size_t i=0; i<slicelength; ++i)
442 f._ptr[i] = _ptr[raw_ptr_index(start+i*step)*_stride];
443 }
444 else
445 {
446 for (size_t i=0; i<slicelength; ++i)
447 f._ptr[i] = _ptr[(start+i*step)*_stride];
448 }
449 return f;
450 }
451
452 template <typename MaskArrayType>
453 FixedArray getslice_mask(const MaskArrayType& mask)

Callers

nothing calls this directly

Calls 1

extract_slice_indicesFunction · 0.85

Tested by

no test coverage detected