211 std::pair<int, int> rc = std::make_pair(0, 0);
212 while (rc.first >= 0) {
221 bool didOperate =
true;
234 for (
int i = 1; i < N; ++i) {
242 for (
int j = 1; j < N; ++j) {
255 rc = std::make_pair(-1, -1);
261 D.template block<N - 1, N - 1>(1, 1) = sd.matrixD();
262 U.template block<N - 1, N>(1, 0) =
263 sd.matrixU() *
U.template block<N - 1, N>(1, 0);
264 V.template block<1, N - 1>(0, 1) =
265 V.template block<1, N - 1>(0, 1) * sd.matrixV();
266 V.template block<N - 1, N - 1>(1, 1) =
267 V.template block<N - 1, N - 1>(1, 1) * sd.matrixV();
269 Y.template block<N - 1, N>(1, 0) =
270 sd.matrixY() *
Y.template block<N - 1, N>(1, 0);
271 X.template block<1, N - 1>(0, 1) =
272 X.template block<1, N - 1>(0, 1) * sd.matrixX();
273 X.template block<N - 1, N - 1>(1, 1) =
274 X.template block<N - 1, N - 1>(1, 1) * sd.matrixX();
281 if (UAVD != 0 || XDYA != 0) {
282 throw std::runtime_error(
"Smith decomposition failed\n");