PETSc version 3.16.0

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

Table of Contents