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
ee06e568
Commit
ee06e568
authored
11 years ago
by
Pospelov, Gennady
Browse files
Options
Downloads
Patches
Plain Diff
Additional check in ChiSquaredModule for mask consistency
parent
dcc7ce65
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Core/Algorithms/inc/ChiSquaredModule.h
+1
-0
1 addition, 0 deletions
Core/Algorithms/inc/ChiSquaredModule.h
Core/Algorithms/src/ChiSquaredModule.cpp
+5
-0
5 additions, 0 deletions
Core/Algorithms/src/ChiSquaredModule.cpp
with
6 additions
and
0 deletions
Core/Algorithms/inc/ChiSquaredModule.h
+
1
−
0
View file @
ee06e568
...
...
@@ -41,6 +41,7 @@ public:
//! Returns residual between data and simulation for single element.
virtual
double
getResidualValue
(
size_t
index
)
const
;
};
#endif
/* CHISQUAREDMODULE_H_ */
...
...
This diff is collapsed.
Click to expand it.
Core/Algorithms/src/ChiSquaredModule.cpp
+
5
−
0
View file @
ee06e568
...
...
@@ -46,6 +46,7 @@ double ChiSquaredModule::calculateChiSquared()
OutputData
<
double
>
*
p_difference
=
createChi2DifferenceMap
();
OutputData
<
double
>::
const_iterator
it_weights
=
mp_weights
->
begin
();
OutputData
<
double
>::
const_iterator
it_diff
=
p_difference
->
begin
();
double
sum
=
0
;
while
(
it_diff
!=
p_difference
->
end
())
sum
+=
(
*
it_diff
++
)
*
(
*
it_weights
++
);
...
...
@@ -92,6 +93,9 @@ OutputData<double>* ChiSquaredModule::createChi2DifferenceMap() const
OutputData
<
double
>::
const_iterator
it_real
=
mp_real_data
->
begin
();
while
(
it_diff
!=
p_difference
->
end
())
{
if
(
(
it_sim
.
getIndex
()
!=
it_real
.
getIndex
())
||
(
it_sim
.
getIndex
()
!=
it_diff
.
getIndex
())
)
{
throw
DomainErrorException
(
"ChiSquaredModule::calculateChiSquared() -> Iterator inconsistency"
);
}
double
value_simu
=
*
it_sim
++
;
double
value_real
=
*
it_real
++
;
double
squared_difference
=
...
...
@@ -105,3 +109,4 @@ OutputData<double>* ChiSquaredModule::createChi2DifferenceMap() const
}
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