Skip to content

Commit

Permalink
Fixed C++ not and and boolean operators
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaudin47 committed Aug 23, 2023
1 parent 80b2e6d commit d6e21ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ FunctionalChaosResult FunctionalChaosResult::getConditionalExpectation(const Ind
// See if this function has active marginal indices only
bool isActive = true;
for (UnsignedInteger i = 0; i < inputDimension; ++i)
if (not conditioningIndices.contains(i) and multiIndex[i] > 0)
if (!(conditioningIndices.contains(i)) && multiIndex[i] > 0)
{
isActive = false;
break;
Expand Down
6 changes: 3 additions & 3 deletions lib/test/t_FunctionalChaos_conditionalExpectation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int main(int, char *[])
Distribution distributionMarginalGivenX1(distribution.getMarginal(0));
MonteCarloExperiment experimentTestGivenX1(distributionMarginalGivenX1, errorSampleSize);
Point errorGivenX1(experimentTestGivenX1.computeError(functionCEGivenX1, functionEgivenX1Exact));
fullprint << " Error = " << errorGivenX1 << std::endl;
fullprint << " Error = " << errorGivenX1[0] << std::endl;
assert(errorGivenX1[0] < atol);

// Condition with respect to X2
Expand All @@ -136,7 +136,7 @@ int main(int, char *[])
Distribution distributionMarginalGivenX2(distribution.getMarginal(1));
MonteCarloExperiment experimentTestGivenX2(distributionMarginalGivenX2, errorSampleSize);
Point errorGivenX2(experimentTestGivenX2.computeError(functionCEGivenX2, functionEgivenX2Exact));
fullprint << " Error = " << errorGivenX2 << std::endl;
fullprint << " Error = " << errorGivenX2[0] << std::endl;
assert(errorGivenX2[0] < atol);

// Condition with respect to X3
Expand All @@ -161,7 +161,7 @@ int main(int, char *[])
Distribution distributionMarginalGivenX3(distribution.getMarginal(2));
MonteCarloExperiment experimentTestGivenX3(distributionMarginalGivenX3, errorSampleSize);
Point errorGivenX3(experimentTestGivenX3.computeError(functionCEGivenX3, functionEgivenX3Exact));
fullprint << " Error = " << errorGivenX3 << std::endl;
fullprint << " Error = " << errorGivenX3[0] << std::endl;
assert(errorGivenX3[0] < atol);

return ExitCode::Success;
Expand Down

0 comments on commit d6e21ee

Please sign in to comment.