[Trilinos-Users] Conversion from Teuchos::Array to Epectra_Vector

Baker, Christopher G. bakercg at ornl.gov
Thu Jul 14 11:39:34 MDT 2011


Shota, 

Since you are using Teuchos::Array, I would assume that the data is not
too large. In that case, I would simply write it to a ASCII text file;
MATLAB loads these very easily.

I would loop over all of the elements in the array:
ofstream out("data.txt")
for (int i=0; i < array.size(); ++i) { out << array[i] << endl; }
out.close();

Then, in MATLAB, simply load the file:
array = load('data.txt');



Chris

On 7/14/11 1:31 PM, "Shota Soga" <ssoga at ncsu.edu> wrote:

>Dear Sir/Madam:
>
>    Hi, I am Shota Soga, a graduate student at NCSU.
>
>I have a question how to convert Teuchos::Array to Epectra_Vector so that
>I
>can export Teuchos::Array into MatrixMarket format by EpetraExt. I would
>greatly appreciate it if you would answer my question.
>
>I would like to access Teuchos::Array data by MATLAB. Is there any
>possible
>way to convert Teuchos::Array into Epectra_Vector?
>
>
>Thank you for your help and kindness.
>
>Sincerely,
>
>-- 
>Shota Soga
>Graduate Research Assistant at North Carolina State University
>
>Email: ssoga at ncsu.edu





More information about the Trilinos-Users mailing list