DGtal  0.9.2
LinearOperator.h
1 
17 #pragma once
18 
31 #if defined(LinearOperator_RECURSES)
32 #error Recursive header files inclusion detected in LinearOperator.h
33 #else // defined(LinearOperator_RECURSES)
34 
35 #define LinearOperator_RECURSES
36 
37 #if !defined LinearOperator_h
38 
39 #define LinearOperator_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"
48 #include "DGtal/dec/KForm.h"
50 
51 namespace DGtal
52 {
53 
55  // template class LinearOperator
67 template <typename TCalculus, Order order_in, Duality duality_in, Order order_out, Duality duality_out>
69  {
70  // ----------------------- Standard services ------------------------------
71  public:
72  typedef TCalculus Calculus;
73 
74  BOOST_STATIC_ASSERT(( order_in >= 0 ));
75  BOOST_STATIC_ASSERT(( order_in <= Calculus::dimensionEmbedded ));
76  BOOST_STATIC_ASSERT(( order_out >= 0 ));
77  BOOST_STATIC_ASSERT(( order_out <= Calculus::dimensionEmbedded ));
78 
80  typedef typename Calculus::SparseMatrix Container;
82  typedef typename Calculus::Scalar Scalar;
89 
90 
96 
102  LinearOperator(ConstAlias<Calculus> calculus, const Container& container);
103 
109  LinearOperator& operator=(const LinearOperator& other);
110 
111  // ----------------------- Interface --------------------------------------
112  public:
113 
117  Container myContainer;
118 
122  const Calculus* myCalculus;
123 
128  void selfDisplay(std::ostream& out) const;
129 
133  TransposedLinearOperator transpose() const;
134 
138  void clear();
139 
144  bool isValid() const;
145 
146  // ------------------------- Private Datas --------------------------------
147  private:
148 
149  // ------------------------- Hidden services ------------------------------
150  protected:
151 
156  LinearOperator();
157 
158  // ------------------------- Internals ------------------------------------
159  private:
160 
161  }; // end of class LinearOperator
162 
163 
170  template <typename Calculus, Order order_in, Duality duality_in, Order order_out, Duality duality_out>
171  std::ostream&
172  operator<<(std::ostream& out,
174 
181  template <typename Calculus, Order order_in, Duality duality_in, Order order_out, Duality duality_out>
185 
192  template <typename Calculus, Order order_in, Duality duality_in, Order order_out, Duality duality_out>
196 
203  template <typename Calculus, Order order_in, Duality duality_in, Order order_out, Duality duality_out>
205  operator*(const typename Calculus::Scalar& scalar,
207 
214  template <typename Calculus, Order order_in, Duality duality_in, Order order_fold, Duality duality_fold, Order order_out, Duality duality_out>
218 
225  template <typename Calculus, Order order_in, Duality duality_in, Order order_out, Duality duality_out>
228  const KForm<Calculus, order_in, duality_in>& input_form);
229 
235  template <typename Calculus, Order order_in, Duality duality_in, Order order_out, Duality duality_out>
238 
239 } // namespace DGtal
240 
241 
243 // Includes inline functions.
244 #include "DGtal/dec/LinearOperator.ih"
245 
246 // //
248 
249 #endif // !defined LinearOperator_h
250 
251 #undef LinearOperator_RECURSES
252 #endif // else defined(LinearOperator_RECURSES)
KForm< Calculus, order_in, duality_in > InputKForm
Input KForm type.
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
bool isValid() const
Aim: KForm represents discrete kforms in the dec package.
Definition: KForm.h:65
KForm< Calculus, order, duality > operator-(const KForm< Calculus, order, duality > &form_a, const KForm< Calculus, order, duality > &form_b)
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
BOOST_STATIC_ASSERT((order_in >=0))
LinearOperator & operator=(const LinearOperator &other)
Circulator< TIterator > operator+(typename IteratorCirculatorTraits< TIterator >::Difference d, Circulator< TIterator > &object)
Definition: Circulator.h:453
Aim: LinearOperator represents discrete linear operator between discrete kforms in the DEC package...
const Calculus * myCalculus
Calculus::Scalar Scalar
Calculus scalar type.
DGtal is the top-level namespace which contains all DGtal functions and types.
void selfDisplay(std::ostream &out) const
TransposedLinearOperator transpose() const
Calculus::SparseMatrix Container
Container typr.
LinearOperator< Calculus, order_out, duality_out, order_in, duality_in > TransposedLinearOperator
Transposed operator type.
KForm< Calculus, order_out, duality_out > OutputKForm
Output KForm type.
KForm< Calculus, order, duality > operator*(const typename Calculus::Scalar &scalar, const KForm< Calculus, order, duality > &form)