lapack

package
v0.0.0-...-dfba71b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2020 License: BSD-2-Clause Imports: 1 Imported by: 0

README

Gonum LAPACK Build Status Coverage Status GoDoc

This repository is no longer maintained. Development has moved to https://github.com/gonum/gonum.

A collection of packages to provide LAPACK functionality for the Go programming language (http://golang.org). This provides a partial implementation in native go and a wrapper using cgo to a c-based implementation.

Installation

  go get github.com/gonum/lapack

Install OpenBLAS:

  git clone https://github.com/xianyi/OpenBLAS
  cd OpenBLAS
  make

Then install the lapack/cgo package:

  CGO_LDFLAGS="-L/path/to/OpenBLAS -lopenblas" go install github.com/gonum/lapack/cgo

For Windows you can download binary packages for OpenBLAS at http://sourceforge.net/projects/openblas/files/

If you want to use a different BLAS package such as the Intel MKL you can adjust the CGO_LDFLAGS variable:

  CGO_LDFLAGS="-lmkl_rt" go install github.com/gonum/lapack/cgo

Packages

lapack

Defines the LAPACK API based on http://www.netlib.org/lapack/lapacke.html

lapack/lapacke

Binding to a C implementation of the lapacke interface (e.g. OpenBLAS or intel MKL)

The linker flags (i.e. path to the BLAS library and library name) might have to be adapted.

The recommended (free) option for good performance on both linux and darwin is OpenBLAS.

Issues

If you find any bugs, feel free to file an issue on the github issue tracker for gonum/gonum or gonum/netlib for the CGO implementation if the bug exists in that reposity; no code changes will be made to this repository. Other discussions should be taken to the gonum-dev Google Group.

https://groups.google.com/forum/#!forum/gonum-dev

License

Please see github.com/gonum/license for general license information, contributors, authors, etc on the Gonum suite of packages.

Documentation

Index

Constants

View Source
const (
	ComputeEV      EVJob      = 'V' // Compute eigenvectors in Dsyev.
	ComputeLeftEV  LeftEVJob  = 'V' // Compute left eigenvectors.
	ComputeRightEV RightEVJob = 'V' // Compute right eigenvectors.
)

Job constants for computation of eigenvectors.

View Source
const None = 'N'

Variables

This section is empty.

Functions

This section is empty.

Types

type Comp

type Comp byte

type Complex128

type Complex128 interface{}

Complex128 defines the public complex128 LAPACK API supported by gonum/lapack.

type DecompUpdate

type DecompUpdate byte
const (
	ApplyP DecompUpdate = 'P'
	ApplyQ DecompUpdate = 'Q'
)

type Direct

type Direct byte

Direct specifies the direction of the multiplication for the Householder matrix.

const (
	Forward  Direct = 'F' // Reflectors are right-multiplied, H_0 * H_1 * ... * H_{k-1}.
	Backward Direct = 'B' // Reflectors are left-multiplied, H_{k-1} * ... * H_1 * H_0.
)

type EVComp

type EVComp byte

EVComp specifies how eigenvectors are computed.

const (
	// OriginalEV specifies to compute the eigenvectors of the original
	// matrix.
	OriginalEV EVComp = 'V'
	// TridiagEV specifies to compute both the eigenvectors of the input
	// tridiagonal matrix.
	TridiagEV EVComp = 'I'
	// HessEV specifies to compute both the eigenvectors of the input upper
	// Hessenberg matrix.
	HessEV EVComp = 'I'

	// UpdateSchur specifies that the matrix of Schur vectors will be
	// updated by Dtrexc.
	UpdateSchur EVComp = 'V'
)

type EVJob

type EVJob byte

Job types for computation of eigenvectors.

const (
	EigenvaluesOnly     EVJob = 'E'
	EigenvaluesAndSchur EVJob = 'S'
)

Job constants for Dhseqr.

type EVSide

type EVSide byte

EVSide specifies what eigenvectors will be computed.

const (
	RightEV     EVSide = 'R' // Compute right eigenvectors only.
	LeftEV      EVSide = 'L' // Compute left eigenvectors only.
	RightLeftEV EVSide = 'B' // Compute both right and left eigenvectors.
)

EVSide constants for Dtrevc3.

type Float64

type Float64 interface {
	Dgecon(norm MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64
	Dgeev(jobvl LeftEVJob, jobvr RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int)
	Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool
	Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int)
	Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int)
	Dgesvd(jobU, jobVT SVDJob, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) (ok bool)
	Dgetrf(m, n int, a []float64, lda int, ipiv []int) (ok bool)
	Dgetri(n int, a []float64, lda int, ipiv []int, work []float64, lwork int) (ok bool)
	Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int)
	Dggsvd3(jobU, jobV, jobQ GSVDJob, m, n, p int, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int) (k, l int, ok bool)
	Dlantr(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, m, n int, a []float64, lda int, work []float64) float64
	Dlange(norm MatrixNorm, m, n int, a []float64, lda int, work []float64) float64
	Dlansy(norm MatrixNorm, uplo blas.Uplo, n int, a []float64, lda int, work []float64) float64
	Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int)
	Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int)
	Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int)
	Dpocon(uplo blas.Uplo, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64
	Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool)
	Dsyev(jobz EVJob, uplo blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int) (ok bool)
	Dtrcon(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int, work []float64, iwork []int) float64
	Dtrtri(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) (ok bool)
	Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool)
}

