Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
887e379f
Commit
887e379f
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
ScanResolution w/o 'Single'
parent
c40c86be
No related branches found
No related tags found
1 merge request
!1287
scan resolution: rm relative-vector class; rename other classes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sim/Scan/ScanResolution.cpp
+19
-19
19 additions, 19 deletions
Sim/Scan/ScanResolution.cpp
with
19 additions
and
19 deletions
Sim/Scan/ScanResolution.cpp
+
19
−
19
View file @
887e379f
...
...
@@ -24,21 +24,21 @@ const std::string relative_resolution = "scanRelativeResolution";
const
std
::
string
absolute_resolution
=
"scanAbsoluteResolution"
;
// ************************************************************************************************
// Scan
Single
RelativeResolution
// ScanRelativeResolution
// ************************************************************************************************
class
Scan
Single
RelativeResolution
:
public
IScanResolution
{
class
ScanRelativeResolution
:
public
IScanResolution
{
public:
Scan
Single
RelativeResolution
(
const
IRangedDistribution
&
distr
,
double
reldev
)
ScanRelativeResolution
(
const
IRangedDistribution
&
distr
,
double
reldev
)
:
IScanResolution
(
distr
)
,
m_reldev
(
reldev
)
{
}
~
Scan
Single
RelativeResolution
()
override
=
default
;
~
ScanRelativeResolution
()
override
=
default
;
IScanResolution
*
clone
()
const
override
{
return
new
Scan
Single
RelativeResolution
(
*
rdistribution
(),
m_reldev
);
return
new
ScanRelativeResolution
(
*
rdistribution
(),
m_reldev
);
}
DistrOutput
generateResolutionSamples
(
const
std
::
vector
<
double
>&
mean
)
const
override
;
...
...
@@ -55,7 +55,7 @@ private:
};
IScanResolution
::
DistrOutput
Scan
Single
RelativeResolution
::
generateResolutionSamples
(
const
std
::
vector
<
double
>&
mean
)
const
ScanRelativeResolution
::
generateResolutionSamples
(
const
std
::
vector
<
double
>&
mean
)
const
{
ASSERT
(
!
mean
.
empty
());
DistrOutput
result
;
...
...
@@ -65,12 +65,12 @@ ScanSingleRelativeResolution::generateResolutionSamples(const std::vector<double
return
result
;
}
std
::
vector
<
double
>
Scan
Single
RelativeResolution
::
stdDevs
(
double
mean
,
size_t
n_times
)
const
std
::
vector
<
double
>
ScanRelativeResolution
::
stdDevs
(
double
mean
,
size_t
n_times
)
const
{
return
std
::
vector
<
double
>
(
n_times
,
mean
*
m_reldev
);
}
std
::
vector
<
double
>
Scan
Single
RelativeResolution
::
stdDevs
(
const
std
::
vector
<
double
>&
mean
)
const
std
::
vector
<
double
>
ScanRelativeResolution
::
stdDevs
(
const
std
::
vector
<
double
>&
mean
)
const
{
ASSERT
(
!
mean
.
empty
());
std
::
vector
<
double
>
result
;
...
...
@@ -81,21 +81,21 @@ std::vector<double> ScanSingleRelativeResolution::stdDevs(const std::vector<doub
}
// ************************************************************************************************
// Scan
Single
AbsoluteResolution
// ScanAbsoluteResolution
// ************************************************************************************************
class
Scan
Single
AbsoluteResolution
:
public
IScanResolution
{
class
ScanAbsoluteResolution
:
public
IScanResolution
{
public:
Scan
Single
AbsoluteResolution
(
const
IRangedDistribution
&
distr
,
double
stddev
)
ScanAbsoluteResolution
(
const
IRangedDistribution
&
distr
,
double
stddev
)
:
IScanResolution
(
distr
)
,
m_stddev
(
stddev
)
{
}
~
Scan
Single
AbsoluteResolution
()
override
=
default
;
~
ScanAbsoluteResolution
()
override
=
default
;
IScanResolution
*
clone
()
const
override
{
return
new
Scan
Single
AbsoluteResolution
(
*
rdistribution
(),
m_stddev
);
return
new
ScanAbsoluteResolution
(
*
rdistribution
(),
m_stddev
);
}
DistrOutput
generateResolutionSamples
(
const
std
::
vector
<
double
>&
mean
)
const
override
;
...
...
@@ -112,7 +112,7 @@ private:
};
IScanResolution
::
DistrOutput
Scan
Single
AbsoluteResolution
::
generateResolutionSamples
(
const
std
::
vector
<
double
>&
mean
)
const
ScanAbsoluteResolution
::
generateResolutionSamples
(
const
std
::
vector
<
double
>&
mean
)
const
{
ASSERT
(
!
mean
.
empty
());
DistrOutput
result
;
...
...
@@ -122,19 +122,19 @@ ScanSingleAbsoluteResolution::generateResolutionSamples(const std::vector<double
return
result
;
}
std
::
vector
<
double
>
Scan
Single
AbsoluteResolution
::
stdDevs
(
double
,
size_t
n_times
)
const
std
::
vector
<
double
>
ScanAbsoluteResolution
::
stdDevs
(
double
,
size_t
n_times
)
const
{
return
std
::
vector
<
double
>
(
n_times
,
m_stddev
);
}
std
::
vector
<
double
>
Scan
Single
AbsoluteResolution
::
stdDevs
(
const
std
::
vector
<
double
>&
mean
)
const
std
::
vector
<
double
>
ScanAbsoluteResolution
::
stdDevs
(
const
std
::
vector
<
double
>&
mean
)
const
{
ASSERT
(
!
mean
.
empty
());
return
std
::
vector
<
double
>
(
mean
.
size
(),
m_stddev
);
}
// ************************************************************************************************
// Scan
Single
VectorResolution
// ScanVectorResolution
// ************************************************************************************************
class
ScanVectorResolution
:
public
IScanResolution
{
...
...
@@ -265,12 +265,12 @@ IScanResolution::DistrOutput IScanResolution::generateResolutionSamples(double m
IScanResolution
*
scanRelativeResolution
(
const
IRangedDistribution
&
distr
,
double
stddev
)
{
return
new
Scan
Single
RelativeResolution
(
distr
,
stddev
);
return
new
ScanRelativeResolution
(
distr
,
stddev
);
}
IScanResolution
*
scanAbsoluteResolution
(
const
IRangedDistribution
&
distr
,
double
stddev
)
{
return
new
Scan
Single
AbsoluteResolution
(
distr
,
stddev
);
return
new
ScanAbsoluteResolution
(
distr
,
stddev
);
}
IScanResolution
*
scanVectorResolution
(
const
IRangedDistribution
&
distr
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment