AlignedBox.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. // This file is part of Eigen, a lightweight C++ template library
  2. // for linear algebra.
  3. //
  4. // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla
  7. // Public License v. 2.0. If a copy of the MPL was not distributed
  8. // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. // Function void Eigen::AlignedBox::transform(const Transform& transform)
  10. // is provided under the following license agreement:
  11. //
  12. // Software License Agreement (BSD License)
  13. //
  14. // Copyright (c) 2011-2014, Willow Garage, Inc.
  15. // Copyright (c) 2014-2015, Open Source Robotics Foundation
  16. // All rights reserved.
  17. //
  18. // Redistribution and use in source and binary forms, with or without
  19. // modification, are permitted provided that the following conditions
  20. // are met:
  21. //
  22. // * Redistributions of source code must retain the above copyright
  23. // notice, this list of conditions and the following disclaimer.
  24. // * Redistributions in binary form must reproduce the above
  25. // copyright notice, this list of conditions and the following
  26. // disclaimer in the documentation and/or other materials provided
  27. // with the distribution.
  28. // * Neither the name of Open Source Robotics Foundation nor the names of its
  29. // contributors may be used to endorse or promote products derived
  30. // from this software without specific prior written permission.
  31. //
  32. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  33. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  34. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  35. // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  36. // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  37. // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  38. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  39. // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  40. // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  41. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  42. // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  43. // POSSIBILITY OF SUCH DAMAGE.
  44. #ifndef EIGEN_ALIGNEDBOX_H
  45. #define EIGEN_ALIGNEDBOX_H
  46. namespace Eigen {
  47. /** \geometry_module \ingroup Geometry_Module
  48. *
  49. *
  50. * \class AlignedBox
  51. *
  52. * \brief An axis aligned box
  53. *
  54. * \tparam _Scalar the type of the scalar coefficients
  55. * \tparam _AmbientDim the dimension of the ambient space, can be a compile time value or Dynamic.
  56. *
  57. * This class represents an axis aligned box as a pair of the minimal and maximal corners.
  58. * \warning The result of most methods is undefined when applied to an empty box. You can check for empty boxes using isEmpty().
  59. * \sa alignedboxtypedefs
  60. */
  61. template <typename _Scalar, int _AmbientDim>
  62. class AlignedBox
  63. {
  64. public:
  65. EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
  66. enum { AmbientDimAtCompileTime = _AmbientDim };
  67. typedef _Scalar Scalar;
  68. typedef NumTraits<Scalar> ScalarTraits;
  69. typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
  70. typedef typename ScalarTraits::Real RealScalar;
  71. typedef typename ScalarTraits::NonInteger NonInteger;
  72. typedef Matrix<Scalar,AmbientDimAtCompileTime,1> VectorType;
  73. typedef CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const VectorType, const VectorType> VectorTypeSum;
  74. /** Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box */
  75. enum CornerType
  76. {
  77. /** 1D names @{ */
  78. Min=0, Max=1,
  79. /** @} */
  80. /** Identifier for 2D corner @{ */
  81. BottomLeft=0, BottomRight=1,
  82. TopLeft=2, TopRight=3,
  83. /** @} */
  84. /** Identifier for 3D corner @{ */
  85. BottomLeftFloor=0, BottomRightFloor=1,
  86. TopLeftFloor=2, TopRightFloor=3,
  87. BottomLeftCeil=4, BottomRightCeil=5,
  88. TopLeftCeil=6, TopRightCeil=7
  89. /** @} */
  90. };
  91. /** Default constructor initializing a null box. */
  92. EIGEN_DEVICE_FUNC inline AlignedBox()
  93. { if (EIGEN_CONST_CONDITIONAL(AmbientDimAtCompileTime!=Dynamic)) setEmpty(); }
  94. /** Constructs a null box with \a _dim the dimension of the ambient space. */
  95. EIGEN_DEVICE_FUNC inline explicit AlignedBox(Index _dim) : m_min(_dim), m_max(_dim)
  96. { setEmpty(); }
  97. /** Constructs a box with extremities \a _min and \a _max.
  98. * \warning If either component of \a _min is larger than the same component of \a _max, the constructed box is empty. */
  99. template<typename OtherVectorType1, typename OtherVectorType2>
  100. EIGEN_DEVICE_FUNC inline AlignedBox(const OtherVectorType1& _min, const OtherVectorType2& _max) : m_min(_min), m_max(_max) {}
  101. /** Constructs a box containing a single point \a p. */
  102. template<typename Derived>
  103. EIGEN_DEVICE_FUNC inline explicit AlignedBox(const MatrixBase<Derived>& p) : m_min(p), m_max(m_min)
  104. { }
  105. EIGEN_DEVICE_FUNC ~AlignedBox() {}
  106. /** \returns the dimension in which the box holds */
  107. EIGEN_DEVICE_FUNC inline Index dim() const { return AmbientDimAtCompileTime==Dynamic ? m_min.size() : Index(AmbientDimAtCompileTime); }
  108. /** \deprecated use isEmpty() */
  109. EIGEN_DEVICE_FUNC inline bool isNull() const { return isEmpty(); }
  110. /** \deprecated use setEmpty() */
  111. EIGEN_DEVICE_FUNC inline void setNull() { setEmpty(); }
  112. /** \returns true if the box is empty.
  113. * \sa setEmpty */
  114. EIGEN_DEVICE_FUNC inline bool isEmpty() const { return (m_min.array() > m_max.array()).any(); }
  115. /** Makes \c *this an empty box.
  116. * \sa isEmpty */
  117. EIGEN_DEVICE_FUNC inline void setEmpty()
  118. {
  119. m_min.setConstant( ScalarTraits::highest() );
  120. m_max.setConstant( ScalarTraits::lowest() );
  121. }
  122. /** \returns the minimal corner */
  123. EIGEN_DEVICE_FUNC inline const VectorType& (min)() const { return m_min; }
  124. /** \returns a non const reference to the minimal corner */
  125. EIGEN_DEVICE_FUNC inline VectorType& (min)() { return m_min; }
  126. /** \returns the maximal corner */
  127. EIGEN_DEVICE_FUNC inline const VectorType& (max)() const { return m_max; }
  128. /** \returns a non const reference to the maximal corner */
  129. EIGEN_DEVICE_FUNC inline VectorType& (max)() { return m_max; }
  130. /** \returns the center of the box */
  131. EIGEN_DEVICE_FUNC inline const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(VectorTypeSum, RealScalar, quotient)
  132. center() const
  133. { return (m_min+m_max)/RealScalar(2); }
  134. /** \returns the lengths of the sides of the bounding box.
  135. * Note that this function does not get the same
  136. * result for integral or floating scalar types: see
  137. */
  138. EIGEN_DEVICE_FUNC inline const CwiseBinaryOp< internal::scalar_difference_op<Scalar,Scalar>, const VectorType, const VectorType> sizes() const
  139. { return m_max - m_min; }
  140. /** \returns the volume of the bounding box */
  141. EIGEN_DEVICE_FUNC inline Scalar volume() const
  142. { return sizes().prod(); }
  143. /** \returns an expression for the bounding box diagonal vector
  144. * if the length of the diagonal is needed: diagonal().norm()
  145. * will provide it.
  146. */
  147. EIGEN_DEVICE_FUNC inline CwiseBinaryOp< internal::scalar_difference_op<Scalar,Scalar>, const VectorType, const VectorType> diagonal() const
  148. { return sizes(); }
  149. /** \returns the vertex of the bounding box at the corner defined by
  150. * the corner-id corner. It works only for a 1D, 2D or 3D bounding box.
  151. * For 1D bounding boxes corners are named by 2 enum constants:
  152. * BottomLeft and BottomRight.
  153. * For 2D bounding boxes, corners are named by 4 enum constants:
  154. * BottomLeft, BottomRight, TopLeft, TopRight.
  155. * For 3D bounding boxes, the following names are added:
  156. * BottomLeftCeil, BottomRightCeil, TopLeftCeil, TopRightCeil.
  157. */
  158. EIGEN_DEVICE_FUNC inline VectorType corner(CornerType corner) const
  159. {
  160. EIGEN_STATIC_ASSERT(_AmbientDim <= 3, THIS_METHOD_IS_ONLY_FOR_VECTORS_OF_A_SPECIFIC_SIZE);
  161. VectorType res;
  162. Index mult = 1;
  163. for(Index d=0; d<dim(); ++d)
  164. {
  165. if( mult & corner ) res[d] = m_max[d];
  166. else res[d] = m_min[d];
  167. mult *= 2;
  168. }
  169. return res;
  170. }
  171. /** \returns a random point inside the bounding box sampled with
  172. * a uniform distribution */
  173. EIGEN_DEVICE_FUNC inline VectorType sample() const
  174. {
  175. VectorType r(dim());
  176. for(Index d=0; d<dim(); ++d)
  177. {
  178. if(!ScalarTraits::IsInteger)
  179. {
  180. r[d] = m_min[d] + (m_max[d]-m_min[d])
  181. * internal::random<Scalar>(Scalar(0), Scalar(1));
  182. }
  183. else
  184. r[d] = internal::random(m_min[d], m_max[d]);
  185. }
  186. return r;
  187. }
  188. /** \returns true if the point \a p is inside the box \c *this. */
  189. template<typename Derived>
  190. EIGEN_DEVICE_FUNC inline bool contains(const MatrixBase<Derived>& p) const
  191. {
  192. typename internal::nested_eval<Derived,2>::type p_n(p.derived());
  193. return (m_min.array()<=p_n.array()).all() && (p_n.array()<=m_max.array()).all();
  194. }
  195. /** \returns true if the box \a b is entirely inside the box \c *this. */
  196. EIGEN_DEVICE_FUNC inline bool contains(const AlignedBox& b) const
  197. { return (m_min.array()<=(b.min)().array()).all() && ((b.max)().array()<=m_max.array()).all(); }
  198. /** \returns true if the box \a b is intersecting the box \c *this.
  199. * \sa intersection, clamp */
  200. EIGEN_DEVICE_FUNC inline bool intersects(const AlignedBox& b) const
  201. { return (m_min.array()<=(b.max)().array()).all() && ((b.min)().array()<=m_max.array()).all(); }
  202. /** Extends \c *this such that it contains the point \a p and returns a reference to \c *this.
  203. * \sa extend(const AlignedBox&) */
  204. template<typename Derived>
  205. EIGEN_DEVICE_FUNC inline AlignedBox& extend(const MatrixBase<Derived>& p)
  206. {
  207. typename internal::nested_eval<Derived,2>::type p_n(p.derived());
  208. m_min = m_min.cwiseMin(p_n);
  209. m_max = m_max.cwiseMax(p_n);
  210. return *this;
  211. }
  212. /** Extends \c *this such that it contains the box \a b and returns a reference to \c *this.
  213. * \sa merged, extend(const MatrixBase&) */
  214. EIGEN_DEVICE_FUNC inline AlignedBox& extend(const AlignedBox& b)
  215. {
  216. m_min = m_min.cwiseMin(b.m_min);
  217. m_max = m_max.cwiseMax(b.m_max);
  218. return *this;
  219. }
  220. /** Clamps \c *this by the box \a b and returns a reference to \c *this.
  221. * \note If the boxes don't intersect, the resulting box is empty.
  222. * \sa intersection(), intersects() */
  223. EIGEN_DEVICE_FUNC inline AlignedBox& clamp(const AlignedBox& b)
  224. {
  225. m_min = m_min.cwiseMax(b.m_min);
  226. m_max = m_max.cwiseMin(b.m_max);
  227. return *this;
  228. }
  229. /** Returns an AlignedBox that is the intersection of \a b and \c *this
  230. * \note If the boxes don't intersect, the resulting box is empty.
  231. * \sa intersects(), clamp, contains() */
  232. EIGEN_DEVICE_FUNC inline AlignedBox intersection(const AlignedBox& b) const
  233. {return AlignedBox(m_min.cwiseMax(b.m_min), m_max.cwiseMin(b.m_max)); }
  234. /** Returns an AlignedBox that is the union of \a b and \c *this.
  235. * \note Merging with an empty box may result in a box bigger than \c *this.
  236. * \sa extend(const AlignedBox&) */
  237. EIGEN_DEVICE_FUNC inline AlignedBox merged(const AlignedBox& b) const
  238. { return AlignedBox(m_min.cwiseMin(b.m_min), m_max.cwiseMax(b.m_max)); }
  239. /** Translate \c *this by the vector \a t and returns a reference to \c *this. */
  240. template<typename Derived>
  241. EIGEN_DEVICE_FUNC inline AlignedBox& translate(const MatrixBase<Derived>& a_t)
  242. {
  243. const typename internal::nested_eval<Derived,2>::type t(a_t.derived());
  244. m_min += t;
  245. m_max += t;
  246. return *this;
  247. }
  248. /** \returns a copy of \c *this translated by the vector \a t. */
  249. template<typename Derived>
  250. EIGEN_DEVICE_FUNC inline AlignedBox translated(const MatrixBase<Derived>& a_t) const
  251. {
  252. AlignedBox result(m_min, m_max);
  253. result.translate(a_t);
  254. return result;
  255. }
  256. /** \returns the squared distance between the point \a p and the box \c *this,
  257. * and zero if \a p is inside the box.
  258. * \sa exteriorDistance(const MatrixBase&), squaredExteriorDistance(const AlignedBox&)
  259. */
  260. template<typename Derived>
  261. EIGEN_DEVICE_FUNC inline Scalar squaredExteriorDistance(const MatrixBase<Derived>& p) const;
  262. /** \returns the squared distance between the boxes \a b and \c *this,
  263. * and zero if the boxes intersect.
  264. * \sa exteriorDistance(const AlignedBox&), squaredExteriorDistance(const MatrixBase&)
  265. */
  266. EIGEN_DEVICE_FUNC inline Scalar squaredExteriorDistance(const AlignedBox& b) const;
  267. /** \returns the distance between the point \a p and the box \c *this,
  268. * and zero if \a p is inside the box.
  269. * \sa squaredExteriorDistance(const MatrixBase&), exteriorDistance(const AlignedBox&)
  270. */
  271. template<typename Derived>
  272. EIGEN_DEVICE_FUNC inline NonInteger exteriorDistance(const MatrixBase<Derived>& p) const
  273. { EIGEN_USING_STD(sqrt) return sqrt(NonInteger(squaredExteriorDistance(p))); }
  274. /** \returns the distance between the boxes \a b and \c *this,
  275. * and zero if the boxes intersect.
  276. * \sa squaredExteriorDistance(const AlignedBox&), exteriorDistance(const MatrixBase&)
  277. */
  278. EIGEN_DEVICE_FUNC inline NonInteger exteriorDistance(const AlignedBox& b) const
  279. { EIGEN_USING_STD(sqrt) return sqrt(NonInteger(squaredExteriorDistance(b))); }
  280. /**
  281. * Specialization of transform for pure translation.
  282. */
  283. template<int Mode, int Options>
  284. EIGEN_DEVICE_FUNC inline void transform(
  285. const typename Transform<Scalar, AmbientDimAtCompileTime, Mode, Options>::TranslationType& translation)
  286. {
  287. this->translate(translation);
  288. }
  289. /**
  290. * Transforms this box by \a transform and recomputes it to
  291. * still be an axis-aligned box.
  292. *
  293. * \note This method is provided under BSD license (see the top of this file).
  294. */
  295. template<int Mode, int Options>
  296. EIGEN_DEVICE_FUNC inline void transform(const Transform<Scalar, AmbientDimAtCompileTime, Mode, Options>& transform)
  297. {
  298. // Only Affine and Isometry transforms are currently supported.
  299. EIGEN_STATIC_ASSERT(Mode == Affine || Mode == AffineCompact || Mode == Isometry, THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS);
  300. // Method adapted from FCL src/shape/geometric_shapes_utility.cpp#computeBV<AABB, Box>(...)
  301. // https://github.com/flexible-collision-library/fcl/blob/fcl-0.4/src/shape/geometric_shapes_utility.cpp#L292
  302. //
  303. // Here's a nice explanation why it works: https://zeuxcg.org/2010/10/17/aabb-from-obb-with-component-wise-abs/
  304. // two times rotated extent
  305. const VectorType rotated_extent_2 = transform.linear().cwiseAbs() * sizes();
  306. // two times new center
  307. const VectorType rotated_center_2 = transform.linear() * (this->m_max + this->m_min) +
  308. Scalar(2) * transform.translation();
  309. this->m_max = (rotated_center_2 + rotated_extent_2) / Scalar(2);
  310. this->m_min = (rotated_center_2 - rotated_extent_2) / Scalar(2);
  311. }
  312. /**
  313. * \returns a copy of \c *this transformed by \a transform and recomputed to
  314. * still be an axis-aligned box.
  315. */
  316. template<int Mode, int Options>
  317. EIGEN_DEVICE_FUNC AlignedBox transformed(const Transform<Scalar, AmbientDimAtCompileTime, Mode, Options>& transform) const
  318. {
  319. AlignedBox result(m_min, m_max);
  320. result.transform(transform);
  321. return result;
  322. }
  323. /** \returns \c *this with scalar type casted to \a NewScalarType
  324. *
  325. * Note that if \a NewScalarType is equal to the current scalar type of \c *this
  326. * then this function smartly returns a const reference to \c *this.
  327. */
  328. template<typename NewScalarType>
  329. EIGEN_DEVICE_FUNC inline typename internal::cast_return_type<AlignedBox,
  330. AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type cast() const
  331. {
  332. return typename internal::cast_return_type<AlignedBox,
  333. AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type(*this);
  334. }
  335. /** Copy constructor with scalar type conversion */
  336. template<typename OtherScalarType>
  337. EIGEN_DEVICE_FUNC inline explicit AlignedBox(const AlignedBox<OtherScalarType,AmbientDimAtCompileTime>& other)
  338. {
  339. m_min = (other.min)().template cast<Scalar>();
  340. m_max = (other.max)().template cast<Scalar>();
  341. }
  342. /** \returns \c true if \c *this is approximately equal to \a other, within the precision
  343. * determined by \a prec.
  344. *
  345. * \sa MatrixBase::isApprox() */
  346. EIGEN_DEVICE_FUNC bool isApprox(const AlignedBox& other, const RealScalar& prec = ScalarTraits::dummy_precision()) const
  347. { return m_min.isApprox(other.m_min, prec) && m_max.isApprox(other.m_max, prec); }
  348. protected:
  349. VectorType m_min, m_max;
  350. };
  351. template<typename Scalar,int AmbientDim>
  352. template<typename Derived>
  353. EIGEN_DEVICE_FUNC inline Scalar AlignedBox<Scalar,AmbientDim>::squaredExteriorDistance(const MatrixBase<Derived>& a_p) const
  354. {
  355. typename internal::nested_eval<Derived,2*AmbientDim>::type p(a_p.derived());
  356. Scalar dist2(0);
  357. Scalar aux;
  358. for (Index k=0; k<dim(); ++k)
  359. {
  360. if( m_min[k] > p[k] )
  361. {
  362. aux = m_min[k] - p[k];
  363. dist2 += aux*aux;
  364. }
  365. else if( p[k] > m_max[k] )
  366. {
  367. aux = p[k] - m_max[k];
  368. dist2 += aux*aux;
  369. }
  370. }
  371. return dist2;
  372. }
  373. template<typename Scalar,int AmbientDim>
  374. EIGEN_DEVICE_FUNC inline Scalar AlignedBox<Scalar,AmbientDim>::squaredExteriorDistance(const AlignedBox& b) const
  375. {
  376. Scalar dist2(0);
  377. Scalar aux;
  378. for (Index k=0; k<dim(); ++k)
  379. {
  380. if( m_min[k] > b.m_max[k] )
  381. {
  382. aux = m_min[k] - b.m_max[k];
  383. dist2 += aux*aux;
  384. }
  385. else if( b.m_min[k] > m_max[k] )
  386. {
  387. aux = b.m_min[k] - m_max[k];
  388. dist2 += aux*aux;
  389. }
  390. }
  391. return dist2;
  392. }
  393. /** \defgroup alignedboxtypedefs Global aligned box typedefs
  394. *
  395. * \ingroup Geometry_Module
  396. *
  397. * Eigen defines several typedef shortcuts for most common aligned box types.
  398. *
  399. * The general patterns are the following:
  400. *
  401. * \c AlignedBoxSizeType where \c Size can be \c 1, \c 2,\c 3,\c 4 for fixed size boxes or \c X for dynamic size,
  402. * and where \c Type can be \c i for integer, \c f for float, \c d for double.
  403. *
  404. * For example, \c AlignedBox3d is a fixed-size 3x3 aligned box type of doubles, and \c AlignedBoxXf is a dynamic-size aligned box of floats.
  405. *
  406. * \sa class AlignedBox
  407. */
  408. #define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
  409. /** \ingroup alignedboxtypedefs */ \
  410. typedef AlignedBox<Type, Size> AlignedBox##SizeSuffix##TypeSuffix;
  411. #define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
  412. EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 1, 1) \
  413. EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
  414. EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
  415. EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
  416. EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X)
  417. EIGEN_MAKE_TYPEDEFS_ALL_SIZES(int, i)
  418. EIGEN_MAKE_TYPEDEFS_ALL_SIZES(float, f)
  419. EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d)
  420. #undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
  421. #undef EIGEN_MAKE_TYPEDEFS
  422. } // end namespace Eigen
  423. #endif // EIGEN_ALIGNEDBOX_H