The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 strange problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ovince

Yugoslavia
Posts

Posted - 10/27/2006 :  03:43:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
hi,

I have a very strange problem with Append() function.

In the example bellow, I calculate Dataset q (red) and what is appended to Worksheet wksNew (green) is not the same as q. I am checking the first element of q (pink) in the loop and what is appended to wksNew is not the same number. I check for other elements (q[1]....) also and the result is the same.

In summary, within the loop everything is calculated correctly but something goes wrong when append with Append().

what I do wrong?

//take 1st column
Dataset curr( wks, 1);

for (int j=2; j<11; j++)
{
//take next columns
Dataset next( wks, j );
printf("ln(HaHb): %f\n", ln(HaHb[j-1]/HaHb[0]));
Dataset div = -ln(next / curr);
printf("div[0]: %f\n", div[0]);
Dataset q = div/ln( HaHb[j-1]/HaHb[0] );
printf("q[0]: %f\n", q[0]);
Dataset tmpY(wksNew, j-1);
tmpY.Append(q);
}



oliver

ovince

Yugoslavia
Posts

Posted - 10/27/2006 :  04:44:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi

I found the problem. Sorry to everybody for false alarm

oliver
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000