<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>dotMath Wiki &amp; Documentation Rss Feed</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home</link><description>dotMath Wiki Rss Description</description><item><title>UPDATED WIKI: The History of dotMath</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The History of dotMath&amp;version=5</link><description>&lt;p&gt;
&lt;h2&gt;A Brief History of dotMath&lt;/h2&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Initial Design&lt;/h3&gt;
The initial design of .Math came about in 1997 with a need to create a function evaluator in C++.&amp;nbsp;&amp;nbsp;After looking around for commercial libraries, the pieces available generally reached a complexity we weren’t requiring and too expensive.&amp;nbsp;&amp;nbsp;We had a need for fairly simple equations (such as 4&lt;b&gt;x^2 + 2&lt;/b&gt;x +24) where we would perform a wide range of values for x and evaluate each one.&amp;nbsp;&amp;nbsp;I went back to my college compiler books, read up on the subject and decided I could handle the problem myself.&amp;nbsp;&amp;nbsp;I decided to expose the variables thorough an interface and allow them to be discovered and set.&amp;nbsp;&amp;nbsp;At this point the code supported a minimal set of trig-functions.&amp;nbsp;&amp;nbsp;This implementation ran approximately 75,000 calculations per second on a Pentium 2 450.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Creating the Compiler&lt;/h3&gt;
I used similar implementations on other projects and contemplated createing a ‘true’ compiler.&amp;nbsp;&amp;nbsp;The speed increase would be significant, but never significant enough to warrant the time spent.&amp;nbsp;&amp;nbsp;Then, in 2000, I decided to go ahead tackle the problem. It became apparent I could make this into a nice O-O based structure with the implementation classes compiled in C++ and instantiated as-needed.&amp;nbsp;&amp;nbsp;This structure gave me the opportunity to make the compiler extensible by registering new functions with the framework. Given the O-O framework, the first two-passes are handled by the code, while the linking was handled during the application compile. It’s a different way of looking at the compilation problem, but much simpler in terms of building and delivering the solution.&amp;nbsp;&amp;nbsp;I took this implementation and ported it to an early Visual Basic.NET implementation to test how the new language O-O features behaved.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Multi-Parameter Functions and Binary Operators&lt;/h3&gt;
Shortly after creating the compiler, the need for more complex functions arose.&amp;nbsp;&amp;nbsp;These functions were modeled after the Excel format with comma-separators.&amp;nbsp;&amp;nbsp;I quickly realized that each function within the statement could be handled as a separate compiled function that shared the same variable space with the rest of the equation.&amp;nbsp;&amp;nbsp;At that point, the implementation became very simple.&amp;nbsp;&amp;nbsp;The most intriguing function then became the If-statement as such:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
if&amp;#40; condition, then-result, else-result &amp;#41;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
The if-statement required the use of binary operators (&amp;lt;, &amp;gt;, &amp;lt;=, &amp;lt;&amp;gt;, etc).&amp;nbsp;&amp;nbsp;The binary operation returns a 1 for true or a 0 for false.&amp;nbsp;&amp;nbsp;The if statement only tests for 0 equality – perform else portion if 0, otherwise perform then portion.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Porting to C# and the .NET Platform&lt;/h3&gt;
I ported the code to C# in 2003 out of interest in reviving the code.&amp;nbsp;&amp;nbsp;I later used the project in 2004 to provide dimensionality support to a planning application.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Looking Ahead&lt;/h3&gt;
There are a number of directions the code can take, including code optimization and levelization of the called objects.&amp;nbsp;&amp;nbsp;Levelization offers the biggest payback because the current implementation relies heavily on the call-stack.&amp;nbsp;&amp;nbsp;Getting away from the call-stack will remove the reliance on the memory allocations and jumps that become significant when doing millions of operations. I believe levelization of the function calls would involve using an accumulator structure for storing operation values one at a time.&lt;br/&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Thu, 26 Oct 2006 01:50:06 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: The History of dotMath 20061026015006A</guid></item><item><title>UPDATED WIKI: Built-in functions and operators</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in functions and operators&amp;version=3</link><description>&lt;p&gt;
&lt;h2&gt;Built-in Operators and Functions&lt;/h2&gt;
&lt;/p&gt;
&lt;p&gt;
The following lists show the built-in functions and operators that are included in dotMath.&amp;nbsp;&amp;nbsp;You can add your own functions by creating classes and registering with dotMath before compiling.&amp;nbsp;&amp;nbsp;Check out &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt; to learn more.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Binary Operators &lt;/h3&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;table border="1" cellspacing="0" cellpadding="3" &gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;=&lt;/td&gt;&lt;td&gt;Returns 1 if both sides are equal.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;lt;&lt;/td&gt;&lt;td&gt;Returns 1 if left side is less than the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;gt;&lt;/td&gt;&lt;td&gt;Returns 1 if left side is greater than the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;lt;=&lt;/td&gt;&lt;td&gt;Returns 1 if the left side is less than or equal to the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;gt;=&lt;/td&gt;&lt;td&gt;Returns 1 if the left side is greater than or equal to the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;lt;&amp;gt;&lt;/td&gt;&lt;td&gt;Returns 1 if the left side is not equal to the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;amp;&lt;/td&gt;&lt;td&gt;Returns 1 if both sides are not equal to 0&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;Returns 1 if one or both sides are not equal to 1.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Built-in Functions&lt;/h3&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;table border="1" cellspacing="0" cellpadding="3" &gt;&lt;tr&gt;&lt;th&gt;Function&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Abs&lt;/td&gt;&lt;td&gt;Absolute value of a specified value or expression.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Acos&lt;/td&gt;&lt;td&gt;Returns the angle whose cosine is the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Asin&lt;/td&gt;&lt;td&gt;Returns the angle whose sin is the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Atan&lt;/td&gt;&lt;td&gt;Returns the angle whose tangent is the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Ceiling&lt;/td&gt;&lt;td&gt;Returns the smallest whole number greater than or equal to the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Cos&lt;/td&gt;&lt;td&gt;Returns the cosine of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Cosh&lt;/td&gt;&lt;td&gt;Returns the hyperbolic cosine of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Exp&lt;/td&gt;&lt;td&gt;Returns e raised to the specified power.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Floor&lt;/td&gt;&lt;td&gt;Returns the largest whole number less than or equal to the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Log&lt;/td&gt;&lt;td&gt;Returns the logarithm of the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Log10&lt;/td&gt;&lt;td&gt;Returns the base 10 logarithm of the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Round&lt;/td&gt;&lt;td&gt;Returns the value nearest the specified value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sign&lt;/td&gt;&lt;td&gt;Returns a value indicating the sign of the specified value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sin&lt;/td&gt;&lt;td&gt;Returns the sine of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sinh&lt;/td&gt;&lt;td&gt;Returns the hyperbolic sine of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sqrt&lt;/td&gt;&lt;td&gt;Returns the square root of the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tan&lt;/td&gt;&lt;td&gt;Returns the tangent of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tanh&lt;/td&gt;&lt;td&gt;Returns the hyperbolic tangent of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Min&lt;/td&gt;&lt;td&gt;Min(expr1, expr2, &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=%u2026%2c%20expr%28n%29"&gt;…, expr(n)&lt;/a&gt;)&amp;nbsp;&amp;nbsp;Min returns the minimum value among the list of evaluated expressions.&amp;nbsp;&amp;nbsp;The list may contain 2 or more elements.&amp;nbsp;&amp;nbsp;Highest current test uses 50,000 values in the expression list.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Max&lt;/td&gt;&lt;td&gt;Max(expr1, expr2, &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=%u2026%2c%20expr%28n%29"&gt;…, expr(n)&lt;/a&gt;)&amp;nbsp;&amp;nbsp;Max returns the maximum value among the list of evaluated expressions.&amp;nbsp;&amp;nbsp;The list may contain 2 or more elements.&amp;nbsp;&amp;nbsp;Highest current test uses 50,000 values in the expression list.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;If&lt;/td&gt;&lt;td&gt;If( binary&lt;i&gt;expression, true&lt;/i&gt;expression, false&lt;i&gt;expression )&amp;nbsp;&amp;nbsp;If the value of binary&lt;/i&gt;expression is non-zero, the true&lt;i&gt;expression evaluation is returned. Otherwies the false&lt;/i&gt;expression is returned.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Thu, 26 Oct 2006 01:49:55 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Built-in functions and operators 20061026014955A</guid></item><item><title>UPDATED WIKI: Getting Started - How to use dotMath</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting Started - How to use dotMath&amp;version=3</link><description>&lt;p&gt;
&lt;h2&gt;How to use dotMath&lt;/h2&gt;
&lt;/p&gt;
&lt;p&gt;
The following page is focused on understanding how to use dotMath in your application and get up and running in the shortest amount of time.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
If you are using the compiled assembly library, be sure to create a reference to the .Math library and include the library DLL in your distribution package.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Scenario 1:&amp;nbsp;&amp;nbsp;Evaluating an Expression&lt;/h3&gt;
&lt;/p&gt;
&lt;p&gt;
In order to take an expression without variables stored in a string – sExpression – and evaluate its value we need the following set of code.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
sExpression &amp;#61; &amp;#8220;4&amp;#43;3&amp;#8221;&amp;#59;
EqCompiler oCompiler &amp;#61; new EqCompiler&amp;#40; sExpression, true&amp;#41;&amp;#59;
oCompiler.Compile&amp;#40;&amp;#41;&amp;#59;
double dValue &amp;#61; oCompiler.Calculate&amp;#40;&amp;#41;&amp;#59;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
If you do not perform the ‘.Compile()’ step, it will be executed automatically the first time you perform ‘.Calculate();’.&amp;nbsp;&amp;nbsp;Wherever the compile step is performed it is important to place a try..catch block around it to capture any compilation errors.&amp;nbsp;&amp;nbsp;All errors raised by the compilers are ApplicationExceptions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Scenario 2: Evaluating an Expression with Variables&lt;/h3&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Taking advantage of expressions with variables involves discovering the variables and setting them before performing the .Calculate() step.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
sExpression &amp;#61; &amp;#8220;a&amp;#43;b&amp;#8221;&amp;#59;
EqCompiler oCompiler &amp;#61; new EqCompiler&amp;#40; sExpression, true&amp;#41;&amp;#59;
oCompiler.Compile&amp;#40;&amp;#41;&amp;#59;
string&amp;#91;&amp;#93; asVars &amp;#61; oCompiler.GetVariableList&amp;#40;&amp;#41;&amp;#59;
&amp;#47;&amp;#47; At this point we have the variable list and we can do what we want.
&amp;#47;&amp;#47; Here, we&amp;#8217;ll set the values of each variable using the interface&amp;#8230;
double dValue &amp;#61; 1.0&amp;#59;
foreach &amp;#40;string sVar in asVars&amp;#41;
&amp;#123;
       oCompiler.SetVariable&amp;#40; sVar, dValue &amp;#41;&amp;#59;
       dValue &amp;#61; dValue &amp;#43;1.5&amp;#59;    
