46 #ifndef EIGEN_ALIGNEDBOX_H 47 #define EIGEN_ALIGNEDBOX_H 65 template <
typename _Scalar,
int _AmbientDim>
110 template<
typename OtherVectorType1,
typename OtherVectorType2>
114 template<
typename Derived>
164 {
return sizes().prod(); }
189 for(Index
d=0;
d<
dim(); ++
d)
191 if( mult & corner ) res[
d] =
m_max[
d];
203 for(Index
d=0;
d<
dim(); ++
d)
217 template<
typename Derived>
221 return (
m_min.array()<=p_n.array()).
all() && (p_n.array()<=
m_max.array()).
all();
226 {
return (
m_min.array()<=(b.min)().array()).
all() && ((b.max)().array()<=
m_max.array()).
all(); }
231 {
return (
m_min.array()<=(b.max)().array()).
all() && ((b.min)().array()<=
m_max.array()).
all(); }
235 template<
typename Derived>
239 m_min = m_min.cwiseMin(p_n);
276 template<
typename Derived>
286 template<
typename Derived>
290 result.translate(a_t);
298 template<
typename Derived>
311 template<
typename Derived>
325 template<
int Mode,
int Options>
338 template<
int Mode,
int Options>
350 const VectorType rotated_extent_2 = transform.
linear().cwiseAbs() *
sizes();
352 const VectorType rotated_center_2 = transform.
linear() * (this->
m_max + this->
m_min) +
355 this->
m_max = (rotated_center_2 + rotated_extent_2) /
Scalar(2);
356 this->
m_min = (rotated_center_2 - rotated_extent_2) /
Scalar(2);
363 template<
int Mode,
int Options>
367 result.transform(transform);
376 template<
typename NewScalarType>
385 template<
typename OtherScalarType>
388 m_min = (other.min)().template cast<Scalar>();
389 m_max = (other.max)().template cast<Scalar>();
397 {
return m_min.isApprox(other.m_min, prec) &&
m_max.isApprox(other.m_max, prec); }
406 template<
typename Scalar,
int AmbientDim>
407 template<
typename Derived>
413 for (Index k=0; k<
dim(); ++k)
415 if(
m_min[k] > p[k] )
417 aux =
m_min[k] - p[k];
420 else if( p[k] >
m_max[k] )
422 aux = p[k] -
m_max[k];
429 template<
typename Scalar,
int AmbientDim>
434 for (Index k=0; k<
dim(); ++k)
436 if(
m_min[k] > b.m_max[k] )
438 aux =
m_min[k] - b.m_max[k];
441 else if( b.m_min[k] >
m_max[k] )
443 aux = b.m_min[k] -
m_max[k];
466 #define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ 468 typedef AlignedBox<Type, Size> AlignedBox##SizeSuffix##TypeSuffix; 470 #define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ 471 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 1, 1) \ 472 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \ 473 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \ 474 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \ 475 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) 481 #undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES 482 #undef EIGEN_MAKE_TYPEDEFS 486 #endif // EIGEN_ALIGNEDBOX_H
EIGEN_DEVICE_FUNC const VectorType &() min() const
EIGEN_DEVICE_FUNC bool contains(const AlignedBox &b) const
EIGEN_DEVICE_FUNC AlignedBox translated(const MatrixBase< Derived > &a_t) const
ScalarTraits::NonInteger NonInteger
Point3 translation(const Pose3 &pose, OptionalJacobian< 3, 6 > H)
static const Eigen::internal::all_t all
EIGEN_DEVICE_FUNC const CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > sizes() const
EIGEN_DEVICE_FUNC AlignedBox & translate(const MatrixBase< Derived > &a_t)
ScalarTraits::Real RealScalar
EIGEN_DEVICE_FUNC bool intersects(const AlignedBox &b) const
EIGEN_DEVICE_FUNC AlignedBox & extend(const AlignedBox &b)
EIGEN_DEVICE_FUNC ~AlignedBox()
EIGEN_DEVICE_FUNC AlignedBox merged(const AlignedBox &b) const
Namespace containing all symbols from the Eigen library.
EIGEN_DEVICE_FUNC VectorType corner(CornerType corner) const
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > diagonal() const
EIGEN_DEVICE_FUNC NonInteger exteriorDistance(const MatrixBase< Derived > &p) const
EIGEN_DEVICE_FUNC void transform(const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &transform)
EIGEN_DEVICE_FUNC AlignedBox(const OtherVectorType1 &_min, const OtherVectorType2 &_max)
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar, Size)
EIGEN_DEVICE_FUNC bool isEmpty() const
EIGEN_DEVICE_FUNC NonInteger exteriorDistance(const AlignedBox &b) const
#define EIGEN_CONST_CONDITIONAL(cond)
Represents a translation transformation.
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Generic expression where a coefficient-wise binary operator is applied to two expressions.
EIGEN_DEVICE_FUNC void transform(const typename Transform< Scalar, AmbientDimAtCompileTime, Mode, Options >::TranslationType &translation)
EIGEN_DEVICE_FUNC AlignedBox & clamp(const AlignedBox &b)
EIGEN_DEVICE_FUNC AlignedBox()
EIGEN_DEVICE_FUNC AlignedBox(const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other)
EIGEN_DEVICE_FUNC Index dim() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(VectorTypeSum, RealScalar, quotient) center() const
EIGEN_DEVICE_FUNC AlignedBox transformed(const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &transform) const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
EIGEN_DEVICE_FUNC bool isNull() const
EIGEN_DEVICE_FUNC bool isApprox(const AlignedBox &other, const RealScalar &prec=ScalarTraits::dummy_precision()) const
EIGEN_DEVICE_FUNC void setEmpty()
EIGEN_DEVICE_FUNC AlignedBox(const MatrixBase< Derived > &p)
#define EIGEN_DEVICE_FUNC
CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const VectorType, const VectorType > VectorTypeSum
EIGEN_DEVICE_FUNC void setNull()
EIGEN_DEVICE_FUNC Scalar squaredExteriorDistance(const MatrixBase< Derived > &p) const
#define EIGEN_USING_STD(FUNC)
EIGEN_DEVICE_FUNC Scalar volume() const
NumTraits< Scalar > ScalarTraits
EIGEN_DEVICE_FUNC AlignedBox & extend(const MatrixBase< Derived > &p)
EIGEN_DEVICE_FUNC AlignedBox(Index _dim)
conditional< Evaluate, PlainObject, typename ref_selector< T >::type >::type type
EIGEN_DEVICE_FUNC AlignedBox intersection(const AlignedBox &b) const
Jet< T, N > sqrt(const Jet< T, N > &f)
EIGEN_DEVICE_FUNC VectorType &() max()
EIGEN_DEVICE_FUNC VectorType &() min()
EIGEN_DEVICE_FUNC const VectorType &() max() const
#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix)
Base class for all dense matrices, vectors, and expressions.
EIGEN_DEVICE_FUNC bool contains(const MatrixBase< Derived > &p) const
Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
EIGEN_DEVICE_FUNC internal::cast_return_type< AlignedBox, AlignedBox< NewScalarType, AmbientDimAtCompileTime > >::type cast() const
EIGEN_DEVICE_FUNC VectorType sample() const