DGtal  1.4.beta
KForm.h
1 
17 #pragma once
18 
31 #if defined(KForm_RECURSES)
32 #error Recursive header files inclusion detected in KForm.h
33 #else // defined(KForm_RECURSES)
34 
35 #define KForm_RECURSES
36 
37 #if !defined KForm_h
38 
39 #define KForm_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/base/Clone.h"
47 #include "DGtal/dec/Duality.h"
49 
50 namespace DGtal
51 {
52 
54  // template class KForm
64  template <typename TCalculus, Order order, Duality duality>
65  class KForm
66  {
67  // ----------------------- Standard services ------------------------------
68  public:
69  typedef TCalculus Calculus;
70 
71  BOOST_STATIC_ASSERT(( order >= 0 ));
72  BOOST_STATIC_ASSERT(( order <= Calculus::dimensionEmbedded ));
73 
74  typedef typename Calculus::DenseVector Container;
75  typedef typename Calculus::Scalar Scalar;
76  typedef typename Calculus::SCell SCell;
77  typedef typename Calculus::Index Index;
78 
83  static
85  ones(ConstAlias<Calculus> calculus);
86 
92  static
94  zeros(ConstAlias<Calculus> calculus);
95 
101  static
103  dirac(ConstAlias<Calculus> calculus, const typename Calculus::Cell& cell);
104 
109  KForm(ConstAlias<Calculus> calculus);
110 
116  KForm(ConstAlias<Calculus> calculus, const Container& container);
117 
123  KForm& operator=(const KForm& other);
124 
125  // ----------------------- Interface --------------------------------------
126  public:
127 
132 
137 
142  void selfDisplay(std::ostream& out) const;
143 
147  std::string className() const;
148 
152  void clear();
153 
159  SCell getSCell(const Index& index) const;
160 
165  Index length() const;
166 
171  bool isValid() const;
172 
173  // ------------------------- Private Datas --------------------------------
174  private:
175 
176  // ------------------------- Hidden services ------------------------------
177  protected:
178 
183  KForm();
184 
185  // ------------------------- Internals ------------------------------------
186  private:
187 
188  }; // end of class KForm
189 
196  template <typename Calculus, Order order, Duality duality>
197  std::ostream&
198  operator<<(std::ostream& out, const KForm<Calculus, order, duality>& object);
199 
206  template <typename Calculus, Order order, Duality duality>
209 
216  template <typename Calculus, Order order, Duality duality>
219 
226  template <typename Calculus, Order order, Duality duality>
228  operator*(const typename Calculus::Scalar& scalar, const KForm<Calculus, order, duality>& form);
229 
235  template <typename Calculus, Order order, Duality duality>
238 
239 } // namespace DGtal
240 
241 
243 // Includes inline functions.
244 #include "DGtal/dec/KForm.ih"
245 
246 // //
248 
249 #endif // !defined KForm_h
250 
251 #undef KForm_RECURSES
252 #endif // else defined(KForm_RECURSES)
DGtal::KForm::dirac
static KForm< TCalculus, order, duality > dirac(ConstAlias< Calculus > calculus, const typename Calculus::Cell &cell)
DGtal::operator-
KForm< Calculus, order, duality > operator-(const KForm< Calculus, order, duality > &form_a, const KForm< Calculus, order, duality > &form_b)
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
DGtal::KForm::ones
static KForm< TCalculus, order, duality > ones(ConstAlias< Calculus > calculus)
DGtal::KForm::length
Index length() const
Index
SMesh::Index Index
Definition: fullConvexitySphereGeodesics.cpp:117
DGtal::KForm::clear
void clear()
DGtal::KForm::operator=
KForm & operator=(const KForm &other)
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::KForm::SCell
Calculus::SCell SCell
Definition: KForm.h:76
DGtal::KForm::Scalar
Calculus::Scalar Scalar
Definition: KForm.h:75
DGtal::KForm::className
std::string className() const
DGtal::operator+
Circulator< TIterator > operator+(typename IteratorCirculatorTraits< TIterator >::Difference d, Circulator< TIterator > &object)
Definition: Circulator.h:453
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::KForm::KForm
KForm()
DGtal::KForm::myContainer
Container myContainer
Definition: KForm.h:131
DGtal::KForm::getSCell
SCell getSCell(const Index &index) const
DGtal::KForm::isValid
bool isValid() const
DGtal::KForm::myCalculus
const Calculus * myCalculus
Definition: KForm.h:136
DGtal::KForm::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::KForm::zeros
static KForm< TCalculus, order, duality > zeros(ConstAlias< Calculus > calculus)
DGtal::KForm::Container
Calculus::DenseVector Container
Definition: KForm.h:74
DGtal::KForm::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((order >=0))
DGtal::KForm
Aim: KForm represents discrete kforms in the dec package.
Definition: KForm.h:65
DGtal::operator*
KForm< Calculus, order, duality > operator*(const typename Calculus::Scalar &scalar, const KForm< Calculus, order, duality > &form)
Cell
KSpace::Cell Cell
Definition: testCubicalComplex.cpp:56
DGtal::KForm::Index
Calculus::Index Index
Definition: KForm.h:77
SCell
Z3i::SCell SCell
Definition: digitalPolyhedronBuilder3D.cpp:79
DGtal::KForm::Calculus
TCalculus Calculus
Definition: KForm.h:69