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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 problem with numbrer of rows

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
22111967 Posted - 04/24/2008 : 10:33:42 AM
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

1   L A T E S T    R E P L I E S    (Newest First)
Echo_Chu Posted - 04/30/2008 : 05:04:01 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000