Commit 3a1b0aa9 authored by Ali Safari's avatar Ali Safari
Browse files

This version of code calculates eigenvalues for Normallized laplacian...

This version of code calculates eigenvalues for Normallized laplacian matrix(which is symmetric) for percolated networks.
parent b765b0f5
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
seed  1                #seed for random number generator
N  1048576                #n of nodes
steps  18               #n of hierarchical levels/steps
fixed_links  10          #fixed number of links between block pairs
N  8                #n of nodes
steps  1               #n of hierarchical levels/steps
fixed_links  1          #fixed number of links between block pairs
realizations  1
prob  0.30
Emin          3.0         #Lower  bound of search interval
Emax          3.2         #upper bound of search interval
M0            250         #Initial guess for subspace dimension to be used
M             250          #Total number of eigenvalues found in the interval
prob  1.0
Emin          -1.0         #Lower  bound of search interval
Emax          1.0         #upper bound of search interval
M0            8         #Initial guess for subspace dimension to be used
M             8          #Total number of eigenvalues found in the interval
loop           0         #Number of refinement loop
info           0         #Errors
epsout         0.0         #Relative error on the trace
+6 −6
Original line number Diff line number Diff line
@@ -36,17 +36,17 @@ public:
          //always store diagonal elements, even if =0, MKL likes it this way
          els.push_back(row_id);
          for(auto& nn: neighbors) {
              /*if(nn>row_id)*/ els.push_back(nn); //IF statement makes the settings for symmetric cases
              //when you just need the Upper and lower part of matrix(Adjacency), but for Normallized laplacian
              //we give the full matrix
              if(nn>row_id) els.push_back(nn);
          }
          //sort column indices is ascending order, MKL likes it this way
          sort(els.begin(),els.end());
          for(auto e: els) {
              ja[valpt] = e+1;//changed
              //cout<<row_id<<" ______"<<e<<endl;
              //for Laplacian matrix (Normallized L):
              a[valpt] = (e!=row_id)? -1.0/*/(static_cast<NodeVal>(degree))*/ : /*1.0*/ (static_cast<NodeVal>(degree));
              vector<int> &neighbors_j = nodelist[e].neighbors;
              int degree_j = neighbors_j.size();
              //for Laplacian matrix (Symmetric Normallized L):
              a[valpt] = (e!=row_id)? -1.0/std::sqrt((static_cast<NodeVal>(degree)) * (static_cast<NodeVal>(degree_j) )) : 1.0;
              //for adjacency matrix:
            //  a[valpt] = (e!=row_id)? 1.0 : 0.0;
              ++valpt;
+9 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ int main(int argc, char **argv)
{
    FileReader   conf;
    /* Declaration of FEAST variables */
    char         UPLO = 'F'; /* Type of matrix: (F means full matrix, L/U - lower/upper triangular part of matrix) */
    char         UPLO = 'U'; /* Type of matrix: (F means full matrix, L/U - lower/upper triangular part of matrix) */
    MKL_INT      fpm[128];      /* Array to pass parameters to Intel MKL Extended Eigensolvers */

    /* Declaration of local variables */
@@ -148,6 +148,14 @@ int main(int argc, char **argv)
        feastinit(fpm);

        fpm[0] =  1; /* Extended Eigensolver routines print runtime status to the screen. */
        fpm[13] = 0;
        fpm[26] = 1;//check input matrices
        fpm[27] = 0;//1,checks if matrix B positive definite
        fpm[2]=12;
        fpm[5]=1;//extended eigensolver stopping test
        fpm[1]=32;//{3,4,5,6,8,10,12,16,20,24,32,40,48}
        fpm[6]=10;//Error tarce single precision stopping crieteria




+1 −0
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ class Ensemble {
        }
        //	cout << "Network generated: " << nlinks << " links"  << endl;
        //	cout << "corrections = " << corrections << endl;
      
    }

    vector<Node<int>> release_link_diluted_copy(double premove)