Search the web
Sign In
New User? Sign Up
win32forth
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 14466 - 14495 of 14495   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries   (Group by Topic) Sort by Date ^  
#14466 From: "robotics1uk" <david4@...>
Date: Wed Oct 28, 2009 9:43 am
Subject: RS232
robotics1uk
Offline Offline
Send Email Send Email
 
Hi, a quick intro: I wrote and maintain RoboForth for our ST Robotics robots
arms. I started it from zero 18 years ago. A colleague writes GUIs in C but I
want to do it myself in Forth. My robots communicate via RS232. There are lots
of super GUI examples in the package but I can't find how to do RS232. Any help
would be appreciated.
David Sands

#14467 From: "Jos v.d.Ven" <josv@...>
Date: Thu Oct 29, 2009 6:03 pm
Subject: Re: RS232
josven2001
Offline Offline
Send Email Send Email
 
Hi David,

> but I can't find how to do RS232

For Win32Forth see ~\win32forth\demosWINSER.F

Jos

----- Original Message -----
From: "robotics1uk" <david4@...>
To: <win32forth@yahoogroups.com>
Sent: Wednesday, October 28, 2009 10:43 AM
Subject: [win32forth] RS232


> Hi, a quick intro: I wrote and maintain RoboForth for our ST Robotics
> robots arms. I started it from zero 18 years ago. A colleague writes GUIs
> in C but I want to do it myself in Forth. My robots communicate via RS232.
> There are lots of super GUI examples in the package but I can't find how
> to do RS232. Any help would be appreciated.
> David Sands

#14468 From: David <david4@...>
Date: Thu Oct 29, 2009 6:20 pm
Subject: Re: RS232
robotics1uk
Offline Offline
Send Email Send Email
 
Stupid of me, don't know why I didn't see it before!
Many thanx.
David

Jos v.d.Ven wrote something like this on 29/10/2009 18:03 UT:
> Hi David,
>
>> but I can't find how to do RS232
>
> For Win32Forth see ~\win32forth\demosWINSER.F
>
> Jos
>
> ----- Original Message -----
> From: "robotics1uk" <david4@...>
> To: <win32forth@yahoogroups.com>
> Sent: Wednesday, October 28, 2009 10:43 AM
> Subject: [win32forth] RS232
>
>
>> Hi, a quick intro: I wrote and maintain RoboForth for our ST Robotics
>> robots arms. I started it from zero 18 years ago. A colleague writes GUIs
>> in C but I want to do it myself in Forth. My robots communicate via RS232.
>> There are lots of super GUI examples in the package but I can't find how
>> to do RS232. Any help would be appreciated.
>> David Sands
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
--
________________________________________________________
        David N. Sands, ST Robotics International
        Website: http://strobotics.com
        robotics within reach

Please do not reply to anything@... but use david4@...
________________________________________________________
STANDARD DEVIATION: a sexual activity formerly considered perverted but
now universally practised.

#14469 From: win32forth@yahoogroups.com
Date: Fri Oct 30, 2009 1:19 am
Subject: New file uploaded to win32forth
win32forth@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the win32forth
group.

   File        : /Users/holinepu /232C.F
   Uploaded by : holinepu <holinepu@...>
   Description : extending winser.f  ( rs232 )

You can access this file at the URL:
http://groups.yahoo.com/group/win32forth/files/Users/holinepu%20/232C.F

To learn more about file sharing for your group, please visit:
http://help.yahoo.com/l/us/yahoo/groups/original/general.htmlfiles

Regards,

holinepu <holinepu@...>

#14470 From: "camilleforth" <camilleforth@...>
Date: Sat Oct 31, 2009 10:41 pm
Subject: Re: New release. Was: Wrong file size
camilleforth
Offline Offline
Send Email Send Email
 
test reply

--- In win32forth@yahoogroups.com, "Jos v.d.Ven" <josv@...> wrote:
>
> IMO let's release the final version as soon possible with only the new
> console.
>
> Reasons:
> 1) There was not much response to the last beta release and
> nothing very important has been changed since the last beta release.
> 2) We can move to the next update without waiting. I hope Camille is still
> alive :-)
> 3) The old console can be used in the previous version.
> 4) A final release might get more response. So the next release will be
> better.
>
> In short: Let's move!
>
> Jos
>
>
> ----- Original Message -----
> From: "Dirk Busch" <dirk.yahoo@...>
> To: <win32forth@yahoogroups.com>
> Sent: Saturday, October 24, 2009 8:20 AM
> Subject: Re: [win32forth] New release. Was: Wrong file size
>
>
> > If you all are fine with a new release, I'll do it.
> >
> > Maybe this is the only way to find the last bug's
> > in the new console.
> >
> > A relese with both the old and the new console
> > isn't easy to do, so I would vote for a version
> > with the new console only.
> >
> > What about doing a last beta release this weekend?
> > and do the final release by end of november?
> >
> > Dirk
> >
> > On 24 Oct 2009 at 0:14, Jos v.d.Ven wrote:
> >
> >> It seems waiting longer harms more than making a new release.
> >> I wonder what Dirk Bush and others think about making a new release.
> >>
> >> Jos
> >>
> >> ----- Original Message -----
> >> From: "George" <georgeahubert@...>
> >> To: <win32forth@yahoogroups.com>
> >> Sent: Friday, October 23, 2009 11:47 PM
> >> Subject: [win32forth] Re: Wrong file size
> >>
> >>
> >> >
> >> >
> >> > --- In win32forth@yahoogroups.com, "Jos v.d.Ven" <josv@> wrote:
> >> >>
> >> >> Perhaps it is better to solve it in the next version.
> >> >> Then we would not delay V6.14
> >> >>
> >> >> Note: I would like to see it released.
> >> >> Then I could  upgrade my site and we all could dive on the next
> >> >> release
> >> >> with
> >> >> new idea's
> >> >> and improvements.
> >> >>
> >> >> Jos
> >> >>
> >> >
> >> > I agree (I've got a few developements I'm holding back on until the
> >> > next
> >> > developement cycle). I've updated the CVS with the modified FILE-SIZE
> >> > as a
> >> > tempory fix. I think there are still some problems with some code in
> >> > the
> >> > new console (try 10 EMIT with it: you'll have fun working out what's
> >> > going
> >> > on!).
> >> >
> >> > Could we release a version with both the new console (for the majority
> >> > of
> >> > apps) while still supplying the DLL (plus a file to link it in) for the
> >> > few apps that give problems. It's not ideal but would help speed things
> >> > up.
> >> >
> >> > George
> >> >
> >> >
> >> >
> >> > ------------------------------------
> >> >
> >> > Yahoo! Groups Links
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >> ------------------------------------
> >>
> >> Yahoo! Groups Links
> >>
> >>
> >>
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>

