HP 34S: Find an element in a matrix?
05-22-2014, 05:36 AM
Post: #1
 Gerald H Senior Member Posts: 1,360 Joined: May 2014
HP 34S: Find an element in a matrix?
Can someone please explain the syntax/function of MFD?

I need to find a given matrix element to implement Shanks square form factorization method.
05-22-2014, 06:10 AM
Post: #2
 Thomas Klemm Senior Member Posts: 1,145 Joined: Dec 2013
RE: HP 34S: Find an element in a matrix?
From the code I'd say: ( y mat -> r )
Where mat is a matrix descriptor and y is the element you search.

Cheers
Thomas

Code:
/* Find a specified element in a matrix  */             LBL'MFD'             ABS             M-ALL             x[<->] Y m_find_loop::       x=?[->]Y             JMP m_found             ISG Y             JMP m_find_loop m_found::       DROP             RTN
05-22-2014, 06:51 AM
Post: #3
 Gerald H Senior Member Posts: 1,360 Joined: May 2014
RE: HP 34S: Find an element in a matrix?
To post #2:

Thank you.

I don't understand r.

For 5,6,7,8 stored in registers 20 to 23

stack y: 55 x: 20.0401 returns 24.02301

and

stack y: 7 x: 20.0401 returns 22.02301

Presumably the second result indicates "found"? How should this result be interpreted?
05-22-2014, 07:10 AM
Post: #4
 Thomas Klemm Senior Member Posts: 1,145 Joined: Dec 2013
RE: HP 34S: Find an element in a matrix?
You probably want the index of the element. The matrix descriptor is still in the last x register. Therefore you can use:
Code:
RCL L M.IJ
For 7 you get (x, y) = (3, 1). For 55 you get an Error: Out of range.
05-22-2014, 07:33 AM
Post: #5
 Gerald H Senior Member Posts: 1,360 Joined: May 2014
RE: HP 34S: Find an element in a matrix?
To post #4:

Thank you & yes that is the info I needed.

Will now get to work on Shanks SQFF.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)