File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,9 @@ namespace cp_algo::linalg {
110110 return res;
111111 }
112112 matrix submatrix (auto viewx, auto viewy) const {
113- return from (*this | viewx | std::views::transform (
114- [&](auto const & y) {return vec_t (y | viewy);}));
113+ return from (*this | viewx | std::views::transform ([&](auto const & y) {
114+ return y | viewy;
115+ }));
115116 }
116117
117118 matrix T () const {
@@ -213,7 +214,7 @@ namespace cp_algo::linalg {
213214 det *= b[i][i];
214215 b[i] *= base (1 ) / b[i][i];
215216 }
216- return {det, b.submatrix (std::views::take ( n ()) , std::views::drop ( n ()) | std::views::take (n ()))};
217+ return {det, b.submatrix (std::views::all , std::views::drop (n ()))};
217218 }
218219
219220 // Can also just run gauss on T() | eye(m)
@@ -244,10 +245,8 @@ namespace cp_algo::linalg {
244245 return std::nullopt ;
245246 } else {
246247 return std::array{
247- sols.submatrix (std::views::drop (sols.n () - t.m ()),
248- std::views::take (m ())),
249- sols.submatrix (std::views::take (sols.n () - t.m ()),
250- std::views::take (m ()))
248+ sols.submatrix (std::views::drop (sols.n () - t.m ()), std::views::all),
249+ sols.submatrix (std::views::take (sols.n () - t.m ()), std::views::all)
251250 };
252251 }
253252 }
You can’t perform that action at this time.
0 commit comments