Forum | | | | - Page 1 - |
| Andreas Koch | Hello together,
here has by me one small trouble with the Übergabe one Arrays on a nProc yield.
and of course comes each Time the attached Error Message (Application Crash), after the first Result ausgedruckt watts. can someone explain, I there wrong make? CompileMarkSeparation |
| | | | |
| | | | | - Page 1 - |
| Nico Madysa | so far I know, can Arrays not on NProcs transfer go. only reaches#, Strings$, Longs& and Floats! are allows. |
| | | | |
| | | Please see Datentypen: [...]
Nativ go (How of Nico already erwähnt) Strings, Floats & Longs supported.
If you a Wertekette How Arrays transfer want then fetch you simply
a memory z.B. by globalAlloc: CompileMarkSeparationvar meinSpeicher&=globalAlloc(gPTR,20)// 20 Byte Speicher reservieren und Handle in meinSpeicher& merken > and lay there into your values: CompileMarkSeparationlong meinSpeicher&,0=10,20,30,40,50 > One Long needed in memory 4 byte and a Float 8 -
5 Floats into memory lay means so: CompileMarkSeparation |
| |
| | Andreas Koch | thanks for response.
then have I iFs Posting here well something wrong interprets.
[...] |
| | | | |
| | | | | | | |
| | Nico Madysa | Presumably whom here: [...] because it therein so sound, as should one only the Schlüsselwort "proc" through "nproc" supplant and everything would knorke. |
| | | | |
| | Andreas Koch | open stood, had You only in keinem your Posts written, that with the Arrays none goes. I had the so interprets, that it too with Arrays functions (and me already gefreut...). really had I it from the last Posting entnehmen can, me was by then only yet never noticed, that one on APIs no Arrays commit. but presumably wanted You me there very the communicating, what now To this Topic here led has. Sorry for circumstances. be sometimes bisschen heavy of concept. |
| | | | |
| | | understand. the here once durchlesen: [...] -
its quasi one very very simple Profan but even as Support To XProfan
with all positive properties one nativen Profans.
open stood, had You only in keinem your Posts written, that with the Arrays none goes.
Yes, simply because the "soooo" indeed not integrally is correct, because even if The aray-
spelling not is used, so are Arrays Yes Datenketten and these against
are slight by memory anzufertigen and against too slight with nProcs
verwertbar. I had attempts for 1-2 Examples To give. If you not weiterkommst
then simply fix report because then basteln we the together. |
| | | | |
| | funkheld | Error Message: meineFloats undeklariert....
greeting |
| | | | |
| | | certainly because I one Undzeichen forget have:
getFloat(meineFloats&,8*3)
How written simply into editor here typed |
| | | | |
| | Andreas Koch | Sorry people, i'm again steckengeblieben. now have I The Arrays![] in reaches# transformed and the transfer, so far so well. it shining too with Procs correctly. To calculate. but with nProcs beschwert it itself in the procedure DreiecksmatrixTest first, that FHG% and Anzahl_Lastfaelle% not declared seien (though The still with transfer go). If I The deklariere, I get subsequently a seltsame Error Message, see Appendix. CompileMarkSeparationWindow 800,800
var Size%=6
Declare A#, Zeile&, Spalte&, Diagonale&, Faktor!, aux!,L#,Lastfall%,V#
DIM A#,Size%*Size%*8
DIM L#,Size%*8
DIM V#,Size%*8
Lastfall%=0
'Erzeugung zweier Zufallsmatrizen
WhileLoop 0,Size%-1
Spalte&=&loop
WhileLoop 0,Size%-1
Zeile&=&loop
SMAT(A#,Size%,Spalte&,Zeile&,1+Rnd())
If Spalte&<1
SMAT(L#,Size%,Spalte&,Zeile&,1+Rnd())
EndIf
EndWhile
EndWhile
'Umformung, Erzeugung einer Dreiecksmatrix
nproc DreiecksmatrixTest
Parameters A#, L#, FHG%, Anzahl_Lastfaelle%
Declare Diagonale&,Zeile&,Lastfall&,Faktor!,Spalte&, aux!, FHG%, Anzahl_Lastfaelle%
WhileLoop 0,(FHG%-1),1
Diagonale&=&loop
WhileLoop Diagonale&+1,FHG%-1,1
Zeile&=&loop
' WaitInput
Faktor!=LMAT(A#,FHG%,Diagonale&,Zeile&)/LMAT(A#,FHG%,Diagonale&,Diagonale&)
if Faktor!<>0
WhileLoop 0,Anzahl_Lastfaelle%-1
Lastfall&=&loop
aux!=LMAT(L#,FHG%,Lastfall&,Zeile&)-Faktor!*LMAT(L#,FHG%,Lastfall&,Diagonale&)
SMAT(L#,FHG%,Lastfall&,Zeile&,aux!)
EndWhile
WhileLoop 0,FHG%-1,1
Spalte&=&loop
aux!=LMAT(A#,FHG%,Spalte&,Zeile&)-Faktor!*LMAT(A#,FHG%,Spalte&,Diagonale&)
SMAT(A#,FHG%,Spalte&,Zeile&,aux!)
EndWhile
EndIf
EndWhile
EndWhile
EndProc
nProc LMAT
Parameters Bereich#, Size%, Spalte& , Zeile&
Declare Result!
Result!=Float(Bereich#, (Spalte&*Size%+Zeile&)*8)
' Print "Spalte&",Spalte&,"Zeile&",Zeile&, ": ", Result!
Return Result!
EndProc
nProc SMAT
Parameters Bereich#, Size%, Spalte&, Zeile&,Wert!
' Locate 1,1
' Print "Spalte&",Spalte&,"Zeile&",Zeile&,": ",Wert!
Float Bereich#,(Spalte&*Size%+Zeile&)*8=Wert!
EndProc
'Rücksubstitution
nProc SolverTest
Parameters Lastfall&, A#,L#, V#, FHG%
Declare aux!, Zeile&, Spalte&, Diagonale&
WhileLoop FHG%,1,-1
Diagonale&=&loop-1
aux!=0
WhileLoop Diagonale&+1,FHG%-1,1
Spalte&=&loop
aux!=aux!+LMAT(A#,FHG%,Spalte&,Diagonale&)*LMAT(V#,FHG%,Lastfall&,Spalte&)
EndWhile
aux!=(LMAT(L#,FHG%,Lastfall&,Diagonale&)-aux!)/LMAT(A#,FHG%,Diagonale&,Diagonale&)
SMAT(V#,FHG%,Lastfall&,Diagonale&,aux!)
EndWhile
EndProc
DreiecksmatrixTest(A#, L#, Size%, 0)
SolverTest(0,A#,L#, V#, Size%)
WhileLoop 0,Size%-1
Print LMAT(V#, Size%,0, &loop)
EndWhile
WaitInput
Dispose L#, V#, A#
have a little bit patience with me, I work not yet such a long time with Profan.... |
| | | | |
| | | No worry, there's In any drop sufficient patience present.
You verwendest into nProcs Integer ( % ) -
in nProcs there Longs ( & ), Floats ( ! ) and Strings ( $ ) -
use means instead of the Integer ( % ) The Longs ( & ).
The nProcs are manchen Things something pingeliger -
so must Float-Konstanten always with Dezimaltrenner/ point
ausgeschrieben go.
Z.B. 1.0 instead of 1 or 0.0 instead of 0.
You write: if factor!<>0 instead of if factor!<>0.0
therefore bleats XPSE the Long given is ( The 0 ) but Float expects becomes
in the function dreiecksmatrixtest.
You write in the nProc SMAT: Parameters area#, should but area&
heissen.
hint: but not Float area#,(Spalte&*Size%+Zeile&)*8=Wert! what but Float area&,(Spalte&*Size%+Zeile&)*8=Wert! heissen should in nProcs rather setFloat(Bereich&,(Spalte&*Size%+Zeile&)*8,worth!) write.
too into others Procs The Memory-Variables instead of with # with & write. |
| | | | |
| | | | - Page 2 - |
| | Andreas Koch | thanks for Help and the Lehrstunde, I faith, there had I dusselig sought. now runs it correct through what about me have what learnt. whether it calculate properly, must I yet Verify. on and itself ought to the thing but one lineares Gleichungssystem solve can (sofern on the Hauptdiagonalen no nobodies come along). CompileMarkSeparationWindow 800,800
var Size&=6
Declare A#, Zeile&, Spalte&, Diagonale&, Faktor!, aux!,L#,Lastfall%,V#
DIM A#,Size&*Size&*8
DIM L#,Size&*8
DIM V#,Size&*8
Lastfall%=0
'Erzeugung zweier Zufallsmatrizen
WhileLoop 0,Size&-1
Spalte&=&loop
WhileLoop 0,Size&-1
Zeile&=&loop
SMAT(A#,Size&,Spalte&,Zeile&,1+Rnd())
If Spalte&<1
SMAT(L#,Size&,Spalte&,Zeile&,1+Rnd())
EndIf
EndWhile
EndWhile
'Umformung, Erzeugung einer Dreiecksmatrix
nproc DreiecksmatrixTest
Parameters A&, L&, FHG&, Anzahl_Lastfaelle&
Declare Diagonale&,Zeile&,Lastfall&,Faktor!,Spalte&, aux!
WhileLoop 0,(FHG&-1),1
Diagonale&=&loop
WhileLoop Diagonale&+1,FHG&-1,1
Zeile&=&loop
' WaitInput
Faktor!=LMAT(A&,FHG&,Diagonale&,Zeile&)/LMAT(A&,FHG&,Diagonale&,Diagonale&)
if Faktor!<>0.0
WhileLoop 0,Anzahl_Lastfaelle&-1
Lastfall&=&loop
aux!=LMAT(L&,FHG&,Lastfall&,Zeile&)-Faktor!*LMAT(L&,FHG&,Lastfall&,Diagonale&)
SMAT(L&,FHG&,Lastfall&,Zeile&,aux!)
EndWhile
WhileLoop 0,FHG&-1,1
Spalte&=&loop
aux!=LMAT(A&,FHG&,Spalte&,Zeile&)-Faktor!*LMAT(A&,FHG&,Spalte&,Diagonale&)
SMAT(A&,FHG&,Spalte&,Zeile&,aux!)
EndWhile
EndIf
EndWhile
EndWhile
EndProc
nProc LMAT
Parameters Bereich&, Size&, Spalte& , Zeile&
Declare Result!
Result!=Float(Bereich&, (Spalte&*Size&+Zeile&)*8)
' Print "Spalte&",Spalte&,"Zeile&",Zeile&, ": ", Result!
Return Result!
EndProc
nProc SMAT
Parameters Bereich&, Size&, Spalte&, Zeile&,Wert!
' Locate 1,1
' Print "Spalte&",Spalte&,"Zeile&",Zeile&,": ",Wert!
Setfloat(Bereich&,(Spalte&*Size&+Zeile&)*8,Wert!)
EndProc
'Rücksubstitution
nProc SolverTest
Parameters Lastfall&, A&,L&, V&, FHG&
Declare aux!, Zeile&, Spalte&, Diagonale&
WhileLoop FHG&,1,-1
Diagonale&=&loop-1
aux!=0
WhileLoop Diagonale&+1,FHG&-1,1
Spalte&=&loop
aux!=aux!+LMAT(A&,FHG&,Spalte&,Diagonale&)*LMAT(V&,FHG&,Lastfall&,Spalte&)
EndWhile
aux!=(LMAT(L&,FHG&,Lastfall&,Diagonale&)-aux!)/LMAT(A&,FHG&,Diagonale&,Diagonale&)
SMAT(V&,FHG&,Lastfall&,Diagonale&,aux!)
EndWhile
EndProc
DreiecksmatrixTest(A#, L#, Size&, 0)
SolverTest(0,A#,L#, V#, Size&)
WhileLoop 0,Size&-1
Print LMAT(V#, Size&,0, &loop)
EndWhile
WaitInput
Dispose L#, V#, A#
Nachtrag: The Source is meanwhile examined and it shining correctly To calculate. he's in the doing very plenty faster as before. I have no detailed Messung made, but factor 2000 is realistic. |
| | | | |
|
AnswerThemeninformationenthis Topic has 4 subscriber: |