1. Introduction

Dodoni.net is a free/open-source library with the aim to provide a object-oriented framework for
  • numerical computations, i.e. Linear Algebra operations, Numerical Integration, Fast-Fourier-Transformation, 1-/n-dimensional Optimization, curve/surface fitting, special functions etc.
  • quantitative finance (pricing and risk management).
The Excel interface of Dodoni.net contains a part that can be seen as a high-level extension of the Excel-DNA library, i.e. it serves as building block for individual Excel Add-In's.
  • The Dodoni.net runtime is free for all use, and distributed under a permissive open-source license that also allows commercial use.
  • The project Roadmap provide an overview of progress made towards releasing a version.
Release notes

2. Preliminaries

As the name indicates, the Dodoni.net library requires
  • Microsoft .NET framework, at least .NET 4.0.
Moreover, the operation system should be
  • Windows XP, Windows Vista or Windows 7 etc. (32- or 64 bit).
Perhaps the framework works under Mono in an Linux environment as well, but it is not tested yet. The complete feature set of Dodoni.net requires external libraries for BLAS, LAPACK, Random Number Generators, Fast-Fourier-Transformations (FFT) etc. Some assemblies contains unsafe code (for native code wrapper), thus the library must run in a full trust environment; in general this is no restriction at all.

... for the Excel Add-In:
The Excel interface is based on the Excel-DNA project, an intuitive open source .NET library for using .NET functions in Excel, designed by Govert van Drimmelen. The Add-In has been tested with
  • Microsoft Excel 2007 and Excel 2010 (32- and 64 bit).
It should work with other MS Excel versions as well. Macro running must be enable, at least for the .XLL file of the Dodoni.net Add-In, change the security level if required. Moreover one should have the right to change (configuration) files in the specified directory.

3. Installation

The distribution of the Dodoni.net project contains a .XLL file and several .dll files. One can use the .XLL file directly in Microsoft Excel. One may change the configuration of the Add-In in the corresponding menu entry (Ribbon). Furthermore the dll's of the Dodoni.net project can be imported into your individual project. The Excel Add-In does not support all features of the Dodoni.net framework.

The complete feature set of Dodoni.net requires external (native) libraries for
  • BLAS,
  • LAPACK,
  • Random Number Generators,
  • Fast-Fourier-Transformations (FFT), optimizer etc.
