diff --git a/lib/src/InverseFORM.cxx b/lib/src/InverseFORM.cxx index 141c714..d52e67e 100755 --- a/lib/src/InverseFORM.cxx +++ b/lib/src/InverseFORM.cxx @@ -170,7 +170,7 @@ void InverseFORM::run() // direction du = -(betaC / dgdunorm) * dgdu - u; dp = (fabs(dgdp) < (SpecFunc::ScalarEpsilon * SpecFunc::ScalarEpsilon)) ? 0.0 : (u.dot(dgdu) - g + betaC * dgdunorm) / dgdp; - LOGINFO(OSS() << "InverseFORM::run i=" << iteration << " u="<getClassName())) + const DeconditionedDistribution * p_conditional = dynamic_cast(coll[i].getImplementation().get()); + if (p_conditional) { - DistributionImplementation::PointWithDescriptionCollection parametersCollection(distributionCollection[i].getParametersCollection()); + DistributionImplementation::PointWithDescriptionCollection parametersCollection(coll[i].getParametersCollection()); for (UnsignedInteger j = 0; j < parametersCollection.getSize(); ++ j) { const String marginalName(parametersCollection[j].getName()); @@ -256,22 +255,17 @@ Function InverseFORM::getG(const Scalar p) } } } - const DeconditionedDistribution * p_conditional = dynamic_cast(distributionCollection[i].getImplementation().get()); - if (p_conditional) - { - Distribution conditioning(p_conditional->getConditioningDistribution()); - conditioning.setParametersCollection(parametersCollection); - DeconditionedDistribution newConditional(p_conditional->getConditionedDistribution(), conditioning); - distributionCollection[i] = newConditional; - JointDistribution newDistribution(distributionCollection); - antecedent = RandomVector(newDistribution); - } // if p_conditional + Distribution conditioning(p_conditional->getConditioningDistribution()); + conditioning.setParametersCollection(parametersCollection); + coll[i] = DeconditionedDistribution(p_conditional->getConditionedDistribution(), conditioning); + antecedent = RandomVector(JointDistribution(coll)); } // if conditional } // i } // if p_joint const CompositeRandomVector composite(newFunction, antecedent); + const Scalar threshold = event_.getThreshold(); + const ComparisonOperator op(event_.getOperator()); const ThresholdEvent event(composite, op, threshold); const StandardEvent standardEvent(event); const Scalar gsign = op(1.0, 2.0) ? 1.0 : -1.0;