DGtal  1.4.beta
VectorField.h
1 
17 #pragma once
18 
31 #if defined(VectorField_RECURSES)
32 #error Recursive header files inclusion detected in VectorField.h
33 #else // defined(VectorField_RECURSES)
34 
35 #define VectorField_RECURSES
36 
37 #if !defined VectorField_h
38 
39 #define VectorField_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/base/ConstAlias.h"
47 #include "DGtal/dec/Duality.h"
48 #include "DGtal/dec/KForm.h"
49 #include "DGtal/kernel/PointVector.h"
51 
52 namespace DGtal
53 {
54 
56  // template class VectorField
66 template <typename TCalculus, Duality duality>
68  {
69  // ----------------------- Standard services ------------------------------
70  public:
71  typedef TCalculus Calculus;
72 
73  typedef typename Calculus::Scalar Scalar;
74  typedef typename Calculus::SCell SCell;
75  typedef typename Calculus::Index Index;
77 
80 
86 
92  VectorField(ConstAlias<Calculus> calculus, const Container& container);
93 
99  VectorField& operator=(const VectorField& other);
100 
106  SCell getSCell(const Index& index) const;
107 
112  Index length() const;
113 
118  Vector getVector(const Index& index) const;
119 
125  void setVector(const Index& index, const Vector& vector);
126 
127  // ----------------------- Interface --------------------------------------
128  public:
129 
134 
139 
144  void selfDisplay(std::ostream& out) const;
145 
149  std::string className() const;
150 
156 
161  KForm<Calculus, 0, duality> intensity(const typename Vector::NormType norm_type = Vector::L_2) const;
162 
166  void clear();
167 
173  VectorField<TCalculus, duality> normalized(const Scalar& epsilon = 0) const;
174 
179  bool isValid() const;
180 
181 
182  // ------------------------- Private Datas --------------------------------
183  private:
184 
185  // ------------------------- Hidden services ------------------------------
186  protected:
187 
192  VectorField();
193 
194  // ------------------------- Internals ------------------------------------
195  private:
196 
197  }; // end of class VectorField
198 
199 
206  template <typename Calculus, Duality duality>
207  std::ostream&
208  operator<<(std::ostream& out, const VectorField<Calculus, duality>& object);
209 
216  template <typename Calculus, Duality duality>
218  operator+(const VectorField<Calculus, duality>& vector_field_a, const VectorField<Calculus, duality>& vector_field_b);
219 
226  template <typename Calculus, Duality duality>
228  operator-(const VectorField<Calculus, duality>& vector_field_a, const VectorField<Calculus, duality>& vector_field_b);
229 
236  template <typename Calculus, Duality duality>
238  operator*(const typename Calculus::Scalar& scalar, const VectorField<Calculus, duality>& vector_field);
239 
245  template <typename Calculus, Duality duality>
247  operator-(const VectorField<Calculus, duality>& vector_field);
248 
249 } // namespace DGtal
250 
251 
253 // Includes inline functions.
254 #include "DGtal/dec/VectorField.ih"
255 
256 // //
258 
259 #endif // !defined VectorField_h
260 
261 #undef VectorField_RECURSES
262 #endif // else defined(VectorField_RECURSES)
DGtal::VectorField::Container
Coordinates Container
Definition: VectorField.h:79
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::VectorField::clear
void clear()
DGtal::VectorField::Coordinates
Calculus::DenseMatrix Coordinates
Definition: VectorField.h:78
DGtal::VectorField::Calculus
TCalculus Calculus
Definition: VectorField.h:71
DGtal::VectorField::myCoordinates
Coordinates myCoordinates
Definition: VectorField.h:133
DGtal::VectorField::setVector
void setVector(const Index &index, const Vector &vector)
DGtal::VectorField::SCell
Calculus::SCell SCell
Definition: VectorField.h:74
Index
SMesh::Index Index
Definition: fullConvexitySphereGeodesics.cpp:117
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:137
DGtal::PointVector::L_2
@ L_2
Definition: PointVector.h:1493
DGtal::VectorField::Scalar
Calculus::Scalar Scalar
Definition: VectorField.h:73
DGtal::VectorField::getSCell
SCell getSCell(const Index &index) const
DGtal::VectorField
Aim: VectorField represents a discrete vector field in the dec package. Vector field values are attac...
Definition: VectorField.h:67
DGtal::VectorField::length
Index length() const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::VectorField::myCalculus
const Calculus * myCalculus
Definition: VectorField.h:138
DGtal::VectorField::Index
Calculus::Index Index
Definition: VectorField.h:75
DGtal::operator+
Circulator< TIterator > operator+(typename IteratorCirculatorTraits< TIterator >::Difference d, Circulator< TIterator > &object)
Definition: Circulator.h:453
DGtal::VectorField::normalized
VectorField< TCalculus, duality > normalized(const Scalar &epsilon=0) const
DGtal::VectorField::getVector
Vector getVector(const Index &index) const
DGtal::VectorField::operator=
VectorField & operator=(const VectorField &other)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::VectorField::coordAlongDirection
KForm< Calculus, 0, duality > coordAlongDirection(const Dimension &dir) const
DGtal::VectorField::isValid
bool isValid() const
DenseMatrix
EigenLinearAlgebraBackend::DenseMatrix DenseMatrix
Definition: testHeatLaplace.cpp:51
DGtal::VectorField::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::VectorField::intensity
KForm< Calculus, 0, duality > intensity(const typename Vector::NormType norm_type=Vector::L_2) const
DGtal::VectorField::VectorField
VectorField()
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165
DGtal::PointVector::NormType
NormType
Definition: PointVector.h:1493
DGtal::VectorField::Vector
DGtal::PointVector< Calculus::dimensionAmbient, Scalar > Vector
Definition: VectorField.h:76
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)
DGtal::VectorField::className
std::string className() const
SCell
Z3i::SCell SCell
Definition: digitalPolyhedronBuilder3D.cpp:79