[petsc-users] Question - read text file

Matthew Knepley knepley at gmail.com
Tue Oct 27 12:32:31 CDT 2015


On Fri, Oct 23, 2015 at 2:21 PM, Marcelo Xavier Guterres <
m.guterres at gmail.com> wrote:

> Dear friends,
>
> I need to read a matrix from a text file (txt).
>
> This matrix has a high dimension (2000 X 2000) .
>
> Example: date.txt - provision in the text file:
>
> 1 2 3 5
> 5 5 7 8
> 5 6 8 9
>
>
> What's the proper way to perform the action?
>

Read each row in and call MatSetValues() for that row.

  Thanks,

    Matt


> thanks for help
>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- -- -- -- -- -- --
> Marcelo Xavier Guterres
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- -- -- -- -- -- -
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151027/723f71ab/attachment.html>


More information about the petsc-users mailing list