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

Functor for the SPTRIU projector. More...

Public Member Functions

function sptriu (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 SPTRIU projector.

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

Usage

    sptriu(shape, k): returns a SPTRIU 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).
    sptriu(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 sptriu projector.


Example

>> import matfaust.proj.sptriu
>> rng(42); % for reproducibility
>> M = rand(5, 5);
>> p = sptriu(size(M), 2);
>> p(M)
ans =
0 0 0 0 0
0 0 0.7588 0 0
0 0 0.6513 0 0
0 0 0 0 0
0 0 0 0 0

see also matfaust.proj.sptril

Constructor & Destructor Documentation

◆ sptriu()

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

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