46 #ifndef EIGEN_ALIGNEDBOX_H
47 #define EIGEN_ALIGNEDBOX_H
67 template <
typename Scalar_,
int AmbientDim_>
112 template<
typename OtherVectorType1,
typename OtherVectorType2>
116 template<
typename Derived>
166 {
return sizes().prod(); }
219 template<
typename Derived>
222 typename internal::nested_eval<Derived,2>::type p_n(
p.derived());
223 return (
m_min.array()<=p_n.array()).all() && (p_n.array()<=
m_max.array()).
all();
228 {
return (
m_min.array()<=(
b.min)().array()).all() && ((
b.max)().array()<=
m_max.array()).
all(); }
233 {
return (
m_min.array()<=(
b.max)().array()).all() && ((
b.min)().array()<=
m_max.array()).
all(); }
237 template<
typename Derived>
240 typename internal::nested_eval<Derived,2>::type p_n(
p.derived());
278 template<
typename Derived>
281 const typename internal::nested_eval<Derived,2>::type t(a_t.
derived());
288 template<
typename Derived>
300 template<
typename Derived>
313 template<
typename Derived>
327 template<
int Mode,
int Options>
340 template<
int Mode,
int Options>
357 this->
m_max = (rotated_center_2 + rotated_extent_2) /
Scalar(2);
358 this->
m_min = (rotated_center_2 - rotated_extent_2) /
Scalar(2);
365 template<
int Mode,
int Options>
378 template<
typename NewScalarType>
382 return typename internal::cast_return_type<
AlignedBox,
387 template<
typename OtherScalarType>
390 m_min = (other.
min)().template cast<Scalar>();
391 m_max = (other.
max)().template cast<Scalar>();
408 template<
typename Scalar,
int AmbientDim>
409 template<
typename Derived>
412 typename internal::nested_eval<Derived,2*AmbientDim>::type
p(a_p.
derived());
415 for (
Index k=0; k<dim(); ++k)
417 if( m_min[k] >
p[k] )
419 aux = m_min[k] -
p[k];
422 else if(
p[k] > m_max[k] )
424 aux =
p[k] - m_max[k];
431 template<
typename Scalar,
int AmbientDim>
436 for (
Index k=0; k<dim(); ++k)
438 if( m_min[k] >
b.m_max[k] )
440 aux = m_min[k] -
b.m_max[k];
443 else if(
b.m_min[k] > m_max[k] )
445 aux =
b.m_min[k] - m_max[k];
468 #define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
470 typedef AlignedBox<Type, Size> AlignedBox##SizeSuffix##TypeSuffix;
472 #define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
473 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 1, 1) \
474 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
475 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
476 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
477 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X)
483 #undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
484 #undef EIGEN_MAKE_TYPEDEFS
#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix)
#define EIGEN_CONST_CONDITIONAL(cond)
#define EIGEN_USING_STD(FUNC)
#define EIGEN_DEVICE_FUNC
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar, Size)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
#define EIGEN_STATIC_ASSERT(X, MSG)
bool isApprox(const AlignedBox &other, const RealScalar &prec=ScalarTraits::dummy_precision()) const
const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(VectorTypeSum, RealScalar, quotient) center() const
AlignedBox intersection(const AlignedBox &b) const
AlignedBox(const OtherVectorType1 &_min, const OtherVectorType2 &_max)
void transform(const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &transform)
VectorType sample() const
const VectorType &() max() const
AlignedBox(const MatrixBase< Derived > &p)
AlignedBox & extend(const MatrixBase< Derived > &p)
bool contains(const AlignedBox &b) const
AlignedBox transformed(const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &transform) const
Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const VectorType, const VectorType > VectorTypeSum
bool intersects(const AlignedBox &b) const
AlignedBox merged(const AlignedBox &b) const
VectorType corner(CornerType corner) const
ScalarTraits::NonInteger NonInteger
AlignedBox translated(const MatrixBase< Derived > &a_t) const
ScalarTraits::Real RealScalar
bool contains(const MatrixBase< Derived > &p) const
AlignedBox & clamp(const AlignedBox &b)
Scalar squaredExteriorDistance(const MatrixBase< Derived > &p) const
AlignedBox & extend(const AlignedBox &b)
internal::cast_return_type< AlignedBox, AlignedBox< NewScalarType, AmbientDimAtCompileTime > >::type cast() const
NonInteger exteriorDistance(const AlignedBox &b) const
NumTraits< Scalar > ScalarTraits
void transform(const typename Transform< Scalar, AmbientDimAtCompileTime, Mode, Options >::TranslationType &translation)
const VectorType &() min() const
const CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > sizes() const
@ AmbientDimAtCompileTime
NonInteger exteriorDistance(const MatrixBase< Derived > &p) const
AlignedBox(const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other)
AlignedBox & translate(const MatrixBase< Derived > &a_t)
CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > diagonal() const
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Base class for all dense matrices, vectors, and expressions.
Derived & setConstant(Index size, const Scalar &val)
Represents a translation transformation.
static const Eigen::internal::all_t all
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)