Skip to content

Commit

Permalink
Avoid copying matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l authored Oct 2, 2024
1 parent 53024fa commit 534e40f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/particles/diagnostics/CovarianceMatrixMath.H
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ namespace impactx::diagnostics
*/
amrex::ParticleReal
TraceMat (
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> A
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> const & A
)
{
int const dim = 6;
Expand All @@ -182,8 +182,8 @@ namespace impactx::diagnostics
*/
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6>
MultiplyMat (
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> A,
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> B
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> const & A,
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> const & B
)
{
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> C;
Expand Down
4 changes: 2 additions & 2 deletions src/particles/diagnostics/EmittanceInvariants.H
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace impactx::diagnostics
amrex::ParticleReal,
amrex::ParticleReal>
KineticInvariants (
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> Sigma
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> const & Sigma
);

/** Returns the three eigenemittances
Expand All @@ -68,7 +68,7 @@ namespace impactx::diagnostics
amrex::ParticleReal,
amrex::ParticleReal>
Eigenemittances (
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> Sigma
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> const & Sigma
);

} // namespace impactx::diagnostics
Expand Down
4 changes: 2 additions & 2 deletions src/particles/diagnostics/EmittanceInvariants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace impactx::diagnostics
amrex::ParticleReal,
amrex::ParticleReal>
KineticInvariants (
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> Sigma
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> const & Sigma
)
{
using namespace amrex::literals;
Expand Down Expand Up @@ -98,7 +98,7 @@ namespace impactx::diagnostics
amrex::ParticleReal,
amrex::ParticleReal>
Eigenemittances (
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> Sigma
amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6> const & Sigma
)
{
BL_PROFILE("impactx::diagnostics::Eigenemittances");
Expand Down

0 comments on commit 534e40f

Please sign in to comment.