#14471 From: <japeters@...>
Date: Sat Oct 31, 2009 10:48 pm
Subject: Test back
japeters1939
Online Now Online Now
Send Email Send Email
 
test reply

Yes?

#14472 From: David <david4@...>
Date: Sat Oct 31, 2009 11:02 pm
Subject: Re: Test back
robotics1uk
Offline Offline
Send Email Send Email
 
yes its ok

japeters@... wrote something like this on 31/10/2009 22:48 UT:
>
> test reply
>
> Yes?
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>

--
________________________________________________________
        David N. Sands, ST Robotics International
        Website: http://strobotics.com
        robotics within reach

Please do not reply to anything@... but use david4@...
________________________________________________________
The two greatest causes of system failures are sysadmins and users.
If you can keep both of these groups away from your machines, the
reliability increases dramatically.

#14473 From: "camilleforth" <camilleforth@...>
Date: Sat Oct 31, 2009 11:20 pm
Subject: Re: New release. Was: Wrong file size
camilleforth
Offline Offline
Send Email Send Email
 
--- In win32forth@yahoogroups.com, "Jos v.d.Ven" <josv@...> wrote:
>
> IMO let's release the final version as soon possible with only the new
> console.
>
> Reasons:
> 1) There was not much response to the last beta release and
> nothing very important has been changed since the last beta release.
> 2) We can move to the next update without waiting. I hope Camille is still
> alive :-)


Yes I am :-)
(but I am overloaded with "conventionnal" work at the moment).

I am ok too for the new release, even if I might be involved or questionned
about the help system.

(A little suggestion for the release : rename winser.f as something like
winRS232.f).


> 3) The old console can be used in the previous version.
> 4) A final release might get more response. So the next release will be
> better.
>
> In short: Let's move!
>
> Jos


I'm still developping VisualForth (not really the same thing that "Dirk - the
second" is working on). I am affraid that I can't use Win32Forth as it is. So I
created a new kernel and a new OOP language. The new kernel is very similar, the
OOP language is quite different and new. The Visual part itself is far from
finished or even prooved possible but I have got some interesting results. The
only problem, at the moment, is time...

Camille

#14474 From: "Jos v.d.Ven" <josv@...>
Date: Sun Nov 1, 2009 9:02 pm
Subject: Re: Re: New release. Was: Wrong file size
josven2001
Offline Offline
Send Email Send Email
 
----- Original Message -----
From: "camilleforth" <camilleforth@...>
To: <win32forth@yahoogroups.com>
Sent: Sunday, November 01, 2009 12:20 AM
Subject: [win32forth] Re: New release. Was: Wrong file size



> I am ok too for the new release, even if I might be involved or
> questionned about the help system.

Thank you. I think it is going to take some time.

> I'm still developping VisualForth (not really the same thing that "Dirk -
> the second" is working on). I am affraid that I can't use Win32Forth as it
> is. So I created a new kernel and a new OOP language. The new kernel is
> very similar, the OOP language is quite different and new. The Visual part
> itself is far from finished or even prooved possible but I have got some
> interesting results. The only problem, at the moment, is time...

Sounds brave. Will the old application run on it without any change?

Jos

#14475 From: "Yves" <ysur2004@...>
Date: Wed Nov 4, 2009 5:12 pm
Subject: Win32Forth Hashing
ysur2004
Offline Offline
Send Email Send Email
 
Hello all

FYI, I have encountered a second time in my Win32Forth programmer life two
strings that provide the same hash-code:

s" FILT_X_15mm{A}[MAX](04)" method-hash . -1772370691  ok
s" FILT_X_25mm{A}[MAX](08)" method-hash . -1772370691  ok

So, the hashing algorithm is not that much reliable (the first example -I have
forgotten but may be in this group archives, as I reported on it- was also two
strings very similar).

Yves

#14476 From: "George" <georgeahubert@...>
Date: Fri Nov 6, 2009 1:14 pm
Subject: Re: Win32Forth Hashing
georgeahubert
Offline Offline
Send Email Send Email
 
--- In win32forth@yahoogroups.com, "Yves" <ysur2004@...> wrote:
>
> Hello all
>
> FYI, I have encountered a second time in my Win32Forth programmer life two
strings that provide the same hash-code:
>
> s" FILT_X_15mm{A}[MAX](04)" method-hash . -1772370691  ok
> s" FILT_X_25mm{A}[MAX](08)" method-hash . -1772370691  ok
>
> So, the hashing algorithm is not that much reliable (the first example -I have
forgotten but may be in this group archives, as I reported on it- was also two
strings very similar).
>
> Yves
>

If you're using the strings as names of ivars then an error occurs thus



