Loading NetworkCSR.h +6 −4 Original line number Diff line number Diff line Loading @@ -36,17 +36,19 @@ 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(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 } //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: //a[valpt] = (e!=row_id)? -1.0 : static_cast<NodeVal>(degree); //for Laplacian matrix (Normallized L): a[valpt] = (e!=row_id)? -1.0/(static_cast<NodeVal>(degree)) : 1.0 ; //for adjacency matrix: a[valpt] = (e!=row_id)? 1.0 : 0.0; // a[valpt] = (e!=row_id)? 1.0 : 0.0; ++valpt; //cout<<valpt<<endl; } Loading main.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ int main(int argc, char **argv) { FileReader conf; /* Declaration of FEAST variables */ char UPLO = 'U'; /* Type of matrix: (F means full matrix, L/U - lower/upper triangular part of matrix) */ char UPLO = 'F'; /* 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 */ Loading Loading @@ -133,7 +133,7 @@ int main(int argc, char **argv) {res[i] = 0.;} //number of nonzeroes in upper triangular matrix, always including diagonal MKL_INT nnz = ncsr.get_n_of_links()/2 + newN ; MKL_INT nnz = ncsr.get_n_of_links() + newN ;//The adjacency matrix is symmetric but the Normallized laplacian is not double *a = (double*)mkl_malloc(nnz*sizeof(double),64); MKL_INT *ja = (MKL_INT*)mkl_malloc(nnz*sizeof(MKL_INT),64); MKL_INT *ia = (MKL_INT*)mkl_malloc((newN+1)*sizeof(MKL_INT),64); Loading Loading
NetworkCSR.h +6 −4 Original line number Diff line number Diff line Loading @@ -36,17 +36,19 @@ 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(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 } //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: //a[valpt] = (e!=row_id)? -1.0 : static_cast<NodeVal>(degree); //for Laplacian matrix (Normallized L): a[valpt] = (e!=row_id)? -1.0/(static_cast<NodeVal>(degree)) : 1.0 ; //for adjacency matrix: a[valpt] = (e!=row_id)? 1.0 : 0.0; // a[valpt] = (e!=row_id)? 1.0 : 0.0; ++valpt; //cout<<valpt<<endl; } Loading
main.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ int main(int argc, char **argv) { FileReader conf; /* Declaration of FEAST variables */ char UPLO = 'U'; /* Type of matrix: (F means full matrix, L/U - lower/upper triangular part of matrix) */ char UPLO = 'F'; /* 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 */ Loading Loading @@ -133,7 +133,7 @@ int main(int argc, char **argv) {res[i] = 0.;} //number of nonzeroes in upper triangular matrix, always including diagonal MKL_INT nnz = ncsr.get_n_of_links()/2 + newN ; MKL_INT nnz = ncsr.get_n_of_links() + newN ;//The adjacency matrix is symmetric but the Normallized laplacian is not double *a = (double*)mkl_malloc(nnz*sizeof(double),64); MKL_INT *ja = (MKL_INT*)mkl_malloc(nnz*sizeof(MKL_INT),64); MKL_INT *ia = (MKL_INT*)mkl_malloc((newN+1)*sizeof(MKL_INT),64); Loading