I have a while loop, in which I use a Matrix A
, vectors B
and x
with varying dimensions:
int count=0;
while(true){
count+=1;
MatrixXd A(count,2*count);
VectorXd B(2*count);
// assignment of A, and B
//
VectorXd x = A.householderQr().solve(B);
// output of x
if (x.norm()>30)
break;
}
However the program built this way always collapses. I tried to use pointers to such matrices or vector, and got similar failures.
How can I handle such issue?