Go to the documentation of this file.
20 auto ndim = shape.size();
21 std::vector<ssize_t>
strides(ndim, itemsize);
23 for (
size_t i = ndim - 1;
i > 0; --
i) {
31 inline std::vector<ssize_t>
f_strides(
const std::vector<ssize_t> &shape,
ssize_t itemsize) {
32 auto ndim = shape.size();
33 std::vector<ssize_t>
strides(ndim, itemsize);
34 for (
size_t i = 1;
i < ndim; ++
i) {
40 template <
typename T,
typename SFINAE =
void>
64 detail::any_container<ssize_t> shape_in,
65 detail::any_container<ssize_t> strides_in,
70 pybind11_fail(
"buffer_info: ndim doesn't match shape and/or strides length");
79 detail::any_container<ssize_t> shape_in,
80 detail::any_container<ssize_t> strides_in,
102 template <
typename T>
118 ? std::vector<ssize_t>(
view->strides,
view->strides +
view->ndim)
120 (
view->readonly != 0)) {
124 this->ownview = ownview;
134 itemsize = rhs.itemsize;
136 format = std::move(rhs.format);
138 shape = std::move(rhs.shape);
139 strides = std::move(rhs.strides);
142 readonly = rhs.readonly;
147 if (m_view && ownview) {
148 PyBuffer_Release(m_view);
153 Py_buffer *
view()
const {
return m_view; }
154 Py_buffer *&
view() {
return m_view; }
162 template <
typename T>
173 const std::string &
format,
175 detail::any_container<ssize_t> &&shape_in,
176 detail::any_container<ssize_t> &&strides_in,
181 Py_buffer *m_view =
nullptr;
182 bool ownview =
false;
187 template <
typename T,
typename SFINAE>
195 template <
typename T>
198 return (
size_t)
b.itemsize ==
sizeof(
T)
200 || ((
sizeof(
T) ==
sizeof(
long))
202 || ((
sizeof(
T) ==
sizeof(
size_t))
buffer_info(void *ptr, ssize_t itemsize, const std::string &format, ssize_t ndim, detail::any_container< ssize_t > shape_in, detail::any_container< ssize_t > strides_in, bool readonly=false)
std::string format(const std::string &str, const std::vector< std::string > &find, const std::vector< std::string > &replace)
EIGEN_ALWAYS_INLINE DSizes< IndexType, NumDims > strides(const DSizes< IndexType, NumDims > &dimensions)
buffer_info(void *ptr, ssize_t itemsize, const std::string &format, ssize_t size, bool readonly=false)
std::vector< ssize_t > f_strides(const std::vector< ssize_t > &shape, ssize_t itemsize)
#define PYBIND11_NAMESPACE_END(name)
Eigen::Triplet< double > T
#define PYBIND11_NAMESPACE_BEGIN(name)
static bool compare(const buffer_info &b)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set view
buffer_info(Py_buffer *view, bool ownview=true)
buffer_info(const T *ptr, ssize_t size, bool readonly=true)
std::vector< ssize_t > shape
buffer_info(private_ctr_tag, void *ptr, ssize_t itemsize, const std::string &format, ssize_t ndim, detail::any_container< ssize_t > &&shape_in, detail::any_container< ssize_t > &&strides_in, bool readonly)
void swap(GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &a, GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &b)
PyExc_RuntimeError PYBIND11_NOINLINE void pybind11_fail(const char *reason)
Used internally.
detail::enable_if_t<!detail::move_never< T >::value, T > move(object &&obj)
buffer_info & operator=(buffer_info &&rhs) noexcept
Information record describing a Python buffer object.
static bool compare(const buffer_info &b)
buffer_info(T *ptr, detail::any_container< ssize_t > shape_in, detail::any_container< ssize_t > strides_in, bool readonly=false)
std::vector< ssize_t > strides
std::vector< ssize_t > c_strides(const std::vector< ssize_t > &shape, ssize_t itemsize)
typename std::enable_if< B, T >::type enable_if_t
from cpp_future import (convenient aliases from C++14/17)
bool item_type_is_equivalent_to() const
buffer_info(T *ptr, ssize_t size, bool readonly=false)
buffer_info(buffer_info &&other) noexcept
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:56