<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:verdana,helvetica,sans-serif;font-size:12pt">Hi,<br><br>I have a related question to the one above: what is the best way to create a purely diagonal matrix?<br>I am using<br>ierr = MatCreateMPIAIJ(comm,localM,localN,PETSC_DETERMINE,PETSC_DETERMINE,1, PETSC_NULL, 0, PETSC_NULL, &amp;lumpedMP);CHKERRQ(ierr);<br>But I would think there might be a even better (faster/less memory) way?<br><br>I thought about the BDiag Matrix. I tried<br>ierr=MatCreateMPIBDiag(comm,localM,globalSize,globalSize,PETSC_NULL,1,&nbsp; &nbsp;&nbsp;&nbsp; PETSC_NULL,PETSC_NULL,&amp;lumpedM);CHKERRQ(ierr);<br>but not sure if it is done correctly. I am a little suspicious about those pointers I set as NULL.<br><br>If the above two are both correct, is there a better one?<br><br>Thank you very much.<br><div>&nbsp;</div>--<br>Shi Jin, PhD<div><br></div></div><br>
      <hr size=1>Special deal for Yahoo! users & friends - <a href="http://us.rd.yahoo.com/evt=47521/*http://tc.deals.yahoo.com/tc/blockbuster/text3.com
">No Cost. Get a month of Blockbuster Total Access</a> now</body></html>