Float64 defines the public float64 LAPACK API supported by gonum/lapack.

type GSVDJob

type GSVDJob byte

GSVDJob specifies the singular vector computation type for Generalized SVD.

const (
	GSVDU    GSVDJob = 'U' // Compute orthogonal matrix U
	GSVDV    GSVDJob = 'V' // Compute orthogonal matrix V
	GSVDQ    GSVDJob = 'Q' // Compute orthogonal matrix Q
	GSVDUnit GSVDJob = 'I' // Use unit-initialized matrix
	GSVDNone GSVDJob = 'N' // Do not compute orthogonal matrix
)

type HowMany

type HowMany byte

HowMany specifies which eigenvectors will be computed.

const (
	AllEV      HowMany = 'A' // Compute all right and/or left eigenvectors.
	AllEVMulQ  HowMany = 'B' // Compute all right and/or left eigenvectors multiplied by an input matrix.
	SelectedEV HowMany = 'S' // Compute selected right and/or left eigenvectors.
)

HowMany constants for Dhseqr.

type Job

type Job byte
const (
	Permute      Job = 'P'
	Scale        Job = 'S'
	PermuteScale Job = 'B'
)

Jobs for Dgebal.

type LeftEVJob

type LeftEVJob byte

Job types for computation of eigenvectors.

type MatrixNorm

type MatrixNorm byte

MatrixNorm represents the kind of matrix norm to compute.

const (
	MaxAbs       MatrixNorm = 'M' // max(abs(A(i,j)))  ('M')
	MaxColumnSum MatrixNorm = 'O' // Maximum column sum (one norm) ('1', 'O')
	MaxRowSum    MatrixNorm = 'I' // Maximum row sum (infinity norm) ('I', 'i')
	NormFrob     MatrixNorm = 'F' // Frobenius norm (sqrt of sum of squares) ('F', 'f', E, 'e')
)

type MatrixType

type MatrixType byte

MatrixType represents the kind of matrix represented in the data.

const (
	General  MatrixType = 'G' // A dense matrix (like blas64.General).
	UpperTri MatrixType = 'U' // An upper triangular matrix.
	LowerTri MatrixType = 'L' // A lower triangular matrix.
)

type Pivot

type Pivot byte

Pivot specifies the pivot type for plane rotations

const (
	Variable Pivot = 'V'
	Top      Pivot = 'T'
	Bottom   Pivot = 'B'
)

type RightEVJob

type RightEVJob byte

Job types for computation of eigenvectors.

type SVDJob

type SVDJob byte

SVDJob specifies the singular vector computation type for SVD.

const (
	SVDAll       SVDJob = 'A' // Compute all singular vectors
	SVDInPlace   SVDJob = 'S' // Compute the first singular vectors and store them in provided storage.
	SVDOverwrite SVDJob = 'O' // Compute the singular vectors and store them in input matrix
	SVDNone      SVDJob = 'N' // Do not compute singular vectors
)

type Sort

type Sort byte

Sort is the sorting order.

const (
	SortIncreasing Sort = 'I'
	SortDecreasing Sort = 'D'
)

type StoreV

type StoreV byte

StoreV indicates the storage direction of elementary reflectors.

const (
	ColumnWise StoreV = 'C' // Reflector stored in a column of the matrix.
	RowWise    StoreV = 'R' // Reflector stored in a row of the matrix.
)

Directories

Path Synopsis
cgo
Package cgo provides an interface to bindings for a C LAPACK library.
Package cgo provides an interface to bindings for a C LAPACK library.
lapacke
Package lapacke provides bindings to the LAPACKE C Interface to LAPACK.
Package lapacke provides bindings to the LAPACKE C Interface to LAPACK.
Package lapack64 provides a set of convenient wrapper functions for LAPACK calls, as specified in the netlib standard (www.netlib.org).
Package lapack64 provides a set of convenient wrapper functions for LAPACK calls, as specified in the netlib standard (www.netlib.org).
Package native is a pure-go implementation of the LAPACK API.
Package native is a pure-go implementation of the LAPACK API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL