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
 LabTalk Forum
 inefficient curve object?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

eno

Japan
34 Posts

Posted - 12/01/2005 :  10:58:50 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version :7.5SR5
Operating System:Win XP Pro SP2

Hi all,

I have a dataset that has 3,000,000 rows in col(b) (col(a) is
data&time), and want to do an adjacet average on col(b) using
the following script. However, it is extremely inefficient (it may
fall into an infinite loop). When I do not use %o!wks.maxrows
for loop, the situation can not be improved.

What's a problem?

%o="data1";
%p="_b";
time=5;
spts=3*6*60;
win -t D;
%w=%h;
loop(ii,time*6*60+1,%o!wks.maxrows)
{
bigini=ii-time*6*60;
endi=ii-1;
curve.data$=%o%p;
curve.result$=%w%p;
curve.i1=$(bigini);
curve.i2=$(endi);
curve.smoothpts=$(spts);
curve.adjave();
%(%o,3,ii)=%(%w,2,%w!wks.maxrows);
clearworksheet %w;
};
win -cd %w;

eno

rlewis

Canada
253 Posts

Posted - 12/02/2005 :  06:26:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Given the size of your dataset, investing in an an OriginC solution may be worthwhile ....

The OriginC function "smooth" should do the trick
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