:object foo <super object  ok
object FILT_X_15mm{A}[MAX](04)   ok
object FILT_X_25mm{A}[MAX](08)
        ^^^^^^^^^^^^^^^^^^^^^^^
Error(-2): FILT_X_25MM{A}[MAX](08) Duplicate Instance Variable

and has done so since V4.2 (or earlier). Duplicate hashes in different classes
don't generate an error, but aren't a problem.

For methods :M warns about a possible collision if a new method name collides
with an existing name in the same class (or a super class in the inheritance
chain), but not otherwise (since issuing warnings for overloading would IMO be a
pain) since V6.12. If you need it in V4.2 then you could add it yourself.

George

#14477 From: Dirk Bruehl <dirk_bruehl@...>
Date: Fri Nov 6, 2009 4:45 pm
Subject: AW: Re: Win32Forth Hashing
dirk_bruehl
Offline Offline
Send Email Send Email
 
Hello George et all,

I am sorry I wasn't aware when you encountered a first time in your Win32Forth
programmer life two strings that provide the same hash-code.

I hope it is not to late to tell you now that this is a well known problem to
all other programming communities. It is a good sign for the used hash-algorithm
that it up to now happened only two times. Others have this experience more
often, and it is a statistical problem, that means, it will always happen again,
but nobody knows when. It is like the blow up of a nuclear power plant - nobody
nows when, but with three major differences: it is not so devestating, there is
a preventive cure for it, but the probability is much higher.

The standard book for Hash-Codes (sorry, I forgot the name of the book) says
that if a hash-codes appears a second time, it gets an order number added, so in
case there are several results with the same hash code they can be separated.

Does this help?

Best Regards,

Dirk Bruehl

P.S.: I just checked http://en.wikipedia.org/wiki/Hash_table
Ideally the hash function should map each possible key to a different slot
index, but this ideal is rarely achievable in practice... Most hash table
designs assume that hash collisions — pairs of different keys with the same
hash values — are normal occurrences and must be accommodated in some way.



--- George <georgeahubert@...> schrieb am Fr, 6.11.2009:


Von: George <georgeahubert@...>
Betreff: [win32forth] Re: Win32Forth Hashing
An: win32forth@yahoogroups.com
Datum: Freitag, 6. November 2009, 14:14

--- In win32forth@yahoogro ups.com, "Yves" <ysur2004@.. .> wrote:
>
> Hello all
>
> FYI, I have encountered a second time in my Win32Forth programmer life two
strings that provide the same hash-code:
>
> s" FILT_X_15mm{ A}[MAX](04) " method-hash . -1772370691 ok
> s" FILT_X_25mm{ A}[MAX](08) " method-hash . -1772370691 ok
>
> So, the hashing algorithm is not that much reliable (the first example -I have
forgotten but may be in this group archives, as I reported on it- was also two
strings very similar).
>
> Yves
>

If you're using the strings as names of ivars then an error occurs thus

:object foo <super object ok
object FILT_X_15mm{ A}[MAX](04) ok
object FILT_X_25mm{ A}[MAX](08)
^^^^^^^^^^^^ ^^^^^^^^^ ^^
Error(-2): FILT_X_25MM{ A}[MAX](08) Duplicate Instance Variable

and has done so since V4.2 (or earlier). Duplicate hashes in different classes
don't generate an error, but aren't a problem.

For methods :M warns about a possible collision if a new method name collides
with an existing name in the same class (or a super class in the inheritance
chain), but not otherwise (since issuing warnings for overloading would IMO be a
pain) since V6.12. If you need it in V4.2 then you could add it yourself.

George

#14478 From: "Frank R" <fjrusso@...>
Date: Fri Nov 6, 2009 6:39 pm
Subject: Function needed
fjrusso
Offline Offline
Send Email Send Email
 
Looking for a least squares function. Ideas where I can look? My search has not
found me anything helpful.

Frank

#14479 From: Doug Hoffman <dhoffman@...>
Date: Fri Nov 6, 2009 7:44 pm
Subject: Re: Function needed
t0004dh
Offline Offline
Send Email Send Email
 
On Nov 6, 2009, at 1:39 PM, Frank R wrote:

> Looking for a least squares function. Ideas where I can look? My
> search has not found me anything helpful.

Are you talking about curve-fitting to data points using the least
squares method as in:

http://en.wikipedia.org/wiki/Least_squares    ?

If so I agree that the wiki reference is a bit obtuse.  The formulae
are simple and I can forward them to you in a more readable form if
you wish.

Regards,

-Doug

#14480 From: "Frank R" <fjrusso@...>
Date: Fri Nov 6, 2009 8:01 pm
Subject: Re: Function needed
fjrusso
Offline Offline
Send Email Send Email
 
Thanks. That is what I am looking for. I have very large data files of cyclic
fatigue test. The testing software does not ID peaks/valleys or max/min. So I
post process it. Least square function can get me a slope and a change in the
slope will point me to the peak/valley. So I think.

Frank
FJRusso at Yahoo dot com

--- In win32forth@yahoogroups.com, Doug Hoffman <dhoffman@...> wrote:
>
>
> On Nov 6, 2009, at 1:39 PM, Frank R wrote:
>
> > Looking for a least squares function. Ideas where I can look? My
> > search has not found me anything helpful.
>
> Are you talking about curve-fitting to data points using the least
> squares method as in:
>
> http://en.wikipedia.org/wiki/Least_squares    ?
>
> If so I agree that the wiki reference is a bit obtuse.  The formulae
> are simple and I can forward them to you in a more readable form if
> you wish.
>
> Regards,
>
> -Doug
>

#14481 From: "Jos v.d.Ven" <josv@...>
Date: Sun Nov 15, 2009 1:06 pm
Subject: Comments in Locals
josven2001
Offline Offline
Send Email Send Email
 
