:orphan: # 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 ## Note It is recommended that one use the `MatCreate()`, `MatSetType()` and/or `MatSetFromOptions()` paradigm instead of this routine directly. ## See Also [](ch_ksp), `MatCreate()`, `MATLMVM`, `MATLMVMSR1`, `MatCreateLMVMBFGS()`, `MatCreateLMVMDFP()`, `MatCreateLMVMBrdn()`, `MatCreateLMVMBadBrdn()`, `MatCreateLMVMSymBrdn()` ## Level intermediate ## Location src/ksp/ksp/utils/lmvm/sr1/sr1.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/utils/lmvm/sr1/sr1.c) [Index of all KSP routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)