コード例 #1
0
ファイル: tvl1.py プロジェクト: jasmainak/sporco
    def GaussSeidelStep(self, S, X, ATYU, rho, lcw, W2):
        """Gauss-Seidel step for linear system in TV problem"""

        Xss = np.zeros_like(S, dtype=self.dtype)
        for ax in self.axes:
            Xss += sl.zpad(X[(slice(None),)*ax + (slice(0,-1),)], (1,0), ax)
            Xss += sl.zpad(X[(slice(None),)*ax + (slice(1,None),)], (0,1), ax)
        return (rho*(Xss + ATYU) + W2*S) / (W2 + rho*lcw)
コード例 #2
0
ファイル: tvl1.py プロジェクト: bwohlberg/sporco
    def GaussSeidelStep(self, S, X, ATYU, rho, lcw, W2):
        """Gauss-Seidel step for linear system in TV problem."""

        Xss = np.zeros_like(S, dtype=self.dtype)
        for ax in self.axes:
            Xss += sl.zpad(X[(slice(None),)*ax + (slice(0, -1),)], (1, 0), ax)
            Xss += sl.zpad(X[(slice(None),)*ax + (slice(1, None),)],
                           (0, 1), ax)
        return (rho*(Xss + ATYU) + W2*S) / (W2 + rho*lcw)