PETSc version 3.17.4

Matrices Mat: : Examples

PETSc matrices (Mat objects) are used to store Jacobians and other sparse matrices in PDE-based (or other) simulations.

Beginner - Basic usage
MATAIJ MATSOLVERMUMPS MatMumpsGetInfog
MATAIJCRL MATSOLVERPASTIX MatMumpsGetInverse
MATAIJCUSPARSE MATSOLVERSPARSEELEMENTAL MatMumpsGetInverseTranspose
MATAIJMKL MATSOLVERSPQR MatMumpsGetRinfo
MATAIJPERM MATSOLVERSSTRUMPACK MatMumpsGetRinfog
MATAIJSELL MATSOLVERSUPERLU MatMumpsSetCntl
MATAIJVIENNACL MATSOLVERSUPERLU_DIST MatMumpsSetIcntl
MATBAIJ MATSOLVERUMFPACK MatOption
MATBAIJMKL Mat MatOrderingType
MATDENSE MatAssemblyBegin MatPartitioning
MATDENSECUDA MatAssemblyEnd MatPartitioningType
MATELEMENTAL MatAssemblyType MatProductAlgorithm
MATH2OPUS MatColoring MatProductType
MATHTOOL MatColoringType MatPropagateSymmetryOptions
MATMPIADJ MatComputeBandwidth MatResetPreallocation
MATMPIAIJ MatCreate MatReuse
MATMPIAIJCUSPARSE MatCreateSubMatrixOption MatSORType
MATMPIBAIJ MatDestroy MatSTRUMPACKSetColPerm
MATMPIDENSE MatDuplicateOption MatSTRUMPACKSetHSSAbsTol
MATMPIDENSECUDA MatFDColoring MatSTRUMPACKSetHSSLeafSize
MATMPISBAIJ MatFactorError MatSTRUMPACKSetHSSMaxRank
MATMPISELL MatFactorShiftType MatSTRUMPACKSetHSSMinSepSize
MATSBAIJ MatFactorType MatSTRUMPACKSetHSSRelTol
MATSCALAPACK MatGetLocalSize MatSTRUMPACKSetReordering
MATSELL MatGetOwnershipRange MatSetFromOptions
MATSEQAIJ MatGetOwnershipRanges MatSetPreallocationCOO
MATSEQAIJCUSPARSE MatGetOwnershipRangesColumn MatSetPreallocationCOOLocal
MATSEQAIJKOKKOS MatGetSize MatSetSizes
MATSEQAIJVIENNACL MatHasCongruentLayouts MatSetStencil
MATSEQBAIJ MatHtoolClusteringType MatSetUp
MATSEQDENSE MatHtoolCompressorType MatSetValue
MATSEQDENSECUDA MatInfoType MatSetValues
MATSEQSBAIJ MatLoad MatSetValuesBlockedStencil
MATSEQSELL MatMFFDType MatSetValuesCOO
MATSMPIAIJKOKKOS MatMkl_PardisoSetCntl MatSetValuesStencil
MATSOLVERCHOLMOD MatMult MatSolverType
MATSOLVERCUSPARSE MatMultAdd MatStencil
MATSOLVERESSL MatMultHermitianTranspose MatStructure
MATSOLVERKLU MatMultHermitianTransposeAdd MatSuperluSetILUDropTol
MATSOLVERKOKKOS MatMultTranspose MatTransposeColoring
MATSOLVERLUSOL MatMultTransposeAdd MatType
MATSOLVERMATLAB MatMumpsGetCntl MatView
MATSOLVERMKL_CPARDISO MatMumpsGetIcntl MatXAIJSetPreallocation
MATSOLVERMKL_PARDISO MatMumpsGetInfo
Intermediate - Setting options for algorithms and data structures
MATHYPRE MatDuplicate MatPreallocateSymmetricSetLocalBlock
MATMFFD_DS MatEqual MatProductClear
MATMFFD_WP MatFDColoringSetValues MatProductCreate
MATNEST MatFactorGetSolverType MatProductCreateWithMat
MATSOLVERBAS MatFindNonzeroRows MatProductGetMats
MatAXPY MatFindZeroRows MatProductGetType
MatAYPX MatGetBlockSize MatProductNumeric
MatBindToCPU MatGetBlockSizes MatProductReplaceMats
MatBlockMatSetPreallocation MatGetColumnMeans MatProductSetAlgorithm
MatBoundToCPU MatGetColumnMeansImaginaryPart MatProductSetFill
MatCUSPARSEFormatOperation MatGetColumnMeansRealPart MatProductSetFromOptions
MatCUSPARSESetFormat MatGetColumnNorms MatProductSetType
MatCUSPARSESetUseCPUSolve MatGetColumnSums MatProductSymbolic
MatCUSPARSEStorageFormat MatGetColumnSumsImaginaryPart MatProductView
MatChop MatGetColumnSumsRealPart MatPtAP
MatColoringWeightType MatGetDiagonal MatPtAPMultEqual
MatConvert MatGetFactor MatPythonCreate
MatCopy MatGetFactorAvailable MatPythonSetType
MatCreateAIJ MatGetFactorType MatRARt
MatCreateAIJCUSPARSE MatGetInfo MatRARtMultEqual
MatCreateAIJKokkos MatGetLocalSubMatrix MatReorderForNonzeroDiagonal
MatCreateAIJViennaCL MatGetNonzeroState MatRestoreLocalSubMatrix
MatCreateBAIJ MatGetOption MatRestrict
MatCreateBAIJMKL MatGetOwnershipIS MatSTRUMPACKReordering
MatCreateBlockMat MatGetRowMax MatScaLAPACKGetBlockSizes
MatCreateCentering MatGetRowMaxAbs MatScaLAPACKSetBlockSizes
MatCreateDense MatGetRowMin MatScale
MatCreateDenseCUDA MatGetRowMinAbs MatScatterGetVecScatter
MatCreateFFT MatGetRowSum MatSeqAIJGetArray
MatCreateH2OpusFromKernel MatGetSeqNonzeroStructure MatSeqAIJGetArrayRead
MatCreateH2OpusFromMat MatGetType MatSeqAIJGetArrayWrite
MatCreateHermitianTranspose MatGetVariableBlockSizes MatSeqAIJGetMaxRowNonzeros
MatCreateHtoolFromKernel MatGetVecType MatSeqAIJKron
MatCreateLRC MatH2OpusCompress MatSeqAIJRestoreArray
MatCreateMPIAIJCRL MatH2OpusGetIndexMap MatSeqAIJRestoreArrayRead
MatCreateMPIAIJMKL MatH2OpusLowRankUpdate MatSeqAIJRestoreArrayWrite
MatCreateMPIAIJPERM MatH2OpusMapVec MatSeqAIJSetPreallocation
MatCreateMPIAIJSELL MatH2OpusOrthogonalize MatSeqAIJSetType
MatCreateMPIAIJWithArrays MatH2OpusSetSamplingMat MatSeqBAIJGetArray
MatCreateMPIAdj MatHYPRESetPreallocation MatSeqBAIJRestoreArray
MatCreateMPIBAIJWithArrays MatHermitianTranspose MatSeqBAIJSetPreallocation
MatCreateMPISBAIJWithArrays MatHermitianTransposeGetMat MatSeqDenseSetPreallocation
MatCreateNormal MatISSetPreallocation MatSeqSBAIJGetArray
MatCreateNormalHermitian MatInfo MatSeqSBAIJRestoreArray
MatCreateSBAIJ MatInterpolate MatSeqSBAIJSetPreallocation
MatCreateSELL MatInterpolateAdd MatSeqSELLRestoreArray
MatCreateScaLAPACK MatIsHermitian MatSeqSELLSetPreallocation
MatCreateScatter MatIsHermitianTranspose MatSetBlockSize
MatCreateSeqAIJ MatIsLinear MatSetBlockSizes
MatCreateSeqAIJCRL MatIsStructurallySymmetric MatSetFactorType
MatCreateSeqAIJCUSPARSE MatIsSymmetric MatSetLocalToGlobalMapping
MatCreateSeqAIJFromTriple MatIsTranspose MatSetOption
MatCreateSeqAIJKokkos MatLRCGetMats MatSetRandom
MatCreateSeqAIJMKL MatMPIAIJGetSeqAIJ MatSetType
MatCreateSeqAIJPERM MatMPIAIJSetPreallocation MatSetValueLocal
MatCreateSeqAIJSELL MatMPIAdjSetPreallocation MatSetValuesBlocked
MatCreateSeqAIJViennaCL MatMPIAdjToSeq MatSetValuesBlockedLocal
MatCreateSeqAIJWithArrays MatMPIBAIJSetPreallocation MatSetValuesLocal
MatCreateSeqBAIJ MatMPIDenseSetPreallocation MatSetValuesRowLocal
MatCreateSeqBAIJMKL MatMPISBAIJSetPreallocation MatSetVariableBlockSizes
MatCreateSeqCUFFT MatMPISELLSetPreallocation MatSetVecType
MatCreateSeqDense MatMatInterpolate MatShift
MatCreateSeqDenseCUDA MatMatInterpolateAdd MatSolverTypeGet
MatCreateSeqSBAIJ MatMatMatMult MatSolverTypeRegister
MatCreateSeqSELL MatMatMult MatStashSetInitialSize
MatCreateTranspose MatMatMultEqual MatTranspose
MatDenseGetArray MatMatRestrict MatTransposeColoringCreate
MatDenseGetArrayRead MatMatTransposeMult MatTransposeColoringDestroy
MatDenseGetArrayWrite MatMatTransposeMultEqual MatTransposeGetMat
MatDenseGetColumn MatMkl_CPardisoSetCntl MatTransposeMatMult
MatDenseGetColumnVec MatMultAddEqual MatTransposeMatMultEqual
MatDenseGetColumnVecRead MatMultEqual MatUpdateMPIAIJWithArrays
MatDenseGetColumnVecWrite MatMultHermitianTransposeAddEqual MatViewFromOptions
MatDenseGetLDA MatMultHermitianTransposeEqual MatZeroEntries
MatDenseGetLocalMatrix MatMultTransposeAddEqual MatZeroRows
MatDenseGetSubMatrix MatMultTransposeEqual MatZeroRowsColumns
MatDenseRestoreArray MatNorm MatZeroRowsColumnsIS
MatDenseRestoreArrayRead MatNormalGetMat MatZeroRowsColumnsLocal
MatDenseRestoreArrayWrite MatNormalHermitianGetMat MatZeroRowsColumnsLocalIS
MatDenseRestoreColumn MatPreallocateFinalize MatZeroRowsColumnsStencil
MatDenseRestoreColumnVec MatPreallocateInitialize MatZeroRowsIS
MatDenseRestoreColumnVecRead MatPreallocateLocation MatZeroRowsLocal
MatDenseRestoreColumnVecWrite MatPreallocateSet MatZeroRowsLocalIS
MatDenseRestoreSubMatrix MatPreallocateSetLocal MatZeroRowsStencil
MatDenseSetLDA MatPreallocateSetLocalBlock VecScatterFFTWToPetsc
MatDiagonalScale MatPreallocateSetLocalRemoveDups VecScatterPetscToFFTW
MatDiagonalSet MatPreallocateSymmetricSetBlock
Advanced - Setting more advanced options and customization
MATBLOCKMAT MatGetGhosts MatMFFDSetType
MATCOMPOSITE MatGetInertia MatMFFDWPSetComputeNormU
MATIS MatGetLayouts MatMPIAIJSetUseScalableIncreaseOverlap
MATKAIJ MatGetLocalToGlobalMapping MatMPIBAIJSetHashTableFactor
MATMAIJ MatGetMultiProcBlock MatMPIBAIJSetPreallocationCSR
MATMFFD MatGetOptionsPrefix MatMPIBAIJSetValuesBlocked
MATPREALLOCATOR MatGetRow MatMPISBAIJSetPreallocationCSR
MATSCATTER MatGetRowUpperTriangular MatMissingDiagonal
MATSHELL MatGetTrace MatNestGetISs
MatAppendOptionsPrefix MatGetValue MatNestGetLocalISs
MatAssembled MatGetValues MatNestSetSubMats
MatCompositeAddMat MatGetValuesLocal MatNullSpace
MatCompositeGetMat MatHasOperation MatNullSpaceCreate
MatCompositeGetMatStructure MatHtoolGetHierarchicalMat MatNullSpaceCreateRigidBody
MatCompositeGetNumberMat MatHtoolGetPermutationSource MatNullSpaceDestroy
MatCompositeGetType MatHtoolGetPermutationTarget MatNullSpaceRemove
MatCompositeMerge MatHtoolSetKernel MatNullSpaceSetFunction
MatCompositeSetMatStructure MatHtoolUsePermutation MatNullSpaceTest
MatCompositeSetMergeType MatISFixLocalEmpty MatNullSpaceView
MatCompositeSetScalings MatISGetLocalMat MatPermute
MatCompositeSetType MatISGetLocalToGlobalMapping MatPreallocatorPreallocate
MatComputeOperator MatISRestoreLocalMat MatRealPart
MatComputeOperatorTranspose MatISSetLocalMat MatRegister
MatConjugate MatISSetLocalMatType MatRegisterAll
MatCreateComposite MatISStoreL2L MatRestoreRow
MatCreateConstantDiagonal MatImaginaryPart MatRestoreRowUpperTriangular
MatCreateIS MatInodeGetInodeSizes MatRetrieveValues
MatCreateKAIJ MatInvertBlockDiagonal MatScatterSetVecScatter
MatCreateMAIJ MatInvertBlockDiagonalMat MatSeqAIJGetArrayF90
MatCreateMFFD MatInvertVariableBlockDiagonal MatSeqAIJRegister
MatCreateMPIAIJSumSeqAIJ MatIsHermitianKnown MatSeqAIJRegisterAll
MatCreateMPIAIJWithSeqAIJ MatIsSymmetricKnown MatSeqAIJRestoreArrayF90
MatCreateMPIAIJWithSplitArrays MatKAIJGetAIJ MatSeqAIJSetColumnIndices
MatCreateMPIMatConcatenateSeqMat MatKAIJGetS MatSeqAIJSetTotalPreallocation
MatCreateNest MatKAIJGetSRead MatSeqBAIJSetColumnIndices
MatCreateRedundantMatrix MatKAIJGetScaledIdentity MatSeqBAIJSetPreallocationCSR
MatCreateSeqBAIJWithArrays MatKAIJGetT MatSeqSBAIJSetColumnIndices
MatCreateSeqSBAIJWithArrays MatKAIJGetTRead MatSeqSBAIJSetPreallocationCSR
MatCreateShell MatKAIJRestoreS MatSetErrorIfFailure
MatCreateSubMatrices MatKAIJRestoreSRead MatSetLayouts
MatCreateSubMatricesMPI MatKAIJRestoreT MatSetNearNullSpace
MatCreateSubMatrix MatKAIJRestoreTRead MatSetNullSpace
MatCreateVecs MatKAIJSetAIJ MatSetOptionsPrefix
MatCreateVecsFFTW MatKAIJSetS MatSetTransposeNullSpace
MatDenseGetArrayF90 MatKAIJSetT MatSetValuesBatch
MatDenseRestoreArrayF90 MatMAIJGetAIJ MatSetValuesRow
MatDestroyMatrices MatMAIJRedimension MatShellGetContext
MatDestroySeqNonzeroStructure MatMFFDCheckPositivity MatShellGetOperation
MatDestroySubMatrices MatMFFDDSSetUmin MatShellSetContext
MatFactorCreateSchurComplement MatMFFDGetH MatShellSetManageScalingShifts
MatFactorFactorizeSchurComplement MatMFFDResetHHistory MatShellSetMatProductOperation
MatFactorGetError MatMFFDSetBase MatShellSetOperation
MatFactorGetErrorZeroPivot MatMFFDSetCheckh MatShellSetVecType
MatFactorGetSchurComplement MatMFFDSetFunction MatShellTestMult
MatFactorInvertSchurComplement MatMFFDSetFunctionError MatShellTestMultTranspose
MatFactorRestoreSchurComplement MatMFFDSetFunctioni MatStashGetInfo
MatFactorSolveSchurComplement MatMFFDSetFunctioniBase MatStoreValues
MatFactorSolveSchurComplementTranspose MatMFFDSetHHistory MatSubdomainsCreateCoalesce
MatGetColumnVector MatMFFDSetOptionsPrefix MatTransColoringApplyDenToSp
MatGetDiagonalBlock MatMFFDSetPeriod MatTransColoringApplySpToDen
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
MATDUMMY MatGetColumnIJ MatNestGetSize
MatBackwardSolve MatGetColumnReductions MatNestGetSubMat
MatCheckCompressedRow MatGetNearNullSpace MatNestGetSubMats
MatCholeskyFactor MatGetNullSpace MatNestSetSubMat
MatCholeskyFactorNumeric MatGetOperation MatNestSetVecType
MatCholeskyFactorSymbolic MatGetOwnershipRangeColumn MatNullSpaceGetVecs
MatColoringPatch MatGetRowIJ MatQRFactor
MatCreateLocalRef MatGetTransposeNullSpace MatQRFactorNumeric
MatCreateSubMatrixVirtual MatICCFactor MatQRFactorSymbolic
MatDenseCUDAGetArray MatICCFactorSymbolic MatRegisterRootName
MatDenseCUDAGetArrayRead MatILUFactor MatResidual
MatDenseCUDAGetArrayWrite MatILUFactorSymbolic MatRestoreColumnIJ
MatDenseCUDAPlaceArray MatISGetMPIXAIJ MatRestoreRowIJ
MatDenseCUDAReplaceArray MatIncreaseOverlap MatSOR
MatDenseCUDAResetArray MatIncreaseOverlapSplit MatSeqAIJCUSPARSEGetArray
MatDenseCUDARestoreArray MatInitializePackage MatSeqAIJCUSPARSEGetArrayRead
MatDenseCUDARestoreArrayRead MatIsShell MatSeqAIJCUSPARSEGetArrayWrite
MatDenseCUDARestoreArrayWrite MatLUFactor MatSeqAIJCUSPARSEGetIJ
MatDensePlaceArray MatLUFactorNumeric MatSeqAIJCUSPARSERestoreArray
MatDenseReplaceArray MatLUFactorSymbolic MatSeqAIJCUSPARSERestoreArrayRead
MatDenseResetArray MatMFFD MatSeqAIJCUSPARSERestoreArrayWrite
MatDiagonalScaleLocal MatMFFDFinalizePackage MatSeqAIJCUSPARSERestoreIJ
MatFactorClearError MatMFFDInitializePackage MatSeqAIJGetCSRAndMemType
MatFactorGetCanUseOrdering MatMFFDRegister MatSeqAIJSetPreallocationCSR
MatFactorGetPreferredOrdering MatMFFDRegisterAll MatSetBindingPropagates
MatFactorInfo MatMPIAIJGetLocalMat MatSetBlockSizesFromMats
MatFactorInfoInitialize MatMPIAIJGetLocalMatCondensed MatSetOperation
MatFactorSetSchurIS MatMPIAIJGetLocalMatMerge MatSetUnfactored
MatFinalizePackage MatMPIAIJSetPreallocationCSR MatSolve
MatFindOffBlockDiagonalEntries MatMPIAdjCreateNonemptySubcommMat MatSolveAdd
MatFindZeroDiagonals MatMPISELLGetLocalMatCondensed MatSolveTranspose
MatForwardSolve MatMatSolve MatSolveTransposeAdd
MatGalerkin MatMatSolveTranspose MatSolves
MatGetBindingPropagates MatMatTransposeSolve MatSubMatrixVirtualUpdate
MatGetBrowsOfAcols MatMultDiagonalBlock
No deprecated routines

Table of Contents