2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU Lesser General Public License as
4 * published by the Free Software Foundation, either version 3 of the
5 * License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * @file DiscreteExteriorCalculusSolver.ih
19 * @author Pierre Gueth (\c pierre.gueth@liris.cnrs.fr )
20 * Laboratoire d'InfoRmatique en Image et Systemes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
24 * Implementation of inline methods defined in DiscreteExteriorCalculusSolver.h
26 * This file is part of the DGtal library.
29///////////////////////////////////////////////////////////////////////////////
30// IMPLEMENTATION of inline methods.
31///////////////////////////////////////////////////////////////////////////////
33///////////////////////////////////////////////////////////////////////////////
34// ----------------------- Standard services ------------------------------
36template <typename C, typename S, DGtal::Order order_in, DGtal::Duality duality_in, DGtal::Order order_out, DGtal::Duality duality_out>
37DGtal::DiscreteExteriorCalculusSolver<C, S, order_in, duality_in, order_out, duality_out>::DiscreteExteriorCalculusSolver()
42///////////////////////////////////////////////////////////////////////////////
43// Interface - public :
45template <typename C, typename S, DGtal::Order order_in, DGtal::Duality duality_in, DGtal::Order order_out, DGtal::Duality duality_out>
47DGtal::DiscreteExteriorCalculusSolver<C, S, order_in, duality_in, order_out, duality_out>::selfDisplay(std::ostream& out) const
49 out << "[DiscreteExteriorCalculusSolver]";
52template <typename C, typename S, DGtal::Order order_in, DGtal::Duality duality_in, DGtal::Order order_out, DGtal::Duality duality_out>
53DGtal::DiscreteExteriorCalculusSolver<C, S, order_in, duality_in, order_out, duality_out>&
54DGtal::DiscreteExteriorCalculusSolver<C, S, order_in, duality_in, order_out, duality_out>::compute(const Operator& linear_operator)
56 myLinearAlgebraSolver.compute(linear_operator.myContainer);
57 myCalculus = linear_operator.myCalculus;
61template <typename C, typename S, DGtal::Order order_in, DGtal::Duality duality_in, DGtal::Order order_out, DGtal::Duality duality_out>
62DGtal::KForm<C, order_in, duality_in>
63DGtal::DiscreteExteriorCalculusSolver<C, S, order_in, duality_in, order_out, duality_out>::solve(const InputKForm& input_kform) const
65 ASSERT( myCalculus == input_kform.myCalculus );
66 SolutionKForm solution(*input_kform.myCalculus, myLinearAlgebraSolver.solve(input_kform.myContainer));
70template <typename C, typename S, DGtal::Order order_in, DGtal::Duality duality_in, DGtal::Order order_out, DGtal::Duality duality_out>
72DGtal::DiscreteExteriorCalculusSolver<C, S, order_in, duality_in, order_out, duality_out>::isValid() const
74 if (myCalculus == NULL) return false;
75 return myLinearAlgebraSolver.info() == 0;
78///////////////////////////////////////////////////////////////////////////////
79// Implementation of inline functions //
81template <typename C, typename S, DGtal::Order order_in, DGtal::Duality duality_in, DGtal::Order order_out, DGtal::Duality duality_out>
83DGtal::operator<<(std::ostream& out, const DiscreteExteriorCalculusSolver<C, S, order_in, duality_in, order_out, duality_out>& object)
85 object.selfDisplay(out);
90///////////////////////////////////////////////////////////////////////////////