graph_c

class iw.graph_c.Graph_c

Bases: object

A Graph_c class,

Example

>>> gr = Graph_c(graph_file, opt=None)
>>> gr._cal_Laplacien()
  • Inputs:

Parameters

graph_file (str) – name of graph file

Param

dict opt: option dictionary

  • Attributes:

Variables
  • Laplacien – Laplacian of the current graph (original laplacian if no computation has been performed)

  • col – indices of columns of non vanishing entries of Laplacien

  • row – indices of rows of non vanishing entries of Laplacien

  • shape (int) – number of rows of the square matrix Laplacien

  • entry (list) – instructions for the C programm to sample the roots

  • nbr_entry (int) – number of list entries

  • mu_initial – array of value of initial \mu

  • option_forest (dic) – instructions for the C programm to sample the roots

  • option_process (dic) – instructions and options to run Monte-Carlo simulations for the choice of the optimal q.

  • reversible (int) – 1 if the graph is reversible, 0 if not.

Laplacien
choixq_m()

choixq_m function

  • Inputs:

Parameters
  • qmin (double) – qmin value

  • qmax (double) – qmax value

  • Nsim (int) – number of simulations

  • a (double) – a value

  • n (int) – number of roots

  • Output:

Returns

tuple of (timebc, taf, itbf, tasurtbf, qc, nRR) timebc: vector. Inverse of the discontinuities of the various stairs functions, taf: vector. Values of the stair function estimating ar{alpha}, itbf: vector. Values of the stair function estimating 1/eta, itgf:vector. Values of the stair function estimating 1/gamma, tasurtgf: vector. Values of the stair function estimating ar{alpha}/gamma, tasurtbf: vector. Values of the stair function estimating lpha ar{alpha}/eta, qc = array of roots corresponding to the first draw, of the current graph nRR = corresponding number of elements, of the current graph

Return type

tuple 6 arrays

col
entry
initialize_reversible()

set reversible field

mu_initial
nbr_entry
option_forest
option_process
reversible
row
sample_root_q()

sample_root_q function

  • Inputs:

Parameters
  • q (double) – q value

  • n (int) – number of samples

  • Output:

Returns

tuple of (R, newR, k) where Root, new Root and k number of root

Return type

tuple of 3 components

shape
tab_one_step_Lbarre_sparse()

tab_one_step_Lbarre_sparse function

  • Inputs:

Parameters
  • L (numpy 1d double array) – a Laplacian matrix 1d sparse matrix

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

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

  • shape (int) – shape of L matrix

  • graph (Graph_c class) – graph to populate

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

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

  • step (int) – iteration index in the case of multiresolution

  • n (int) – -cardinal of the entire set

  • Outputs:

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

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

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

  • shape_brs (int) – shape of Lbarres matrix

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

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

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

  • shape1 (int) – shape of Lbarre matrix

  • GXbarrebr – GXbarrebr matrix 1d sparse matrix GXbarrebr: it is the matrix (-L_(Xbreve,Xbreve))^{-1}

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

  • col2 (1d int_ array) – column array of sparse matrix GXbarrebr

  • shape2 (int) – shape of GXbarrebr matrix

  • Lambdabarre (1d double array) – Lambdabarre matrix 1d sparse matrix

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

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

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

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

  • Lambdabreve (1d double array) – Lambdabreve matrix 1d sparse matrix

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

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

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

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

  • graph (Graph_c class) – graph populated