DGtal 1.3.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
HodgeTester< Calculus, order > Struct Template Reference

#include </Users/davidcoeurjolly/Sources/DGtal/tests/dec/DECCommon.h>

Public Member Functions

 BOOST_STATIC_ASSERT ((order<=Calculus::dimensionEmbedded))
 

Static Public Member Functions

static bool test (const Calculus &calculus)
 

Detailed Description

template<typename Calculus, int order>
struct HodgeTester< Calculus, order >

Definition at line 55 of file DECCommon.h.

Member Function Documentation

◆ BOOST_STATIC_ASSERT()

template<typename Calculus , int order>
HodgeTester< Calculus, order >::BOOST_STATIC_ASSERT ( (order<=Calculus::dimensionEmbedded)  )

◆ test()

template<typename Calculus , int order>
static bool HodgeTester< Calculus, order >::test ( const Calculus &  calculus)
inlinestatic

Definition at line 59 of file DECCommon.h.

60 {
61 DGtal::trace.info() << "testing identity operators " << order << std::endl;
62
63 { // test identity operator
65 PrimalIdentity primal_identity = calculus.template identity<order, DGtal::PRIMAL>();
66 if (!is_identity(primal_identity.myContainer, 1)) return false;
67
69 SolveForm input(calculus);
70 SolveForm output = primal_identity * input;
71 typedef typename Calculus::LinearAlgebraBackend LinearAlgebraBackend;
72 typedef typename LinearAlgebraBackend::SolverConjugateGradient LinearSolver;
74 Solver solver;
75 SolveForm input_solved = solver.compute(primal_identity).solve(output);
76 //if (input_solved != input) return false;
77
79 DualIdentity dual_identity = calculus.template identity<order, DGtal::DUAL>();
80 if (!is_identity(dual_identity.myContainer, 1)) return false;
81 }
82
83 typedef DGtal::LinearOperator<Calculus, order, DGtal::PRIMAL, Calculus::dimensionEmbedded-order, DGtal::DUAL> PrimalHodge;
84 typedef DGtal::LinearOperator<Calculus, Calculus::dimensionEmbedded-order, DGtal::DUAL, order, DGtal::PRIMAL> DualHodge;
85 const PrimalHodge primal_hodge = calculus.template hodge<order, DGtal::PRIMAL>();
86 const DualHodge dual_hodge= calculus.template hodge<Calculus::dimensionEmbedded-order, DGtal::DUAL>();
87
88 DGtal::trace.info() << "testing primal to primal hodge composition order " << order << std::endl;
89
90 { // test primal to primal composition
92 PrimalPrimal primal_primal = dual_hodge * primal_hodge;
93 if (!is_identity(primal_primal.myContainer, pow(-1, order*(Calculus::dimensionEmbedded-order)))) return false;
94 }
95
96 DGtal::trace.info() << "testing dual to dual hodge composition order " << order << std::endl;
97
98 { // test dual to dual composition
99 typedef DGtal::LinearOperator<Calculus, Calculus::dimensionEmbedded-order, DGtal::DUAL, Calculus::dimensionEmbedded-order, DGtal::DUAL> DualDual;
100 DualDual dual_dual = primal_hodge * dual_hodge;
101 if (!is_identity(dual_dual.myContainer, pow(-1, order*(Calculus::dimensionEmbedded-order)))) return false;
102 }
103
105 }
Aim: This wraps a linear algebra solver around a discrete exterior calculus.
SolutionKForm solve(const InputKForm &input_kform) const
DiscreteExteriorCalculusSolver & compute(const Operator &linear_operator)
Aim: KForm represents discrete kforms in the dec package.
Definition: KForm.h:66
Aim: LinearOperator represents discrete linear operator between discrete kforms in the DEC package.
std::ostream & info()
Trace trace
Definition: Common.h:154
@ PRIMAL
Definition: Duality.h:61
@ DUAL
Definition: Duality.h:62
static bool test(const Calculus &calculus)
Definition: DECCommon.h:59

References DGtal::DiscreteExteriorCalculusSolver< TCalculus, TLinearAlgebraSolver, order_in, duality_in, order_out, duality_out >::compute(), DGtal::DUAL, DGtal::Trace::info(), DGtal::PRIMAL, DGtal::DiscreteExteriorCalculusSolver< TCalculus, TLinearAlgebraSolver, order_in, duality_in, order_out, duality_out >::solve(), HodgeTester< Calculus, order >::test(), and DGtal::trace.

Referenced by HodgeTester< Calculus, order >::test().


The documentation for this struct was generated from the following file: