Skip to content

Commit 75479f8

Browse files
Merge pull request #197 from EXP-code/covarianceBugfix
Covariance bugfix
2 parents 96dc5f2 + 4fd636c commit 75479f8

4 files changed

Lines changed: 17 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25) # Needed for CUDA, MPI, and CTest features
22

33
project(
44
EXP
5-
VERSION "7.9.1"
5+
VERSION "7.9.2"
66
HOMEPAGE_URL https://github.com/EXP-code/EXP
77
LANGUAGES C CXX Fortran)
88

doc/exp.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ PROJECT_NAME = EXP
4848
# could be handy for archiving the generated documentation or if some version
4949
# control system is used.
5050

51-
PROJECT_NUMBER = 7.9.1
51+
PROJECT_NUMBER = 7.9.2
5252

5353
# Using the PROJECT_BRIEF tag one can provide an optional one line description
5454
# for a project that appears at the top of each page and should give viewer a

doc/exp.cfg.breathe

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ PROJECT_NAME = EXP
4848
# could be handy for archiving the generated documentation or if some version
4949
# control system is used.
5050

51-
PROJECT_NUMBER = 7.9.1
51+
PROJECT_NUMBER = 7.9.2
5252

5353
# Using the PROJECT_BRIEF tag one can provide an optional one line description
5454
# for a project that appears at the top of each page and should give viewer a

exputil/EmpCylSL.cc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4102,8 +4102,20 @@ void EmpCylSL::accumulate(double r, double z, double phi, double mass,
41024102
}
41034103

41044104
if (compute and covar) {
4105-
Eigen::VectorXcd vec = std::complex<double>(mcos, msin) *
4106-
vc[id].row(mm).transpose() * norm;
4105+
int size = vc[id].row(mm).size();
4106+
if (size != NORDER) {
4107+
throw GenericError("size of vectors must match", __FILE__, __LINE__, 1039, false);
4108+
}
4109+
Eigen::VectorXcd vec(size);
4110+
4111+
Eigen::VectorXd vC = vc[id].row(mm).transpose() * norm;
4112+
Eigen::VectorXd vS = vs[id].row(mm).transpose() * norm;
4113+
4114+
// For m = 0, the azimuthal dependence vanishes; set vS to zero to ensure a purely real result
4115+
if (mm==0) vS.setZero();
4116+
4117+
vec.real() = vC*mcos + vS*msin;
4118+
vec.imag() = vC*msin - vS*mcos;
41074119

41084120
VC[id][whch][mm] += mass * vec;
41094121
MV[id][whch][mm] += mass * (vec * vec.adjoint());

0 commit comments

Comments
 (0)