krypy.recycling.factories - deflation vector factories

class krypy.recycling.factories.RitzFactory(candidate_generator, candidate_evaluator, mode='ritz')

Bases: krypy.recycling.factories._DeflationVectorFactory

Select Ritz vectors.

get(solver)
class krypy.recycling.factories.RitzFactorySimple(mode='ritz', n_vectors=0, which='smallest_abs')

Bases: krypy.recycling.factories._DeflationVectorFactory

Selects a fixed number of Ritz or harmonic Ritz vectors with respect to a prescribed criterion.

Parameters:
  • mode – See mode parameter of Ritz.
  • n_vectors – number of vectors that are chosen. Actual number of deflation vectors may be lower if the number of Ritz pairs is less than n_vectors.
  • which

    the n_vectors Ritz vectors are chosen such that the corresponding Ritz values are the ones with

    • lm: largest magnitude.
    • sm: smallest magnitude.
    • lr: largest real part.
    • sr: smallest real part.
    • li: largest imaginary part.
    • si: smallest imaginary part.
    • smallest_res: smallest Ritz residual norms.
get(solver)
class krypy.recycling.factories._DeflationVectorFactory

Abstract base class for selectors.

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

get(solver)

Get deflation vectors.

Returns:numpy.array of shape (N,k)