ITK  5.2.0
Insight Toolkit
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  * 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 itkNormalVariateGenerator_h
19 #define itkNormalVariateGenerator_h
20 
21 #include "itkObjectFactory.h"
23 #include "ITKStatisticsExport.h"
24 
25 namespace itk
26 {
27 namespace Statistics
28 {
98 class ITKStatistics_EXPORT NormalVariateGenerator : public RandomVariateGeneratorBase
99 {
100 public:
106 
109 
111  itkNewMacro(Self);
112 
114  void
115  Initialize(int randomSeed);
116 
118  double
119  GetVariate() override;
120 
121 protected:
123  ~NormalVariateGenerator() override;
124  void
125  PrintSelf(std::ostream & os, Indent indent) const override;
126 
128  double
129  FastNorm();
130 
131 private:
132  static inline int
133  SignedShiftXOR(int irs)
134  {
135  // shifting of signed integer gives undefined results, explicitly
136  // cast to unsigned to get expected ( if two complement
137  // representation ) results.
138  auto uirs = static_cast<unsigned int>(irs);
139  return static_cast<int>((irs <= 0) ? ((uirs << 1) ^ 333556017) : (uirs << 1));
140  }
141 
142  double m_Scale;
143  double m_Rscale;
144  double m_Rcons;
145  int m_ELEN;
146  int m_LEN;
147  int m_LMASK;
148  int m_TLEN;
149 
151  int * m_Gausssave;
152 
153  double m_GScale;
154 
155  int * m_Vec1;
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
itkObjectFactory.h
itk::Statistics::NormalVariateGenerator::m_TLEN
int m_TLEN
Definition: itkNormalVariateGenerator.h:148
itk::Statistics::NormalVariateGenerator::m_Scale
double m_Scale
Definition: itkNormalVariateGenerator.h:142
itk::Statistics::NormalVariateGenerator::m_Lseed
int m_Lseed
Definition: itkNormalVariateGenerator.h:158
itk::Statistics::NormalVariateGenerator::SignedShiftXOR
static int SignedShiftXOR(int irs)
Definition: itkNormalVariateGenerator.h:133
itk::Statistics::NormalVariateGenerator::m_Rscale
double m_Rscale
Definition: itkNormalVariateGenerator.h:143
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Statistics::NormalVariateGenerator::m_Gaussfaze
int m_Gaussfaze
Definition: itkNormalVariateGenerator.h:150
itk::Statistics::NormalVariateGenerator::m_Gausssave
int * m_Gausssave
Definition: itkNormalVariateGenerator.h:151
itk::Statistics::NormalVariateGenerator::m_LMASK
int m_LMASK
Definition: itkNormalVariateGenerator.h:147
itk::Statistics::RandomVariateGeneratorBase
Defines common interfaces for random variate generators.
Definition: itkRandomVariateGeneratorBase.h:33
itk::Statistics::NormalVariateGenerator::m_LEN
int m_LEN
Definition: itkNormalVariateGenerator.h:146
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::Statistics::NormalVariateGenerator
Normal random variate generator.
Definition: itkNormalVariateGenerator.h:98
itk::Statistics::NormalVariateGenerator::m_Chic1
double m_Chic1
Definition: itkNormalVariateGenerator.h:159
itk::Statistics::NormalVariateGenerator::m_ELEN
int m_ELEN
Definition: itkNormalVariateGenerator.h:145
itkRandomVariateGeneratorBase.h
itk::Statistics::NormalVariateGenerator::m_ActualRSD
double m_ActualRSD
Definition: itkNormalVariateGenerator.h:161
itk::Statistics::NormalVariateGenerator::m_Rcons
double m_Rcons
Definition: itkNormalVariateGenerator.h:144
itk::Statistics::NormalVariateGenerator::m_Nslew
int m_Nslew
Definition: itkNormalVariateGenerator.h:156
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Statistics::NormalVariateGenerator::m_GScale
double m_GScale
Definition: itkNormalVariateGenerator.h:153
itk::Statistics::NormalVariateGenerator::m_Chic2
double m_Chic2
Definition: itkNormalVariateGenerator.h:160
itk::Statistics::NormalVariateGenerator::m_Irs
int m_Irs
Definition: itkNormalVariateGenerator.h:157
itk::Statistics::NormalVariateGenerator::m_Vec1
int * m_Vec1
Definition: itkNormalVariateGenerator.h:155