1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
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 * http://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 itkRegularizedHeavisideStepFunction_hxx
19 #define itkRegularizedHeavisideStepFunction_hxx
20
21 #include "itkRegularizedHeavisideStepFunction.h"
22
23 namespace itk
24 {
25 template< typename TInput, typename TOutput >
26 RegularizedHeavisideStepFunction< TInput, TOutput >
RegularizedHeavisideStepFunction()27 ::RegularizedHeavisideStepFunction() : Superclass(),
28 m_Epsilon( NumericTraits< RealType >::OneValue() ),
29 m_OneOverEpsilon( NumericTraits< RealType >::OneValue() )
30 {}
31
32 template< typename TInput, typename TOutput >
33 void
34 RegularizedHeavisideStepFunction< TInput, TOutput >
SetEpsilon(const RealType & ieps)35 ::SetEpsilon(const RealType & ieps)
36 {
37 if ( ieps > NumericTraits< RealType >::epsilon() )
38 {
39 this->m_Epsilon = ieps;
40 m_OneOverEpsilon = 1.0 / ieps;
41 }
42 else
43 {
44 itkGenericExceptionMacro("ERROR: Epsilon needs to be greater than "
45 << NumericTraits< RealType >::epsilon() );
46 }
47 }
48 }
49
50 #endif
51