Hi all,

While using some locals I found the following:

In Evolve.f:
: --            \ replace by \
                 postpone \ ; immediate
                 deprecated \ june 27 2008  - was in-system

That might be confusing EG define:

: Test1  { Lparm n -- }   \ You will get 2 locals
    Lparm n -
  ;

: Test2  { Lparm n \ - } \ You will get 3 locals
    Lparm n -
  ;

: Test3  { Lparm n \ foo } \ You will get 3 locals
    Lparm n -
  ;

See test1
See test2
See test3
\s

: TEST1         { LOCAL1 LOCAL0 } LOCAL1 LOCAL0 - ;
: TEST2         { LOCAL2 LOCAL1 | LOCAL0 } LOCAL2 LOCAL1 LOCAL0 ;
: TEST3         { LOCAL2 LOCAL1 | LOCAL0 } LOCAL2 LOCAL1 - ;

It seems -- inside { and } is still needed and should perhaps not be
depracted
or better explained in Evolve.f.

Jos

#14482 From: "George" <georgeahubert@...>
Date: Sun Nov 15, 2009 10:34 pm
Subject: Re: Comments in Locals
georgeahubert
Offline Offline
Send Email Send Email
 
--- In win32forth@yahoogroups.com, "Jos v.d.Ven" <josv@...> wrote:
>
> Hi all,
>
> While using some locals I found the following:
>
> In Evolve.f:
> : --            \ replace by \
>                 postpone \ ; immediate
>                 deprecated \ june 27 2008  - was in-system
>

That refers to -- used outside of the locals declaration (which is a synonym of
\ ), though I agree it's confusing

> That might be confusing EG define:
>
> : Test1  { Lparm n -- }   \ You will get 2 locals
>    Lparm n -
>  ;

Which is correct

: Test4 { Lparm n }
    Lparm n -
  ;

would produce identical code ( i.e. the -- can be left out if other comments
aren't needed, though it makes it obvious that nothing is returned).

>
> : Test2  { Lparm n \ - } \ You will get 3 locals
>    Lparm n -
>  ;

That's because - isn't -- so it's treated as a local (V4.2 had a bug where any
string beginning with - was treated as -- ; it also treated \foo as \ foo which
was confusing).

> : Test3  { Lparm n \ foo } \ You will get 3 locals
>    Lparm n -
>  ;
>
> See test1
> See test2
> See test3
> \s
>
> : TEST1         { LOCAL1 LOCAL0 } LOCAL1 LOCAL0 - ;
> : TEST2         { LOCAL2 LOCAL1 | LOCAL0 } LOCAL2 LOCAL1 LOCAL0 ;
> : TEST3         { LOCAL2 LOCAL1 | LOCAL0 } LOCAL2 LOCAL1 - ;
>
> It seems -- inside { and } is still needed and should perhaps not be
> depracted
> or better explained in Evolve.f.

-- inside { and } isn't deprecated it's just evolve.f needs to explain it
better.

> Jos
>

George

#14483 From: "jan.kromhout" <jan.kromhout@...>
Date: Tue Nov 17, 2009 6:47 pm
Subject: Calling function from DLL
jan.kromhout
Offline Offline
Send Email Send Email
 
Dear All,

I wont to acces to a Labjack U12 device by calling a dll.

These are the headers:

long _stdcall EDigitalIn(long *idnum,
			 long demo,
			 long channel,
			 long readD,
			 long *state);

long _stdcall EAnalogIn(long *idnum,
			 long demo,
			 long channel,
			 long gain,
			 long *overVoltage,
			 float *voltage);

Can someone help me to get acces by Win32Fort (6.13.00)

Thanks in advance.

Jan Kromhout
Hellevoetsluis-NL

#14484 From: "Andrew K" <kr6dd@...>
Date: Wed Nov 18, 2009 10:36 pm
Subject: Re: Calling function from DLL
kr6dd
Offline Offline
Send Email Send Email
 
Click "Documentation Help" in the WinEd menu and then click "Win32Forth
documentation". This will open your browser with the panel
"...6.13.00/doc/p-windlls.htm".  Or just go directly to that html in your 6.13
directory.  There is a complete helpful description and if you do search all
files for the text " call " with WinEd that will bring out all examples of uses
of calling DLL functions, e.g. in WINSER.F, etc.

Andy Korsak
forth.fanatic@...
kr6dd@...


--- In win32forth@yahoogroups.com, "jan.kromhout" <jan.kromhout@...> wrote:
>
> Dear All,
>
> I wont to acces to a Labjack U12 device by calling a dll.
>
> These are the headers:
>
> long _stdcall EDigitalIn(long *idnum,
> 		 long demo,
> 		 long channel,
> 		 long readD,
> 		 long *state);
>
> long _stdcall EAnalogIn(long *idnum,
> 		 long demo,
> 		 long channel,
> 		 long gain,
> 		 long *overVoltage,
> 		 float *voltage);
>
> Can someone help me to get acces by Win32Fort (6.13.00)
>
> Thanks in advance.
>
> Jan Kromhout
> Hellevoetsluis-NL
>

#14485 From: RAMZI TLIGUE <ramziesstt@...>
Date: Thu Nov 19, 2009 2:21 pm
Subject: matrix multiplication in forth
ramziesstt
Offline Offline
Send Email Send Email
 
hi everybody,

I'm beginner in forth programming.i want to do a matrix multiplication (3*3) in
forth.can anyone help me.thanks

#14486 From: "Jos v.d.Ven" <josv@...>
Date: Thu Nov 19, 2009 6:18 pm
Subject: Re: matrix multiplication in forth
josven2001
Offline Offline
Send Email Send Email
 
Hi Ramzi,

> a matrix multiplication (3*3)

