Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Math::Symbolic::Compiler 0.508

    Download button

    No screenshots available
    Downloads: 287  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Steffen Muller | More programs
    Perl Artistic License / FREE
    July 10th, 2007, 12:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Math::Symbolic::Compiler description

    Math::Symbolic::Compiler is a Perl module that can compile Math::Symbolic trees to Perl code.

    Math::Symbolic::Compiler is a Perl module that can compile Math::Symbolic trees to Perl code.

    SYNOPSIS

    use Math::Symbolic::Compiler;

    # A tree to compile
    my $tree = Math::Symbolic->parse_from_string('a^2 + b * c * 2');

    # The Math::Symbolic::Variable 'a' will be evaluated to $_[1], etc.
    my $vars = [qw(b a c)];

    my ($closure, $code, $trees) =
    Math::Symbolic::Compiler->compile($tree, $vars);

    print $closure->(2, 3, 5); # (b, a, c)
    # prints 29 (= 3^2 + 2 * 5 * 2)

    # or:
    ($closure, $trees) =
    Math::Symbolic::Compiler->compile_to_sub($tree, $vars);

    ($code, $trees) = Math::Symbolic::Compiler->compile_to_code($tree, $vars);

    This module allows to compile Math::Symbolic trees to Perl code and/or anonymous subroutines whose arguments will be positionally mapped to the variables of the compiled Math::Symbolic tree.

    The reason you'd want to do this is that evaluating a Math::Symbolic tree to its numeric value is extremely slow. So is compiling, but once you've done all necessary symbolic calculations, you can take advantage of the speed gain of invoking a closure instead of evaluating a tree.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    compile Math::Symbolic trees | Perl code | Perl module | Math::Symbolic::Comp | compile | Math::Symbolic

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM