English
Forum

Routine rapid for Durchschnittsbildung from array sought

 
- Page 1 -



KHR
Hello together,

.

i want a large crowd Meßdaten aufbereiten and then as curve(n) present. The data go a File read and Arrays zwischengelagert

circa heavy flackernde Meßwerte in a übersichtlichen curve present to would like I these over Durchschnittsbildung calm the whole should then in the finished Program for five zahlenreihen weg

yet make I the in something so:

there's 5 arrays with 100 elementen Float-variables , with beginn with 0 filled

One set Meßwerte becomes read, each aray sustain one element registered

for each aray becomes the average determined,

The jeweiligen spots go geplottet

and moreover goes it with the next Datensatz Meßwerte.

Since I yet whom average with while-wend creep errechne, becomes everything infinite slow. self with Profan2cpp lasts it minutes To the screen vollgekritzelt is.

here time one integrally kurzer statement the data How tappt im dunkeln exist. real having The Files often over ten- or quite zwanzigtausend Datensätze (Lines)

25.07.2007;08:22:53;1874;63.3;0.019387;0.023140;0.024151;0.022312;-----;-----
25.07.2007;08:22:54;1871;63.3;0.028538;0.022725;0.025337;0.022793;-----;-----
25.07.2007;08:22:55;1914;63.3;0.024311;0.023610;0.022366;0.022739;-----;-----
25.07.2007;08:22:56;1889;63.3;0.021887;0.023453;0.019952;0.022303;-----;-----
25.07.2007;08:22:57;1895;63.3;0.027712;0.023644;0.021144;0.022193;-----;-----
25.07.2007;08:22:58;1902;63.3;0.023383;0.023765;0.022752;0.022195;-----;-----
25.07.2007;08:22:59;1891;63.3;0.026178;0.023538;0.022319;0.022224;-----;-----
25.07.2007;08:23:00;1912;63.3;0.024255;0.023965;0.021904;0.022195;-----;-----
25.07.2007;08:23:01;1898;63.3;0.021041;0.023673;0.024442;0.022237;-----;-----
25.07.2007;08:23:02;1895;63.3;0.024243;0.023550;0.022202;0.022322;-----;-----
25.07.2007;08:23:03;1919;63.3;0.029875;0.023874;0.022494;0.022521;-----;-----
25.07.2007;08:23:04;1930;63.3;0.027768;0.024126;0.022018;0.022461;-----;-----
25.07.2007;08:23:05;1914;63.3;0.020411;0.023905;0.020469;0.022334;-----;-----
25.07.2007;08:23:06;1915;63.3;0.027465;0.023837;0.023016;0.022474;-----;-----
25.07.2007;08:23:07;1924;63.3;0.020727;0.023959;0.023631;0.022536;-----;-----
25.07.2007;08:23:08;1891;63.3;0.020876;0.023436;0.021933;0.022374;-----;-----
25.07.2007;08:23:09;1867;63.3;0.020627;0.023159;0.020591;0.022087;-----;-----
....
the first both Split Date and Time are uninteressant, first thereafter GEHTS correctly. go.

to lauter frustration over my Ideenlosigkeit Have I The recent Codes deleted
has there someone ne idea, How so what faster weg could??

be hold unfortunately still no Programmer separate only one Profan-Wurschtler.
 
Gruß
Karl-Heinz
WIN XP home/Pro / XPROFAN 11 / P2CPP
ATMEL + BASCOM Fan
06/03/08  
 



 
- Page 2 -



KHR
Hello together,

.

Freut me, that I so much dust aufgewirbelt have. there exists Yes ne real chance, that I ne Solution my Geschwindigkeitsproblem find before Intel a P9 with 34000facher Rechenleistung on the market brint.

in the TXT-File are so on The 8000 Datensätze.

in the JPG is displayed, what now with my Program with the statement rauskommt.

this partly wirre Gekritzel would like I calm, so that I ne curve get can.

Each line is ne Datenreihe. I habs time with plenty patience probiert. If I the story from 30 Datensätzen take, becomes it already much better, but there's Cases, there ought to one already 100 take, so to the whole sensible image can.

means once more:

each the spots on the abgebildeten lines would like I by a Mittelwertbildung calm. Each line has ca 6000 (virtual)spots, 5 Kurven are displayed - means should I for each Page 30000 time by the Mittelwertbildung weg and moreover still always The data correctly. provide

the best, I of these data in this dissolution geschafft have, were even P2CPP 3 minutes.

for a Image would the still acceptable, if one but still weiterblättern wants, Better get going very very tedious

Übrigens: not that your think, i want you here free for my employers einspannen. Neee Neee

the Program is a Tool, that I for me and my work zusammenbastele. I geb it too now and then time nem customers moreover - but everything free and just for fun. there stick no Komerz behind it only my Laziness defined Auswertungen plainer having To want

.

.

913 kB
Hochgeladen:06/04/08
Downloadcounter131
Download
179 kB
Hochgeladen:06/04/08
Downloadcounter135
Download
 
Gruß
Karl-Heinz
WIN XP home/Pro / XPROFAN 11 / P2CPP
ATMEL + BASCOM Fan
06/04/08  
 




Frank
Abbing

Each line is ne Datenreihe. I habs time with plenty patience probiert. If I the story from 30 Datensätzen take, becomes it already much better, but there's Cases, there ought to one already 100 take, so to the whole sensible image can.


I make straight Ähnliches. though with less Values what about me verfahre so, three values to a story together To calculate, take off my tack enough is.

an your Files let itself by the List view.dll binnen less hundred Millisekunden reading. once read can tappt im dunkeln for each slot separated the value all Lines together calculate, so You slight whom story form could. but You möchstest Yes only always a defined amount zusammenrechnen... there should a new function since The the Done.
on the other hand would it sure rather The whole Umrechnung without whom detour over The Dll To make, there You The values Yes only visuell present want. the ought to in Assembler on the fastest possible his, where the Hauptproblem The Benutzung of Fliesskommazahlen is. here goes plenty Rechenzeit lost.
I could you offer me at a Assemblerfunktion To try, The You through XPIA or as Dll in your Program integrate could. The would vaguely so looks:

Mediate(datenfile#, newdatas#, spalte&, anzahlmittlungsdaten&)

Return Value would The amount gebildeter Mittelwerte, The in newdatas# as Longwerte one after another written been are.

from your 3 minutes Berechnungszeit would then schätzungsweise little (3-4) sec go.
 
06/04/08  
 



with reinem XProfan come I on 6.2 sec (10652 Datensätze with each 10 Split and with even dynamic Tabellenbreite and relatively plainer but effective Glättung. (see Image)

Dou you mean something like?

17 kB
Hochgeladen:06/05/08
Downloadcounter149
Download
 
06/04/08  
 




Thomas
Freier
@Frank, then offering us still Please The story-function of/ one slot (max., mins. and amount having we already). And if possible a function, The The Number of with Values gefüllten Items of/ one slot determined.
 
Gruß Thomas
Windows XP SP2, XProfan X2
06/04/08  
 



here the Source to that Image...

contain a function createHPicByStats(data$,xx,yy) and supply one Bildhandle the Statistik back. The Ausgabegrösse can by Pixel xx and yy tuned go. with the function can too to Laufzeit by String such one à ¶ Open produce. in the cover standing The Number of required Millisekunden.

Orginalcode: [...] 

without xpse
CompileMarkSeparation
WINDOW 100,100 - 700,500
CLS $888888
var TME&=&GETTICKCOUNT
var HPIC&=CREATEHPICBYSTATS(FILE_GET_CONTENTS(fme-300-test.txt),600,420)
SETTEXT %HWND,STR$(&GETTICKCOUNT-TME&)+ ms
DRAWPIC HPIC&,10,10;0
USERMESSAGES $0014

WHILE 1

    WAITINPUT

ENDWHILE

end

proc CREATEHPICBYSTATS

    PARAMETERS S$,XX&,YY&
    DECLARE LN$[],HDR$[],ENTI$[]
    LN$[]=EXPLODE(S$+
    ,
    )
    var C&=SIZEOF(LN$[])
    HDR$[]=EXPLODE(LN$[0],;)
    var HDRC&=SIZEOF(HDR$[])
    var F!=0
    var F2!=0
    DECLARE VMIN![HDRC&],VMAX![HDRC&],V![HDRC&,C&],VMM![HDRC&],COL&[IF(HDRC&>7,HDRC&,8)],COLB&[HDRC&],OLDF![HDRC&]
    MAT VMIN![]=999999999999999
    MAT VMAX![]=-999999999999999
    DEC HDRC&
    DEC C&
    COL&[0]=$FF0000
    COL&[1]=$00FF00
    COL&[2]=$0000FF
    COL&[3]=$880000
    COL&[4]=$008800
    COL&[5]=$000088
    COL&[6]=$FF8800
    COL&[7]=$00FF88
    var CL&=0

    WHILE 1

        INC CL&

        IFNOT CL&<C&

            BREAK

        ENDIF

        ENTI$[]=EXPLODE(LN$[CL&],;)
        SETSIZE ENTI$[],HDRC&+1

        WHILELOOP 0,HDRC&

            F!=VAL(ENTI$[&LOOP])
            V![&LOOP,CL&]=F!

            IF VMIN![&LOOP]>F!

                VMIN![&LOOP]=F!

            ENDIF

            IF VMAX![&LOOP]<F!

                VMAX![&LOOP]=F!

            ENDIF

        ENDWHILE

    ENDWHILE

    var I&=0
    var A!=0

    WHILELOOP 0,HDRC&

        VMM![&LOOP]=(VMAX![&LOOP]-VMIN![&LOOP])
        A!=V![&LOOP,1]
        F!=VMM![&LOOP]

        IF F!=0

            CONTINUE

        ENDIF

        F2!=A!-VMIN![&LOOP]

        IF F2!=0

            CONTINUE

        ENDIF

        OLDF![&LOOP]=(F2!/F!*YY&)

    ENDWHILE

    var Y!=0
    var HOP!=C&/XX&
    var XH!=1
    var YYHOP!=YY&*0.1
    var X&=0
    var HPIC&=CREATE(hNewPic,XX&,YY&,$FFFFFF)
    STARTPAINT HPIC&

    WHILE 1

        INC X&

        WHILELOOP 0,HDRC&

            F!=VMM![&LOOP]

            IFNOT F!=0

                F2!=V![&LOOP,XH!]-VMIN![&LOOP]

                IFNOT F2!=0

                    F!=(OLDF![&LOOP]*0.9)+(F2!/F!*YYHOP!)

                ELSE

                    F!=(OLDF![&LOOP]*0.9)

                ENDIF

                USEPEN 0,0,COL&[&LOOP]
                LINE (X&-1),(YY&-OLDF![&LOOP]) - (X&),(YY&-F!)
                OLDF![&LOOP]=F!

            ENDIF

        ENDWHILE

        XH!=XH!+HOP!

        IF XH!>C&

            BREAK

        ENDIF

    ENDWHILE

    ENDPAINT
    RETURN HPIC&

endproc

proc FILE_GET_CONTENTS

    PARAMETERS FLE$
    var B&=FILESIZE(FLE$)

    IF B&<1

        RETURN

    ENDIF

    DECLARE MEM#
    DIM MEM#,B&
    var R&=BLOCKREAD(FLE$,MEM#,0,B&)
    var S$=CHAR$(MEM#,0,R&)
    DISPOSE MEM#
    RETURN S$

endproc

proc FILE_PUT_CONTENTS

    PARAMETERS FLE$,S$
    var L&=LEN(S$)

    IF L&=0

        var FH&=ASSIGN(FLE$)
        REWRITE FH&
        CLOSE FH&
        ASSIGN FH&,
        RETURN

    ENDIF

    DECLARE MEM#
    DIM MEM#,L&+1
    STRING MEM#,0=S$
    BLOCKWRITE FLE$,MEM#,0,L&
    DISPOSE MEM#

endproc

proc RGB.MIX

    PARAMETERS COL1&,COL2&,TRANSL!
    RETURN RGB(GETRVALUE(COL1&)*(1-TRANSL!)+GETRVALUE(COL2&)*(TRANSL!),GETGVALUE(COL1&)*(1-TRANSL!)+GETGVALUE(COL2&)*(TRANSL!),GETBVALUE(COL1&)*(1-TRANSL!)+GETBVALUE(COL2&)*(<
TRANSL!)) endproc end

If I now considerate thats method too slot 1 and column 2 mitberechnet (but here no numbers finds) then could I me present, that with small optimization To this point Perhaps even 4 To 5 instead of 6,8 sec access go can.

@KHR: How long needed the Algo for complete File?

17 kB
Hochgeladen:06/04/08
Downloadcounter169
Download
913 kB
Hochgeladen:06/04/08
Downloadcounter175
Download
1.020 kB
Hochgeladen:06/04/08
Downloadcounter125
Download
 
06/04/08  
 



hey typical - on my Notebook with 2,4GHz even only 6.2 sec, instead of as well as my DesktopPC with 3,2 GhZ 6.8 sec. has yet someone NEN 486dx4/100 herumzugammeln?
 
06/05/08  
 




Thomas
Freier
One quick zusammengestrickter Test over a doWhile- Loop is neither straight slow (here only for 4 Reihen with story/sec and over a *.dbf) .

856 kB
Hochgeladen:06/05/08
Downloadcounter107
Download
6 kB
Hochgeladen:06/05/08
Downloadcounter153
Download
6 kB
Hochgeladen:06/05/08
Downloadcounter139
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
06/05/08  
 



it sees so from as though You The Skalen not normalisierst - get the still fix installed?

and for a Performancevergleich would it imho necessary any 10 Split To mind. (the power my example too, though it with Date and Time naturally only 0 evaluiert and uses.)

means Skalen normalisieren (x and y) and any Split mind and then: duration abandon for Codeperformancevergleich.
 
06/05/08  
 




Thomas
Freier
@iF: from Zeitgründen have I it with 6 Values leave. The Hauptzeit becomes at create the *.dbf verbraten. here would one comparison to that Or list view GridBoxen yet interestingly. The Skalierung, if I tappt im dunkeln correctly. hinbekommen have, cost ca. 300ms with of/ one Endzeit of 3734 ms.
On my computer lying both Applications sure on same Höhe, if The further 4 values moreover come.

324 kB
Hochgeladen:06/05/08
Downloadcounter89
Download
16 kB
Hochgeladen:06/05/08
Downloadcounter222
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
06/05/08  
 



Hm, something is correct not the Normalisierung - The must automatically certainly go for each slot self-contained. in example have You a black Line in the middle, The is sozuagen not the whole Y-spectrum displayed. an Umrechnung to of/ one einstellbaren Ausgabegröße missing there too yet drin. ^^
 
06/05/08  
 




Thomas
Freier
@ iF: The black line is the temperature (in fme-300-Test.txt is max=64.8° - min=63.9°) . with of my Skalierung corresponds to 1° = 13.9 spots. More deflection comes there not out. its Temperaturanzeige goes of 44° To 80°. there helps only a filigranere graphic How with you. was but not my target .
 
Gruß Thomas
Windows XP SP2, XProfan X2
06/05/08  
 



I saw strain that I supra whom incorrect code posted having, the was a Vorversion.

The Orginalcode under [...]  was/is however the right.

I have whom without xpse-code supra korrigiert - now stimmts with Exe and Screenshot überein.

KHR had it strike must.
 
06/06/08  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.871 Views

Untitledvor 0 min.
H.Brill04/24/23
Jörg Sellmeyer05/30/18
iF11/06/14
Michael Wodrich02/26/14
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie