16template <std::
size_t size, std::
size_t alignment = EIGENPY_DEFAULT_ALIGN_BYTES>
19 typename ::boost::aligned_storage<size, alignment>::type data;
26 PyObject_VAR_HEAD PyObject *dict;
28 boost::python::instance_holder *objects;
33inline void *aligned_malloc(
34 std::size_t size, std::size_t alignment = EIGENPY_DEFAULT_ALIGN_BYTES) {
35 void *original = std::malloc(size + alignment);
36 if (original == 0)
return 0;
37 if (is_aligned(original, alignment))
return original;
39 reinterpret_cast<void *
>((
reinterpret_cast<std::size_t
>(original) &
40 ~(std::size_t(alignment - 1))) +
42 *(
reinterpret_cast<void **
>(aligned) - 1) = original;
54struct referent_storage<
55 Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &> {
56 typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> T;
63struct referent_storage<
64 const Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &> {
65 typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> T;
72struct referent_storage<Eigen::Tensor<Scalar, Rank, Options, IndexType> &> {
73 typedef Eigen::Tensor<Scalar, Rank, Options, IndexType> T;
80 const Eigen::Tensor<Scalar, Rank, Options, IndexType> &> {
81 typedef Eigen::Tensor<Scalar, Rank, Options, IndexType> T;
130struct rvalue_from_python_data
131 : ::boost::python::converter::rvalue_from_python_storage<T> {
132#if (!defined(__MWERKS__) || __MWERKS__ >= 0x3000) && \ 133 (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 245) && \ 134 (!defined(__DECCXX_VER) || __DECCXX_VER > 60590014) && \ 135 !defined(BOOST_PYTHON_SYNOPSIS) 139 BOOST_PYTHON_OFFSETOF(
140 ::boost::python::converter::rvalue_from_python_storage<T>, stage1) ==
145 rvalue_from_python_data(
146 ::boost::python::converter::rvalue_from_python_stage1_data
const 148 this->stage1 = _stage1;
154 rvalue_from_python_data(
void *convertible) {
155 this->stage1.convertible = convertible;
159 ~rvalue_from_python_data() {
160 if (this->stage1.convertible == this->storage.bytes) {
161 void *storage =
reinterpret_cast<void *
>(this->storage.bytes);
162 call_destructor<T>::run(storage);