Show
Ignore:
Timestamp:
08/30/09 22:13:15 (15 years ago)
Author:
smidl
Message:

doc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/html/mexfiles.html

    r590 r591  
    1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     2<html xmlns="http://www.w3.org/1999/xhtml"> 
     3<head> 
     4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 
    35<title>mixpp: How to write and use mex files for Matlab</title> 
    4 <link href="tabs.css" rel="stylesheet" type="text/css"> 
    5 <link href="doxygen.css" rel="stylesheet" type="text/css"> 
    6 </head><body> 
    7 <!-- Generated by Doxygen 1.5.8 --> 
     6<link href="tabs.css" rel="stylesheet" type="text/css"/> 
     7<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
     8</head> 
     9<body> 
     10<!-- Generated by Doxygen 1.6.1 --> 
    811<script type="text/javascript"> 
    912<!-- 
     
    6063</div> 
    6164<div class="contents"> 
    62 <h1><a class="anchor" name="mexfiles">How to write and use mex files for Matlab </a></h1><h2><a class="anchor" name="use"> 
     65 
     66 
     67<h1><a class="anchor" id="mexfiles">How to write and use mex files for Matlab </a></h1><h2><a class="anchor" id="use"> 
    6368Howto use predefined mexfiles</a></h2> 
    64 A range of mexfiles is predefined in directory <code>library/mex</code>. Many of these mexfile process ui files (see <a class="el" href="ui_page.html">User Infos and their use</a>) examples of these files are in directory <code>library/tutorial</code>. Note that in order to run these files you need to let matlab know where to find them: <div class="fragment"><pre class="fragment">&gt;&gt; addpath path_to_bdm/library/mex 
    65 </pre></div><p> 
    66 Then, you can go to <code>library/tutorial</code> and run e.g. <code>arx_test_mex</code>.<h2><a class="anchor" name="write"> 
     69<p>A range of mexfiles is predefined in directory <code>library/mex</code>. Many of these mexfile process ui files (see <a class="el" href="ui_page.html">User Infos and their use</a>) examples of these files are in directory <code>library/tutorial</code>. Note that in order to run these files you need to let matlab know where to find them: </p> 
     70<div class="fragment"><pre class="fragment">&gt;&gt; addpath path_to_bdm/library/mex 
     71</pre></div><p>Then, you can go to <code>library/tutorial</code> and run e.g. <code>arx_test_mex</code>.</p> 
     72<h2><a class="anchor" id="write"> 
    6773Howto write custom mex file</a></h2> 
    68 Due to special nature of the mex files, the mex file can be split in three parts: <ul> 
     74<p>Due to special nature of the mex files, the mex file can be split in three parts: </p> 
     75<ul> 
    6976<li>input conversion, where input arguments are converted to IT++ structures, </li> 
    7077<li>main body of algorithm, where any C++ bdm constructions can be used, </li> 
    7178<li>output conversion, where resulting IT++ structures are converted to mxArrays.</li> 
    7279</ul> 
    73 The first and the third part is achieved using prepared IT++ routines, see IT++ documentation.<p> 
    74 Script <code></code>./buildmex is prepared to compile and link the mexfile with bdm. <div class="fragment"><pre class="fragment">$ ./buildmex.sh my_mex_file.cpp 
    75 </pre></div> on Linux, or <div class="fragment"><pre class="fragment">$ ./buildmex.bat my_mex_file.cpp 
    76 </pre></div> on Windows.<p> 
    77 Example of a mexfile: <div class="fragment"><pre class="fragment"></pre></div> </div> 
    78 <hr size="1"><address style="text-align: right;"><small>Generated on Sat Aug 29 20:49:42 2009 for mixpp by&nbsp; 
     80<p>The first and the third part is achieved using prepared IT++ routines, see IT++ documentation.</p> 
     81<p>Script <code></code>./buildmex is prepared to compile and link the mexfile with bdm. </p> 
     82<div class="fragment"><pre class="fragment">$ ./buildmex.sh my_mex_file.cpp 
     83</pre></div><p> on Linux, or </p> 
     84<div class="fragment"><pre class="fragment">$ ./buildmex.bat my_mex_file.cpp 
     85</pre></div><p> on Windows.</p> 
     86<p>Example of a mexfile: </p> 
     87<div class="fragment"><pre class="fragment"></pre></div> </div> 
     88<hr size="1"/><address style="text-align: right;"><small>Generated on Sun Aug 30 22:10:50 2009 for mixpp by&nbsp; 
    7989<a href="http://www.doxygen.org/index.html"> 
    80 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> 
     90<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> 
    8191</body> 
    8292</html>