HP Forums
New Bug in Matrix with SCALE [Solved] - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: New Bug in Matrix with SCALE [Solved] (/thread-5459.html)



New Bug in Matrix with SCALE [Solved] - jrozsas - 01-04-2016 05:30 PM

I was impressed with the result. This bug occurs both in the calculator as in the emulator.
After creating an matrix, using SCALE, the error occurs.
[Image: o73L5.jpg] [Image: sY49N.jpg]
Up to this point everything is correct.
After using the SCALE function:
[Image: CT66f.jpg] [Image: 0LoeN.jpg]
But when checking the matrix, sometimes the matrix is reset, sometimes the calculator restarts, sometimes the calculator enters wrong values in the matrix and sometimes its OK!
The error is random. Note that after the SCALE matrix is reset. I used the FORMAT function (F-C-O) and did not correct the error. To reproduce this error I realized the operation 5 times.
See the video.





RE: New Bug in Matrix with SCALE - cyrille de brébisson - 01-05-2016 04:12 AM

Hello,

Sorry about the issue.
If you need to use SCALE, doing M1:= SCALE(EVAL(M1), ....) might work better.
SCALE is part of a small but frustrating number of functions that do side effects (ie, modify their inputs, in this case M1). This makes it relatively complex to implement.
This is a leftover from the HP38G.

However, SCALE is also able to work without side effects, but for this to work, you need the input to NOT be a variable name. Hence the EVAL above.

Cyrille


RE: New Bug in Matrix with SCALE - jrozsas - 01-05-2016 10:06 AM

(01-05-2016 04:12 AM)cyrille de brébisson Wrote:  Hello,

Sorry about the issue.
If you need to use SCALE, doing M1:= SCALE(EVAL(M1), ....) might work better.
SCALE is part of a small but frustrating number of functions that do side effects (ie, modify their inputs, in this case M1). This makes it relatively complex to implement.
This is a leftover from the HP38G.

However, SCALE is also able to work without side effects, but for this to work, you need the input to NOT be a variable name. Hence the EVAL above.

Cyrille

These functions SCALE and SCALEADD are similar to the HP 50 functions RCI and RCIJ, very even used in SIMPLEX. I use RCI and RCIJ in HP 50.
What is the difference of mRow function in the HP Prime?


RE: New Bug in Matrix with SCALE - jrozsas - 01-05-2016 10:17 AM

It is not a solution, but it is simpler and faster than writing M1:= SCALE(EVAL(M1), ....)
See:
[Image: FVyGW.jpg]
The result in: [Image: WutXs.jpg]
Matrix M1 after :
[Image: 4YPhb.jpg]


RE: New Bug in Matrix with SCALE - cyrille de brébisson - 01-06-2016 05:30 AM

hello,

M1:= SCALE(M1*1, ....) would also work, be faster to type, but be slower to execute.

cyrille


RE: New Bug in Matrix with SCALE - jrozsas - 01-06-2016 10:08 AM

(01-06-2016 05:30 AM)cyrille de brébisson Wrote:  hello,

M1:= SCALE(M1*1, ....) would also work, be faster to type, but be slower to execute.

cyrille

cyrille, what is the difference of mRow function and scale in the HP Prime? It's the same thing?


RE: New Bug in Matrix with SCALE - cyrille de brébisson - 01-07-2016 06:02 AM

Hello,

mRow is a CAS function.
It will work a little bit like SCALE, with the exception that it does not try to do in-place modification (ie, no auto store of result in input matrix).

This means that you can use it, BUT it will be slower because:
- Using it will require a Home to CAS/CAS to home transition
- CAS is usually slower on matrices because it does much more memory allocations (HOME handles matrices as 1 memory block of numbers, CAS handle each number as 1 memory block).

Cyrille


RE: New Bug in Matrix with SCALE - jrozsas - 01-07-2016 12:37 PM

(01-07-2016 06:02 AM)cyrille de brébisson Wrote:  Hello,

mRow is a CAS function.
It will work a little bit like SCALE, with the exception that it does not try to do in-place modification (ie, no auto store of result in input matrix).

This means that you can use it, BUT it will be slower because:
- Using it will require a Home to CAS/CAS to home transition
- CAS is usually slower on matrices because it does much more memory allocations (HOME handles matrices as 1 memory block of numbers, CAS handle each number as 1 memory block).

Cyrille

Thanks!


RE: New Bug in Matrix with SCALE - jrozsas - 09-01-2016 09:15 PM

Fortunately the new update 10637 has resolved this issue with SCALE.
I took several tests and there were no problems
Smile