Features:
- Runtime evaluation of Math Expressions
- Parallel evaluation
- Plotting of results
Code Modules:
- MathVM (Runtime)
Number of Blueprints: 1
Number of C++ Classes: 10
Network Replicated: No
Supported Development Platforms: Windows, Linux, Mac
Supported Target Build Platforms: Windows, Linux, Mac, Android, iOS
Documentation: https://github.com/rdeioris/MathVM/blob/master/README.md
特征:
- 数学表达式的运行时评估
- 并行评估
- 绘制结果
代码模块:
- MathVM(运行时)
蓝图数目:1
C++类数:10
网络复制:没有
支持的开发平台:Windows、Linux、Mac
支持的目标构建平台:Windows,Linux,Mac,Android,iOS
文件:https://github.com/rdeioris/MathVM/blob/master/README.md
MathVM exposes a simple framework (both C++ and Blueprint) for running user-defined math expressions:
y = sin(x) * 2
This expression will compute the sin of x and multiply it by 2. The result will be put in y.
The two symbols (x and y), can be local variables or globals (more on this below) and, in the case of x, it can be a constant.
There is a very important difference between local and global: MathVM supports running expressions in parallel (read: on multiple threads) but while accessing local variables is fully thread-safe and lock-free (each thread works on a different copy of them), global variables are shared between parallel evaluations.
For global variables a locking is required to avoid race conditions (see below). Constants are shared and lock-free (but obviously you cannot change them).
The native data type is double and multiple statements can be specified by using the ; separator:
y = tan(x * 2); y = y + (3 * sin(z)); final = y + x;
If there are parts of your expressions that works over global variables (or resources, see below), and you want to avoid race conditions you can "surround" critical sections with curly brackets (braces):
y = sin(z); {x = x + 1;}
Here the x increment (assuming x is a global variable) will be under lock.
Note: the compiler will automatically detect deadlocks
A plotter is included for drawing simple lines/points based graphs.
The plugin is open source under the MIT license. This marketplace version is meant for supporting the development of the project.
MathVM公开了一个简单的框架(C++和蓝图),用于运行用户定义的数学表达式:
y=sin(x)*2
这个表达式将计算x的罪并将其乘以2。 结果将放在y中。
两个符号(x和y),可以是 本地 变量或 全局变量 (更多关于这在下面)和,在x的情况下,它可以是一个 常数.
本地和全局之间有一个非常重要的区别:MathVM支持并行运行表达式(读取:在多个线程上),但是访问局部变量是完全线程安全和无锁的(每个线程在它们的不同副本上工作),全局变量在并行评估之间共享。
对于全局变量,需要锁定以避免竞争条件(见下文)。 常量是共享和无锁的(但显然你不能改变它们)。
本机数据类型为double,可以使用;分隔符指定多个语句:
y=tan(x*2);y=y+(3*sin(z));final=y+x;
如果您的表达式的某些部分适用于全局变量(或资源,请参阅下文),并且您希望避免竞争条件,则可以用花括号(大括号)”包围”关键部分:
y=sin(z);{x=x+1;}
这里的x增量(假设x是一个全局变量)将处于锁定状态。
注意:编译器会自动检测死锁
包括绘图仪,用于绘制基于简单线/点的图形。
该插件是MIT许可证下的开源。 这个市场版本是为了支持项目的开发。
评论(0)