Skip to content

Commit 8c5f236

Browse files
authored
Merge branch 'master' into develop
2 parents 93121f4 + dee414b commit 8c5f236

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
from sysconfig import get_config_var, get_paths
66
import logging
77

8+
89
__version__ = '0.0.5'
910

1011

12+
1113
def get_include(): # TODO
1214
info = get_paths()
1315
Eigen_path = '/'.join(info['include'].split('/')[:-1])

src/krbalancing.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
#include "krbalancing.hpp"
22

3-
// kr_balancing::kr_balancing(const SparseMatrixCol & input){
4-
// A = input;
5-
// e.resize(A.rows(),1);
6-
// e.setOnes();
7-
// /*Replace zeros with 0.00001 on the main diagonal*/
8-
// SparseMatrixCol I;
9-
// I.resize(A.rows(),A.cols());
10-
// I.setIdentity();
11-
// I = I*0.00001;
12-
// A = A + I;
13-
// rescaled = false;
14-
// }
15-
163
kr_balancing::kr_balancing(const int64_t &input_rows, const int64_t &input_cols,
174
const int64_t &input_nnz,
185
const Eigen::Ref<VectorXint64> input_indptr,
@@ -44,6 +31,7 @@ kr_balancing::kr_balancing(const int64_t &input_rows, const int64_t &input_cols,
4431
}
4532
A.setFromTriplets(triplets.begin(), triplets.end()); //bottleneck
4633

34+
4735
triplets.clear();
4836

4937
e.resize(A.rows(), 1);
@@ -211,6 +199,7 @@ void kr_balancing::compute_normalised_matrix(bool &rescale)
211199
{
212200

213201
assert(A.rows() == A.cols());
202+
214203
if (rescale == true && rescaled == false)
215204
{
216205
rescale_norm_vector();
@@ -227,6 +216,7 @@ void kr_balancing::compute_normalised_matrix(bool &rescale)
227216
for (SparseMatrixCol::InnerIterator it(A, k); it; ++it)
228217
{
229218
it.valueRef() = it.value() * x.coeff(it.row(), 0) * x.coeff(it.col(), 0);
219+
230220
}
231221
}
232222
}
@@ -258,7 +248,6 @@ void kr_balancing::rescale_norm_vector()
258248
}
259249
}
260250
}
261-
262251
std::cout << "normalisation factor is " << std::sqrt(norm_vector_sum / original_sum) << std::endl;
263252
x /= std::sqrt(norm_vector_sum / original_sum);
264253
}
@@ -274,6 +263,7 @@ const SparseMatrixCol *kr_balancing::get_normalisation_vector(bool &rescale)
274263

275264
if (rescale == true && rescaled == false)
276265
{
266+
277267
rescale_norm_vector();
278268
rescaled = true;
279269
}

src/krbalancing.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class kr_balancing
6969
Eigen::SparseVector<double> rk;
7070
SparseMatrixCol output;
7171
bool rescaled;
72+
7273
};
7374

7475
#endif

0 commit comments

Comments
 (0)