Sounds quite serious.
What need the matrix contain? Singles doubles or floats?

Jos

----- Original Message -----
From: "RAMZI TLIGUE" <ramziesstt@...>
To: "forth group" <win32forth@yahoogroups.com>
Sent: Thursday, November 19, 2009 3:21 PM
Subject: [win32forth] matrix multiplication in forth


> hi everybody,
>
> I'm beginner in forth programming.i want to do a matrix multiplication
> (3*3) in forth.can anyone help me.thanks

#14487 From: RAMZI TLIGUE <ramziesstt@...>
Date: Thu Nov 19, 2009 9:37 pm
Subject: Re : matrix multiplication in forth
ramziesstt
Offline Offline
Send Email Send Email
 
hi,

i prefer to begin with single then we can change.i hope that you can help as
soon as possible.thanks



________________________________
De : Jos v.d.Ven <josv@...>
À : win32forth@yahoogroups.com
Envoyé le : Jeu 19 Novembre 2009, 19 h 18 min 49 s
Objet : Re: [win32forth] matrix multiplication in  forth


Hi Ramzi,

> a matrix multiplication (3*3)

Sounds quite serious.
What need the matrix contain? Singles doubles or floats?

Jos

----- Original Message -----
From: "RAMZI TLIGUE" <ramziesstt@yahoo. fr>
To: "forth group" <win32forth@yahoogro ups.com>
Sent: Thursday, November 19, 2009 3:21 PM
Subject: [win32forth] matrix multiplication in forth

> hi everybody,
>
> I'm beginner in forth programming. i want to do a matrix multiplication
> (3*3) in forth.can anyone help me.thanks






[Non-text portions of this message have been removed]

#14488 From: "Jos v.d.Ven" <josv@...>
Date: Fri Nov 20, 2009 5:22 pm
Subject: Re: matrix multiplication in forth
josven2001
Offline Offline
Send Email Send Email
 
Hi Ramzi,

> i prefer to begin with single then we can change.i

Changing it would mean redign and start all over again.
That is not my favorite aproach!
So if you think you will end into floats, then it is better to tell so now.
Note: Floats are very atractive since they like a wide range of numbers and
fractions of numbers!

I just studied the mechanics of  3x3 matrix multiplications at:
http://www.easycalculation.com/matrix/matrix-multiplication.php
It looks not very complicated once you fill in the matrix.

There is one important question:
Say matrix1 is multiplied by matrix2 would you like to see the result to be
in a other matrix3
or would you like to see the results in matrix2 ?

Jos


----- Original Message -----
From: "RAMZI TLIGUE" <ramziesstt@...>
To: <win32forth@yahoogroups.com>
Sent: Thursday, November 19, 2009 10:37 PM
Subject: Re : [win32forth] matrix multiplication in forth


hi,

i prefer to begin with single then we can change.i hope that you can help as
soon as possible.thanks



________________________________
De : Jos v.d.Ven <josv@...>
À : win32forth@yahoogroups.com
Envoyé le : Jeu 19 Novembre 2009, 19 h 18 min 49 s
Objet : Re: [win32forth] matrix multiplication in  forth


Hi Ramzi,

> a matrix multiplication (3*3)

Sounds quite serious.
What need the matrix contain? Singles doubles or floats?

Jos

----- Original Message -----
From: "RAMZI TLIGUE" <ramziesstt@yahoo. fr>
To: "forth group" <win32forth@yahoogro ups.com>
Sent: Thursday, November 19, 2009 3:21 PM
Subject: [win32forth] matrix multiplication in forth

> hi everybody,
>
> I'm beginner in forth programming. i want to do a matrix multiplication
> (3*3) in forth.can anyone help me.thanks






