Skip to content

Commit b049baf

Browse files
author
Martin D. Weinberg
committed
Typo in index bounds fixed
1 parent 5081b16 commit b049baf

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

expui/BiorthBasis.cc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3880,19 +3880,19 @@ namespace BasisClasses
38803880
// Assign values from YAML
38813881
//
38823882
try {
3883-
if (conf["nminx"]) nminx = conf["nminx"].as<int>();
3884-
if (conf["nminy"]) nminy = conf["nminy"].as<int>();
3885-
if (conf["nminz"]) nminz = conf["nminz"].as<int>();
3883+
if (conf["nminx"]) nminx = conf["nminx" ].as<int>();
3884+
if (conf["nminy"]) nminy = conf["nminy" ].as<int>();
3885+
if (conf["nminz"]) nminz = conf["nminz" ].as<int>();
38863886

3887-
if (conf["nmaxx"]) nmaxx = conf["nmaxx"].as<int>();
3888-
if (conf["nmaxy"]) nmaxy = conf["nmaxy"].as<int>();
3889-
if (conf["nmaxz"]) nmaxz = conf["nmaxz"].as<int>();
3887+
if (conf["nmaxx"]) nmaxx = conf["nmaxx" ].as<int>();
3888+
if (conf["nmaxy"]) nmaxy = conf["nmaxy" ].as<int>();
3889+
if (conf["nmaxz"]) nmaxz = conf["nmaxz" ].as<int>();
38903890

3891-
if (conf["knots"]) knots = conf["knots"].as<int>();
3891+
if (conf["knots"]) knots = conf["knots" ].as<int>();
38923892

3893-
if (conf["check"]) check = conf["check"].as<bool>();
3893+
if (conf["check"]) check = conf["check" ].as<bool>();
38943894

3895-
if (conf["pcavar"]) pcavar = conf["pcavar"].as<bool>();
3895+
if (conf["pcavar"]) pcavar = conf["pcavar" ].as<bool>();
38963896
if (conf["subsamp"]) sampT = conf["subsamp"].as<int>();
38973897
}
38983898
catch (YAML::Exception & error) {
@@ -4055,7 +4055,7 @@ namespace BasisClasses
40554055
expcoef(ix, iy, iz) += - mass * curr(0)*curr(1)*curr(2) * norm;
40564056

40574057
if (pcavar)
4058-
g[index1D(ix, iy, iz)] = curr(0)*curr(1)*curr(2) * norm;
4058+
g[index1D(ix, iy, iz)] = - mass * curr(0)*curr(1)*curr(2) * norm;
40594059
}
40604060
}
40614061
}
@@ -4270,21 +4270,21 @@ namespace BasisClasses
42704270

42714271
unsigned Cube::index1D(int kx, int ky, int kz)
42724272
{
4273-
if (kx <0 or kx > 2*nmaxx) {
4273+
if (kx < 0 or kx > 2*nmaxx) {
42744274
std::ostringstream sout;
42754275
sout << "Cube::index1D: x index [" << kx << "] must be in [0, "
42764276
<< 2*nmaxx << "]";
42774277
throw std::runtime_error(sout.str());
42784278
}
42794279

4280-
if (ky <-nmaxy or ky > nmaxy) {
4280+
if (ky < 0 or ky > 2*nmaxy) {
42814281
std::ostringstream sout;
42824282
sout << "Cube::index1D: y index [" << ky << "] must be in [0, "
42834283
<< 2*nmaxy << "]";
42844284
throw std::runtime_error(sout.str());
42854285
}
42864286

4287-
if (kz <-nmaxz or kx > nmaxz) {
4287+
if (kz < 0 or kx > 2*nmaxz) {
42884288
std::ostringstream sout;
42894289
sout << "Cube::index1D: z index [" << kz << "] must be in [0, "
42904290
<< 2*nmaxz << "]";

0 commit comments

Comments
 (0)