8 #include "utility/Matrix.h"
21 py::class_<utility::Matrix<PointCoordinateType>> te_p2p(
22 m,
"Matrix",
"Class to interface of numpy and std::vector.");
24 py::detail::bind_default_constructor<utility::Matrix<PointCoordinateType>>(
26 py::detail::bind_copy_functions<utility::Matrix<PointCoordinateType>>(
29 te_p2p.def(py::init([](
const std::vector<size_t> &shape,
31 return new utility::Matrix<PointCoordinateType>(shape, data);
33 "shape"_a = std::vector<size_t>(0),
"data"_a =
NULL)
35 [](
const utility::Matrix<PointCoordinateType> &te) {
36 return std::string(
"utility::Matrix");
40 [](
const utility::Matrix<PointCoordinateType> &s) {
43 "Function to get matrix internal ptr")
46 [](
const utility::Matrix<PointCoordinateType> &s,
47 size_t ndim = 0) {
return s.shape(ndim); },
48 "ndim"_a,
"Function to get matrix shape")
51 [](
const utility::Matrix<PointCoordinateType> &s,
52 bool bytes =
false) {
return s.strides(
bytes); },
53 "bytes"_a,
"Function to get matrix strides")
56 [](
const utility::Matrix<PointCoordinateType> &s) {
59 "Function to get matrix dimension")
62 [](
const utility::Matrix<PointCoordinateType> &s) {
65 "Function to get matrix size");
float PointCoordinateType
Type of the coordinates of a (N-D) point.
void pybind_matrix(py::module &m)
Generic file read and write utility for python interface.