parameters: (x, w, method='hybridtautstring', sigma=0.05, maxbacktracks=None)
return_statement: return y
docstring: r"""1D proximal operator for :math:`\ell_1`.
  
      Specifically, this optimizes the following program:
  
      .. math::
  
          \mathrm{min}_y \frac{1}{2} \|x-y\|^2 + w \sum_i |y_i - y_{i+1}|.
  
      Parameters
      ----------
      x : numpy array
          The signal we are approximating.
      w : float
          The non-negative weight in the optimization problem.
      method : str
          The algorithm to be used, one of:
  
          * ``'classictautstring'`` - classic Taut String method
          * ``'linearizedtautstring'`` - linearized Taut String method
          * ``'hybridtautstring'`` - hybrid classic+linear Taut String method
          * ``'pn'`` - projected Newton.
          * ``'condat'`` - Condat's segment construction method.
          * ``'dp'`` - Johnson's dynamic programming algorithm.
          * ``'condattautstring'`` - Condat's implementation of classic taut
              string method.
          * ``'kolgomorov'`` - Kolmogorov et al's message passing method.
  
      sigma : float
          Tolerance for sufficient descent (used only if ``method='pn'``).
          
      maxbacktracks: float
          Backtrack steps before switching (used only if ``method='hybridtautstring'``)
  
      Returns
      -------
      numpy array
          The solution of the optimization problem.
docstring_summary: r"""1D proximal operator for :math:`\ell_1`.
docstring_tokens: r 1D proximal operator for : math : \ ell_1 .
function: def tv1_1d(x, w, method='hybridtautstring', sigma=0.05, maxbacktracks=None):
      r"""1D proximal operator for :math:`\ell_1`.
  
      Specifically, this optimizes the following program:
  
      .. math::
  
          \mathrm{min}_y \frac{1}{2} \|x-y\|^2 + w \sum_i |y_i - y_{i+1}|.
  
      Parameters
      ----------
      x : numpy array
          The signal we are approximating.
      w : float
          The non-negative weight in the optimization problem.
      method : str
          The algorithm to be used, one of:
  
          * ``'classictautstring'`` - classic Taut String method
          * ``'linearizedtautstring'`` - linearized Taut String method
          * ``'hybridtautstring'`` - hybrid classic+linear Taut String method
          * ``'pn'`` - projected Newton.
          * ``'condat'`` - Condat's segment construction method.
          * ``'dp'`` - Johnson's dynamic programming algorithm.
          * ``'condattautstring'`` - Condat's implementation of classic taut
              string method.
          * ``'kolgomorov'`` - Kolmogorov et al's message passing method.
  
      sigma : float
          Tolerance for sufficient descent (used only if ``method='pn'``).
          
      maxbacktracks: float
          Backtrack steps before switching (used only if ``method='hybridtautstring'``)
  
      Returns
      -------
      numpy array
          The solution of the optimization problem.
      """
      METHODS = {
          'classictautstring' : _classictautstring_TV1,
          'linearizedtautstring' : _linearizedtautstring_TV1,
          'hybridtautstring' : _hybridtautstring_TV1,
          'pn' : _pn_TV1,
          'condat' : _condat_TV1,
          'dp' : _dp_TV1,
          'condattautstring' : _condattautstring_TV1,
          'kolmogorov' : _kolmogorov_TV1
      }
      assert method in METHODS
      assert w >= 0
      w = force_float_scalar(w)
      x = force_float_matrix(x)
      y = np.zeros(np.size(x))
      METHODS[method](x, w, y, sigma=sigma, maxbacktracks=maxbacktracks)
      return y
function_tokens: def tv1_1d ( x , w , method = 'hybridtautstring' , sigma = 0.05 , maxbacktracks = None ) : METHODS = { 'classictautstring' : _classictautstring_TV1 , 'linearizedtautstring' : _linearizedtautstring_TV1 , 'hybridtautstring' : _hybridtautstring_TV1 , 'pn' : _pn_TV1 , 'condat' : _condat_TV1 , 'dp' : _dp_TV1 , 'condattautstring' : _condattautstring_TV1 , 'kolmogorov' : _kolmogorov_TV1 } assert method in METHODS assert w >= 0 w = force_float_scalar ( w ) x = force_float_matrix ( x ) y = np . zeros ( np . size ( x ) ) METHODS [ method ] ( x , w , y , sigma = sigma , maxbacktracks = maxbacktracks ) return y