Other Functionality

class NTPolySwig.Analysis

A class for solving matrix equations.

static PivotedCholeskyDecomposition(AMat, LMat, rank, solver_parameters)

Compute The Cholesky Decomposition of a Symmetric Positive Semi-Definite matrix.:type AMat: Matrix_ps

Parameters:
  • AMat – the matrix A, must be symmetric, positive definite.:type LMat: Matrix_ps

  • LMat – the matrix computed.:type rank: int

  • rank – the target rank:type solver_parameters: SolverParameters

  • solver_parameters – parameters for the solver

static ReduceDimension(AMat, dim, RMat, solver_parameters)

When we want to only compute the first n eigenvalues of a matrix, this routine will project out the higher eigenvalues.:type AMat: Matrix_ps

Parameters:
  • AMat – The starting matrix.:type dim: int

  • dim – The number of eigenvalues ot keep.:type RMat: Matrix_ps

  • RMat – a dimxdim matrix with the same first n eigenvalues as A.:type solver_parameters: SolverParameters

  • solver_parameters – parameters for the solver

property thisown

The membership flag

class NTPolySwig.EigenBounds

A class for computing eigen bounds matrices.

static GershgorinBounds(matrix)

Compute a bounds on the minimum and maximum eigenvalue of a matrix. Uses Gershgorin’s theorem.:type matrix: Matrix_ps

Parameters:
  • matrix – the matrix to compute the min/max of.:type min_ger_eig: float

  • min_ger_eig – a lower bound on the eigenspectrum.:type max_ger_eig: float

  • max_ger_eig – an uppder bound on the eigenspectrum.

static PowerBounds(matrix, solver_parameters)

Compute a bounds on and maximum eigenvalue of a matrix. Uses The Power Method.:type matrix: Matrix_ps

Parameters:
  • matrix – the matrix to compute the min/max of.:type max_power_eig: float

  • max_power_eig – an upper bound on the eigenspectrum.:type solver_parameters: SolverParameters

  • solver_parameters – parameters for the solver

property thisown

The membership flag

class NTPolySwig.EigenSolvers

A class for computing eigen decompositions matrices.

static EigenDecomposition(matrix, eigenvalues, nvals, eigenvectors, solver_parameters)

Compute the eigendecomposition of a matrix. Uses a dense routine.:type matrix: Matrix_ps

Parameters:
  • matrix – the matrix to decompose.:type eigenvalues: Matrix_ps

  • eigenvalues – the eigenvalues of a matrix.:type eigenvectors: Matrix_ps

  • eigenvectors – the eigenvectors of a matrix.:type nvals: int

  • nvals – the number of values to compute.:type solver_parameters: SolverParameters

  • solver_parameters – parameters for computing.

static EigenValues(matrix, eigenvalues, nvals, solver_parameters)

Compute the eigenvalues of a matrix. Uses a dense routine.:type matrix: Matrix_ps

Parameters:
  • matrix – the matrix to decompose.:type eigenvalues: Matrix_ps

  • eigenvalues – the eigenvalues of a matrix.:type nvals: int

  • nvals – the number of values to compute.:type solver_parameters: SolverParameters

  • solver_parameters – parameters for computing.

static SingularValueDecomposition(matrix, leftvectors, rightvectors, singularvalues, solver_parameters)

Compute the singular value decomposition of a matrix. Uses a dense routine.:type matrix: Matrix_ps

Parameters:
  • matrix – the matrix to decompose.:type leftvectors: Matrix_ps

  • leftvectors – the left singular vectors.:type rightvectors: Matrix_ps

  • rightvectors – the right singular vectors:type singularvalues: Matrix_ps

  • singularvalues – a diagonal matrix containing the singular values.:type solver_parameters: SolverParameters

  • solver_parameters – parameters for computing.

property thisown

The membership flag

class NTPolySwig.MatrixConversion

Helper routines for converting an NTPoly matrix to other program types.

static SnapMatrixToSparsityPattern(mata, matb)

Some codes use a fixed sparsity pattern for a matrix instead of filtering small values. Using this routine, the matrix is filled to have the same pattern as the second matrix argument. Zeros of the sparsity pattern are left in, whereas values outside the sparsity are removed. This can faciliate conversion between formats. :type mata: Matrix_ps

Parameters:
  • mata – the matrix to modify. :type matb: Matrix_ps

  • matb – the matrix which defines the sparsity pattern.

property thisown

The membership flag

Logging

NTPolySwig.ActivateLogger(*args)
Overload 1:

Activate the logger. :type start_document: boolean, optional

Parameters:

start_document – if this is a new document we can write the start document marker.


Overload 2:

Activate the logger with a specific file. :type file_name: string

Parameters:
  • file_name – file to print to. :type start_document: boolean, optional

  • start_document – if this is a new document we can write the start document marker.


Overload 3:

Activate the logger with a specific file. :type file_name: string

Parameters:

file_name – file to print to. :param start_document: if this is a new document we can write the start document marker.

NTPolySwig.DeactivateLogger()

Deactivate the logger.