From e3aa5ca66e7ff54a58596cbcc416c33fd334d35b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lisa=20Sch=C3=A4tzle?= <lisa.schaetzle@kit.edu>
Date: Thu, 11 Jan 2024 08:17:51 +0000
Subject: [PATCH] Update applyRP.m

---
 src/applyRP.m | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/applyRP.m b/src/applyRP.m
index 352f922..34df31b 100644
--- a/src/applyRP.m
+++ b/src/applyRP.m
@@ -1,10 +1,16 @@
 function P_Omega2 = applyRP(P_Omega)
-% Completes G according to the reciprocity principle
 
-[nd, nxhat] = size(P_Omega);
+% Completes a matrix according to the symmetrie resulting from the reciprocity relation.
+%
+% INPUT:    P_Omega     Projection operator corresponding to non-observable part Omega, nxhat*nd-array
+%                       with only 0 and 1 entries.
+% OUTPUT    P_Omega2    Completed version of P_Omega, nxhat*nd-array, with only 0 and 1 entries.
+%
+% *****************************************************************************************************
 
-% Projection onto according to the reciprocity principle non-completable
-% part of Omega:
+[nxhat, nd] = size(P_Omega);
+
+% Projection onto according to the reciprocity principle non-completable part of Omega:
 P_Omega_shifted=zeros(nxhat,nd);
 P_Omega2=zeros(nxhat,nd);
 P_Omega_shifted(1:nxhat/2,:) = P_Omega(nxhat/2+1:nxhat,:);
@@ -14,8 +20,7 @@ P_Omega2(1:nxhat/2,:) = P_Omega2_shifted(nxhat/2+1:nxhat,:);
 P_Omega2(nxhat/2+1:nxhat,:) = P_Omega2_shifted(1:nxhat/2,:);
 clear P_Omega_shifted P_Omega1_shifted
 
-% Projection onto according to the reciprocity principle completable part
-% of Omega:
+% Projection onto according to the reciprocity principle completable part of Omega:
 P_Omega1 = P_Omega - P_Omega2;
 P_Omega1_shifted = zeros(nxhat,nd);
 P_Omega1_shifted(1:nxhat/2,:) = P_Omega1(nxhat/2+1:nxhat,:);
@@ -28,4 +33,4 @@ P_Omega1_mirrored(1:nxhat/2,:) = P_Omega1_mirrored_shifted(nxhat/2+1:nxhat,:);
 P_Omega1_mirrored(nxhat/2+1:nxhat,:) = P_Omega1_mirrored_shifted(1:nxhat/2,:);
 clear P_Omega1_mirrored_shifted P_Omega1_mirrored
 
-end
\ No newline at end of file
+end
-- 
GitLab