[petsc-users] question about extracting numbers from a matrix

Jim Fonseca jefonseca at gmail.com
Tue Jun 25 10:36:42 CDT 2013


Hi Michael,
It's a change in the API for PETSc 3.4
http://www.mcs.anl.gov/petsc/documentation/changes/34.html

   - MatGetArray()/MatRestoreArray() have been remove d. Use
   MatDenseGetArray()/MatDenseRestoreArray() or
   MatSeqAIJGetArray()/MatSeqAIJRestoreArray()

Thanks,
Jim

On Tue, Jun 25, 2013 at 11:22 AM, Michael Povolotskyi
<mpovolot at purdue.edu>wrote:

> On 06/24/2013 06:07 PM, Jed Brown wrote:
>
>> Michael Povolotskyi <mpovolot at purdue.edu> writes:
>>
>>  Hello everybody,
>>> I have a sparse matrix defined on 1 MPI process.
>>> I want to extract all entries from it (including zeros) and put them
>>> into an array to use as an argument for some lapack functions.
>>> What is the most optimal way of doing this?
>>>
>> Mat A_dense;
>> PetscScalar a;
>> MatConvert(A,MATDENSE,MAT_**INITIAL_MATRIX,&A_dense);
>> MatDenseGetArray(A_dense,&a);
>>
> What is the difference (if any) between  MatDenseGetArray and MatGetArray?
>
>
> --
> Michael Povolotskyi, PhD
> Research Assistant Professor
> Network for Computational Nanotechnology
> 207 S Martin Jischke Drive
> Purdue University, DLR, room 441-10
> West Lafayette, Indiana 47907
>
> phone: +1-765-494-9396
> fax: +1-765-496-6026
>
>


-- 
Jim Fonseca, PhD
Research Scientist
Network for Computational Nanotechnology
Purdue University
765-496-6495
www.jimfonseca.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130625/771ff4cd/attachment.html>


More information about the petsc-users mailing list