iw.multiresolution

sparsify_matrix

iw.multiresolution.sparsify_matrix.sparsify_matrix()

sparsify_matrix function

  • Inputs:

Parameters
  • M (or array 1d double values) – M input matrix 1d sparse matrix to sparsified

  • row (1d array 1d int_ values) – row array of sparse matrix M

  • col (1d int_ values) – column array of sparse matrix M

  • shape (int) – shape of M matrix

  • threshold (1d array 1d double array) – array of threshold values

  • Output:

Returns

tuple of (Msparsedata, Msparserow, Msparsecol, shape) where Msparsedata is M sparsified Matrix Msparserow, Msparsecol, shape corresponding row colunms and shape

Return type

tuple of array and int value

struct_multires_Lbarre

1. Tab_Struct_multires_Lbarre

class iw.multiresolution.struct_multires_Lbarre.Tab_Struct_multires_Lbarre

Bases: object

This Class computes the new subgraph, the matrix of the Laplacian of the new subgraph, the matrix Lambda (which is built through Lambdabreve and Lambdabarre from the approximate solution 1 of Diaconis-Fill equation. This means:

Parameters
  • graph (iw.graph_c.Graph_c class.) – graph is the current graph for this step of calculation

  • mu (1d double array) – measure of reversibility. In the case the laplacian is symetric it has to be the uniform measure.

  • n (int) – size of the set of vertices

  • mod (string) –

    define the mod of multiscale calculations:

    • ’step’ determine the number of steps for decomposition

    • ’card’ determine the minimum cardinal of graph

  • m (int) – number of maximum nodes to stop the decomposition lowerbound on the size of Xbarre

  • steps (int) – number of steps to stop the decomposition

  • theta (double) – parameter for sparsification threshold

  • Attributes:

Variables
Struct_Mana_re
Struct_Mres_gr
steps

2. Struct_multires_Lbarre

class iw.multiresolution.struct_multires_Lbarre.Struct_multires_Lbarre

Bases: object

Class Struct_multires_Lbarre this class saves Inputs of analysis computation in its attribute

  • Inputs:

Parameters
  • Lbarre (1d double array) – Lbarre matrix 1d sparse matrix Lbarre is Schur complement of [L]_Rc in L iw.diaconis_fill.complementschur() with Rc the complement of the set Xbarre

  • row1b (1d int_ array) – row array of sparse matrix Lbarre

  • col1b (1d int_ array) – column array of sparse matrix Lbarre

  • shapelb (int) – shape of Lbarre matrix

  • Lbarres (1d double array) – Lbarres matrix 1d sparse matrix sparcified Schur complement of [L]_Rc in L

  • rowlbs (1d int_ array) – row array of sparse matrix Lbarres

  • collbs (1d int_ array) – column array of sparse matrix Lbarres

  • shapelbs (int) – shape of Lbarres matrix

  • alphabar (double) – max(abs(L(x,x))

  • mu (1d double array) – measure of reversibility. In the case the laplacian is symetric it has to be the uniform measure.

  • Xbarre (1d int_ array) – vector of nR indices corresponding to the part of matrix L

  • gamma (double) – value of gamma : numeric. 1/gamma= maximum Hitting time

  • beta (double) – value of beta : mean time of return after the first step

  • q (double) – parameter to sample the vertices of the new graph

  • qprime (double) – parameter to compute the solution of Diaconis-Fill equation

  • Attributes:

Variables
  • Lbarre – Lbarre matrix 1d sparse matrix Lbarre is Schur complement of [L]_Rc in L iw.diaconis_fill.complementschur() with Rc the complement of the set Xbarre

  • rowLbarre – row array of sparse matrix Lbarre

  • colLbarre – column array of sparse matrix Lbarre

  • shapeLbarre (int) – shape of Lbarre matrix

  • Lbarres – Lbarres matrix 1d sparse matrix sparcified Schur complement of [L]_Rc in L

  • rowLbarres – row array of sparse matrix Lbarres

  • colLbarres – column array of sparse matrix Lbarres

  • shapeLbarres (int) – shape of Lbarres matrix

  • alphabar (double) – max(abs(L(x,x))

  • mubarre – measure of reversibility. In the case the laplacian is symetric it has to be the uniform measure.

  • Xbarre – vector of nR indices corresponding to the part of matrix L

  • gamma (double) – value of gamma : numeric. 1/gamma= maximum Hitting time

  • beta (double) – value of beta : mean time of return after the first step

  • q (double) – parameter to sample the vertices of the new graph

  • qprime (double) – parameter to compute the solution of Diaconis-Fill equation

Lbarre
Lbarres
Xbarre
alphabar
beta
colLbarre
colLbarres
gamma
mubarre
q
qprime
rowLbarre
rowLbarres
shapeLbarre
shapeLbarres

3. Struct_M_ana_recons

class iw.multiresolution.struct_multires_Lbarre.Struct_M_ana_recons

Bases: object

Class Struct_M_ana_recons this class saves Inputs for reconstruction computation in its attributes

  • Inputs:

Parameters
  • Lambdabarre (1d double array) – Lambdabarre matrix 1d sparse matrix matrix whose rows are the nu_xbarre

  • rowla (1d int_ array) – row array of sparse matrix Lambdabarre

  • colla (1d int_ array) – column array of sparse matrix Lambdabarre

  • shape0la (int) – shape dimension 0 of Lambdabarre matrix

  • shape1la (int) – shape dimension 1 of Lambdabarre matrix

  • Lambdabreve (1d double array) – Lambdabreve matrix 1d sparse matrix matrix whose rows are the psi_xbreve

  • rowlb (1d int_ array) – row array of sparse matrix Lambdabreve

  • collb (1d int_ array) – column array of sparse matrix Lambdabreve

  • shape0lb (int) – shape dimension 0 of Lambdabreve matrix

  • shape1lb (int) – shape dimension 1 of Lambdabreve matrix

  • Reconsbarre (1d double array) – Reconsbarre matrix 1d sparse matrix Reconstruction matrix whose rows are the nu_xbarre

  • rowlra (1d int_ array) – row array of sparse matrix Reconsbarre

  • collra (1d int_ array) – column array of sparse matrix Reconsbarre

  • shape0lra (int) – shape dimension 0 of Reconsbarre matrix

  • shape1lra (int) – shape dimension 1 of Reconsbarre matrix

  • Reconsbreve (1d double array) – Reconsbreve matrix 1d sparse matrix Reconstruction matrix matrix whose rows are the psi_xbreve

  • rowlrb (1d int_ array) – row array of sparse matrix Reconsbreve

  • collrb (1d int_ array) – column array of sparse matrix Reconsbreve

  • shape0lrb (int) – shape dimension 0 of Reconsbreve matrix

  • shape1lrb (int) – shape dimension 1 of Reconsbreve matrix

  • Attributes:

Variables
Lambdabarre
Lambdabreve
Recons_col_barre
Recons_col_breve
Recons_row_barre
Recons_row_breve
Recons_shape0_barre
Recons_shape0_breve
Recons_shape1_barre
Recons_shape1_breve
Reconsbarre
Reconsbreve
colLambdabarre
colLambdabreve
rowLambdabarre
rowLambdabreve
shape0Lambdabarre
shape0Lambdabreve
shape1Lambdabarre
shape1Lambdabreve

tab_one_step_Lambda

iw.multiresolution.tab_one_step_Lambda.tab_one_step_Lambda()

Intermediate function which returns Lambdabarre, Lambdabreve matrix

  • Inputs:

Parameters
  • L (1d double array) – L is the laplacien matrix L n x n matrix; Markov generator

  • row (1d int_ array) – row array of sparse matrix L

  • col (1d int_ array) – column array of sparse matrix L

  • shape (int) – shape of Laplacien matrix

  • Xbarre (1d int_ array) – vector of nR indices corresponding to the part of matrix L

  • Xbreve (1d int_ array) – vector of nR-n indices corresponding to complement of Xbarre the root indices

  • n (int) – size of the set of vertices

  • Outputs:

Returns

tuple of (Lambdabarre and its row, col and shapes, Lambdabreve ,and its row, col and shapes qprime), where matrix whose rows are the nu_xbarre and Lambdabreve matrix whose rows are the psi_xbreve qprime parameter to compute the solution of Diaconis-Fill equation

Return type

tuple of arrays and int