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
 problem with numbrer of rows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

22111967

Czech Republic
Posts

Posted - 04/24/2008 :  10:33:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System:XP

This procedure:

double to_degr( double x ) {
double pix = 3.1415926;
return x / pix * 180;
}

void prevod2()
{
Worksheet wks = Project.ActiveLayer();
Dataset a, b, c, d, e, f, g, h;

a.Attach(wks, 0);
b.Attach(wks, 1);
c.Attach(wks, 2);
d.Attach(wks, 3);
e.Attach(wks, 4);
f.Attach(wks, 5);
g.Attach(wks, 6);
h.Attach(wks, 7);

unsigned int pocet_riadkov = a.GetSize();
double sucet = 0;
double pix = 3.1415926;


for( unsigned int i = 0; i < pocet_riadkov ; i++ ) {

double tmp = atan( abs( b[i] / a[i] ) );

if ( (a[ i ] > 0) && (b[ i ] > 0) ) {
e[ i ] = tmp;
}

if ( (a[ i ] < 0) && (b[ i ] > 0 )) {
e[ i ] = pix - tmp;
}

if ( (a[ i ] < 0) && (b[ i ] < 0 )) {
e[ i ] = - pix + tmp;
}

if ( (a[ i ] > 0) && (b[ i ] < 0 )) {
e[ i ] = - tmp;
}



d[i] = sqrt( a[i]*a[i] + b[i]*b[i] );
f[i] = to_degr( e[i] );


}

printf("fin!\n");
}

working up to [i] = 9957 and after turn off with "Error: Failed to execute script"
Number of rows is 40 000.

You have some idea, please ??

jan

Echo_Chu

China
Posts

Posted - 04/30/2008 :  05:04:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Jan,

I have filled 40000 random number to first 8 columns and run your code.It has no problem. The problem might be caused by your data file. Would you mind to send it to us and let's look into it?

Echo
OriginLab Corp
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