comparison doc/interpreter/dynamic.txi @ 11479:746609dd54fd

Remove Matlab euphemisms in docs and use @file macro for filenames
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Mon, 10 Jan 2011 15:43:41 -0500
parents a4f482e66b65
children fd0a3ac60b0e
comparison
equal deleted inserted replaced
11478:655d5c2d8462 11479:746609dd54fd
1209 @section Mex-Files 1209 @section Mex-Files
1210 @cindex mex-files 1210 @cindex mex-files
1211 @cindex mex 1211 @cindex mex
1212 1212
1213 Octave includes an interface to allow legacy mex-files to be compiled 1213 Octave includes an interface to allow legacy mex-files to be compiled
1214 and used with Octave. This interface can also be used to share code 1214 and used with Octave. This interface can also be used to share code
1215 between Octave and non Octave users. However, as mex-files expose the 1215 between Octave and @sc{Matlab} users. However, as mex-files expose the
1216 internal API of an alternative product to Octave, and the internal 1216 @sc{Matlab}'s internal API, and the internal structure of Octave is
1217 structure of Octave is different to this product, a mex-file can never 1217 different, a mex-file can never have the same performance in Octave as
1218 have the same performance in Octave as the equivalent oct-file. In 1218 the equivalent oct-file. In particular to support the manner in which
1219 particular to support the manner in which mex-files access the variables 1219 mex-files access the variables passed to mex functions, there are a
1220 passed to mex functions, there are a significant number of additional 1220 significant number of additional copies of memory when calling or
1221 copies of memory when calling or returning from a mex function. For 1221 returning from a mex function. For this reason, new code should be
1222 this reason, new code should be written using the oct-file interface 1222 written using the oct-file interface discussed above if possible.
1223 discussed above if possible.
1224 1223
1225 @menu 1224 @menu
1226 * Getting Started with Mex-Files:: 1225 * Getting Started with Mex-Files::
1227 * Working with Matrices and Arrays in Mex-Files:: 1226 * Working with Matrices and Arrays in Mex-Files::
1228 * Character Strings in Mex-Files:: 1227 * Character Strings in Mex-Files::
1234 @end menu 1233 @end menu
1235 1234
1236 @node Getting Started with Mex-Files 1235 @node Getting Started with Mex-Files
1237 @subsection Getting Started with Mex-Files 1236 @subsection Getting Started with Mex-Files
1238 1237
1239 The basic command to build a mex-file is either @code{mkoctfile --mex} or 1238 The basic command to build a mex-file is either @code{mkoctfile --mex}
1240 @code{mex}. The first can either be used from within Octave or from the 1239 or @code{mex}. The first can either be used from within Octave or from
1241 command line. However, to avoid issues with the installation of other 1240 the command line. However, to avoid issues with @sc{Matlab}'s own @code{mex}
1242 products, the use of the command @code{mex} is limited to within Octave. 1241 command, the use of the command @code{mex} is limited to within Octave.
1243 1242
1244 @DOCSTRING(mex) 1243 @DOCSTRING(mex)
1245 1244
1246 @DOCSTRING(mexext) 1245 @DOCSTRING(mexext)
1247 1246
1248 One important difference between the use of mex with other products and 1247 One important difference with the use of @code{mex} between @sc{Matlab} and
1249 with Octave is that the header file "matrix.h" is implicitly included 1248 Octave is that the header file "matrix.h" is implicitly included through
1250 through the inclusion of "mex.h". This is to avoid a conflict with the 1249 the inclusion of "mex.h". This is to avoid a conflict with the Octave
1251 Octave file "Matrix.h" with operating systems and compilers that don't 1250 file "Matrix.h" with operating systems and compilers that don't
1252 distinguish between filenames in upper and lower case 1251 distinguish between filenames in upper and lower case
1253 1252
1254 Consider the short example: 1253 Consider the short example:
1255 1254
1256 @example 1255 @example
1668 1667
1669 @node Standalone Programs 1668 @node Standalone Programs
1670 @section Standalone Programs 1669 @section Standalone Programs
1671 1670
1672 The libraries Octave itself uses, can be utilized in standalone 1671 The libraries Octave itself uses, can be utilized in standalone
1673 applications. These applications then have access, for example, to the 1672 applications. These applications then have access, for example, to the
1674 array and matrix classes as well as to all the Octave algorithms. The 1673 array and matrix classes as well as to all the Octave algorithms. The
1675 following C++ program, uses class Matrix from liboctave.a or 1674 following C++ program, uses class Matrix from @file{liboctave.a} or
1676 liboctave.so. 1675 @file{liboctave.so}.
1677 1676
1678 @example 1677 @example
1679 @group 1678 @group
1680 @EXAMPLEFILE(standalone.cc) 1679 @EXAMPLEFILE(standalone.cc)
1681 @end group 1680 @end group