From 607bc0594167df28706dd6f24ceb25ace4a6fdbe Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Sat, 16 Apr 2022 06:38:02 +0200 Subject: [PATCH] Fix for unusual shape behaviors --- src/daComposant/daAlgorithms/Atoms/ecwblue.py | 6 +++--- src/daComposant/daAlgorithms/Atoms/ecwexblue.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/daComposant/daAlgorithms/Atoms/ecwblue.py b/src/daComposant/daAlgorithms/Atoms/ecwblue.py index 0e62f6a..617c352 100644 --- a/src/daComposant/daAlgorithms/Atoms/ecwblue.py +++ b/src/daComposant/daAlgorithms/Atoms/ecwblue.py @@ -77,12 +77,12 @@ def ecwblue(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): if Y.size <= Xb.size: _HNHt = numpy.dot(Hm, B @ Ha) _A = R + _HNHt - _u = numpy.linalg.solve( _A , Innovation ) - Xa = Xb + (B @ (Ha @ _u)).reshape((-1,1)) + _u = numpy.linalg.solve( _A , numpy.ravel(Innovation) ) + Xa = Xb + (B @ numpy.ravel(Ha @ _u)).reshape((-1,1)) else: _HtRH = numpy.dot(Ha, RI @ Hm) _A = BI + _HtRH - _u = numpy.linalg.solve( _A , numpy.dot(Ha, RI @ Innovation) ) + _u = numpy.linalg.solve( _A , numpy.ravel(numpy.dot(Ha, RI @ numpy.ravel(Innovation))) ) Xa = Xb + _u.reshape((-1,1)) # if __storeState: selfA._setInternalState("Xn", Xa) diff --git a/src/daComposant/daAlgorithms/Atoms/ecwexblue.py b/src/daComposant/daAlgorithms/Atoms/ecwexblue.py index 8ddefc9..eeb358a 100644 --- a/src/daComposant/daAlgorithms/Atoms/ecwexblue.py +++ b/src/daComposant/daAlgorithms/Atoms/ecwexblue.py @@ -78,12 +78,12 @@ def ecwexblue(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): if Y.size <= Xb.size: _HNHt = numpy.dot(Hm, B @ Ha) _A = R + _HNHt - _u = numpy.linalg.solve( _A , Innovation ) - Xa = Xb + (B @ (Ha @ _u)).reshape((-1,1)) + _u = numpy.linalg.solve( _A , numpy.ravel(Innovation) ) + Xa = Xb + (B @ numpy.ravel(Ha @ _u)).reshape((-1,1)) else: _HtRH = numpy.dot(Ha, RI @ Hm) _A = BI + _HtRH - _u = numpy.linalg.solve( _A , numpy.dot(Ha, RI @ Innovation) ) + _u = numpy.linalg.solve( _A , numpy.ravel(numpy.dot(Ha, RI @ numpy.ravel(Innovation))) ) Xa = Xb + _u.reshape((-1,1)) # if __storeState: selfA._setInternalState("Xn", Xa) -- 2.39.2