added dqr

This commit is contained in:
David Neumann
2014-01-29 21:25:01 +01:00
parent 20313fb406
commit da2378864e
5 changed files with 38 additions and 14 deletions

21
dqr.go Normal file
View File

@@ -0,0 +1,21 @@
package lapack
import "github.com/gonum/blas"
type QRFact struct {
A blas.General
tau []float64
}
func QR(A blas.General, tau []float64) QRFact {
impl.Dgeqrf(A, tau)
return QRFact{A, tau}
}
func (f QRFact) Solve(B blas.General) blas.General {
impl.Dormqr(blas.Left, blas.Trans, f.A, f.tau, B)
blas.Dtrsm(blas.Left, blas.NoTrans, 1,
blas.Ge2Tr(f.A, blas.NonUnit, blas.Upper), B)
B.Rows = f.A.Cols
return B
}

View File

@@ -1,4 +0,0 @@
package golapack
func Dgeqrf() {
}

7
impl.go Normal file
View File

@@ -0,0 +1,7 @@
package lapack
var impl Lapack
func Register(i Lapack) {
impl = i
}

10
lapack.go Normal file
View File

@@ -0,0 +1,10 @@
package lapack
import (
"github.com/gonum/blas"
)
type Lapack interface {
Dgeqrf(A blas.General, tau []float64)
Dormqr(s blas.Side, t blas.Transpose, A blas.General, tau []float64, B blas.General)
}

View File

@@ -1,10 +0,0 @@
package latypes
import (
"github.com/dane-unltd/goblas"
"github.com/gonum/blas"
)
type Lapack interface {
Dgeqrf(order blas.Order, A goblas.General, tau []float64)
}