linalg

class pyviennacl.linalg.bicgstab_tag(tolerance=1e-08, max_iterations=400, max_iterations_before_restart=200)

Instruct the solver to solve using the stabilised bi-conjugate gradient (BiCGStab) solver.

Assumes that the system matrix is non-symmetric.

Used for supplying solver parameters.

error

The estimated relative error at the end of the solver run

iters

The number of solver iterations

max_iterations

The maximum number of iterations before a restart

tolerance

The relative tolerance

class pyviennacl.linalg.cg_tag(tolerance=1e-08, max_iterations=300)

Instruct the solver to solve using the conjugate gradient solver.

Assumes that the system matrix is symmetric positive definite.

Used for supplying solver parameters.

error

The estimated relative error at the end of the solver run

iters

The number of solver iterations

max_iterations

The maximum number of iterations

tolerance

The relative tolerance

pyviennacl.linalg.eig(A, tag)

Solve an eigenvalue problem for matrix A, with results depending on tag.

A : Matrix tag : eigenvalue computation tag instance

Must be one of * power_iter_tag * lanczos_tag See the help for each tag class for more information.
x : {scalar, array-like}
Return type depends on tag * if power_iter_tag, then a scalar of type dtype(A).type * if lanczos_tag, then an ndarray vector with same dtype as A
TypeError
If A is not a Matrix instance, or if tag is not understood
class pyviennacl.linalg.gmres_tag(tolerance=1e-08, max_iterations=300, krylov_dim=20)

Instruct the solver to solve using the GMRES solver.

Used for supplying solver parameters.

error

The estimated relative error at the end of the solver run

iters

The number of solver iterations

krylov_dim

The maximum dimension of the Krylov space before restart

max_iterations

The maximum number of iterations

max_restarts

The maximum number of GMRES restarts

tolerance

The relative tolerance

class pyviennacl.linalg.lanczos_tag(factor=0.75, num_eig=10, method=0, krylov=100)

Instruct the eigenvalue computation to use the Lanczos algorithm.

Used for supplying eigenvalue computation parameters.

factor

The tolerance factor for reorthogonalisation batches, expressed as the exponent of epsilon.

krylov_size

The size of the Kylov space.

method

The reorthogonalisation method choice.

num_eigenvalues

The number of eigenvalues to return.

class pyviennacl.linalg.lower_tag

Instruct the solver to solve for a lower triangular system matrix

pyviennacl.linalg.norm(x, ord=None)

Returns the vector norm of x, if that is defined.

The norm returned depends on the ord parameter, as in SciPy.

ord : {1, 2, inf}
Order of the norm. inf means NumPy’s inf object.
pyviennacl.linalg.plane_rotation(vec1, vec2, alpha, beta)

Computes (vec1, vec2) <- (alpha*vec1+beta*vec2, -beta*vec1+alpha*vec2)

vec1 : Vector vec2 : Vector alpha : any Python, NumPy or PyViennaCL scalar (real or integer) beta : any Python, NumPy or PyViennaCL scalar (real or integer)

None

The dtypes of the parameters must match.

Operates in-place on vec1 and vec2.

class pyviennacl.linalg.power_iter_tag(factor=1e-08, max_iterations=50000)

Instruct the eigenvalue computation to use the power iteration algorithm.

Used for supplying eigenvalue computation parameters.

factor

The termination factor.

If the eigenvalue does not change more than this value, the algorithm stops.

max_iterations

The maximum number of iterations

pyviennacl.linalg.prod(A, B)

Returns Mul(A, B) where that is defined (see the help for Mul), otherwise returns (A * B).

pyviennacl.linalg.solve(A, B, tag, precond=None)

Solve the linear system expressed by A x = B for x.

A : (M, M) dense or sparse Matrix
A square matrix
B : {Vector, Matrix}
Right-hand side in A x = B
tag : solver tag instance
Describes the system matrix and solver algorithm. Must be one of: * upper_tag * unit_upper_tag * lower_tag * unit_lower_tag * cg_tag * bicgstab_tag * gmres_tag See the help for each tag class for more information.
x : {Vector, Matrix}
Shape and class of x matches shape and class of B.
TypeError
If A is not a Matrix or SparseMatrixBase instance, or B is neither a Matrix nor a Vector instance, or if tag is unsupported.
class pyviennacl.linalg.unit_lower_tag

Instruct the solver to solve for a unit lower triangular system matrix

class pyviennacl.linalg.unit_upper_tag

Instruct the solver to solve for a unit upper triangular system matrix

class pyviennacl.linalg.upper_tag

Instruct the solver to solve for an upper triangular system matrix

This Page