CEPS  24.01
Cardiac ElectroPhysiology Simulator
CepsContinuousFunctions.hpp
Go to the documentation of this file.
1 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2  This file is part of CEPS.
3 
4  CEPS is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  CEPS is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with CEPS (see file LICENSE at root of project).
16  If not, see <https://www.gnu.org/licenses/>.
17 
18 
19  Copyright 2019-2024 Inria, Universite de Bordeaux
20 
21  Authors, in alphabetical order:
22 
23  Pierre-Elliott BECUE, Florian CARO, Yves COUDIERE(*), Andjela DAVIDOVIC,
24  Charlie DOUANLA-LONTSI, Marc FUENTES, Mehdi JUHOOR, Michael LEGUEBE(*),
25  Pauline MIGERDITICHAN, Valentin PANNETIER(*), Nejib ZEMZEMI.
26  * : currently active authors
27 
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
32 #pragma once
33 
34 #include <unordered_map>
35 
36 #include "Eigen/Dense"
39 
41 namespace ceps
42 {
43 
44  namespace math
45  {
46 
64  CepsReal
65  polRef (CepsReal r);
66 
87  CepsReal
89 
109  CepsReal
111 
126  CepsReal
128  CepsReal duration,
129  CepsReal *point,
130  const CepsVector<CepsReal> &orig,
131  CepsReal diam,
132  CepsReal amp);
133 
148  CepsReal
149  constStim (CepsReal t,
150  CepsReal duration,
151  CepsReal *point,
152  const CepsVector<CepsReal> &orig,
153  CepsReal diam,
154  CepsReal amp);
155 
171  CepsReal
172  c4Stim (CepsReal t,
173  CepsReal duration,
174  CepsReal *point,
175  const CepsVector<CepsReal> &orig,
176  CepsReal diam,
177  CepsReal amp);
178 
194  CepsReal
195  c5Stim (CepsReal t,
196  CepsReal duration,
197  CepsReal *point,
198  const CepsVector<CepsReal> &orig,
199  CepsReal diam,
200  CepsReal amp);
201 
211  CepsReal
213  CepsReal f2, CepsReal f3);
214 
224  CepsReal
226  CepsReal f2, CepsReal f3);
227 
238  CepsReal
240  CepsReal c, CepsReal t0);
241 
242 
244  constexpr CepsUInt
246  {
247  return (n == 0) ? 1 : n * factorial (n - 1);
248  }
249 
250  } // namespace ceps::math
251 } // namespace ceps
252 
253 
std::vector< _Type, _Alloc > CepsVector
C++ vector.
Definition: CepsTypes.hpp:155
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
Definition: CepsTypes.hpp:109
float CepsReal
Need single precision floating point.
Definition: CepsTypes.hpp:100
CepsReal d4Polynomial(CepsReal x)
A polynomial satisfying 0-derivative equalities.
constexpr CepsUInt factorial(CepsUInt n)
Compile-time factorial.
CepsReal newtonSolvePol4Pts(CepsReal f0, CepsReal f1, CepsReal f2, CepsReal f3, CepsReal c, CepsReal t0)
Solves for , based on a 4 points interpolation of , using Newton method.
CepsReal polRef(CepsReal r)
Pole function used in stimulation function definition.
CepsReal d5Polynomial(CepsReal r)
Another polynomial satisfying more 0-derivative equalities.
CepsReal cInfinityStim(CepsReal t, CepsReal duration, CepsReal *point, const CepsVector< CepsReal > &orig, CepsReal diam, CepsReal amp)
Regular stimulation function.
CepsReal derivativeLagrangianPol4Pts(CepsReal x, CepsReal f0, CepsReal f1, CepsReal f2, CepsReal f3)
Derivative of Lagrange interpolating polynomial of degree 3.
CepsReal constStim(CepsReal t, CepsReal duration, CepsReal *point, const CepsVector< CepsReal > &orig, CepsReal diam, CepsReal amp)
Constant stimulation in a region (step function in time)
CepsReal c5Stim(CepsReal t, CepsReal duration, CepsReal *point, const CepsVector< CepsReal > &orig, CepsReal diam, CepsReal amp)
Regular stimulation function.
CepsReal lagrangianPol4Pts(CepsReal x, CepsReal f0, CepsReal f1, CepsReal f2, CepsReal f3)
Lagrange interpolation of degree 3.
CepsReal c4Stim(CepsReal t, CepsReal duration, CepsReal *point, const CepsVector< CepsReal > &orig, CepsReal diam, CepsReal amp)
Regular stimulation function.
A namespace for all utility methods.