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
8a1d6695
Commit
8a1d6695
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
-auto, +emplace
parent
d000bd13
No related branches found
No related tags found
1 merge request
!145
new class SliceStack
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sample/Specular/SpecularMagneticStrategy.cpp
+1
-1
1 addition, 1 deletion
Sample/Specular/SpecularMagneticStrategy.cpp
Sample/Specular/SpecularScalarStrategy.cpp
+3
-3
3 additions, 3 deletions
Sample/Specular/SpecularScalarStrategy.cpp
with
4 additions
and
4 deletions
Sample/Specular/SpecularMagneticStrategy.cpp
+
1
−
1
View file @
8a1d6695
...
@@ -45,7 +45,7 @@ SpecularMagneticStrategy::Execute(const SliceStack& slices, const std::vector<co
...
@@ -45,7 +45,7 @@ SpecularMagneticStrategy::Execute(const SliceStack& slices, const std::vector<co
ISpecularStrategy
::
coeffs_t
result
;
ISpecularStrategy
::
coeffs_t
result
;
for
(
auto
&
coeff
:
computeTR
(
slices
,
kz
))
for
(
auto
&
coeff
:
computeTR
(
slices
,
kz
))
result
.
push
_back
(
std
::
make_unique
<
MatrixRTCoefficients
>
(
coeff
));
result
.
emplace
_back
(
std
::
make_unique
<
MatrixRTCoefficients
>
(
coeff
));
return
result
;
return
result
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Sample/Specular/SpecularScalarStrategy.cpp
+
3
−
3
View file @
8a1d6695
...
@@ -48,7 +48,7 @@ ISpecularStrategy::coeffs_t SpecularScalarStrategy::Execute(const SliceStack& sl
...
@@ -48,7 +48,7 @@ ISpecularStrategy::coeffs_t SpecularScalarStrategy::Execute(const SliceStack& sl
ISpecularStrategy
::
coeffs_t
result
;
ISpecularStrategy
::
coeffs_t
result
;
for
(
auto
&
coeff
:
computeTR
(
slices
,
kz
))
for
(
auto
&
coeff
:
computeTR
(
slices
,
kz
))
result
.
push
_back
(
std
::
make_unique
<
ScalarRTCoefficients
>
(
coeff
));
result
.
emplace
_back
(
std
::
make_unique
<
ScalarRTCoefficients
>
(
coeff
));
return
result
;
return
result
;
}
}
...
@@ -60,7 +60,7 @@ SpecularScalarStrategy::computeTopLayerR(const SliceStack& slices,
...
@@ -60,7 +60,7 @@ SpecularScalarStrategy::computeTopLayerR(const SliceStack& slices,
if
(
slices
.
size
()
!=
kz
.
size
())
if
(
slices
.
size
()
!=
kz
.
size
())
throw
std
::
runtime_error
(
"Number of slices does not match the size of the kz-vector"
);
throw
std
::
runtime_error
(
"Number of slices does not match the size of the kz-vector"
);
auto
N
=
slices
.
size
();
const
size_t
N
=
slices
.
size
();
if
(
N
==
1
)
if
(
N
==
1
)
return
0.
;
// only one layer present, there's nothing left to calculate
return
0.
;
// only one layer present, there's nothing left to calculate
...
@@ -115,7 +115,7 @@ void SpecularScalarStrategy::calculateUpFromLayer(std::vector<ScalarRTCoefficien
...
@@ -115,7 +115,7 @@ void SpecularScalarStrategy::calculateUpFromLayer(std::vector<ScalarRTCoefficien
const
SliceStack
&
slices
,
const
SliceStack
&
slices
,
const
std
::
vector
<
complex_t
>&
kz
)
const
const
std
::
vector
<
complex_t
>&
kz
)
const
{
{
auto
N
=
slices
.
size
();
const
size_t
N
=
slices
.
size
();
coeff
.
back
().
t_r
(
0
)
=
1.0
;
coeff
.
back
().
t_r
(
0
)
=
1.0
;
coeff
.
back
().
t_r
(
1
)
=
0.0
;
coeff
.
back
().
t_r
(
1
)
=
0.0
;
...
...
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