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

Functor for the SPSYMM projector. More...

Public Member Functions

function spsymm (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 SPSYMM projector.

A, the image matrix of M, is such that A is symmetric and \( k \le \| A \|_0 \le k + 1, \| A\|_F = 1 \) (if normalized == True), assuming that \(\| M \|_0 >= k\).

Usage

    spsymm(shape, k): returns a SPSYMM 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).
    spsymm(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. The result might be k+1 nonzeros in case of an odd number of nonzeros on the diagonal.
'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 spsymm projector.


Example

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

Constructor & Destructor Documentation

◆ spsymm()

function matfaust::proj::spsymm::spsymm ( 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::rand
function rand(M, N, varargin)
Generates a random Faust.
matfaust::proj::spsymm
Functor for the SPSYMM projector.
Definition: spsymm.m:86
matfaust::proj::spsymm::spsymm
function spsymm(shape, k, varargin)