1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>libqalculate-0.9.6: Index</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.3 -->
<div class="qindex"><a class="qindexHL" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
<h1>Index </h1>
<p>
<h2><a class="anchor" name="intro_sec">
Introduction</a></h2>
libqalculate is math libary for expression evaluation with units, variables and functions support and CAS functionality.<p>
The main parts of the library is the almighty <a class="el" href="classCalculator.html">Calculator</a> class, the <a class="el" href="classMathStructure.html">MathStructure</a> class for mathematical expressions and classes for objects in an epxression, mostly of the class Numbers and sub classes of <a class="el" href="classExpressionItem.html">ExpressionItem</a>.<p>
A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.) and use the calculate function as follows: <div class="fragment"><pre class="fragment"> <span class="keyword">new</span> <a class="code" href="classCalculator.html">Calculator</a>();
CALCULATOR->loadGlobalDefinitions();
CALCULATOR->loadLocalDefinitions();
<a class="code" href="structEvaluationOptions.html">EvaluationOptions</a> eo;
<a class="code" href="classMathStructure.html">MathStructure</a> result = CALCULATOR->calculate(<span class="stringliteral">"1 + 1"</span>, eo);
</pre></div><p>
More complex usage mainly involves manipulating objects of the <a class="el" href="classMathStructure.html">MathStructure</a> class directly.<p>
To display the resulting expression you will normally use MathStructure::format() followed by MathStructure::print() as follows: <div class="fragment"><pre class="fragment"> <a class="code" href="structPrintOptions.html">PrintOptions</a> po;
result.<a class="code" href="classMathStructure.html#z39_4">format</a>(po);
string result_str = result.<a class="code" href="classMathStructure.html#z39_11">print</a>(po);
</pre></div><p>
Central to the flexiblity of libqalculate is the many options passed to evaluating and display functions with <a class="el" href="structEvaluationOptions.html">EvaluationOptions</a> and <a class="el" href="structPrintOptions.html">PrintOptions</a>.<h2><a class="anchor" name="usage_sec">
Using the library</a></h2>
libqalculate uses pkg-config.<p>
For a simple program use pkg-config on the command line: <div class="fragment"><pre class="fragment"> c++ `pkg-config --cflags --libs libqalculate` hello.c -o hello
</pre></div><p>
If the program uses autoconf, put the following in configure.in: <div class="fragment"><pre class="fragment"> PKG_CHECK_MODULES(QALCULATE, [
libqalculate >= 0.9.6
])
AC_SUBST(QALCULATE_CFLAGS)
AC_SUBST(QALCULATE_LIBS)
</pre></div> <hr size="1"><address style="align: right;"><small>
Generated on 17 Jun 2007 for libqalculate-0.9.6 by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.3</small></address>
</body>
</html>
|