&amp;#125;
&amp;#47;&amp;#47; at this point we&amp;#8217;re ready to calculate the expression with our declared variable values.
double dValue &amp;#61; oCompiler.Calculate&amp;#40;&amp;#41;&amp;#59;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Scenario 3:&amp;nbsp;&amp;nbsp;Adding user-defined functions to the compiler’s syntax.&lt;/h3&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The .Math library allows the user to extend the syntax of functions by creating classes and registering them with the compiler. In this case, we’ll create a function called Pythag(a,b) where given the length of side a and the length of side b, we’ll return side c (assuming we’re dealing with a right triangle).&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
First, we’ll create our class:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
using dotMath&amp;#59;
&amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;
&amp;#47;&amp;#47;&amp;#47; CTanh class&amp;#58; Returns the hyperbolic tangent of the supplied angle.
&amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;
public class CPythag &amp;#58; EqCompiler.CFunction 
&amp;#123;
         ArrayList m_alValues&amp;#59;
         public CPythag&amp;#40; &amp;#41;       
         &amp;#123;
         &amp;#125;
          &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;
         &amp;#47;&amp;#47;&amp;#47; CreateInstance&amp;#58; this function is used to create
         &amp;#47;&amp;#47;&amp;#47; and return an object for evaluation of Pythag&amp;#40;a,b&amp;#41;
         &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;
         public override EqCompiler.CFunction CreateInstance&amp;#40; ArrayList alValues &amp;#41; 
         &amp;#123;
                  CPythag oPythag &amp;#61; new CPythag&amp;#40;&amp;#41;&amp;#59;
                  oPythag.SetValue&amp;#40; alValues &amp;#41;&amp;#59;
                  return oPythag&amp;#59;
         &amp;#125;
          &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;
         &amp;#47;&amp;#47;&amp;#47; SetValue&amp;#40;ArrayList&amp;#41;&amp;#58; this function accepts an arraylist
         &amp;#47;&amp;#47;&amp;#47; of CValue objects that represent the parameters passed.
         &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;
         public override void SetValue&amp;#40; ArrayList alValues &amp;#41;
         &amp;#123;
                  &amp;#47;&amp;#47;&amp;#47; CheckParms is a CFunction member that validates
                  &amp;#47;&amp;#47; the number of parameters.  It throws an exception
                  &amp;#47;&amp;#47; formatted for the client if a mismatch occurs.
                  CheckParms&amp;#40;alValues,2&amp;#41;&amp;#59;
                  m_alValues &amp;#61; alValues&amp;#59;
         &amp;#125;
         &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;
         &amp;#47;&amp;#47;&amp;#47; GetValue&amp;#40;&amp;#41;&amp;#58; returns the evaluated function value during
         &amp;#47;&amp;#47;&amp;#47; the .Calculate process.
         &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;
         public override double GetValue&amp;#40;&amp;#41;
         &amp;#123;
                  EqCompiler.CValue oValue1 &amp;#61; &amp;#40;EqCompiler.CValue&amp;#41; m_alValues&amp;#91;0&amp;#93;&amp;#59;
                  EqCompiler.CValue oValue2 &amp;#61; &amp;#40;EqCompiler.CValue&amp;#41; m_alValues&amp;#91;1&amp;#93;&amp;#59;
                  return Math.Sqrt&amp;#40;Math.Pow&amp;#40;oValue1.GetValue&amp;#40;&amp;#41;,2&amp;#41; &amp;#43; Math.Pow&amp;#40;oValue2.GetValue&amp;#40;&amp;#41;,2&amp;#41;&amp;#41;&amp;#59;       &amp;#125;
          public override string GetFunction&amp;#40;&amp;#41;
         &amp;#123;
                  return &amp;#34;pythag&amp;#34;&amp;#59;
         &amp;#125;
