Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline mkraska  
#1 Posted : 16 August 2017 10:51:38(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

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.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 16 August 2017 11:21:07(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
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
thanks 1 user thanked Davide Carpi for this useful post.
on 16/08/2017(UTC)
Offline mkraska  
#3 Posted : 16 August 2017 13:26:33(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

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
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Davide Carpi  
#4 Posted : 16 August 2017 21:06:36(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: mkraska Go to Quoted Post
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 Go to Quoted Post
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
Users browsing this topic
Guest
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.