31 #if defined(DiscreteExteriorCalculus_RECURSES) 32 #error Recursive header files inclusion detected in DiscreteExteriorCalculus.h 33 #else // defined(DiscreteExteriorCalculus_RECURSES) 35 #define DiscreteExteriorCalculus_RECURSES 37 #if !defined DiscreteExteriorCalculus_h 39 #define DiscreteExteriorCalculus_h 47 #include <boost/array.hpp> 48 #include <boost/unordered_map.hpp> 49 #include "DGtal/kernel/SpaceND.h" 50 #include "DGtal/kernel/domains/HyperRectDomain.h" 51 #include "DGtal/base/Common.h" 52 #include "DGtal/topology/KhalimskySpaceND.h" 53 #include "DGtal/dec/Duality.h" 54 #include "DGtal/dec/KForm.h" 55 #include "DGtal/dec/LinearOperator.h" 56 #include "DGtal/dec/VectorField.h" 57 #include "DGtal/base/ConstAlias.h" 58 #include "DGtal/topology/CanonicSCellEmbedder.h" 60 #include <DGtal/kernel/sets/CDigitalSet.h> 61 #include <DGtal/math/linalg/CDynamicMatrix.h> 62 #include <DGtal/math/linalg/CDynamicVector.h> 63 #include <DGtal/math/linalg/CLinearAlgebra.h> 69 template <
typename TLinearAlgebraBackend,
typename TInteger>
77 template <Dimension dim,
typename TInteger>
96 template <Dimension dimEmbedded, Dimension dimAmbient,
typename TLinearAlgebraBackend,
typename TInteger = DGtal::
int32_t>
107 typedef typename LinearAlgebraBackend::DenseVector::Index
Index;
108 typedef typename LinearAlgebraBackend::DenseVector::Scalar
Scalar;
244 template <
typename TDomain>
350 template <Order order, Duality duality>
362 template <Order order, Duality duality,
typename TConstIterator>
364 reorder(
const TConstIterator& begin_range,
const TConstIterator& end_range)
const;
372 template <Order order, Duality duality>
382 template <Order order, Duality duality>
392 template <Order order, Duality duality>
400 template <Duality duality>
411 template <Duality duality>
413 heatLaplace(
const typename DenseVector::Scalar& h,
const typename DenseVector::Scalar& t,
const typename DenseVector::Scalar&
K)
const;
421 template <Order order, Duality duality>
431 template <Duality duality>
442 template <Duality duality>
452 template <Duality duality>
463 template <Duality duality>
598 template <Duality duality>
606 template <Duality duality>
619 template <Dimension dimEmbedded, Dimension dimAmbient,
typename TLinearAlgebraBackend,
typename TInteger>
621 operator<<(std::ostream& out, const DiscreteExteriorCalculus<dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger>& object);
628 #include "DGtal/dec/DiscreteExteriorCalculus.ih" 633 #endif // !defined DiscreteExteriorCalculus_h 635 #undef DiscreteExteriorCalculus_RECURSES 636 #endif // else defined(DiscreteExteriorCalculus_RECURSES)
boost::array< SCells, dimEmbedded+1 > IndexedSCells
KForm< Self, 3, DUAL > DualForm3
void updateSharpOperator()
LinearOperator< Self, 3, DUAL, 2, DUAL > DualAntiderivative3
Aim: DiscreteExteriorCalculus represents a calculus in the dec package. This is the main structure in...
ConstIterator end() const
LinearOperator< Self, 3, DUAL, 3, DUAL > DualIdentity3
Scalar hodgeSign(const Cell &cell, const Duality &duality) const
LinearOperator< Self, order, duality, order, duality > reorder(const TConstIterator &begin_range, const TConstIterator &end_range) const
VectorField< Self, DUAL > DualVectorField
LinearOperator< Self, 2, PRIMAL, 3, PRIMAL > PrimalDerivative2
LinearAlgebraBackend::DenseVector::Scalar Scalar
LinearOperator< Self, 0, DUAL, 1, DUAL > DualDerivative0
VectorField< Self, duality > sharp(const KForm< Self, 1, duality > &one_form) const
LinearOperator< Self, 1, DUAL, dimEmbedded-1, PRIMAL > DualHodge1
LinearOperator< Self, 1, DUAL, 2, DUAL > DualDerivative1
BOOST_STATIC_ASSERT((boost::is_same< Dimension, Order >::value))
LinearOperator< Self, 3, DUAL, dimEmbedded-3, PRIMAL > DualHodge3
DiscreteExteriorCalculus()
LinearAlgebraBackend::SparseMatrix SparseMatrix
Aim: Represent any dynamic sized matrix having sparse or dense representation.
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
LinearOperator< Self, order, duality, dimEmbedded-order, OppositeDuality< duality >::duality > hodge() const
ConstIterator begin() const
Dimension edgeDirection(const Cell &cell, const Duality &duality) const
DGtal::uint32_t Dimension
LinearOperator< Self, 0, duality, 1, duality > flatDirectional(const Dimension &dir) const
Index getCellIndex(const Cell &cell) const
KForm< Self, 1, DUAL > DualForm1
DGtal::KhalimskySpaceND< dimAmbient, TInteger > KSpace
boost::array< boost::array< SparseMatrix, dimAmbient >, 2 > mySharpOperatorMatrixes
LinearOperator< Self, order, duality, order+1, duality > derivative() const
LinearOperator< Self, 0, PRIMAL, 1, PRIMAL > PrimalDerivative0
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
const SCells & getIndexedSCells() const
LinearOperator< Self, order, duality, order, duality > identity() const
Aim: Check right multiplication between matrix and vector and internal matrix multiplication. Matrix and vector scalar types should be the same.
boost::unordered_map< Cell, Property > Properties
KForm< Self, 0, PRIMAL > PrimalForm0
SCell getSCell(const Order &order, const Duality &duality, const Index &index) const
LinearOperator< Self, order, duality, order-1, duality > antiderivative() const
KForm< Self, 1, PRIMAL > PrimalForm1
EigenLinearAlgebraBackend::DenseMatrix DenseMatrix
Properties::iterator Iterator
std::vector< SCell > SCells
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
void selfDisplay(std::ostream &out) const
LinearOperator< Self, 1, PRIMAL, 1, PRIMAL > PrimalIdentity1
LinearOperator< Self, 2, DUAL, 1, DUAL > DualAntiderivative2
LinearOperator< Self, 0, PRIMAL, 0, PRIMAL > PrimalIdentity0
IndexedSCells myIndexSignedCells
LinearOperator< Self, 0, duality, 0, duality > heatLaplace(const typename DenseVector::Scalar &h, const typename DenseVector::Scalar &t, const typename DenseVector::Scalar &K) const
bool eraseCell(const Cell &cell)
Aim: This class provides static members to create DEC structures from various other DGtal structures...
size_t hash_value(const KhalimskyCell< dim, TInteger > &cell)
LinearOperator< Self, 1, PRIMAL, 2, PRIMAL > PrimalDerivative1
LinearOperator< Self, 2, DUAL, 3, DUAL > DualDerivative2
LinearOperator< Self, 0, DUAL, dimEmbedded-0, PRIMAL > DualHodge0
LinearOperator< Self, 0, duality, 0, duality > laplace() const
LinearOperator< Self, 1, PRIMAL, 0, PRIMAL > PrimalAntiderivative1
VectorField< Self, PRIMAL > PrimalVectorField
LinearOperator< Self, 2, DUAL, dimEmbedded-2, PRIMAL > DualHodge2
Aim: LinearOperator represents discrete linear operator between discrete kforms in the DEC package...
KForm< Self, 0, DUAL > DualForm0
bool containsCell(const Cell &cell) const
Holds size 'primal_size', 'dual_size', 'index' and 'flipped' for each cell of the DEC object...
KForm< Self, 2, PRIMAL > PrimalForm2
DGtal is the top-level namespace which contains all DGtal functions and types.
LinearOperator< Self, 1, DUAL, 0, DUAL > DualAntiderivative1
KForm< Self, 3, PRIMAL > PrimalForm3
EigenLinearAlgebraBackend::SparseMatrix SparseMatrix
LinearOperator< Self, 2, DUAL, 2, DUAL > DualIdentity2
Aim: Represent any dynamic sized column vector having sparse or dense representation.
LinearAlgebraBackend::DenseVector DenseVector
unsigned int Order
Aim: Order is used as template parameter for DEC classes.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value...
LinearOperator< Self, 3, PRIMAL, 2, PRIMAL > PrimalAntiderivative3
Order actualOrder(const Order &order, const Duality &duality) const
KForm< Self, 2, DUAL > DualForm2
void initKSpace(ConstAlias< TDomain > domain)
LinearOperator< Self, 1, PRIMAL, dimEmbedded-1, DUAL > PrimalHodge1
std::string className() const
LinearOperator< Self, 2, PRIMAL, 2, PRIMAL > PrimalIdentity2
LinearOperator< Self, 3, PRIMAL, dimEmbedded-3, DUAL > PrimalHodge3
bool myCachedOperatorsNeedUpdate
void updateFlatOperator()
KForm< Self, 1, duality > flat(const VectorField< Self, duality > &vector_field) const
LinearOperator< Self, 0, DUAL, 0, DUAL > DualIdentity0
const Properties & getProperties() const
LinearOperator< Self, 2, PRIMAL, dimEmbedded-2, DUAL > PrimalHodge2
LinearOperator< Self, 2, PRIMAL, 1, PRIMAL > PrimalAntiderivative2
LinearOperator< Self, 0, PRIMAL, dimEmbedded-0, DUAL > PrimalHodge0
bool insertSCell(const SCell &signed_cell)
bool isCellFlipped(const Cell &cell) const
Properties::const_iterator ConstIterator
boost::array< boost::array< SparseMatrix, dimAmbient >, 2 > myFlatOperatorMatrixes
Duality
Aim: Duality enumerator tells if templated object lives in primal or dual space. Used as template par...
Properties myCellProperties
DiscreteExteriorCalculus< dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger > Self
LinearOperator< Self, 1, duality, 0, duality > sharpDirectional(const Dimension &dir) const
LinearAlgebraBackend::DenseMatrix DenseMatrix
Represents an (unsigned) cell in a cellular grid space by its Khalimsky coordinates.
Aim: VectorField represents a discrete vector field in the dec package. Vector field values are attac...
void updateCachedOperators()
LinearOperator< Self, 1, DUAL, 1, DUAL > DualIdentity1
LinearOperator< Self, 3, PRIMAL, 3, PRIMAL > PrimalIdentity3
BOOST_STATIC_CONSTANT(Dimension, dimensionEmbedded=dimEmbedded)
Index kFormLength(const Order &order, const Duality &duality) const
LinearAlgebraBackend::DenseVector::Index Index
TLinearAlgebraBackend LinearAlgebraBackend