Skip to content

Commit 64b6222

Browse files
author
Leily Rabbani
committed
Changed lower triangular to the upper triangular
1 parent 273da3d commit 64b6222

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/KRBalancing.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class kr_balancing{
3838
// A = A + I;
3939
}
4040

41-
void outter_loop(){
41+
void outer_loop(){
4242
x = e.sparseView();
43-
size_t outter_loop_count = 0;
43+
size_t outer_loop_count = 0;
4444
double stop_tol = tol*0.5;
4545
double eta = etamax;
4646
assert(x.isVector());
@@ -56,8 +56,8 @@ class kr_balancing{
5656
if(fl == 1) std::cout<< 'intermediate convergence statistics is off'<<std::endl;
5757
size_t nochange = 0;
5858
while(rout > rt){//outer itteration
59-
outter_loop_count ++;
60-
// if(outter_loop_count == 30) break;
59+
outer_loop_count ++;
60+
// if(outer_loop_count == 30) break;
6161
i=i+1; k=0; y=e.sparseView();
6262
innertol = std::max(std::pow(eta,2)*rout,rt);
6363
inner_loop();
@@ -83,7 +83,7 @@ class kr_balancing{
8383
if(fl == 1){
8484
res.push_back(res_norm);
8585
}
86-
if(outter_loop_count %50 ==0) std::cout << "outer loop number "<< outter_loop_count <<std::endl;
86+
if(outer_loop_count %50 ==0) std::cout << "outer loop number "<< outer_loop_count <<std::endl;
8787
}//End of outer loop
8888
// if (nochange >= 100) {
8989
// std::cout << "nochange >=100" <<std::endl;
@@ -150,7 +150,7 @@ class kr_balancing{
150150
}
151151
const SparseMatrixCol* get_output(){
152152
assert(A.rows() == A.cols());
153-
A = SparseMatrixCol(A.triangularView<Eigen::Lower>());
153+
A = SparseMatrixCol(A.triangularView<Eigen::Upper>());
154154

155155
#pragma omp parallel for num_threads(num_threads) schedule(dynamic)
156156
for (int k=0; k<A.outerSize(); ++k){
@@ -190,7 +190,7 @@ class kr_balancing{
190190
PYBIND11_MODULE(KRBalancing, m) {
191191
py::class_<kr_balancing>(m, "kr_balancing")
192192
.def(py::init< const SparseMatrixCol & >())
193-
.def("outter_loop", &kr_balancing::outter_loop)
193+
.def("outer_loop", &kr_balancing::outer_loop)
194194
.def("get_output",&kr_balancing::get_output, py::return_value_policy::reference_internal);
195195

196196
}

0 commit comments

Comments
 (0)