Package snobfit :: Module minq :: Class Minq

Class Minq

source code


Minimizes an affine quadratic form subject to simple bounds,
using coordinate searches and reduced subspace minimizations
using LDL^T factorization updates
    min    fval = gamma + c^T x + 0.5 x^T G x }
    s.t.   x in [xu,xo]

where G is a symmetric (n x n) matrix, not necessarily definite
(if G is indefinite, only a local minimum is found)

If G is sparse, it is assumed that the ordering is such that
a sparse modified Cholesky factorization is feasible

Instance Methods
 
__init__(self, gamma, c, G, xu, xo, prt=0, x0=None)
gamma a constant.
source code
 
print_minq(self) source code
 
print_init(self) source code
 
setSearchInit(self) source code
 
ldlrk1(self, L, d, alpha, u)
Computes LDL^T factorization for LDL^T + alpha * u * u^T if alpha>=0 or if new factorization is definite(both signalled by p=[]) otherwise, the original L,d and a direction p of null or negative curvature are returned
source code
 
ldlup(self, L, d, j, g)
Updates LDL^T factorization when a unit j-th row and column are replaced by column g
source code
 
ldldown(self, L, d, j)
Downdates LDL^T factorization when j-th row and column are replaced by j-th unit vector
source code
 
coordinateSearch(self)
Coordinate search
source code
 
subspace(self)
Take a subspace step
source code
 
subspaceSearch(self)
Subspace search
source code
 
calcGain(self)
Calculate gain
source code
 
calc_g(self)
Calculate gradient
source code
 
calc_newfval(self) source code
 
pr01(self, name, x)
Prints a (0,1) profile of x and returns the number of nonzeros
source code
 
search(self)
Main loop: alternating coordinate and subspace searches
source code
Class Variables
  convex = 0
  nitrefmax = 3
  neps = 2.2204460492503131e-14
  nsub = 0
  unfix = 1
  nitref = 0
  improvement = 1
  fval = inf
  nfree = 0
  nfree_old = -1
Method Details

__init__(self, gamma, c, G, xu, xo, prt=0, x0=None)
(Constructor)

source code 

Inputs:

gamma a constant. c a colomn vector. G a symmetric (n x n) matrix. xu lower bound xo upper bound

Optional Inputs:

prt print level. xx initial guess (optional)

ldlrk1(self, L, d, alpha, u)

source code 

Computes LDL^T factorization for LDL^T + alpha * u * u^T if alpha>=0 or if new factorization is definite(both signalled by p=[]) otherwise, the original L,d and a direction p of null or negative curvature are returned

d contains diag(D) and is assumed positive

Warning: does not work for dimension 0

ldlup(self, L, d, j, g)

source code 

Updates LDL^T factorization when a unit j-th row and column are replaced by column g

If the new matrix is definite (signalled by p=[]); otherwise, the original L,d and a direction p of null or negative curvature are returned

d contains diag(D) and is assumed positive Note that g must have zeros in other unit rows!!!

ldldown(self, L, d, j)

source code 

Downdates LDL^T factorization when j-th row and column are replaced by j-th unit vector

d contains diag(D) and is assumed positive

pr01(self, name, x)

source code 

Prints a (0,1) profile of x and returns the number of nonzeros

x: a numpy array

search(self)

source code 

Main loop: alternating coordinate and subspace searches

Outputs:
--------
x      minimizer (but unbounded direction if info=1)
fval   optimal function value
nsub   the number of subspace steps
info   0  (local minimizer found)
       1  (unbounded below)
       99 (maxiter exceeded)