dasema


This documentation (rev. 0.1) describes v0.1 of the C++ backend for data set manipulation - dasema.

dasema can be obtained from the Sourceforge project area.

1  Introduction

1.1  What Dasema is, and what it is not

dasema is a C++ class designed as a compact, fast and simple math parser to be included in other projects. Its main selling points are:
However, dasema is not a full-featured parser. The syntax of the input formula is pretty strict (see 2.2 Formula syntax[LINK]), and things like looping to apply a formula to multiple datapoints is left to the frontend in order to ensure the backend's KISS mentality.

1.2  Current project status

As of version 0.1, dasema has entered it's beta stage. It is an early birth, and as a result some features are not completely debugged, and others not yet implemented. As it is now, we hope dasema can be to inspiration for some, and once it reaches maturity we are sure it will be of use for developers (the dasema backend) and end-users (the dsm frontend) alike.

2  Using dasema in your own project

2.1  General

As mentioned, dasema is compact and simple, and using it is no different. To include dasema in your own project, simply include dasema.h where needed and compile the source files in the dasema directory with the rest of your source files. (Currently there are three source files which needs to be compiled, including dasema.cpp. This is a tad bit unfortunate, but is a result of the project being in beta. Work is in progress to either reduce the project to one header file and one source file (for ease of use), or combining the different source files into a library.)

2.2  API

Only two functions are public in the dasema class:
Set() creates a parse tree from a formula given to it in string-form. It will throw an exception if the provided formula is illegal, but currently returns [1|true|success] no matter what the result is.
Get() uses the parse tree from Set() to apply the formula to datapoints. The datapoints (variables) are placed in the second argument array when calling Get(). The first argument is the number of variables, counting from 1 (Note: currently the number of variables is limited to 3, which are represented in the formula by the letters 'x', 'y' and 'z'). Returned from Get() is the result of the formula.
Here is a code snipplet showing basic useage of the dasema class:
    Dasema myDasemaObject;
    
    myDasemaObject.Set("x+1");
    
    double variables[] = {1.45};
    
    double result = 0;
    
    result = myDasemaObject.Get(1, variables); //The value of result is now 2.45
    

2.3  Formula syntax

Coming soon...

2.4  SWIG

Coming soon...

3  Copying

Copyright (c) 2008 Ariel Ladegard
Copyright (c) 2008 Peter Bock

  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.2
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is included in the section entitled "Copying".
  



File translated from TEX by TTH, version 3.80.
On 6 Jun 2008, 12:59.