Programming: Difference between revisions

From SMath Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:


== Examples ==
== Examples ==
[[File:Programming_screenshot1.png]]
[[File:En_programming_screenshot1.png]]


== Performance Hints ==
== Performance Hints ==
In many cases you can gain a speedup by setting the Optimization mode to Numeric as follows:  
In many cases you can gain a speedup by setting the Optimization mode to '''Numeric''' as follows:  


1. Let's start with nothing selected:
1. Let's start with nothing selected:


[[File:Programming_screenshot2.png]]
[[File:En_programming_screenshot2.png]]


2. Left-click anywhere on the loop in question. The loop will be surrounded by a selection box:  
2. Left-click anywhere on the loop in question. The loop will be surrounded by a selection box:  


[[File:Programming_screenshot3.png]]
[[File:En_programming_screenshot3.png]]


3. Right-click anywhere on the loop. The context menu will now have a setting for Optimization. Set this to '''Numeric.''' The Optimization setting automatically applies to all operations within the selection box.  
3. Right-click anywhere on the loop. The context menu will now have a setting for Optimization. Set this to '''Numeric.''' The Optimization setting automatically applies to all operations within the selection box.  


[[File:Programming_screenshot4.png]]
[[File:En_programming_screenshot4.png]]


4. When you left-click outside the loop, [[SMath Studio]] will recalculate the page (if you have main-menu option '''Calculation > Auto calculation''' turned on). The calculation will typically be faster than it was with Optimization set to '''Symbolic'''.  
4. When you left-click outside the loop, [[SMath Studio]] will recalculate the page (if you have main-menu option '''Calculation > Auto calculation''' turned on). The calculation will typically be faster than it was with Optimization set to '''Symbolic'''.  


'''''This page is inspired by legacy wiki article https://smath.info/wiki/programming.ashx.'''''
[[Category:Manual]]
[[Category:SMath Studio]]
[[Category:SMath Studio]]
[[Category:SMath Studio/Programming]]
[[Category:SMath Studio/Programming]]

Latest revision as of 12:21, 12 September 2024

Introduction

SMath Studio has a number of embedded Programming capabilities, allowing you to handle your calculation in a more efficient way. Standard conditional and cyclic constructions are supported.

Examples

Performance Hints

In many cases you can gain a speedup by setting the Optimization mode to Numeric as follows:

1. Let's start with nothing selected:

2. Left-click anywhere on the loop in question. The loop will be surrounded by a selection box:

3. Right-click anywhere on the loop. The context menu will now have a setting for Optimization. Set this to Numeric. The Optimization setting automatically applies to all operations within the selection box.

4. When you left-click outside the loop, SMath Studio will recalculate the page (if you have main-menu option Calculation > Auto calculation turned on). The calculation will typically be faster than it was with Optimization set to Symbolic.


This page is inspired by legacy wiki article https://smath.info/wiki/programming.ashx.