Group Abstract Group Abstract

Message Boards Message Boards

3
|
2.8K Views
|
3 Replies
|
6 Total Likes
View groups...
Share
Share this post:

15 Functions for optimization and readability in the Wolfram Language, for beginners

Posted 1 year ago
Attachments:
POSTED BY: Leo Green
3 Replies

If we consider readability I would prefer:

({x,y} |-> x^2 + y^2)[3, 2]

versus:

(#1^2 + #2^2)&[3, 2]
POSTED BY: Robert Nowak
POSTED BY: Michael Rogers
Posted 1 year ago

Thank you very much for the reply! That's a really interesting consideration, it's quite astounding the difference in time recorded: I also saw ~5s difference which is brilliant.

In regard to the Total[Table[...]] and Sum[...], I really like that way of looking at it. It's another nice example too, at least in my eyes, of how the two both have their purposes, depending on whether anyone else will be looking at the code.

That is odd how my timing varies so much compared to yours though, I'll have to try and check it out; I'm not sure whether it could be bigInt like you say or maybe just a difference in handling overall. Much appreciated, best wishes!

POSTED BY: Leo Green
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard