Skip to content

Commit

Permalink
mat: export Dense.SolveTwoChol
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Jul 31, 2017
1 parent cd23ab5 commit 613df30
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions mat/cholesky.go
Expand Up @@ -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
// SolveTwoChol 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 (m *Dense) SolveTwoChol(a, b *Cholesky) error {
if !a.valid() || !b.valid() {
panic(badCholesky)
}
Expand Down
2 changes: 1 addition & 1 deletion mat/cholesky_test.go
Expand Up @@ -162,7 +162,7 @@ func TestSolveTwoChol(t *testing.T) {
}

var x Dense
x.solveTwoChol(&chola, &cholb)
x.SolveTwoChol(&chola, &cholb)

var ans Dense
ans.Mul(test.a, &x)
Expand Down
4 changes: 2 additions & 2 deletions mat/hogsvd.go
Expand Up @@ -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 = sij.SolveTwoChol(&ai, &aj)
if gsvd.err != nil {
return false
}
s.Add(s, sij)

gsvd.err = sij.solveTwoChol(&aj, &ai)
gsvd.err = sij.SolveTwoChol(&aj, &ai)
if gsvd.err != nil {
return false
}
Expand Down

0 comments on commit 613df30

Please sign in to comment.