petsc-3.7.1 2016-05-15
Report Typos and Errors

# MatCreateADA

Creates a matrix M=A^T D1 A + D2 where D1, D2 are diagonal

### Synopsis

    #include "mat.h"
    PetscErrorCode MatCreateADA(Mat mat,Vec d1, Vec d2, Mat *J)

Collective on matrix Many br

### Input Parameters

| mat | - matrix of arbitrary type Many br
| d1 | - A vector with diagonal elements of D1 Many br
| d2 | - A vector Many br

### Output Parameters

J -New matrix whose operations are defined in terms of mat, D1, and D2. Many br

### Notes

The user provides the input data and is responsible for destroying Many brthis data after matrix J has been destroyed. Many brThe operation MatMult(A,D2,D1) must be well defined. Many brBefore calling the operation MatGetDiagonal(), the function Many brMatADAComputeDiagonal() must be called. The matrices A and D1 must Many brbe the same during calls to MatADAComputeDiagonal() and Many brMatGetDiagonal(). Many br

Many br

### See Also

MatCreate()

Level:developer
Location:src/tao/matrix/adamat.c
Index of all Tao routines
Table of Contents for all manual pages
Index of all manual pages