The MATLAB toolbox offers two particular functions working on vectors as the vector cross product and the dot product. These functions are implemented to work on a general matrix dimension. Unfortunately, this implies a long overhead and slows down the performance significantly.
This archive offers some particular vector functions as the vector norm, the vector length, scaling and the cross respectively dot product. All functions work on the first dimension of
Unpack the archive in a folder that is part of the MATLAB path. The subfolder '@class' contains the extension libraries.
If you unpack the source code, the subfolder 'source' contains all necessary C and assembler files. Each function splits in a C-MEX wrapper part to be translated with MATLAB:
mex [-inline] [-O] func.c ffunc.obj [fdim.obj]
The underlying assembler functions are written in the Netwide Assembler syntax. It is freely available on the Internet. The command is:
nasmw -f win32 ffunc.asm
Each function comes with an equivalent MATLAB script that also provides the command line help.
The libraries should always reside in a subfolder called '@class' to make sure they are not called for any data except of type
class. They do not check the data type of passed arguments.
These routines are published as freeware. The author reserves the right to modify any of the contained files.
You are allowed to distribute this package as long as you deliver the entire, original package for free.
|vcross.dll||Vector cross product|
|vdot.dll||Vector dot product|
The source code is fully disclosed to serve as practical example and for personal use only. You are not allowed to distribute the source code but you may apply it for your personal issues.
|/||CmexWrapper.txt||C-MEX wrapper performance hints|
|FPUasmHints.txt||Floating-point assembler hints|
|fvcross.asm||Vector cross product|
|fvdot.asm||Vector dot product|
|vcross.c||Vector cross product|
|vdot.c||Vector dot product|
Any warranty is strictly refused. Don't rely on any financial or technical support in case of malfunction or damage.
Comments are welcome. I will try to track reported problems and fix bugs.
Service release. Bug fix of the scripts.
Initial extended precision release.
Service release. Version information included.
Initial single precision release and
Downloading these files, you accept the copyright terms.
MATLAB is a registered trademark of The MathWorks, Inc. Pentium is a registered trademark of Intel Corporation. Other product or brand names are trademarks or registered trademarks of their respective holders.
© 2011 École Polytechnique Fédérale de Lausanne