|
DGtal 2.1.0
|
Aim: Utility class to determine the affine geometry of an input set of points. It provides exact results when the input is composed of lattice points, and may determine a basis, the dimension, or an orthogonal vector. More...
#include <DGtal/geometry/tools/AffineGeometry.h>
Public Types | |
| typedef TPoint | Point |
| typedef Point::Coordinate | Scalar |
| typedef Point::Container | Container |
| typedef std::size_t | Size |
| typedef std::vector< Point > | Points |
| type for range of points. | |
| typedef std::vector< Size > | Sizes |
| type for range of sizes. | |
| typedef DGtal::detail::AffineGeometryPointOperations< dimension, Scalar, Container > | PointOps |
| typedef DGtal::detail::AffineGeometryScalarOperations< Scalar > | ScalarOps |
Static Public Member Functions | |
static affine services | |
| template<typename TInputPoint > | |
| static DGtal::int64_t | affineDimension (const std::vector< TInputPoint > &X, const double tolerance=1e-12) |
| template<typename TInputPoint > | |
| static std::vector< Size > | affineSubset (const std::vector< TInputPoint > &X, const double tolerance=1e-12) |
| template<typename TInputPoint , typename TIndexRange > | |
| static std::vector< Size > | affineSubset (const std::vector< TInputPoint > &X, const TIndexRange &I, const double tolerance=1e-12) |
| template<typename TInputPoint > | |
| static std::pair< Point, Points > | affineBasis (const std::vector< TInputPoint > &X, const double tolerance=1e-12) |
| template<typename TInputPoint , typename TIndexRange > | |
| static std::pair< TInputPoint, Points > | affineBasis (const std::vector< TInputPoint > &X, const TIndexRange &I, const double tolerance=1e-12) |
| static Point | independentVector (const Points &basis, const double tolerance=1e-12) |
| template<typename TOtherPoint > | |
| static TOtherPoint | independentVector (const Points &basis, const double tolerance=1e-12) |
| static void | completeBasis (Points &basis, bool normal_vector, const double tolerance=1e-12) |
| template<typename TInputPoint > | |
| static std::vector< Point > | orthogonalLatticeBasis (const TInputPoint &N, bool shortened=false) |
static specific services | |
(Used internally) | |
| static Point | reductionOnBasis (const Point &v, const Points &basis, const double tolerance) |
| static bool | addIfIndependent (Points &basis, const Point &v, const double tolerance) |
| static std::pair< Scalar, Scalar > | reduceVector (Point &w, const Point &b, const double tolerance) |
| static std::pair< Scalar, Scalar > | reduceVector (Point &w, const Point &b, Dimension start, const double tolerance) |
| static const Point & | transform (const Point &w) |
| template<typename TInputPoint > | |
| static Point | transform (const TInputPoint &w) |
| static Point | orthogonalVector (const Points &basis) |
| template<typename TInternalNumber > | |
| static Point | orthogonalVector (const Points &basis) |
| static Point | simplifiedVector (Point v) |
Static Public Attributes | |
| static const Size | dimension = Point::dimension |
Aim: Utility class to determine the affine geometry of an input set of points. It provides exact results when the input is composed of lattice points, and may determine a basis, the dimension, or an orthogonal vector.
Description of template class 'AffineGeometry'
| TPoint | the type for points, which may be lattice points or points with floating-point coordinates. |
Definition at line 453 of file AffineGeometry.h.
| typedef Point::Container DGtal::AffineGeometry< TPoint >::Container |
Definition at line 457 of file AffineGeometry.h.
| typedef TPoint DGtal::AffineGeometry< TPoint >::Point |
Definition at line 455 of file AffineGeometry.h.
| typedef DGtal::detail::AffineGeometryPointOperations< dimension, Scalar, Container > DGtal::AffineGeometry< TPoint >::PointOps |
Definition at line 463 of file AffineGeometry.h.
| typedef std::vector< Point > DGtal::AffineGeometry< TPoint >::Points |
type for range of points.
Definition at line 459 of file AffineGeometry.h.
| typedef Point::Coordinate DGtal::AffineGeometry< TPoint >::Scalar |
Definition at line 456 of file AffineGeometry.h.
| typedef DGtal::detail::AffineGeometryScalarOperations< Scalar > DGtal::AffineGeometry< TPoint >::ScalarOps |
Definition at line 464 of file AffineGeometry.h.
| typedef std::size_t DGtal::AffineGeometry< TPoint >::Size |
Definition at line 458 of file AffineGeometry.h.
| typedef std::vector< Size > DGtal::AffineGeometry< TPoint >::Sizes |
type for range of sizes.
Definition at line 460 of file AffineGeometry.h.
|
inlinestatic |
Checks if the vector v can be decomposed as a linear combination of the vectors of the basis. If yes, returns 'false', otherwise returns 'true' and adds the obtained reduced vector to the basis after normalizing it.
| [in,out] | basis | a range of vectors forming a (partial or not) basis of the space. |
| [in] | v | any vector. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 834 of file AffineGeometry.h.
References DGtal::functions::getSquaredNormL2(), DGtal::detail::AffineGeometryScalarOperations< TScalar >::isNonZero(), DGtal::detail::AffineGeometryPointOperations< dim, TEuclideanRing, TContainer >::normalizeVector(), and DGtal::AffineGeometry< TPoint >::reductionOnBasis().
Referenced by DGtal::AffineGeometry< TPoint >::affineBasis(), DGtal::AffineGeometry< TPoint >::affineBasis(), DGtal::AffineGeometry< TPoint >::affineSubset(), and DGtal::AffineGeometry< TPoint >::affineSubset().
|
inlinestatic |
Given a range of points X, returns a point and a range of vectors forming an affine basis containing X.
| TInputPoint | the type of input points (may be less precise). |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 589 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::addIfIndependent(), DGtal::AffineGeometry< TPoint >::dimension, and DGtal::AffineGeometry< TPoint >::transform().
Referenced by DGtal::functions::getAffineBasis(), DGtal::functions::getAffineBasis(), and DGtal::AffineBasis< TPoint >::reduce().
|
inlinestatic |
Given a range of points X and a range of indices I describing its subset of interest, returns a point and a range of vectors forming an affine basis containing the subset X[I].
| TInputPoint | the type of input points (may be less precise). |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | I | the range of indices within X that specifies the subset of interest. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
X[I].Definition at line 627 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::addIfIndependent(), DGtal::AffineGeometry< TPoint >::dimension, and DGtal::AffineGeometry< TPoint >::transform().
|
inlinestatic |
Given a range of points X, returns the affine dimension of its spanned affine subspace.
| TInputPoint | the type of input points (may be less precise). |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 486 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::affineSubset().
Referenced by DGtal::functions::computeAffineDimension(), and SCENARIO().
|
inlinestatic |
Given a range of points X, returns a subset of these points that form an affine basis of X. Equivalently it is a simplex whose affine space spans all the points of X.
| TInputPoint | the type of input points (may be less precise). |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 508 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::addIfIndependent(), DGtal::AffineGeometry< TPoint >::dimension, and DGtal::AffineGeometry< TPoint >::transform().
Referenced by DGtal::AffineGeometry< TPoint >::affineDimension(), DGtal::functions::computeAffineSubset(), DGtal::functions::computeAffineSubset(), DGtal::functions::getOrthogonalVector(), and DGtal::QuickHull< TKernel >::pickInitialSimplex().
|
inlinestatic |
Given a range of points X and a subset of it given by indices I, returns a subset of these points that form an affine basis of X[I]. Equivalently it is a simplex whose affine space spans all the points of X[I].
| TInputPoint | the type of input points (may be less precise). |
| TIndexRange | any type of range of indices that specifies the subset of points of interest. |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | I | the range of indices specifying the subset of interest. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 551 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::addIfIndependent(), DGtal::AffineGeometry< TPoint >::dimension, and DGtal::AffineGeometry< TPoint >::transform().
|
inlinestatic |
Complete the vectors basis with independent vectors so as to form a basis of the space. When normal_vector is true, the last added vector is guaranteed to be orthogonal to all the previous vectors.
| [in,out] | basis | a range of independent vectors of size less than dimension. |
| [in] | normal_vector | when 'true', the last vector of the basis is orthogonal to all the other vectors of the basis, otherwise it is just an independent canonic vector. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 737 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::dimension, DGtal::AffineGeometry< TPoint >::independentVector(), and DGtal::AffineGeometry< TPoint >::orthogonalVector().
Referenced by DGtal::functions::getCompleteBasis().
|
inlinestatic |
Given a partial basis of vectors, returns a new vector that is independent.
| [in] | basis | a range of independent vectors that defines a partial basis of the space. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 660 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::dimension, DGtal::Trace::error(), DGtal::functions::getSquaredNormL2(), DGtal::detail::AffineGeometryScalarOperations< TScalar >::isNonZero(), DGtal::AffineGeometry< TPoint >::reductionOnBasis(), and DGtal::trace.
Referenced by DGtal::AffineGeometry< TPoint >::completeBasis(), and DGtal::functions::computeIndependentVector().
|
inlinestatic |
Given a partial basis of vectors, returns a new vector that is independent.
| TOtherPoint | any type of point |
| [in] | basis | a range of independent vectors that defines a partial basis of the space. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 696 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::dimension, DGtal::Trace::error(), DGtal::functions::getSquaredNormL2(), DGtal::detail::AffineGeometryScalarOperations< TScalar >::isNonZero(), DGtal::AffineGeometry< TPoint >::reductionOnBasis(), and DGtal::trace.
|
inlinestatic |
Given a primitive lattice vector N, returns a possible basis for its orthogonal d-1 dimensional lattice.
| TOtherPoint | any type of lattice point |
| [in] | N | a non null primitive lattice vector |
| [in] | shortened | when 'false', the basis is in row echelon form, when 'true', the basis is shortened (with pairwise shortenings, may not be optimal, except in 3D). |
Definition at line 768 of file AffineGeometry.h.
References DGtal::functions::computeOrthogonalLattice(), DGtal::R, and DGtal::functions::shortenBasis().
Referenced by DGtal::AffineBasis< TPoint >::AffineBasis(), and DGtal::functions::getOrthogonalLatticeBasis().
|
inlinestatic |
Given d-1 independent vectors in dD, returns a vector that is orthogonal to each of them.
| [in] | basis | a range of independent vectors of size dimension-1. |
Definition at line 962 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::dimension, DGtal::functions::getDeterminantBareiss(), and DGtal::AffineGeometry< TPoint >::simplifiedVector().
Referenced by DGtal::AffineGeometry< TPoint >::completeBasis(), and DGtal::functions::computeOrthogonalVectorToBasis().
|
inlinestatic |
Given d-1 independent vectors in dD, returns a vector that is orthogonal to each of them.
| [in] | basis | a range of independent vectors of size dimension-1. |
Definition at line 1002 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::dimension, DGtal::functions::getDeterminantBareiss(), DGtal::AffineGeometry< TPoint >::simplifiedVector(), DGtal::PointVector< dim, TEuclideanRing, TContainer >::size(), and DGtal::AffineGeometry< TPoint >::transform().
|
inlinestatic |
Reduces vector w by the vector b
| [in,out] | w | any vector |
| [in] | b | a non-null vector of the current basis. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 867 of file AffineGeometry.h.
References DGtal::detail::AffineGeometryScalarOperations< TScalar >::getMultipliers(), and DGtal::detail::AffineGeometryScalarOperations< TScalar >::isNonZero().
Referenced by DGtal::AffineBasis< TPoint >::decomposeVector(), DGtal::AffineBasis< TPoint >::reduceAsEchelon(), and DGtal::AffineGeometry< TPoint >::reductionOnBasis().
|
inlinestatic |
Reduces vector w by the vector b
| [in,out] | w | any vector |
| [in] | b | a non-null vector of the current basis. |
| [in] | start | the starting component index. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 900 of file AffineGeometry.h.
References DGtal::detail::AffineGeometryScalarOperations< TScalar >::getMultipliers(), and DGtal::detail::AffineGeometryScalarOperations< TScalar >::isNonZero().
|
inlinestatic |
Reduces the vector v on the (partial or not) basis of vectors basis.
| [in] | v | any vector |
| [in] | basis | a range of vectors forming a (partial or not) basis of the space. |
| [in] | tolerance | the accepted oo-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 804 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::reduceVector().
Referenced by DGtal::AffineGeometry< TPoint >::addIfIndependent(), and DGtal::AffineGeometry< TPoint >::independentVector().
|
inlinestatic |
Given a vector, returns the aligned vector with its component simplified by the gcd of all components (when the components are integers) or the aligned vector with unit L2-norm (when the components are floating-point numbers).
| [in] | v | any vector. |
Definition at line 1039 of file AffineGeometry.h.
References DGtal::functions::getSquaredNormL2(), and DGtal::detail::AffineGeometryPointOperations< dim, TEuclideanRing, TContainer >::normalizeVector().
Referenced by DGtal::functions::computeSimplifiedVector(), DGtal::AffineBasis< TPoint >::normalize(), DGtal::AffineGeometry< TPoint >::orthogonalVector(), DGtal::AffineBasis< TPoint >::reduceAsEchelon(), and DGtal::AffineBasis< TPoint >::reduceAsLLL().
|
inlinestatic |
Transform a vector or point into the representation chosen for AffineGeometry class. This overloading takes care of the trivial case, where there is no need to change the representation.
| [in] | w | any vector or point |
Definition at line 929 of file AffineGeometry.h.
Referenced by DGtal::AffineBasis< TPoint >::AffineBasis(), DGtal::AffineGeometry< TPoint >::affineBasis(), DGtal::AffineGeometry< TPoint >::affineBasis(), DGtal::AffineBasis< TPoint >::AffineBasis(), DGtal::AffineBasis< TPoint >::AffineBasis(), DGtal::AffineGeometry< TPoint >::affineSubset(), DGtal::AffineGeometry< TPoint >::affineSubset(), DGtal::AffineBasis< TPoint >::initBasis(), and DGtal::AffineGeometry< TPoint >::orthogonalVector().
|
inlinestatic |
Transform a vector or point into the representation chosen for AffineGeometry class. This overloading takes care of the generic case, where a transformation of each component is required.
| [in] | w | any vector or point |
Definition at line 943 of file AffineGeometry.h.
References DGtal::detail::AffineGeometryPointOperations< dim, TEuclideanRing, TContainer >::cast().
|
static |
Definition at line 461 of file AffineGeometry.h.
Referenced by DGtal::AffineGeometry< TPoint >::affineBasis(), DGtal::AffineGeometry< TPoint >::affineBasis(), DGtal::AffineGeometry< TPoint >::affineSubset(), DGtal::AffineGeometry< TPoint >::affineSubset(), DGtal::AffineGeometry< TPoint >::completeBasis(), DGtal::AffineGeometry< TPoint >::independentVector(), and DGtal::AffineGeometry< TPoint >::orthogonalVector().