&amp;#125;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
When we’re ready to evaluate the function, the following code enables the function:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
string sFunction &amp;#61; &amp;#8220;pythag&amp;#40;2,4&amp;#41;&amp;#8221;&amp;#59;
EqCompiler eq &amp;#61; new EqCompiler&amp;#40; txtFunction.Text.Trim&amp;#40;&amp;#41;,true&amp;#41;&amp;#59;
eq.AddFunction&amp;#40; new CPythag&amp;#40;&amp;#41; &amp;#41;&amp;#59;
&lt;/pre&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Thu, 26 Oct 2006 01:49:43 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Getting Started - How to use dotMath 20061026014943A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=22</link><description>&lt;p&gt;
&lt;h1&gt;Welcome to the &lt;i&gt;dotMath Library&lt;/i&gt;&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
If you need to evaluate fixed or variable expressions, dotMath is your solution:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;fixed expression example:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(sin(5)* cos(4/5)) / 3&lt;/i&gt;&lt;br/&gt;
&lt;i&gt;variable expressions example: (sin(a)* cos(b/a)) / c&lt;/i&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
Download the Version 1.0 release here... [release:875]&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Thu, 26 Oct 2006 01:49:24 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061026014924A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=21</link><description>&lt;p&gt;
&lt;h1&gt;Welcome to the &lt;i&gt;dotMath Library&lt;/i&gt;&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
If you need to evaluate fixed or variable expressions, dotMath is your solution:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;fixed expression example:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(sin(5)* cos(4/5)) / 3&lt;/i&gt;&lt;br/&gt;
&lt;i&gt;variable expressions example: (sin(a)* cos(b/a)) / c&lt;/i&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
Download the Version 1.0 release here... [release:875]&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 21:09:07 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025090907P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=20</link><description>&lt;p&gt;
&lt;h1&gt;Steve Hebert's dotMath Library&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
If you need to evaluate fixed or variable expressions, dotMath is your solution:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;fixed expression example:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(sin(5)* cos(4/5)) / 3&lt;/i&gt;&lt;br/&gt;
&lt;i&gt;variable expressions example: (sin(a)* cos(b/a)) / c&lt;/i&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
Download the Version 1.0 release here... [release:875]&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 21:06:10 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025090610P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=19</link><description>&lt;p&gt;
&lt;h1&gt;Steve Hebert's dotMath Library&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
Download the Version 1.0 release here... [release:875]&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 21:00:17 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025090017P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=18</link><description>&lt;p&gt;
&lt;h1&gt;The dotMath Library&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
Download the Version 1.0 release here... [release:875]&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 21:00:03 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025090003P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=17</link><description>&lt;p&gt;
&lt;h1&gt;The dotMath Library&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h4&gt;dotMath is being moved to it's new home - CodePlex.&amp;nbsp;&amp;nbsp;Please be patient, we'll have the source and documentation moved shortly.&lt;/h4&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
Download the Version 1.0 release here... [release:875]&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 20:59:26 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025085926P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=16</link><description>&lt;p&gt;
&lt;h1&gt;The dotMath Library&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h4&gt;dotMath is being moved to it's new home - CodePlex.&amp;nbsp;&amp;nbsp;Please be patient, we'll have the source and documentation moved shortly.&lt;/h4&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 15:25:59 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025032559P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=15</link><description>&lt;p&gt;
&lt;h1&gt;The dotMath Library&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h2&gt;dotMath is being moved to it's new home - CodePlex.&amp;nbsp;&amp;nbsp;Please be patient, we'll have the source and documentation moved shortly.&lt;/h2&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 15:25:46 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025032546P</guid></item><item><title>UPDATED WIKI: The History of dotMath</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The History of dotMath&amp;version=4</link><description>&lt;p&gt;
&lt;h2&gt;A Brief History of dotMath&lt;/h2&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Initial Design&lt;/h3&gt;
The initial design of .Math came about in 1997 with a need to create a function evaluator in C++.&amp;nbsp;&amp;nbsp;After looking around for commercial libraries, the pieces available generally reached a complexity we weren’t requiring and too expensive.&amp;nbsp;&amp;nbsp;We had a need for fairly simple equations (such as 4&lt;b&gt;x^2 + 2&lt;/b&gt;x +24) where we would perform a wide range of values for x and evaluate each one.&amp;nbsp;&amp;nbsp;I went back to my college compiler books, read up on the subject and decided I could handle the problem myself.&amp;nbsp;&amp;nbsp;I decided to expose the variables thorough an interface and allow them to be discovered and set.&amp;nbsp;&amp;nbsp;At this point the code supported a minimal set of trig-functions.&amp;nbsp;&amp;nbsp;This implementation ran approximately 75,000 calculations per second on a Pentium 2 450.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Creating the Compiler&lt;/h3&gt;
I used similar implementations on other projects and contemplated createing a ‘true’ compiler.&amp;nbsp;&amp;nbsp;The speed increase would be significant, but never significant enough to warrant the time spent.&amp;nbsp;&amp;nbsp;Then, in 2000, I decided to go ahead tackle the problem. It became apparent I could make this into a nice O-O based structure with the implementation classes compiled in C++ and instantiated as-needed.&amp;nbsp;&amp;nbsp;This structure gave me the opportunity to make the compiler extensible by registering new functions with the framework. Given the O-O framework, the first two-passes are handled by the code, while the linking was handled during the application compile. It’s a different way of looking at the compilation problem, but much simpler in terms of building and delivering the solution.&amp;nbsp;&amp;nbsp;I took this implementation and ported it to an early Visual Basic.NET implementation to test how the new language O-O features behaved.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Multi-Parameter Functions and Binary Operators&lt;/h3&gt;
Shortly after creating the compiler, the need for more complex functions arose.&amp;nbsp;&amp;nbsp;These functions were modeled after the Excel format with comma-separators.&amp;nbsp;&amp;nbsp;I quickly realized that each function within the statement could be handled as a separate compiled function that shared the same variable space with the rest of the equation.&amp;nbsp;&amp;nbsp;At that point, the implementation became very simple.&amp;nbsp;&amp;nbsp;The most intriguing function then became the If-statement as such:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
if&amp;#40; condition, then-result, else-result &amp;#41;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
The if-statement required the use of binary operators (&amp;lt;, &amp;gt;, &amp;lt;=, &amp;lt;&amp;gt;, etc).&amp;nbsp;&amp;nbsp;The binary operation returns a 1 for true or a 0 for false.&amp;nbsp;&amp;nbsp;The if statement only tests for 0 equality – perform else portion if 0, otherwise perform then portion.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Porting to C# and the .NET Platform&lt;/h3&gt;
I ported the code to C# in 2003 out of interest in reviving the code.&amp;nbsp;&amp;nbsp;I later used the project in 2004 to provide dimensionality support to a planning application.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Looking Ahead&lt;/h3&gt;
There are a number of directions the code can take, including code optimization and levelization of the called objects.&amp;nbsp;&amp;nbsp;Levelization offers the biggest payback because the current implementation relies heavily on the call-stack.&amp;nbsp;&amp;nbsp;Getting away from the call-stack will remove the reliance on the memory allocations and jumps that become significant when doing millions of operations. I believe levelization of the function calls would involve using an accumulator structure for storing operation values one at a time.&lt;br/&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 15:12:49 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: The History of dotMath 20061025031249P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=14</link><description>&lt;p&gt;
&lt;h1&gt;The dotMath Library&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 14:57:19 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025025719P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=13</link><description>&lt;p&gt;
Welcome to dotMath, the extensible OpenSource expression compiler for the .NET platform written entirely in C#.&amp;nbsp;&amp;nbsp;Offering speed through compilation of expressions, the library allows for variable handling, an entire function library and the ability to add your own functions.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 14:56:51 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025025651P</guid></item><item><title>UPDATED WIKI: The History of dotMath</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The History of dotMath&amp;version=3</link><description>&lt;p&gt;
&lt;h2&gt;A Brief History of dotMath&lt;/h2&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Initial Design&lt;/h3&gt;
The initial design of .Math came about in 1997 with a need to create a function evaluator in C++.&amp;nbsp;&amp;nbsp;After looking around for commercial libraries, the pieces available generally reached a complexity we weren’t requiring and too expensive.&amp;nbsp;&amp;nbsp;We had a need for fairly simple equations (such as 4&lt;b&gt;x^2 + 2&lt;/b&gt;x +24) where we would perform a wide range of values for x and evaluate each one.&amp;nbsp;&amp;nbsp;I went back to my college compiler books, read up on the subject and decided I could handle the problem myself.&amp;nbsp;&amp;nbsp;I decided to expose the variables thorough an interface and allow them to be discovered and set.&amp;nbsp;&amp;nbsp;At this point the code supported a minimal set of trig-functions.&amp;nbsp;&amp;nbsp;This implementation ran approximately 75,000 calculations per second on a Pentium 2 450.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
!!!Creating the Compiler&lt;br/&gt;
I used similar implementations on other projects and contemplated createing a ‘true’ compiler.&amp;nbsp;&amp;nbsp;The speed increase would be significant, but never significant enough to warrant the time spent.&amp;nbsp;&amp;nbsp;Then, in 2000, I decided to go ahead tackle the problem. It became apparent I could make this into a nice O-O based structure with the implementation classes compiled in C++ and instantiated as-needed.&amp;nbsp;&amp;nbsp;This structure gave me the opportunity to make the compiler extensible by registering new functions with the framework. Given the O-O framework, the first two-passes are handled by the code, while the linking was handled during the application compile. It’s a different way of looking at the compilation problem, but much simpler in terms of building and delivering the solution.&amp;nbsp;&amp;nbsp;I took this implementation and ported it to an early Visual Basic.NET implementation to test how the new language O-O features behaved.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Multi-Parameter Functions and Binary Operators&lt;/h3&gt;
Shortly after creating the compiler, the need for more complex functions arose.&amp;nbsp;&amp;nbsp;These functions were modeled after the Excel format with comma-separators.&amp;nbsp;&amp;nbsp;I quickly realized that each function within the statement could be handled as a separate compiled function that shared the same variable space with the rest of the equation.&amp;nbsp;&amp;nbsp;At that point, the implementation became very simple.&amp;nbsp;&amp;nbsp;The most intriguing function then became the If-statement as such:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
if&amp;#40; condition, then-result, else-result &amp;#41;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
The if-statement required the use of binary operators (&amp;lt;, &amp;gt;, &amp;lt;=, &amp;lt;&amp;gt;, etc).&amp;nbsp;&amp;nbsp;The binary operation returns a 1 for true or a 0 for false.&amp;nbsp;&amp;nbsp;The if statement only tests for 0 equality – perform else portion if 0, otherwise perform then portion.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Porting to C# and the .NET Platform&lt;/h3&gt;
I ported the code to C# in 2003 out of interest in reviving the code.&amp;nbsp;&amp;nbsp;I later used the project in 2004 to provide dimensionality support to a planning application.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Looking Ahead&lt;/h3&gt;
There are a number of directions the code can take, including code optimization and levelization of the called objects.&amp;nbsp;&amp;nbsp;Levelization offers the biggest payback because the current implementation relies heavily on the call-stack.&amp;nbsp;&amp;nbsp;Getting away from the call-stack will remove the reliance on the memory allocations and jumps that become significant when doing millions of operations. I believe levelization of the function calls would involve using an accumulator structure for storing operation values one at a time.&lt;br/&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 14:55:10 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: The History of dotMath 20061025025510P</guid></item><item><title>UPDATED WIKI: The History of dotMath</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The History of dotMath&amp;version=2</link><description>&lt;p&gt;
&lt;h3&gt;Initial Design&lt;/h3&gt;
The initial design of .Math came about in 1997 with a need to create a function evaluator in C++.&amp;nbsp;&amp;nbsp;After looking around for commercial libraries, the pieces available generally reached a complexity we weren’t requiring and too expensive.&amp;nbsp;&amp;nbsp;We had a need for fairly simple equations (such as 4&lt;b&gt;x^2 + 2&lt;/b&gt;x +24) where we would perform a wide range of values for x and evaluate each one.&amp;nbsp;&amp;nbsp;I went back to my college compiler books, read up on the subject and decided I could handle the problem myself.&amp;nbsp;&amp;nbsp;I decided to expose the variables thorough an interface and allow them to be discovered and set.&amp;nbsp;&amp;nbsp;At this point the code supported a minimal set of trig-functions.&amp;nbsp;&amp;nbsp;This implementation ran approximately 75,000 calculations per second on a Pentium 2 450.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
!!!Creating the Compiler&lt;br/&gt;
I used similar implementations on other projects and contemplated createing a ‘true’ compiler.&amp;nbsp;&amp;nbsp;The speed increase would be significant, but never significant enough to warrant the time spent.&amp;nbsp;&amp;nbsp;Then, in 2000, I decided to go ahead tackle the problem. It became apparent I could make this into a nice O-O based structure with the implementation classes compiled in C++ and instantiated as-needed.&amp;nbsp;&amp;nbsp;This structure gave me the opportunity to make the compiler extensible by registering new functions with the framework. Given the O-O framework, the first two-passes are handled by the code, while the linking was handled during the application compile. It’s a different way of looking at the compilation problem, but much simpler in terms of building and delivering the solution.&amp;nbsp;&amp;nbsp;I took this implementation and ported it to an early Visual Basic.NET implementation to test how the new language O-O features behaved.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Multi-Parameter Functions and Binary Operators&lt;/h3&gt;
Shortly after creating the compiler, the need for more complex functions arose.&amp;nbsp;&amp;nbsp;These functions were modeled after the Excel format with comma-separators.&amp;nbsp;&amp;nbsp;I quickly realized that each function within the statement could be handled as a separate compiled function that shared the same variable space with the rest of the equation.&amp;nbsp;&amp;nbsp;At that point, the implementation became very simple.&amp;nbsp;&amp;nbsp;The most intriguing function then became the If-statement as such:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
if&amp;#40; _condition, then-result, else-result_ &amp;#41;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
The if-statement required the use of binary operators (&amp;lt;, &amp;gt;, &amp;lt;=, &amp;lt;&amp;gt;, etc).&amp;nbsp;&amp;nbsp;The binary operation returns a 1 for true or a 0 for false.&amp;nbsp;&amp;nbsp;The if statement only tests for 0 equality – perform else portion if 0, otherwise perform then portion.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Porting to C# and the .NET Platform&lt;/h3&gt;
I ported the code to C# in 2003 out of interest in reviving the code.&amp;nbsp;&amp;nbsp;I later used the project in 2004 to provide dimensionality support to a planning application.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Looking Ahead&lt;/h3&gt;
There are a number of directions the code can take, including code optimization and levelization of the called objects.&amp;nbsp;&amp;nbsp;Levelization offers the biggest payback because the current implementation relies heavily on the call-stack.&amp;nbsp;&amp;nbsp;Getting away from the call-stack will remove the reliance on the memory allocations and jumps that become significant when doing millions of operations. I believe levelization of the function calls would involve using an accumulator structure for storing operation values one at a time.&lt;br/&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 14:54:32 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: The History of dotMath 20061025025432P</guid></item><item><title>UPDATED WIKI: The History of dotMath</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The History of dotMath&amp;version=1</link><description>&lt;p&gt;
&lt;h3&gt;Initial Design&lt;/h3&gt;
The initial design of .Math came about in 1997 with a need to create a function evaluator in C++.&amp;nbsp;&amp;nbsp;After looking around for commercial libraries, the pieces available generally reached a complexity we weren’t requiring and too expensive.&amp;nbsp;&amp;nbsp;We had a need for fairly simple equations (such as 4&lt;b&gt;x^2 + 2&lt;/b&gt;x +24) where we would perform a wide range of values for x and evaluate each one.&amp;nbsp;&amp;nbsp;I went back to my college compiler books, read up on the subject and decided I could handle the problem myself.&amp;nbsp;&amp;nbsp;I decided to expose the variables thorough an interface and allow them to be discovered and set.&amp;nbsp;&amp;nbsp;At this point the code supported a minimal set of trig-functions.&amp;nbsp;&amp;nbsp;This implementation ran approximately 75,000 calculations per second on a Pentium 2 450.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
!!!Creating the Compiler&lt;br/&gt;
I used similar implementations on other projects and contemplated createing a ‘true’ compiler.&amp;nbsp;&amp;nbsp;The speed increase would be significant, but never significant enough to warrant the time spent.&amp;nbsp;&amp;nbsp;Then, in 2000, I decided to go ahead tackle the problem. It became apparent I could make this into a nice O-O based structure with the implementation classes compiled in C++ and instantiated as-needed.&amp;nbsp;&amp;nbsp;This structure gave me the opportunity to make the compiler extensible by registering new functions with the framework. Given the O-O framework, the first two-passes are handled by the code, while the linking was handled during the application compile. It’s a different way of looking at the compilation problem, but much simpler in terms of building and delivering the solution.&amp;nbsp;&amp;nbsp;I took this implementation and ported it to an early Visual Basic.NET implementation to test how the new language O-O features behaved.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Multi-Parameter Functions and Binary Operators&lt;/h3&gt;
Shortly after creating the compiler, the need for more complex functions arose.&amp;nbsp;&amp;nbsp;These functions were modeled after the Excel format with comma-separators.&amp;nbsp;&amp;nbsp;I quickly realized that each function within the statement could be handled as a separate compiled function that shared the same variable space with the rest of the equation.&amp;nbsp;&amp;nbsp;At that point, the implementation became very simple.&amp;nbsp;&amp;nbsp;The most intriguing function then became the If-statement as such:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
if( &lt;i&gt;condition, then-result, else-result&lt;/i&gt; )&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The if-statement required the use of binary operators (&amp;lt;, &amp;gt;, &amp;lt;=, &amp;lt;&amp;gt;, etc).&amp;nbsp;&amp;nbsp;The binary operation returns a 1 for true or a 0 for false.&amp;nbsp;&amp;nbsp;The if statement only tests for 0 equality – perform else portion if 0, otherwise perform then portion.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Porting to C# and the .NET Platform&lt;/h3&gt;
I ported the code to C# in 2003 out of interest in reviving the code.&amp;nbsp;&amp;nbsp;I later used the project in 2004 to provide dimensionality support to a planning application.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Looking Ahead&lt;/h3&gt;
There are a number of directions the code can take, including code optimization and levelization of the called objects.&amp;nbsp;&amp;nbsp;Levelization offers the biggest payback because the current implementation relies heavily on the call-stack.&amp;nbsp;&amp;nbsp;Getting away from the call-stack will remove the reliance on the memory allocations and jumps that become significant when doing millions of operations. I believe levelization of the function calls would involve using an accumulator structure for storing operation values one at a time.&lt;br/&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 14:54:10 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: The History of dotMath 20061025025410P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Home&amp;version=12</link><description>&lt;p&gt;
&lt;h1&gt;Welcome! (Move inprogress)&lt;/h1&gt;
&lt;/p&gt;
&lt;p&gt;
I am currently moving the dotMath project to CodePlex and what a great home this is for open source projects.&amp;nbsp;&amp;nbsp;Please be patient - I am first transitioning all documentation.&amp;nbsp;&amp;nbsp;This way the documentation can live with the project once and for all.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
-Steve&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in%20functions%20and%20operators"&gt;Built-in functions and operators&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The%20History%20of%20dotMath"&gt;The History of dotMath&lt;/a&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 14:52:23 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20061025025223P</guid></item><item><title>CREATED WIKI: The History of dotMath</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=The History of dotMath</link><description></description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 14:52:23 GMT</pubDate><guid isPermaLink="false">CREATED WIKI: The History of dotMath 20061025025223P</guid></item><item><title>UPDATED WIKI: Built-in functions and operators</title><link>http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Built-in functions and operators&amp;version=2</link><description>&lt;p&gt;
&lt;h2&gt;Built-in Operators and Functions&lt;/h2&gt;
&lt;/p&gt;
&lt;p&gt;
The following lists show the built-in functions and operators that are included in dotMath.&amp;nbsp;&amp;nbsp;You can add your own functions by creating classes and registering with dotMath before compiling.&amp;nbsp;&amp;nbsp;Check out &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=Getting%20Started%20-%20How%20to%20use%20dotMath"&gt;Getting Started - How to use dotMath&lt;/a&gt; to learn more.&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Binary Operators&lt;/h3&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;table border="1" cellspacing="0" cellpadding="3" &gt;&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;=&lt;/td&gt;&lt;td&gt;Returns 1 if both sides are equal.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;lt;&lt;/td&gt;&lt;td&gt;Returns 1 if left side is less than the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;gt;&lt;/td&gt;&lt;td&gt;Returns 1 if left side is greater than the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;lt;=&lt;/td&gt;&lt;td&gt;Returns 1 if the left side is less than or equal to the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;gt;=&lt;/td&gt;&lt;td&gt;Returns 1 if the left side is greater than or equal to the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;lt;&amp;gt;&lt;/td&gt;&lt;td&gt;Returns 1 if the left side is not equal to the right.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;amp;&lt;/td&gt;&lt;td&gt;Returns 1 if both sides are not equal to 0&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;Returns 1 if one or both sides are not equal to 1.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;h3&gt;Built-in Functions&lt;/h3&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;table border="1" cellspacing="0" cellpadding="3" &gt;&lt;tr&gt;&lt;th&gt;Function&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Abs&lt;/td&gt;&lt;td&gt;Absolute value of a specified value or expression.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Acos&lt;/td&gt;&lt;td&gt;Returns the angle whose cosine is the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Asin&lt;/td&gt;&lt;td&gt;Returns the angle whose sin is the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Atan&lt;/td&gt;&lt;td&gt;Returns the angle whose tangent is the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Ceiling&lt;/td&gt;&lt;td&gt;Returns the smallest whole number greater than or equal to the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Cos&lt;/td&gt;&lt;td&gt;Returns the cosine of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Cosh&lt;/td&gt;&lt;td&gt;Returns the hyperbolic cosine of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Exp&lt;/td&gt;&lt;td&gt;Returns e raised to the specified power.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Floor&lt;/td&gt;&lt;td&gt;Returns the largest whole number less than or equal to the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Log&lt;/td&gt;&lt;td&gt;Returns the logarithm of the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Log10&lt;/td&gt;&lt;td&gt;Returns the base 10 logarithm of the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Round&lt;/td&gt;&lt;td&gt;Returns the value nearest the specified value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sign&lt;/td&gt;&lt;td&gt;Returns a value indicating the sign of the specified value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sin&lt;/td&gt;&lt;td&gt;Returns the sine of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sinh&lt;/td&gt;&lt;td&gt;Returns the hyperbolic sine of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Sqrt&lt;/td&gt;&lt;td&gt;Returns the square root of the specified number.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tan&lt;/td&gt;&lt;td&gt;Returns the tangent of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tanh&lt;/td&gt;&lt;td&gt;Returns the hyperbolic tangent of the specified angle.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Min&lt;/td&gt;&lt;td&gt;Min(expr1, expr2, &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=%u2026%2c%20expr%28n%29"&gt;…, expr(n)&lt;/a&gt;)&amp;nbsp;&amp;nbsp;Min returns the minimum value among the list of evaluated expressions.&amp;nbsp;&amp;nbsp;The list may contain 2 or more elements.&amp;nbsp;&amp;nbsp;Highest current test uses 50,000 values in the expression list.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Max&lt;/td&gt;&lt;td&gt;Max(expr1, expr2, &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=dotMath&amp;title=%u2026%2c%20expr%28n%29"&gt;…, expr(n)&lt;/a&gt;)&amp;nbsp;&amp;nbsp;Max returns the maximum value among the list of evaluated expressions.&amp;nbsp;&amp;nbsp;The list may contain 2 or more elements.&amp;nbsp;&amp;nbsp;Highest current test uses 50,000 values in the expression list.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;If&lt;/td&gt;&lt;td&gt;If( binary&lt;i&gt;expression, true&lt;/i&gt;expression, false&lt;i&gt;expression )&amp;nbsp;&amp;nbsp;If the value of binary&lt;/i&gt;expression is non-zero, the true&lt;i&gt;expression evaluation is returned. Otherwies the false&lt;/i&gt;expression is returned.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;
&lt;br/&gt;
&lt;/p&gt;
</description><author>sdhebert</author><pubDate>Wed, 25 Oct 2006 14:51:15 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Built-in functions and operators 20061025025115P</guid></item></channel></rss>