test_that("rcm", { m <- lotri({ a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p ~ c(0.4, 0, 0.3, 0, 0, 0, -0.1, 0, 0, 0.2, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 1.3, 0, 0, 0, 0, 0, -0.6, 0.8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.2, 0, 0.3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.1, 0.2, 0, 0, 0.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.4, 0, 0, 0, 0, 0, -1.1, 0.9, 0, 0, 0, 0, 0, 0, 0, 4.7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0.2, 0, 0, 0, 1.9)}) expect_equal(rcm(m), lotri({ p + l + j ~ c(1.9, 0.2, 0.3, 0.5, -0.2, 0.9) o + g + f ~ c(4.7, 0.9, 0.8, -1.1, -0.6, 1.3) n + d + a ~ c(0.4, 0.2, 0.2, 0.2, -0.1, 0.4) m ~ 2.1 k ~ 0.9 i ~ 0.2 e ~ 0.5 b ~ 0.3 h ~ 0 c ~ 0 })) m <- lotri({ a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p ~ c(0.4, 0, 0.3, 0, 0, 0, -0.1, 0, 0, 0.2, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 1.3, 0, 0, 0, 0, 0, -0.6, 0.8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.2, 0, 0.3, 0, 0, 0, 0, 0, 0,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