SMG2S
Sparse Matrix Generator with Given Spectrum
Nilpotent

This module relates to the nilpotent matrix used by SMG2S. More...

Classes

class  Nilpotent< S >
 A class which determines the information of a nilpotent matrix. More...
 

Functions

 Nilpotent< S >::Nilpotent (S nbOne, S size)
 A constructor of class `Nilpotent`. More...
 
 Nilpotent< S >::Nilpotent (S nbOne, S diag, S size)
 A constructor of class `Nilpotent`. More...
 
 Nilpotent< S >::Nilpotent (std::vector< S > nilpvec, S size)
 A constructor of class `Nilpotent`. More...
 
 Nilpotent< S >::Nilpotent (std::vector< S > nilpvec, S diag, S size)
 A constructor of class `Nilpotent`. More...
 
Nilpotent< S >::computeDegree (std::vector< S > nilpvec)
 compute the degree of a nilpotent with its off-diagonal entries stored in a vector `nilpvec`. More...
 
void Nilpotent< S >::show ()
 Display the information of a nilpotent matrix. More...
 
 Nilpotent< S >::~Nilpotent ()
 A destructor of class `Nilpotent`.
 

Detailed Description

This module relates to the nilpotent matrix used by SMG2S.

Function Documentation

◆ computeDegree()

template<typename S >
S Nilpotent< S >::computeDegree ( std::vector< S >  nilpvec)

compute the degree of a nilpotent with its off-diagonal entries stored in a vector `nilpvec`.

This is a member function of class `Nilpotent`, which computes the degree of a nilpotent with its off-diagonal entries stored in a vector `nilpvec`.

  • Attention, the size of nilpotent matrix and the offset of diagonal should already be provided.
Parameters
[in]nilpvecuser provided vector

◆ Nilpotent() [1/4]

template<typename S >
Nilpotent< S >::Nilpotent ( nbOne,
diag,
size 
)

A constructor of class `Nilpotent`.

This is a constructor of class `Nilpotent`. With this constructor, the nilpotent has single off-diagonal with index `diag`. On this diagonal, the entries starts with a number `k` of continuous `1`, in which `k` is randomly generated as an integer between `0` and `nbOne`. Then a new `k` is re-generated, for a continuous `k` of zero-entries.

In this pattern, the nilpotency is not trivial and it can be computed by Nilpotent<S>::computeDegree.

  • Currently, the maximum degree supported is `80`, there's risk that SMG2S fails with $nbOne - diagonal > 80$
Parameters
[in]nbOnedetermines the maximum lengths of continous `1` and `0` on the off-diagonal. The lengths are randomly generated between `0` and `nbOne`, step by step.
[in]diagoffset of the single off-diagonal of nilpotent matrix
[in]sizesize of nilpotent matrix

◆ Nilpotent() [2/4]

template<typename S >
Nilpotent< S >::Nilpotent ( nbOne,
size 
)

A constructor of class `Nilpotent`.

This is a constructor of class `Nilpotent`. With this constructor, the nilpotent has single off-diagonal with index `1`. On this diagonal, the entries starts with `nbOne` number of continuous `1`, then one single entry to be `0`, then `nbOne` number of continuous `1`. The pattern repeats until to the end.

In this pattern, the nilpotency is easy to be determined as $nbOne + 1$.

  • Currently, the maximum degree supported is `80`, there's risk that SMG2S fails with $nbOne > 80$
Parameters
[in]nbOnenumber of continuous `1` on the single off-diagonal
[in]sizesize of nilpotent matrix

◆ Nilpotent() [3/4]

template<typename S >
Nilpotent< S >::Nilpotent ( std::vector< S >  nilpvec,
diag,
size 
)

A constructor of class `Nilpotent`.

This is a constructor of class `Nilpotent`. It determines a nilpotent with user provided vector `nilpvec`, and set it onto the off-diagonal indexing `diag`.

In this pattern, the nilpotency is not trivial and it can be computed by Nilpotent<S>::computeDegree.

  • Currently, the maximum degree supported is `80`, there's risk that SMG2S fails with user-given `nilpvec`.
Parameters
[in]nilpvecuser provided vector
[in]diagoffset of the single off-diagonal of nilpotent matrix
[in]sizesize of nilpotent matrix

◆ Nilpotent() [4/4]

template<typename S >
Nilpotent< S >::Nilpotent ( std::vector< S >  nilpvec,
size 
)

A constructor of class `Nilpotent`.

This is a constructor of class `Nilpotent`. It determines a nilpotent with user provided vector `nilpvec`, and set it onto the off-diagonal indexing `1`.

In this pattern, the nilpotency is not trivial and it can be computed by Nilpotent<S>::computeDegree.

  • Currently, the maximum degree supported is `80`, there's risk that SMG2S fails with user-given `nilpvec`.
Parameters
[in]nilpvecuser provided vector
[in]sizesize of nilpotent matrix

◆ show()

template<typename S >
void Nilpotent< S >::show

Display the information of a nilpotent matrix.

print Nilpotent<S>::probSize, Nilpotent<S>::degree, Nilpotent<S>::offset, and Nilpotent<S>::indOfZeros