ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkSpecialFunctions.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkSpecialFunctions_h
19#define itkSpecialFunctions_h
20
21#include "itk_eigen.h"
22#include ITK_EIGEN_UNSUPPORTED(SpecialFunctions)
23#include <type_traits>
24
25namespace itk
26{
27namespace Math
28{
29
31template <typename TReal>
32TReal
33IncompleteGammaP(TReal a, TReal x)
34{
35 static_assert(std::is_floating_point_v<TReal>, "IncompleteGammaP requires a floating-point type");
36 return Eigen::numext::igamma(a, x);
37}
38
40template <typename TReal>
41TReal
42RegularizedIncompleteBeta(TReal a, TReal b, TReal x)
43{
44 static_assert(std::is_floating_point_v<TReal>, "RegularizedIncompleteBeta requires a floating-point type");
45 return Eigen::numext::betainc(a, b, x);
46}
47
48} // namespace Math
49} // namespace itk
50
51#endif // itkSpecialFunctions_h
TReal IncompleteGammaP(TReal a, TReal x)
Regularized lower incomplete gamma P(a, x) = γ(a, x) / Γ(a).
TReal RegularizedIncompleteBeta(TReal a, TReal b, TReal x)
Regularized incomplete beta I_x(a, b).
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....