iterative

package
v0.0.0-...-896b79b Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2015 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BiCG

type BiCG struct {
	BreakdownTolerance float64
	// contains filtered or unexported fields
}

BiCG implements the Bi-Conjugate Gradient iterative method with preconditioning for solving the linear system Ax = b.

func (*BiCG) Init

func (bicg *BiCG) Init(ctx *Context) Operation

func (*BiCG) Iterate

func (bicg *BiCG) Iterate(ctx *Context) Operation

type CG

type CG struct {
	// contains filtered or unexported fields
}

func (*CG) Init

func (cg *CG) Init(ctx *Context) Operation

func (*CG) Iterate

func (cg *CG) Iterate(ctx *Context) Operation

type Context

type Context struct {
	X        *mat64.Vector
	Residual *mat64.Vector
	P        *mat64.Vector
	Ap       *mat64.Vector
	Q        *mat64.Vector
	Aq       *mat64.Vector
	Z        *mat64.Vector
}

type Method

type Method interface {
	Init(*Context) Operation
	Iterate(*Context) Operation
}

type Operation

type Operation uint64
const (
	NoOperation Operation = 0
	ComputeAp   Operation = 1 << (iota - 1)
	ComputeAq
	SolvePreconditioner
	CheckConvergence
)

type Result

type Result struct {
	X       *mat64.Vector
	Stats   Stats
	Runtime time.Duration
}

func Solve

func Solve(a sparse.Matrix, b, xInit *mat64.Vector, settings *Settings, method Method) (result Result, err error)

type Settings

type Settings struct {
	Tolerance  float64
	Iterations int
}

func DefaultSettings

func DefaultSettings(dim int) *Settings

type Stats

type Stats struct {
	Iterations         int
	MatVecMultiplies   int
	PrecondionerSolves int
	Residual           float64
	StartTime          time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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