-  3.39.23
Public Member Functions | List of all members
matfaust::proj::sptril Class Reference

Functor for the SPTRIL projector. More...

Public Member Functions

function sptril (shape, k, varargin)
 
- Public Member Functions inherited from matfaust::proj::proj_gen
function subsref (self, S)
 

Additional Inherited Members

- Protected Attributes inherited from matfaust::proj::proj_gen
Property constraint
 

Detailed Description

Functor for the SPTRIL projector.

A, the image matrix, is such that the upper triangular part is 0 and \( \| A \|_0 = k, \| A\|_F = 1 \) (if normalized == True).

Usage

    sptril(shape, k): returns a SPTRIL projector (functor), shape defines the size of the input matrix (e.g. [1, 10]), k defines the sparsity of the output matrix (k nnz coefficients).
    sptril(shape,k,'normalized', bool,'pos', bool): the optional parameters are set. By default both normalized and pos are false.

Parameters
shapevector of size 2, to define the size of the input matrix.
kthe sparsity parameter (the number of nonzeros of the projection image.
'normalized',truenormalizes the projection image according to its Frobenius norm.
'normalized',false(the default) no normalization.
'pos',trueskips the negative values (replaced by zero) of the input matrix.
'pos',false(the default) negative values are not skipped.
Return values
projthe sptril projector.


Example

>> import matfaust.proj.sptril
>> rng(42) % reproducibility
>> M = rand(5, 5);
>> p = sptril(size(M), 2);
>> p(M)
ans =
0 0 0 0 0
0.7392 0 0 0 0
0 0.6735 0 0 0
0 0 0 0 0
0 0 0 0 0
>>

see also matfaust.proj.sptriu

Constructor & Destructor Documentation

◆ sptril()

function matfaust::proj::sptril::sptril ( shape  ,
,
varargin   
)

The documentation for this class was generated from the following file:
matfaust::proj::sptril
Functor for the SPTRIL projector.
Definition: sptril.m:90
matfaust::proj
This module provides matrix projectors.
Definition: +proj/@anticirc/anticirc.m:1
matfaust
The FAuST Matlab Wrapper
Definition: bsl.m:1
matfaust::proj::sptril::sptril
function sptril(shape, k, varargin)
matfaust::rand
function rand(M, N, varargin)
Generates a random Faust.