[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

#14489 From: "Jos v.d.Ven" <josv@...>
Date: Fri Nov 20, 2009 11:39 pm
Subject: Re: matrix multiplication in forth
josven2001
Offline Offline
Send Email Send Email
 
Hi Ramzi,

Here follows a first result.
The 3x3m* could perhaps be better.


aNew -3x3Matrix.f

3 constant rows

: 3x3Allot  [ 3 3 * ] literal cells allot ;

Create 3x3Matrix1 \ Create a 3x3 matrix
  1 ,  2 ,  3 ,    \ And fill them with some values.
-1 , -2 , -3 ,
  5 ,  6 ,  7 ,

Create 3x3Matrix2
  10 ,  20 ,  30 ,
  40 ,  50 ,  60 ,
  70 ,  80 ,  90 ,


Create 3x3Matrix3  3x3Allot  \ For the results

: atRow  ( adrInCol Row - adr-at-xRow )   rows * cells + ;
: >Col   ( adr n        - adrInCol )      cells + ;

: .3x3M  { MatrixAddr -- } \ To see them
     Rows 0
       do  cr
           3 0
             do  MatrixAddr i >Col j atRow @ .
             loop
       loop  cr
  ;

\ 3x3m* could perhaps be done with some kind of nested do loop
\ That took me too much time.

: 3x3m*  { MAddr1 MAddr2 MAddr3 -- }

   MAddr1 0 >Col 0 atRow @  MAddr2 0 >Col 0 atRow @  *
   MAddr1 1 >Col 0 atRow @  MAddr2 0 >Col 1 atRow @  * +
   MAddr1 2 >Col 0 atRow @  MAddr2 0 >Col 2 atRow @  * +
   MAddr3 0 >Col 0 atRow !

   MAddr1 0 >Col 0 atRow @  MAddr2 1 >Col 0 atRow @  *
   MAddr1 1 >Col 0 atRow @  MAddr2 1 >Col 1 atRow @  * +
   MAddr1 2 >Col 0 atRow @  MAddr2 1 >Col 2 atRow @  * +
   MAddr3 1 >Col 0 atRow !


   MAddr1 0 >Col 0 atRow @  MAddr2 2 >Col 0 atRow @  *
   MAddr1 1 >Col 0 atRow @  MAddr2 2 >Col 1 atRow @  * +
   MAddr1 2 >Col 0 atRow @  MAddr2 2 >Col 2 atRow @  * +
   MAddr3 2 >Col 0 atRow !
\ First 3

   MAddr1 0 >Col 1 atRow @  MAddr2 0 >Col 0 atRow @  *
   MAddr1 1 >Col 1 atRow @  MAddr2 0 >Col 1 atRow @  * +
   MAddr1 2 >Col 1 atRow @  MAddr2 0 >Col 2 atRow @  * +
   MAddr3 0 >Col 1 atRow !


   MAddr1 0 >Col 1 atRow @  MAddr2 1 >Col 0 atRow @  *
   MAddr1 1 >Col 1 atRow @  MAddr2 1 >Col 1 atRow @  * +
   MAddr1 2 >Col 1 atRow @  MAddr2 1 >Col 2 atRow @  * +
   MAddr3 1 >Col 1 atRow !

   MAddr1 0 >Col 1 atRow @  MAddr2 2 >Col 0 atRow @  *
   MAddr1 1 >Col 1 atRow @  MAddr2 2 >Col 1 atRow @  * +
   MAddr1 2 >Col 1 atRow @  MAddr2 2 >Col 2 atRow @  * +
   MAddr3 2 >Col 1 atRow !
\ Second 3

   MAddr1 0 >Col 2 atRow @  MAddr2 0 >Col 0 atRow @  *
   MAddr1 1 >Col 2 atRow @  MAddr2 0 >Col 1 atRow @  * +
   MAddr1 2 >Col 2 atRow @  MAddr2 0 >Col 2 atRow @  * +
   MAddr3 0 >Col 2 atRow !


   MAddr1 0 >Col 2 atRow @  MAddr2 1 >Col 0 atRow @  *
   MAddr1 1 >Col 2 atRow @  MAddr2 1 >Col 1 atRow @  * +
   MAddr1 2 >Col 2 atRow @  MAddr2 1 >Col 2 atRow @  * +
   MAddr3 1 >Col 2 atRow !

   MAddr1 0 >Col 2 atRow @  MAddr2 2 >Col 0 atRow @  *
   MAddr1 1 >Col 2 atRow @  MAddr2 2 >Col 1 atRow @  * +
   MAddr1 2 >Col 2 atRow @  MAddr2 2 >Col 2 atRow @  * +
   MAddr3 2 >Col 2 atRow !
\ Last 3
  ;

cr .( Two 3x3 matrices containing:)
  3x3Matrix1 .3x3M
  3x3Matrix2 .3x3M

cr .( Then Multiply them and store the result in matrix3 )
  3x3Matrix1 3x3Matrix2 3x3Matrix3 3x3m*

  3x3Matrix3 .3x3M  \ Show the result

\s Jos
\ Win32Forth tells:

Two 3x3 matrices containing:
1 2 3
-1 -2 -3
5 6 7

10 20 30
40 50 60
70 80 90

Then Multiply them and store the result in matrix3
300 360 420
-300 -360 -420
780 960 1140
  ok


----- Original Message -----
From: "RAMZI TLIGUE" <ramziesstt@...>
To: <win32forth@yahoogroups.com>
Sent: Thursday, November 19, 2009 10:37 PM
Subject: Re : [win32forth] matrix multiplication in forth


hi,

i prefer to begin with single then we can change.i hope that you can help as
soon as possible.thanks



________________________________
De : Jos v.d.Ven <josv@...>
À : win32forth@yahoogroups.com
Envoyé le : Jeu 19 Novembre 2009, 19 h 18 min 49 s
Objet : Re: [win32forth] matrix multiplication in  forth


Hi Ramzi,

> a matrix multiplication (3*3)

Sounds quite serious.
What need the matrix contain? Singles doubles or floats?

Jos

----- Original Message -----
From: "RAMZI TLIGUE" <ramziesstt@yahoo. fr>
To: "forth group" <win32forth@yahoogro ups.com>
Sent: Thursday, November 19, 2009 3:21 PM
Subject: [win32forth] matrix multiplication in forth

> hi everybody,
>
> I'm beginner in forth programming. i want to do a matrix multiplication
> (3*3) in forth.can anyone help me.thanks






[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

#14490 From: "Andrew K" <kr6dd@...>
Date: Sat Nov 21, 2009 5:11 am
Subject: Re: Re : matrix multiplication in forth
kr6dd
Offline Offline
Send Email Send Email
 
Ramzi, do you know the definition of a matrix product?  If not, look it up at
Wikipedia: http://en.wikipedia.org/wiki/Matrix_multiplication

In Win32Forth you can define matrices using two layers of arrays to make usage
look like normal arrays but with indeces in RPN, e.g.
i j A[] \ put A[i,j] at TOS

and you can define a matrix multiply operation to take as its input two array
addresses, and a product destination address, e.g.
: matrix_product { A[] B[] A*B \ -- } \ leave product array at adr
    3 0 do
        3 0 do
               \ using standard Forth inner and outer loop indeces
               \ I and J, do the required summation of 3 products
               \ A(i,k)*B(k,j) and deposit the results at final
               \ array destination [i,j]
            loop
        loop
;

--- In win32forth@yahoogroups.com, RAMZI TLIGUE <ramziesstt@...> wrote:
>
> hi,
>
> i prefer to begin with single then we can change.i hope that you can help as
soon as possible.thanks
>
>
>
> ________________________________
> De : Jos v.d.Ven <josv@...>
> À : win32forth@yahoogroups.com
> Envoyé le : Jeu 19 Novembre 2009, 19 h 18 min 49 s
> Objet : Re: [win32forth] matrix multiplication in  forth
>
>
> Hi Ramzi,
>
> > a matrix multiplication (3*3)
>
> Sounds quite serious.
> What need the matrix contain? Singles doubles or floats?
>
> Jos
>
> ----- Original Message -----
> From: "RAMZI TLIGUE" <ramziesstt@yahoo. fr>
> To: "forth group" <win32forth@yahoogro ups.com>
> Sent: Thursday, November 19, 2009 3:21 PM
> Subject: [win32forth] matrix multiplication in forth
>
> > hi everybody,
> >
> > I'm beginner in forth programming. i want to do a matrix multiplication
> > (3*3) in forth.can anyone help me.thanks
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

#14491 From: "Jos v.d.Ven" <josv@...>
Date: Sat Nov 21, 2009 10:54 pm
Subject: Re: Re : matrix multiplication in forth
josven2001
Offline Offline
Send Email Send Email
 
Andrew K. wrote:
> : matrix_product { A[] B[] A*B \ -- } \ leave product array at adr
>    3 0 do
>        3 0 do
>               \ using standard Forth inner and outer loop indeces
>               \ I and J, do the required summation of 3 products
>               \ A(i,k)*B(k,j) and deposit the results at final
>               \ array destination [i,j]
>            loop
>        loop
>  ;

Since it is a 3x3 matrix you need 3 levels of do..loops
After some more time I came to the following:

aNew -3x3Matrix.f  \ Final source

3 constant rows

: 3x3Allot  [ 3 3 * ] literal cells allot ;

Create 3x3Matrix1 \ Create a 3x3 matrix
  1 ,  2 ,  3 ,    \ And fill them with some values.
-1 , -2 , -3 ,
  5 ,  6 ,  7 ,

Create 3x3Matrix2
  10 ,  20 ,  30 ,
  40 ,  50 ,  60 ,
  70 ,  80 ,  90 ,

Create 3x3Matrix3  3x3Allot  \ For the results

: >ColRow ( col row - adr )  >r cells +  r> rows * cells + ;

: .3x3M  { MatrixAddr -- } \ To see them
     Rows 0
       do  cr
           3 0
             do  MatrixAddr i j >ColRow @ .
             loop
       loop  cr
  ;

: 3x3m*  { MAddr1 MAddr2 MAddr3 -- }
     Rows 0
          do
          Rows 0
               do
             0 Rows 0
                    do    MAddr1 I  K >ColRow @  MAddr2 J  I >ColRow @  * +
                    loop  MAddr3 I  J >ColRow !
               loop
           loop
  ;

cr .( Two 3x3 matrices containing:)
  3x3Matrix1 .3x3M
  3x3Matrix2 .3x3M

cr .( Then Multiply them and store the result in matrix3 )
  3x3Matrix1 3x3Matrix2 3x3Matrix3 3x3m*

  3x3Matrix3 .3x3M  \ Show the result
\s Jos

\ Output:

Two 3x3 matrices containing:
1 2 3
-1 -2 -3
5 6 7

10 20 30
40 50 60
70 80 90

Then Multiply them and store the result in matrix3
300 360 420
-300 -360 -420
780 960 1140
  ok

#14492 From: RAMZI TLIGUE <ramziesstt@...>
Date: Sun Nov 22, 2009 8:38 am
Subject: matrix multiplication in forth(gforth)
ramziesstt
Offline Offline
Send Email Send Email
 
hi, thanks for responding,there is a problem because i use gforth to compile my
forth file to vhdl and not win32.

so there is some error in the program like in the line": 3x3Allot  [ 3 3 * ]
literal cells allot ;".it deosn't work
how can i fix it?thanks again



________________________________
De : Jos v.d.Ven <josv@...>
À : win32forth@yahoogroups.com
Envoyé le : Sam 21 Novembre 2009, 23 h 54 min 51 s
Objet : Re: Re : [win32forth] matrix multiplication in  forth


Andrew K. wrote:
> : matrix_product { A[] B[] A*B \ -- } \ leave product array at adr
>    3 0 do
>        3 0 do
>               \ using standard Forth inner and outer loop indeces
>               \ I and J, do the required summation of 3 products
>               \ A(i,k)*B(k,j) and deposit the results at final
>               \ array destination [i,j]
>            loop
>        loop
>  ;

Since it is a 3x3 matrix you need 3 levels of do..loops
After some more time I came to the following:

aNew -3x3Matrix.f  \ Final source

3 constant rows

: 3x3Allot  [ 3 3 * ] literal cells allot ;

Create 3x3Matrix1 \ Create a 3x3 matrix
1 ,  2 ,  3 ,    \ And fill them with some values.
-1 , -2 , -3 ,
5 ,  6 ,  7 ,

Create 3x3Matrix2
10 ,  20 ,  30 ,
40 ,  50 ,  60 ,
70 ,  80 ,  90 ,

Create 3x3Matrix3  3x3Allot  \ For the results

: >ColRow ( col row - adr )  >r cells +  r> rows * cells + ;

: .3x3M  { MatrixAddr -- } \ To see them
Rows 0
do  cr
3 0
do  MatrixAddr i j >ColRow @ .
loop
loop  cr
;

: 3x3m*  { MAddr1 MAddr2 MAddr3 -- }
Rows 0
do
Rows 0
do
0 Rows 0
do    MAddr1 I  K >ColRow @  MAddr2 J  I >ColRow @  * +
loop  MAddr3 I  J >ColRow !
loop
loop
;

cr .( Two 3x3 matrices containing:)
3x3Matrix1 .3x3M
3x3Matrix2 .3x3M

cr .( Then Multiply them and store the result in matrix3 )
3x3Matrix1 3x3Matrix2 3x3Matrix3 3x3m*

3x3Matrix3 .3x3M  \ Show the result
\s Jos

\ Output:

Two 3x3 matrices containing:
1 2 3
-1 -2 -3
5 6 7

10 20 30
40 50 60
70 80 90

Then Multiply them and store the result in matrix3
300 360 420
-300 -360 -420
780 960 1140
ok






[Non-text portions of this message have been removed]

#14493 From: "Jos v.d.Ven" <josv@...>
Date: Sun Nov 22, 2009 12:38 pm
Subject: Re: matrix multiplication in forth(gforth)
josven2001
Offline Offline
Send Email Send Email
 
Try:

: 3x3Allot   3 3 * cells allot ;

Jos

----- Original Message -----
From: "RAMZI TLIGUE" <ramziesstt@...>
To: <win32forth@yahoogroups.com>
Sent: Sunday, November 22, 2009 9:38 AM
Subject: [win32forth] matrix multiplication in forth(gforth)


hi, thanks for responding,there is a problem because i use gforth to compile
my forth file to vhdl and not win32.

so there is some error in the program like in the line": 3x3Allot  [ 3 3 * ]
literal cells allot ;".it deosn't work
how can i fix it?thanks again



________________________________
De : Jos v.d.Ven <josv@...>
À : win32forth@yahoogroups.com
Envoyé le : Sam 21 Novembre 2009, 23 h 54 min 51 s
Objet : Re: Re : [win32forth] matrix multiplication in  forth


Andrew K. wrote:
> : matrix_product { A[] B[] A*B \ -- } \ leave product array at adr
>    3 0 do
>        3 0 do
>               \ using standard Forth inner and outer loop indeces
>               \ I and J, do the required summation of 3 products
>               \ A(i,k)*B(k,j) and deposit the results at final
>               \ array destination [i,j]
>            loop
>        loop
>  ;

Since it is a 3x3 matrix you need 3 levels of do..loops
After some more time I came to the following:

aNew -3x3Matrix.f  \ Final source

3 constant rows

: 3x3Allot  [ 3 3 * ] literal cells allot ;

Create 3x3Matrix1 \ Create a 3x3 matrix
1 ,  2 ,  3 ,    \ And fill them with some values.
-1 , -2 , -3 ,
5 ,  6 ,  7 ,

Create 3x3Matrix2
10 ,  20 ,  30 ,
40 ,  50 ,  60 ,
70 ,  80 ,  90 ,

Create 3x3Matrix3  3x3Allot  \ For the results

: >ColRow ( col row - adr )  >r cells +  r> rows * cells + ;

: .3x3M  { MatrixAddr -- } \ To see them
Rows 0
do  cr
3 0
do  MatrixAddr i j >ColRow @ .
loop
loop  cr
;

: 3x3m*  { MAddr1 MAddr2 MAddr3 -- }
Rows 0
do
Rows 0
do
0 Rows 0
do    MAddr1 I  K >ColRow @  MAddr2 J  I >ColRow @  * +
loop  MAddr3 I  J >ColRow !
loop
loop
;

cr .( Two 3x3 matrices containing:)
3x3Matrix1 .3x3M
3x3Matrix2 .3x3M

cr .( Then Multiply them and store the result in matrix3 )
3x3Matrix1 3x3Matrix2 3x3Matrix3 3x3m*

3x3Matrix3 .3x3M  \ Show the result
\s Jos

\ Output:

Two 3x3 matrices containing:
1 2 3
-1 -2 -3
5 6 7

10 20 30
40 50 60
70 80 90

Then Multiply them and store the result in matrix3
300 360 420
-300 -360 -420
780 960 1140
ok






[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

#14494 From: Fred Schiff <fschiff@...>
Date: Mon Nov 23, 2009 1:42 am
Subject: Re: Re : matrix multiplication in forth
fschiff
Offline Offline
Send Email Send Email
 
On Sat, Nov 21, 2009 at 5:54 PM, Jos v.d.Ven <josv@...> wrote:

> Andrew K. wrote:
>
> Since it is a 3x3 matrix you need 3 levels of do..loops
> After some more time I came to the following:
>
>
You always need 3 levels of do..loops irregardless of the size of the
matrices you are multiplying.

Fred


[Non-text portions of this message have been removed]

#14495 From: "Andrew K" <kr6dd@...>
Date: Tue Nov 24, 2009 5:24 pm
Subject: Re: Re : matrix multiplication in forth
kr6dd
Offline Offline
Send Email Send Email
 
--- In win32forth@yahoogroups.com, Fred Schiff <fschiff@...> wrote:
>
> On Sat, Nov 21, 2009 at 5:54 PM, Jos v.d.Ven <josv@...> wrote:
>
> > Andrew K. wrote:
> >
> > Since it is a 3x3 matrix you need 3 levels of do..loops
> > After some more time I came to the following:
> >
> >
> You always need 3 levels of do..loops irregardless of the size of the
> matrices you are multiplying.

Not true!  There has been a long history of research striving to improve matrix
multiplication.  Many tricks have been discovered, driving the "loop number"
down towards 2.

Just do a web search on "optimal matrix multiplication".
Here are just a few examples:

http://www.siam.org/pdf/news/174.pdf
http://alexle.net/stuff/dynamic-programming-matrix-multiplication
http://www.cs.berkeley.edu/~oholtz/Talks/mit.pdf

Look especially at this topic in the 3rd url above:
Group-theoretic algorithms for matrix multiplication

>
> Fred
>
>
> [Non-text portions of this message have been removed]
>


Andy Korsak, Ph.D. (math, U.C. Berkeley, 1966)
(retired mathematician and software engineer)

Messages 14466 - 14495 of 14495   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help