0

With the following declarations: uvec basis; rowvec c; sp_mat B;

The expression c(basis) seems to return an arma::subview_elem1<double, arma::Mat<unsigned int> > and the following call appears to work:

vec pi_B = spsolve(trans(B), c(basis), "superlu"); 

How does spsolve resolve this input?

Also vec pi_B = spsolve(trans(B), trans(c(basis)), "superlu"); throws a dimensional mismatch error but the following runs:

rowvec d;
vec pi_B2 = spsolve(trans(B), trans(d), "superlu");
Dr. E.C.
  • 11
  • 1

1 Answers1

0

According to the documentation, c(basis) is a non-contiguous submatrix, where basis specifies which elements in c to use.

In this case c is "... interpreted as one long vector, with column-by-column ordering of the elements" and that "... the aggregate set of the specified elements is treated as a column vector", which means that c(basis) produces a column vector.

hbrerkere
  • 1,561
  • 8
  • 12