Feature SS-19
11 votes

Distinct operators for symbolic/numeric/none optimization

Created by Martin Kraska on 3/23/2014 1:58 AM Last Updated by smath on 3/28/2018 4:41 PM
%
 (hrs)
Logged: 0   (hrs)

 Description

Symbolic evaluation:    ->
Numeric evaluation:      =
Symbolic definition:   <- (store after symbolic simplification)
Numeric definition:    := (store as number or as is)

Non-optimized definition:  ≡ (store as is)

    smath (Wednesday, March 28, 2018 4:41 PM) #

>line operator doesn't always store as is

This is not related error. Please create a separate ticket, so I could address it in future.

Thanks in advance!

    Martin Kraska (Wednesday, March 28, 2018 4:23 PM) #

I would need to play around to see how the blue formatting feels. For a start, I could well live with an error message, indicating which optimization should be used.

It would be important to have keyboard or toolbar access (without context menu) for all optimization options.

: numeric assignment (now it generates a symbolic one)

= numeric display

As this may be matter of taste, you could provide a global preset option for the default optimization mode.

Perhaps = could cycle through the display options (num, sym, none) starting with the default.

The  pressing == would display symbolic result.

Pressing : repeatedly would now create nested assignments.

For : you could use the original shortcut for symbolic display Ctrl+. This would come handy in german, as . and : are on the same key.

 

BTW line operator doesn't always store as is:

This is important if a,b,c become vectors. One would need sort of non_commutative_multiply(a,b) to fix this, perhaps represented by a fat dot.

    smath (Wednesday, March 28, 2018 12:37 AM) #

I have additional suggestion: if requested optimization differs from the one really used program should render the real one and in blue color.

 

F.e.:

a:line(..) with numeric optimization: blue "" will be used as rhs expression will be stored as is here in any case, no matter what optimization will be set by user.

c:a+b with numeric optimization (where a and b are undefined): blue "<-" will be used as numeric optimization in place is failed.

    Martin Kraska (Wednesday, September 7, 2016 2:52 PM) #

"Store as number or as is" means:

try to compute a number (or whatever structure consisting of numbers) and store it or if that fails, store the rhs expression verbatim.

    Mike Kaganski (Friday, April 22, 2016 3:30 AM) #

I am unsure what is the meaning of

":= (store as number or as is)"

I prefer to think of numeric := as of alternative (better) way of x:=eval(...).

Very much needed feature, its absence makes it sometimes impossible to control things inside functions.