You're right that if it's possible to solve the problem without using Mathematica, XS / Inline::C library wrapping, it is better to try what's available. However, I figured that I would put it out there, so that OP would know that there are other options if the problem gets complex enough.

I'm a big fan of Perl, but to be honest, not every problem is right for it. If the OP can get a more elegant solution by using a technical computing platform like Matlab, or Mathematica (and if they can afford to), he or she may want to. However, if the OP has a reason to use Perl -- perhaps to interface with a CGI script or already existing Tk/Perl application? -- the option is there.

I would also like to point out, that the OP doesn't have to use XS to return the values. If the solution is significantly complex, or the number is to a precision bigger then you can return via XS, or there is another reason to make XS a bad solution, it is possible to send the result over a Unix domain socket or a TCP/IP connection, or through a database, or put it in a file, or any of a number of possible solutions. Sometimes the best way to use a program is via a system() call that invokes a program that sends the data back to the program via a Unix domain socket. Of course, you're still going to have to roll your own protocol, but I figured I would put it out there so that the OP can decide what is best for his/her needs.


Want to support the EFF and FSF by buying cool stuff? Click here.

In reply to Re: Re: Re: Re: Re: Geometric Optimisation and Perl by Vautrin
in thread Geometric Optimisation and Perl by stefzody

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.