tao-2.1-p0 2012-07-24


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


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

Input Parameters

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

Output Parameters

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


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

See Also


TAO Solver Index
Table of Contents