CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Steve Hebert's Development Blog

Steve's Blog - From .Net to dotMath and everything in between.

Introducing dotMath...

I've created a math compiler written entirely in C# called dotMath.  I'm thinking about releasing it under GPL, I'm in the process of seeing how to release it and the associated pro's and con's.  I'd love to find someone who has done or is doing this and blogging the experience. 

The library is a two-pass compiler.  Once the compilation phase is complete, parsing is no longer needed to evaluate the expression.  The library offers roughly 100-fold speed improvement over parsing-based evaluators.

The library can be used with variables and the API allows for full discovery/setting of the variables.  Here's sample code that uses the library:

dotMath.CFuncCompiler oComp = new dotMath.CFuncCompiler( "(3*sin(x))/5");
oComp.Compile();  // normally set try..catch to trap syntax/expression errors

double dXValue = 10;
double dYValue = 0;
for( int i = 0; i < 100; i++)
{
   oComp.SetValue("x", dXValue++ );
   dYvalue = oComp.Evaluate();

   // do something with y-value here
}

In addition,  users may create and register their own functions with the class thereby increasing the capabilities of the compiler without dealing with the parsing and compilation details.

I'll keep blogging the experience of taking this public.... stay tuned!  :)

 


Published May 17 2004, 01:29 PM by shebert
Filed under: ,

Comments

Steve Hebert said:

Thanks for the comments. I'm fishing through the GPL license details at SourceForge.net and meanwhile I've thrown out another blog post on the topic.

I'm hoping to get this library available soon, it will be nice to get some other eyes on the library. I've been running variations of this code in a number of places over the years and it'll be nice to get other sets of eyes on it.
# May 18, 2004 3:01 AM

Steve Hebert said:

I have placed the latest info on dotMath at
http://dotnetjunkies.com/WebLog/sdhebert/archive/2004/05/20/14093.aspx.

The project now has a home at SourceForge, you'll see the details on the new post.

-Steve
# May 20, 2004 9:59 AM

Steve Hebert said:

The .Math project is now available for testing and download. Check out my blog entry at http://dotnetjunkies.com/WebLog/sdhebert/archive/2004/05/26/14613.aspx.
# May 26, 2004 5:39 PM

Steve Hebert's Development Blog said:

.Math turns 1.0
# July 15, 2004 3:36 AM
Check out Devlicio.us!

Our Sponsors

Free Tech Publications