Lines Matching refs:Type

110 template <typename Type> struct eigen_extract_stride { using type = Type; };
118 using Type = Type_;
119 using Scalar = typename Type::Scalar;
120 using StrideType = typename eigen_extract_stride<Type>::type;
122 rows = Type::RowsAtCompileTime,
123 cols = Type::ColsAtCompileTime,
124 size = Type::SizeAtCompileTime;
126 row_major = Type::IsRowMajor,
127 vector = Type::IsVectorAtCompileTime, // At least one dimension has fixed size 1
189 static constexpr bool show_writeable = is_eigen_dense_map<Type>::value && is_eigen_mutable_map<Type>::value;
190 static constexpr bool show_order = is_eigen_dense_map<Type>::value;
213 template <typename props> handle eigen_array_cast(typename props::Type const &src, handle base = handle(), bool writeable = true) {
232 template <typename props, typename Type>
233 handle eigen_ref_array(Type &src, handle parent = none()) {
236 return eigen_array_cast<props>(src, parent, !std::is_const<Type>::value);
242 // not the Type of the pointer given is const.
243 template <typename props, typename Type, typename = enable_if_t<is_eigen_dense_plain<Type>::value>>
244 handle eigen_encapsulate(Type *src) {
245 capsule base(src, [](void *o) { delete static_cast<Type *>(o); });
249 // Type caster for regular, dense matrix types (e.g. MatrixXd), but not maps/refs/etc. of dense
251 template<typename Type>
252 struct type_caster<Type, enable_if_t<is_eigen_dense_plain<Type>::value>> {
253 using Scalar = typename Type::Scalar;
254 using props = EigenProps<Type>;
276 value = Type(fits.rows, fits.cols);
317 static handle cast(Type &&src, return_value_policy /* policy */, handle parent) {
321 static handle cast(const Type &&src, return_value_policy /* policy */, handle parent) {
325 static handle cast(Type &src, return_value_policy policy, handle parent) {
331 static handle cast(const Type &src, return_value_policy policy, handle parent) {
337 static handle cast(Type *src, return_value_policy policy, handle parent) {
341 static handle cast(const Type *src, return_value_policy policy, handle parent) {
347 operator Type*() { return &value; }
348 operator Type&() { return value; }
349 operator Type&&() && { return std::move(value); }
353 Type value;
396 template <typename Type> struct type_caster<Type, enable_if_t<is_eigen_dense_map<Type>::value>>
397 : eigen_map_caster<Type> {};
407 using Type = Eigen::Ref<PlainObjectType, 0, StrideType>;
408 using props = EigenProps<Type>;
414 static constexpr bool need_writeable = is_eigen_mutable_map<Type>::value;
417 std::unique_ptr<Type> ref;
467 ref.reset(new Type(*map));
472 operator Type*() { return ref.get(); }
473 operator Type&() { return *ref; }
477 template <typename T = Type, enable_if_t<is_eigen_mutable_map<T>::value, int> = 0>
480 template <typename T = Type, enable_if_t<!is_eigen_mutable_map<T>::value, int> = 0>
518 template <typename Type>
519 struct type_caster<Type, enable_if_t<is_eigen_other<Type>::value>> {
521 using Matrix = Eigen::Matrix<typename Type::Scalar, Type::RowsAtCompileTime, Type::ColsAtCompileTime>;
524 static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) {
528 static handle cast(const Type *src, return_value_policy policy, handle parent) { return cast(*src, policy, parent); }
536 operator Type() = delete;
537 template <typename> using cast_op_type = Type;
540 template<typename Type>
541 struct type_caster<Type, enable_if_t<is_eigen_sparse<Type>::value>> {
542 typedef typename Type::Scalar Scalar;
543 typedef remove_reference_t<decltype(*std::declval<Type>().outerIndexPtr())> StorageIndex;
544 typedef typename Type::Index Index;
545 static constexpr bool rowMajor = Type::IsRowMajor;
573 value = Eigen::MappedSparseMatrix<Scalar, Type::Flags, StorageIndex>(
580 static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) {
581 const_cast<Type&>(src).makeCompressed();
596 PYBIND11_TYPE_CASTER(Type, _<(Type::IsRowMajor) != 0>("scipy.sparse.csr_matrix[", "scipy.sparse.csc_matrix[")