which are not part of the distribution (some managed code is available as fallback implementation). If these features are used one has to copy the corresponding libraries (dll's) into the specified binary folder. The configuration of the Excel-AddIn shows the corresponding file names etc., see also Dodoni.BasicMathLibrary etc.

4. Structure of the framework

The source code, thus the binaries as well, of the Dodoni.net framework are separated into several assemblies, i.e. dll's. Each assembly is related to a specific purpose. The Dodoni.net project consist of the following assemblies:

Dodoni.BasicComponents:
Contains basic classes and methods needed for the project. This assembly provide general stuff which is not directly related to mathematical problems, mathematical finance, Excel interface etc., for example a logfile framework and methods for configuration files etc.

Dodoni.BasicMathLibrary:
Provides mainly the infrastructure and some basic implementations for mathematical operations, for example:
  • BLAS library (interface structure + a managed fallback implementation),
  • LAPACK library (wrapper for native code),
  • generic interface for Fast-Fourier-Transformations (FFT) (+ a dummy managed fallback implementation),
  • Vector operations (interface structure + a managed fallback implementation),
  • interfaces for Special functions,
  • interfaces for interpolation and parametrization of curves and surfaces with some basic implementations (linear, spline etc.)
  • interfaces for numerical integration, Random Number Generators, Optimization etc.
  • implementation for root finding algorithms for polynomials etc.
This enables to incorporate the functionality of 3th party mathematical libraries, as for example Math Kernel Library (MKL), AMD Core Math Library (ACML), Fastest Fourier Transform in the West (FFTW), NLopt, Yeppp! etc. See namespace
Dodoni.MathLibary.Native.<Name of 3th party Library>
for a specific wrapper. The Managed Extensibility Framework (MEF) is used to dynamic link some of the external mathematical libraries to the Dodoni.net framework. The following assemblies provides wrapper for specific (native) 3th Party Libraries to enable the use of these Libraries within the Dodoni.net framework:

Assembly Library
Dodoni.MathLibrary.Native.ACML AMD Core Math Library (ACML) Library
Dodoni.MathLibrary.Native.BLAS BLAS Library (Fortran interface)
Dodoni.MathLibrary.Native.CBLAS C-Interface of the BLAS Library (CBLAS)
Dodoni.MathLibrary.Native.FFTW FFTW Library
Dodoni.MathLibrary.Native.LibM LibM, a 64bit software library containing a collection of basic math functions and vector functions
Dodoni.MathLibrary.Native.MKL Math Kernel Library (MKL) Library
Dodoni.MathLibrary.Native.NLopt NLopt, a free/open-source library for nonlinear optimization
Dodoni.MathLibrary.Native.Yeppp Yeppp!, a high-performance SIMD-optimized mathematical library for x86, ARM, and MIPS processors on Windows, Android, Mac OS X, and GNU/Linux systems

Dodoni.CommonMathLibrary:
Contains some managed implementation of mathematikcal functions, for example:
  • numerical integration algorithms (for example Gauss-Kronrod-Patterson etc.),
  • some curve/surface interpolation approaches,
  • some Special functions (for example erf(x), erfc(x), LambertW(x) etc.),
  • some 1-/n-dimensional optimization algorithm (Brent, Powell, PRAXIS etc.) etc.

Dodoni.FinanceBasics:
Provides interfaces for day count conventions, business day conventions, holiday calendars, Market convention templates etc. Moreover it contains some Tenor arithmetic, Compounding rules, date factory etc. as well as an implementation of the Black-Scholes and the Bachelier (=normal Black) model etc. It does not contain an engine for pricing or risk management for financal instruments etc. This is located in a separate assembly.


Dodoni.FinanceCommonMarketUsages:
Contains market usages, i.e. implementations for day count conventions, business day conventions, holiday calendars etc.

... for the Excel Add-In:

Dodoni.XLBasicComponents:
Provide functionality for a generic Excel Add-In, i.e. extends Excel-DNA by high-level methods, for example an object pool easy accessible in Excel, property/value Excel range queries etc.

Dodoni.XLIntegration:
Serves as Excel Add-In for the Dodoni.net project that provides UDF's (user defined functions) for most of the functionality of the Dodoni.net project. The source code is not yet published.

5. Further documentation

  • A documentation of the API of the Dodoni.net framework is part of the distribution.
  • The unit tests of the Dodoni.net project serves as living documentation.
... for the Excel Add-In:
  • A documentation of the UDF's (user defined functions) provided by the Excel Add-In of the Dodoni.net project is still not available, but the distribution contains several example Excel sheets.
  • The name of each user defined function (UDF) of the Add-In starts with 'do' which can be interpreted as do for doing or as short-name for Dodoni.net.

6. Howto

  • ....write individual Excel Add-Ins with Excel-DNA and Dodoni.net?
Create a new .net project (at least .NET 4.0). Add references at least to the following assemblies of the distribution of Excel-DNA and Dodoni.net:
  • Dodoni.BasicComponents.dll,
  • Dodoni.XLBasicComponents.dll,
  • ExcelDna.Integration.dll.
Copy the 32- or 64-bit XLL file of Excel-DNA to the directory of the binaries of your .net project and store it under a file name of your choice. Create a text file with the same file name and suffix .dna with the following content:

<DnaLibrary RuntimeVersion="v4.0">
  <ExternalLibrary Path="Dodoni.XLBasicComponents.dll" ExplicitExports="true" Pack="true"/>
  <ExternalLibrary Path="NameOfYourProject.dll" ExplicitExports="true" Pack="true"/>
  <Reference AssemblyPath="Dodoni.BasicComponents.dll" Pack="true"/>
</DnaLibrary>

Of course the above file represents the simplest case only (the entry Pack="true" is optional). If necessary one has to add further references in the .dna file. One may have a deeper look in the documentation of the Excel-DNA project. For the features of the Dodoni.XLBasicComponents assembly we refer to the documentation of the Dodoni.net API. Moreover the distribution contains a simple example project in the repository.
  • ...extend the Excel Add-In of the Dodoni.net project?
If you like to add further UDF (user defined functions) to the Excel Add-In it is not recommended to extend or modify the Dodoni.XLIntegration assembly. Instead, create a new .net project (at least .NET 4.0) and add references to ExcelDna.Integration.dll of the distribution of Excel-DNA and to the required assemblies of the Dodoni.net project, i.e. at least
  • Dodoni.BasicComponents.dll,
  • Dodoni.XLBasicComponents.dll,
  • Dodoni.XLIntegration.dll.
Copy the XLDodoni.dna file of the distribution of the Dodoni.net project to the directory of the binaries of your .net project and store it under a file name of your choice. Modify the .dna file in a way that it refers to your .net project as well. Copy the 32- or 64-bit XLL file of Excel-DNA to the same directory and store it under the same name as the .dna file. This XLL should make available your individual UDF's.
  • ...use a specific logging?
Write an individual implementation for the ILogger interface and mark it with the Export attribute of the Managed Extensibility Framework (MEF), i.e.

 [Export(typeof(ILogger))]

Create or modify the configuration file of the Dodoni.net project or of your individual project in the following way; for more information see BasicComponents:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="LoggingSetting" type="Dodoni.BasicComponents.Logging.Configuration.LoggingConfigurationFileSection, Dodoni.BasicComponents"/>
  </configSections>
  <LoggingSetting typeName="YourNamespace.YourClass, YourAssemblyName" />
</configuration>
  • ...create an individual user interface with a separate implementation for Holiday calendar, business day conventions etc.? For example how to link the Dodoni.net framework to a trading system?
Perhaps instead of the Excel Add-In you may use functionality of the Dodoni.net library in a different program, for example a trading system. In this case you should ignore the assemblies of the Dodoni.net framework which are connected to the Excel Add-In, i.e.
  • Dodoni.XLBasicComponents.dll and
  • Dodoni.XLIntegration.dll.
In general a trading system already contains implementations for Holiday calendar, business day conventions etc. Therefore you should replace Dodoni.FinanceCommonMarketUsages by a new assembly that wraps these functions and structures to the infastructure of Dodoni.net.


Last edited Jul 1, 2015 at 8:27 PM by dodoni, version 70