# TaoWrapPetscMat

Creates a new TaoMat object using a PETSc matrix.

## Synopsis

    int TaoWrapPetscMat( Mat M, TaoMatPetsc* *MM)

## Input Parameter

| M | - a PETSc matrix
| MM | - the address of a pointer to a TaoMatPetsc

## Output Parameter

MM -the address of a pointer to new TaoMat

## Note

A TaoMatPetsc is an object with the methods of an abstract TaoMat object. A TaoMatPetsc contains an implementation of the TaoMat methods. Routines using these vectors should declare a pointer to a TaoMat, assign this pointer to the address of a TaoMat object, use the pointer to invoke methods on the object, and use this pointer as an argument when calling other routines. This usage is different from the usage of a PETSc Mat. In PETSc, applications will typically declare a Mat, and pass it as an argument into routines. That is, applications will typically declare a pointer to a TaoMat and use the pointer, or declare a Mat and use it directly.

## Note

The user is repsonsible for destroying the Mat M, in addition to to TaoMatPetsc vector MM. The Mat can be destroyed immediately after this routine.

## See Also

TaoMatGetPetscMat(), TaoMatDestroy()

Level:developer
Location:src/petsctao/matrix/taomat_petsc.c
TAO Solver Index
Table of Contents