Matrix Elements VB-800 Manuel d'utilisateur Page 9

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 172
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 8
Appendix A1
Extending Ox
A1.1 Introduction
Ox is an open system to which you can add functions written in other languages. It
is also possible to control Ox from another programming environment such as Visual
C
++
or Visual Basic. Extending Ox requires an understanding of the innards of Ox,
a decent knowledge of C, as well as the right tools. You also need a version of Ox
with developer support. In addition, extending Ox is simpler on some platforms than
others. Thus, it is unavoidable that writing Ox extensions is somewhat more complex
than writing plain Ox code. However, there could be reasons for extending Ox, e.g.
when you need the speed of raw C code (but make sure that the function takes up a
significant part of the time it takes to run the program and that it actually will be a lot
faster in C than in Ox!), when code is already available in e.g. Fortran, or to add a
user-friendly interface. This chapter gives many examples, which could provide a start
for your coding effort.
When you write your own C functions to link to Ox, memory management inside
the C code is your responsibility. So care is required: any errors can bring down the Ox
program, or, worse, lead to erroneous outcomes.
Although this chapter is tailored towards producing extensions under the Windows
platform, most of it is pertinent to other platforms. Ox supports dynamic linking on all
platforms. Under Unix, a dynamic link library has the .so extension (.sl on HPUX),
under Windows .dll.
Chapter A2 documents the C functions available to interface with Ox. This includes
the C mathematical functions exported by the Ox DLL: any program could use Ox as a
function library by making direct calls to the Ox DLL.
The required header files are in the ox\dev directory, together with some library
files which can be used with Microsoft Visual C
++
. Subdirectories give platform spe-
cific examples. The main header file to use in your C/C
++
code is oxexport.h:
1
Vue de la page 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 171 172

Commentaires sur ces manuels

Pas de commentaire