From 7e51ba03fdbcb02b8fd917c283ea8c0a45a73bab Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Sun, 11 Apr 2021 13:39:36 +0200 Subject: [PATCH] Minor corrections --- src/daComposant/daAlgorithms/Blue.py | 10 +++++----- src/daComposant/daAlgorithms/ExtendedBlue.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/daComposant/daAlgorithms/Blue.py b/src/daComposant/daAlgorithms/Blue.py index c6284da..df1dc90 100644 --- a/src/daComposant/daAlgorithms/Blue.py +++ b/src/daComposant/daAlgorithms/Blue.py @@ -223,16 +223,16 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): dXr = numpy.matrix(numpy.random.multivariate_normal(Xa.A1,A) - Xa.A1).T dYr = numpy.matrix(numpy.ravel( Hm * dXr )).T Yr = HXa + dYr - if selfA._toStore("SampledStateForQuantiles"): Xr = Xa+dXr + if self._toStore("SampledStateForQuantiles"): Xr = Xa+dXr elif self._parameters["SimulationForQuantiles"] == "NonLinear": Xr = numpy.matrix(numpy.random.multivariate_normal(Xa.A1,A)).T Yr = numpy.matrix(numpy.ravel( Hm * Xr )).T if YfQ is None: YfQ = Yr - if selfA._toStore("SampledStateForQuantiles"): EXr = numpy.ravel(Xr) + if self._toStore("SampledStateForQuantiles"): EXr = numpy.ravel(Xr) else: YfQ = numpy.hstack((YfQ,Yr)) - if selfA._toStore("SampledStateForQuantiles"): EXr = numpy.vstack((EXr,numpy.ravel(Xr))) + if self._toStore("SampledStateForQuantiles"): EXr = numpy.vstack((EXr,numpy.ravel(Xr))) YfQ.sort(axis=-1) YQ = None for quantile in self._parameters["Quantiles"]: @@ -241,8 +241,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if YQ is None: YQ = YfQ[:,indice] else: YQ = numpy.hstack((YQ,YfQ[:,indice])) self.StoredVariables["SimulationQuantiles"].store( YQ ) - if selfA._toStore("SampledStateForQuantiles"): - selfA.StoredVariables["SampledStateForQuantiles"].store( EXr.T ) + if self._toStore("SampledStateForQuantiles"): + self.StoredVariables["SampledStateForQuantiles"].store( EXr.T ) if self._toStore("SimulatedObservationAtBackground"): self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) ) if self._toStore("SimulatedObservationAtCurrentState"): diff --git a/src/daComposant/daAlgorithms/ExtendedBlue.py b/src/daComposant/daAlgorithms/ExtendedBlue.py index c0f9892..d526d7f 100644 --- a/src/daComposant/daAlgorithms/ExtendedBlue.py +++ b/src/daComposant/daAlgorithms/ExtendedBlue.py @@ -226,16 +226,16 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): dXr = numpy.matrix(numpy.random.multivariate_normal(Xa.A1,A) - Xa.A1).T dYr = numpy.matrix(numpy.ravel( HtM * dXr )).T Yr = HXa + dYr - if selfA._toStore("SampledStateForQuantiles"): Xr = Xa+dXr + if self._toStore("SampledStateForQuantiles"): Xr = Xa+dXr elif self._parameters["SimulationForQuantiles"] == "NonLinear": Xr = numpy.matrix(numpy.random.multivariate_normal(Xa.A1,A)).T Yr = numpy.matrix(numpy.ravel( H( Xr ) )).T if YfQ is None: YfQ = Yr - if selfA._toStore("SampledStateForQuantiles"): EXr = numpy.ravel(Xr) + if self._toStore("SampledStateForQuantiles"): EXr = numpy.ravel(Xr) else: YfQ = numpy.hstack((YfQ,Yr)) - if selfA._toStore("SampledStateForQuantiles"): EXr = numpy.vstack((EXr,numpy.ravel(Xr))) + if self._toStore("SampledStateForQuantiles"): EXr = numpy.vstack((EXr,numpy.ravel(Xr))) YfQ.sort(axis=-1) YQ = None for quantile in self._parameters["Quantiles"]: @@ -244,8 +244,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if YQ is None: YQ = YfQ[:,indice] else: YQ = numpy.hstack((YQ,YfQ[:,indice])) self.StoredVariables["SimulationQuantiles"].store( YQ ) - if selfA._toStore("SampledStateForQuantiles"): - selfA.StoredVariables["SampledStateForQuantiles"].store( EXr.T ) + if self._toStore("SampledStateForQuantiles"): + self.StoredVariables["SampledStateForQuantiles"].store( EXr.T ) if self._toStore("SimulatedObservationAtBackground"): self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) ) if self._toStore("SimulatedObservationAtCurrentState"): -- 2.39.2