SMath Studio Forum
»
SMath Studio
»
Questions
»
[Dev] How to convert Term[] to Entry
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 Was thanked: 1124 time(s) in 721 post(s)
|
Hi, how can I convert a terms list to an entry structure? The core doc says there is a function SMath.Manager.TryFixStructure, which unfortunately doesn't seem to be available in 0.98.6398.
I also failed to find a function to convert expression strings to Entry.
Thanky you for any hint. |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,648 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
You can use the static method Entry.Create(IEnumerable<Term> value) Code:Entry myEntry = Entry.Crate(myTermsArray);
|
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 Was thanked: 1124 time(s) in 721 post(s)
|
Thanks, Davide,
Seems that I asked the wrong question, I misunderstood an VS error message. It was about the result type, not of the argument type of Decision.NumericCalculation. I need to see how to handle TNumber objects.
BTW, if I want to move towards Entry instead of Term[] in the function arguments, do I need to do that everywhere at once or can I do that that step by step without breaking the whole plugin?
Martin |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,648 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Originally Posted by: mkraska Seems that I asked the wrong question, I misunderstood an VS error message. It was about the result type, not of the argument type of Decision.NumericCalculation. I need to see how to handle TNumber objects. Numeric library makes really easy to handle TNumbers... some examples here (see f.e. fft2) and here (logic starts from line 360) (I'll look if I can post something compact and complete later tonight) Originally Posted by: mkraska BTW, if I want to move towards Entry instead of Term[] in the function arguments, do I need to do that everywhere at once or can I do that that step by step without breaking the whole plugin? Absolutely, you can start implementing the IPluginLowLevelEvaluationFast instead of the IPluginLowLevelEvaluation, and convert Entry to Terms[] from where you don't are yet arrived in refactoring. |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
[Dev] How to convert Term[] to Entry
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.