Skip to content

Commit 134e381

Browse files
author
Leily Rabbani
committed
outputs a pointer
1 parent 12e646b commit 134e381

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/KRBalancing.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ class kr_balancing{
136136

137137
}//End of the inner 'while'
138138
}
139-
SparseMatrixR get_output(){
140-
std::cout << "export output of shape "<< A.cwiseProduct(x*x.transpose()).rows() <<std::endl;
141-
return A.cwiseProduct(x*x.transpose());
139+
const SparseMatrixR* get_output(){
140+
output = A.cwiseProduct(x*x.transpose());
141+
std::cout << "export output of shape "<< output.rows() <<
142+
" by " << output.rows()<<std::endl;
143+
return &output;
142144
}
143145
private:
144146
std::vector<double> res;
@@ -163,6 +165,7 @@ class kr_balancing{
163165
SparseMatrixR v;
164166
SparseMatrixR x;
165167
Eigen::SparseVector<double> rk;
168+
SparseMatrixR output;
166169
};
167170

168171

0 commit comments

Comments
 (0)