ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkNormalVariateGenerator.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 itkNormalVariateGenerator_h
19#define itkNormalVariateGenerator_h
20
21#include "itkObjectFactory.h"
23#include "ITKStatisticsExport.h"
24
25namespace itk
26{
27namespace Statistics
28{
96class ITKStatistics_EXPORT NormalVariateGenerator : public RandomVariateGeneratorBase
97{
98public:
104
106 itkOverrideGetNameOfClassMacro(NormalVariateGenerator);
107
109 itkNewMacro(Self);
110
112 void
113 Initialize(int randomSeed);
114
116 double
117 GetVariate() override;
118
119protected:
122 void
123 PrintSelf(std::ostream & os, Indent indent) const override;
124
126 double
128
129private:
130 static inline int
132 {
133 // shifting of signed integer gives undefined results, explicitly
134 // cast to unsigned to get expected ( if two complement
135 // representation ) results.
136 auto uirs = static_cast<unsigned int>(irs);
137 return static_cast<int>((irs <= 0) ? ((uirs << 1) ^ 333556017) : (uirs << 1));
138 }
139
140 double m_Scale{};
141 double m_Rscale{};
142 double m_Rcons{};
143
144 static constexpr int m_ELEN{ 7 };
145 // LEN must be 2 ** ELEN
146 static constexpr int m_LEN{ 128 };
147 static constexpr int m_LMASK{ 4 * (m_LEN - 1) };
148 static constexpr int m_TLEN{ 8 * m_LEN };
149
151 int * m_Gausssave{};
152
153 double m_GScale{};
154
156 int m_Nslew{};
157 int m_Irs{};
158 int m_Lseed{};
159 double m_Chic1{};
160 double m_Chic2{};
161 double m_ActualRSD{};
162}; // end of class
163} // end of namespace Statistics
164} // end of namespace itk
165#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
void PrintSelf(std::ostream &os, Indent indent) const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....