Skip to main content
`Ctrl`+`K`

# MatCreateLMVMSR1

Creates a limited-memory Symmetric-Rank-1 approximation matrix used for a Jacobian. L-SR1 is symmetric by construction, but is not guaranteed to be positive-definite.

## Synopsis

    #include "petscksp.h"
    PetscErrorCode MatCreateLMVMSR1(MPI_Comm comm, PetscInt n, PetscInt N, Mat *B)

To use the L-SR1 matrix with other vector types, the matrix must be created using `MatCreate()` and `MatSetType()`, followed by `MatLMVMAllocate()`. This ensures that the internal storage and work vectors are duplicated from the correct type of vector.

Collective

## Input Parameters

- comm - MPI communicator

- n - number of local rows for storage vectors

- N - global size of the storage vectors

## Output Parameter

- B - the matrix

## Options Database Keys

- -mat_lmvm_hist_size - the number of history vectors to keep

- -mat_lmvm_mult_algorithm - the algorithm to use for multiplication (recursive, dense, compact_dense)

- -mat_lmvm_cache_J0_products - whether products between the base Jacobian J0 and history vectors should be cached or recomputed

- -mat_lmvm_eps - (developer) numerical zero tolerance for testing when an update should be skipped

- -mat_lmvm_debug - (developer) perform internal debugging checks

## Note

It is recommended that one use the `MatCreate()`, `MatSetType()` and/or `MatSetFromOptions()` paradigm instead of this routine directly.

## See Also

KSP: Linear System Solvers, `MatCreate()`, `MATLMVM`, `MATLMVMSR1`, `MatCreateLMVMBFGS()`, `MatCreateLMVMDFP()`, `MatCreateLMVMBroyden()`, `MatCreateLMVMBadBroyden()`, `MatCreateLMVMSymBroyden()`

## Level

intermediate

## Location

src/ksp/ksp/utils/lmvm/sr1/sr1.c

Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages