mat: export Dense.solveTwoChol as Cholesky.SolveChol
MODIFY
mat/cholesky.go
mat/cholesky.go
@@ -182,10 +182,9 @@ func (c *Cholesky) Solve(m *Dense, b Matrix) error {
return nil
}
-// TODO(kortschak): Export this as SolveTwoChol.
-// solveTwoChol finds the matrix m that solves A * m = B where A and B are represented
+// SolveChol finds the matrix m that solves A * m = B where A and B are represented
// by their Cholesky decompositions a and b, placing the result in the receiver.
-func (m *Dense) solveTwoChol(a, b *Cholesky) error {
+func (a *Cholesky) SolveChol(m *Dense, b *Cholesky) error {
if !a.valid() || !b.valid() {
panic(badCholesky)
}

MODIFY
mat/cholesky_test.go
mat/cholesky_test.go
@@ -114,7 +114,7 @@ func TestCholeskySolve(t *testing.T) {
}
}
-func TestSolveTwoChol(t *testing.T) {
+func TestCholeskySolveChol(t *testing.T) {
for _, test := range []struct {
a, b *SymDense
}{
@@ -162,7 +162,7 @@ func TestSolveTwoChol(t *testing.T) {
}
var x Dense
- x.solveTwoChol(&chola, &cholb)
+ chola.SolveChol(&x, &cholb)
var ans Dense
ans.Mul(test.a, &x)

MODIFY
mat/hogsvd.go
mat/hogsvd.go
@@ -80,13 +80,13 @@ func (gsvd *HOGSVD) Factorize(m ...Matrix) (ok bool) {
defer putWorkspace(sij)
for i, ai := range a {
for _, aj := range a[i+1:] {
- gsvd.err = sij.solveTwoChol(&ai, &aj)
+ gsvd.err = ai.SolveChol(sij, &aj)
if gsvd.err != nil {
return false
}
s.Add(s, sij)
- gsvd.err = sij.solveTwoChol(&aj, &ai)
+ gsvd.err = aj.SolveChol(sij, &ai)
if gsvd.err != nil {
return false
}

mat: export Dense.solveTwoChol as Cholesky.SolveChol