PETSc version v3.15.4-864-ge36148cd4c

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 MATSOLVERSSTRUMPACK MatMumpsGetInfog
MATAIJCRL MATSOLVERSUPERLU MatMumpsGetInverse
MATAIJCUSPARSE MATSOLVERSUPERLU_DIST MatMumpsGetInverseTranspose
MATAIJMKL MATSOLVERUMFPACK MatMumpsGetRinfo
MATAIJPERM Mat MatMumpsGetRinfog
MATAIJSELL MatAssemblyBegin MatMumpsSetCntl
MATAIJVIENNACL MatAssemblyEnd MatMumpsSetIcntl
MATBAIJ MatAssemblyType MatOption
MATBAIJMKL MatColoring MatOrderingType
MATDENSE MatColoringType MatPartitioning
MATDENSECUDA MatComputeBandwidth MatPartitioningType
MATELEMENTAL MatCreate MatProductAlgorithm
MATHTOOL MatCreateSubMatrixOption MatProductType
MATMPIADJ MatDestroy MatPropagateSymmetryOptions
MATMPIAIJ MatDuplicateOption MatResetPreallocation
MATMPIAIJCUSPARSE MatFDColoring MatReuse
MATMPIBAIJ MatFactorError MatSORType
MATMPIDENSE MatFactorShiftType MatSTRUMPACKSetColPerm
MATMPIDENSECUDA MatFactorType MatSTRUMPACKSetHSSAbsTol
MATMPISBAIJ MatGetLocalSize MatSTRUMPACKSetHSSLeafSize
MATMPISELL MatGetOwnershipRange MatSTRUMPACKSetHSSMaxRank
MATSBAIJ MatGetOwnershipRanges MatSTRUMPACKSetHSSMinSepSize
MATSCALAPACK MatGetOwnershipRangesColumn MatSTRUMPACKSetHSSRelTol
MATSELL MatGetSize MatSTRUMPACKSetReordering
MATSEQAIJ MatHasCongruentLayouts MatSetFromOptions
MATSEQAIJCUSPARSE MatHtoolClusteringType MatSetPreallocationCOO
MATSEQAIJVIENNACL MatHtoolCompressorType MatSetSizes
MATSEQBAIJ MatInfoType MatSetStencil
MATSEQDENSE MatLoad MatSetUp
MATSEQDENSECUDA MatMFFDType MatSetValue
MATSEQSBAIJ MatMkl_PardisoSetCntl MatSetValues
MATSOLVERCHOLMOD MatMult MatSetValuesBlockedStencil
MATSOLVERCUSPARSE MatMultAdd MatSetValuesCOO
MATSOLVERESSL MatMultConstrained MatSetValuesStencil
MATSOLVERKLU MatMultHermitianTranspose MatSolverType
MATSOLVERLUSOL MatMultHermitianTransposeAdd MatStencil
MATSOLVERMATLAB MatMultTranspose MatStructure
MATSOLVERMKL_PARDISO MatMultTransposeAdd MatSuperluSetILUDropTol
MATSOLVERMUMPS MatMultTransposeConstrained MatTransposeColoring
MATSOLVERPASTIX MatMumpsGetCntl MatType
MATSOLVERSPARSEELEMENTAL MatMumpsGetIcntl MatView
MATSOLVERSPQR MatMumpsGetInfo MatXAIJSetPreallocation
Intermediate - Setting options for algorithms and data structures
MATHYPRE MatDuplicate MatProductCreate
MATMFFD_DS MatEqual MatProductCreateWithMat
MATMFFD_WP MatFDColoringSetValues MatProductNumeric
MATNEST MatFactorGetSolverType MatProductReplaceMats
MATSOLVERBAS MatFindNonzeroRows MatProductSetAlgorithm
MatAXPY MatFindZeroRows MatProductSetFill
MatAYPX MatGetBlockSize MatProductSetFromOptions
MatBindToCPU MatGetBlockSizes MatProductSetType
MatBlockMatSetPreallocation MatGetColumnMeans MatProductSymbolic
MatCUSPARSEFormatOperation MatGetColumnMeansImaginaryPart MatProductView
MatCUSPARSESetFormat MatGetColumnMeansRealPart MatPtAP
MatCUSPARSEStorageFormat MatGetColumnNorms MatPtAPMultEqual
MatChop MatGetColumnSums MatPythonCreate
MatColoringWeightType MatGetColumnSumsImaginaryPart MatPythonSetType
MatConvert MatGetColumnSumsRealPart MatRARt
MatCopy MatGetDiagonal MatRARtMultEqual
MatCreateAIJ MatGetFactor MatReorderForNonzeroDiagonal
MatCreateAIJCUSPARSE MatGetFactorAvailable MatRestoreLocalSubMatrix
MatCreateAIJViennaCL MatGetFactorType MatRestrict
MatCreateBAIJ MatGetInfo MatSTRUMPACKReordering
MatCreateBAIJMKL MatGetLocalSubMatrix MatScaLAPACKGetBlockSizes
MatCreateBlockMat MatGetNonzeroState MatScaLAPACKSetBlockSizes
MatCreateCentering MatGetOption MatScale
MatCreateDense MatGetOwnershipIS MatScatterGetVecScatter
MatCreateDenseCUDA MatGetRowMax MatSeqAIJGetArray
MatCreateFFT MatGetRowMaxAbs MatSeqAIJGetArrayRead
MatCreateHermitianTranspose MatGetRowMin MatSeqAIJGetMaxRowNonzeros
MatCreateHtoolFromKernel MatGetRowMinAbs MatSeqAIJKron
MatCreateLRC MatGetRowSum MatSeqAIJRestoreArray
MatCreateMPIAIJCRL MatGetSeqNonzeroStructure MatSeqAIJRestoreArrayRead
MatCreateMPIAIJMKL MatGetType MatSeqAIJSetPreallocation
MatCreateMPIAIJPERM MatGetVariableBlockSizes MatSeqAIJSetType
MatCreateMPIAIJSELL MatGetVecType MatSeqBAIJGetArray
MatCreateMPIAIJWithArrays MatHYPRESetPreallocation MatSeqBAIJRestoreArray
MatCreateMPIAdj MatHermitianTranspose MatSeqBAIJSetPreallocation
MatCreateMPIBAIJWithArrays MatHermitianTransposeGetMat MatSeqDenseSetPreallocation
MatCreateMPISBAIJWithArrays MatISSetPreallocation MatSeqSBAIJGetArray
MatCreateNormal MatInfo MatSeqSBAIJRestoreArray
MatCreateNormalHermitian MatInterpolate MatSeqSBAIJSetPreallocation
MatCreateSBAIJ MatInterpolateAdd MatSeqSELLRestoreArray
MatCreateSELL MatIsHermitian MatSeqSELLSetPreallocation
MatCreateScaLAPACK MatIsHermitianTranspose MatSetBlockSize
MatCreateScatter MatIsLinear MatSetBlockSizes
MatCreateSeqAIJ MatIsStructurallySymmetric MatSetFactorType
MatCreateSeqAIJCRL MatIsSymmetric MatSetLocalToGlobalMapping
MatCreateSeqAIJCUSPARSE MatIsTranspose MatSetOption
MatCreateSeqAIJFromTriple MatLRCGetMats MatSetRandom
MatCreateSeqAIJMKL MatMPIAIJGetSeqAIJ MatSetType
MatCreateSeqAIJPERM MatMPIAIJSetPreallocation MatSetValuesBlocked
MatCreateSeqAIJSELL MatMPIAdjSetPreallocation MatSetValuesBlockedLocal
MatCreateSeqAIJViennaCL MatMPIAdjToSeq MatSetValuesLocal
MatCreateSeqAIJWithArrays MatMPIBAIJSetPreallocation MatSetValuesRowLocal
MatCreateSeqBAIJ MatMPIDenseSetPreallocation MatSetVariableBlockSizes
MatCreateSeqBAIJMKL MatMPISBAIJSetPreallocation MatSetVecType
MatCreateSeqCUFFT MatMPISELLSetPreallocation MatShift
MatCreateSeqDense MatMatInterpolate MatSolveTypeGet
MatCreateSeqDenseCUDA MatMatInterpolateAdd MatSolverTypeRegister
MatCreateSeqSBAIJ MatMatMatMult MatStashSetInitialSize
MatCreateSeqSELL MatMatMult MatTranspose
MatCreateTranspose MatMatMultEqual MatTransposeColoringCreate
MatDenseGetArray MatMatRestrict MatTransposeColoringDestroy
MatDenseGetArrayRead MatMatTransposeMult MatTransposeGetMat
MatDenseGetArrayWrite MatMatTransposeMultEqual MatTransposeMatMult
MatDenseGetColumn MatMkl_CPardisoSetCntl MatTransposeMatMultEqual
MatDenseGetColumnVec MatMultAddEqual MatUpdateMPIAIJWithArrays
MatDenseGetColumnVecRead MatMultEqual MatViewFromOptions
MatDenseGetColumnVecWrite MatMultTransposeAddEqual MatZeroEntries
MatDenseGetLDA MatMultTransposeEqual MatZeroRows
MatDenseGetLocalMatrix MatNorm MatZeroRowsColumns
MatDenseGetSubMatrix MatNormalGetMat MatZeroRowsColumnsIS
MatDenseRestoreArray MatNormalHermitianGetMat MatZeroRowsColumnsLocal
MatDenseRestoreArrayRead MatPreallocateFinalize MatZeroRowsColumnsLocalIS
MatDenseRestoreArrayWrite MatPreallocateInitialize MatZeroRowsColumnsStencil
MatDenseRestoreColumn MatPreallocateLocation MatZeroRowsIS
MatDenseRestoreColumnVec MatPreallocateSet MatZeroRowsLocal
MatDenseRestoreColumnVecRead MatPreallocateSetLocal MatZeroRowsLocalIS
MatDenseRestoreColumnVecWrite MatPreallocateSetLocalBlock MatZeroRowsStencil
MatDenseRestoreSubMatrix MatPreallocateSetLocalRemoveDups VecScatterFFTWToPetsc
MatDenseSetLDA MatPreallocateSymmetricSetBlock VecScatterPetscToFFTW
MatDiagonalScale MatPreallocateSymmetricSetLocalBlock
MatDiagonalSet MatProductClear
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