Zhu, Yan - 2007-10-16

I saved some data by using itsave.m. I try to open and read it in my C++ program. However, It seems that some variables can not be successful read and whether it can or can not be read out is dependent on the order that you read the data. So I guess when I use the operator>> to read the .it file, it_file only read from where it stopped after last time calling operator>>. Therefore, How you guys dealing with this problem.

Here is a sample of my code:

[code]

include<iostream>

include "message.hpp"

using namespace std;
using namespace itpp;

int main()
{
it_file FF("debug.it");
cvec output;
vec sigma2H;
cvec alpha;
ivec pilot1;
mat ExP_M;
double sigma2N;
FF>>Name("sigma2H")>>sigma2H;
cout<<"read sigma2H: "<<sigma2H;
FF>>Name("output")>>output;
cout<<"read output: "<<output<<endl;
cout<<"read sigma2H: "<<sigma2H<<endl;
//FF>>Name("alpha")>>alpha;
//FF>>Name("sigma2N")>>sigma2N;
FF>>Name("pilot1")>>pilot1;
FF>>Name("ExP_M")>>ExP_M;
cout<<"ExP_M = "<<ExP_M<<endl;
return 1;
}
[/code]