/* * Example code testing SeqDense matrices with an LDA (leading dimension * of the user-allocated arrray) larger than M. * This example tests the functionality of MatInsertValues, MatMult, * and MatMultTranspose. */ #include #include "petscmat.h" #undef __FUNCT__ #define __FUNCT__ "main" int main(int argc,char **argv) { Mat A,A11,A12,A21,A22; Vec X,X1,X2,Y,Z,Z1,Z2; PetscScalar *a,*b,*x,*y,*z,v,one=1; PetscReal nrm; PetscErrorCode ierr; PetscInt size=8,size1=6,size2=2, i,j; PetscInitialize(&argc,&argv,0,0); /* * Create matrix and three vectors: these are all normal */ ierr = PetscMalloc(size*size*sizeof(PetscScalar),&a);CHKERRQ(ierr); ierr = PetscMalloc(size*size*sizeof(PetscScalar),&b);CHKERRQ(ierr); for (i=0; i