Package gmisclib :: Module matrix_rearrange_labels :: Class diagfom
[frames] | no frames]

Class diagfom

source code


A class that defines a figure-of-merit for a matrix. It tries to put the largest entries on the diagonal. Instances of this class are passed to symm_swap_toward_minimal_fom.

Instance Methods
 
__init__(self, n, sign=1)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
int or float (according to the type of m).
eval(self, swv, m)
Evaluate the figure of merit for a matrix m with the specified swap vector.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, n, sign=1)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • sign (int) -
    • If sign=1, the f-o-m returned by eval will be minimal when the most positive matrix elements are on the diagonal.
    • If sign=-1, you'll get minimal fom with the the most positive elements off diagonal.
  • n (int) - dimension of matrix.
Overrides: object.__init__

eval(self, swv, m)

source code 

Evaluate the figure of merit for a matrix m with the specified swap vector.

Parameters:
  • m - matrix
  • swv - swap vector
Returns: int or float (according to the type of m).
figure of merit