[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MEX/Mkoctfile questions about matrices algorithms...why slower?

From: 钟 伟生
Subject: MEX/Mkoctfile questions about matrices algorithms...why slower?
Date: Wed, 15 Nov 2006 16:16:20 +0000


I really appreciate your reply. ATLAS project maybe an efficient way to do the improvement on matrix math. But I am still wondering to know the reason why the run time increased.

Theoretically speaking, while using the interface functions (MEX/DEDUN-DLD) combining matlab/octave with C/C++ language, the matrix math should be faster than before. So, what is the key problem which makes it slower? The algorithms or the overhead generating by the MEX? If the front one, I will try to solve it. Thank you!

Best Regard,


Weisheng wrote:
> I am trying to use the interface functions between MATLAB/OCTAVE and C
> to compute the matrices algorithms( like matrix-matrix multiplication
> and additon, matrix-vector multiplication ), such as MEX and
> DEFUN_DLD. However, after having compared with Matlab, I found the
> implemented with C/C++ are not faster than the same on in Matlab,
> moreover, it costs more about 30% time. I compared them both in big
> and small matrices multiplications.
> The results are the same as before.
> Are there good and bad ways of implementing matrix multiplication
> combining MATLAB/OCTAVE and C?
> Thank you very much!

Both Octave and Matlab link to external libraries to perform their
matrix and vector computations, and those libraries are already highly
optimized and probably faster than anything you could using a simple Mex
file. If you want faster matrix math, the ATLAS project has made this an
area of ongoing research. If you are not already using ATLAS libraries
with octave, I suggest downloading them and learning how to optimize
them for your computer.


享用世界上最大的电子邮件系统― MSN Hotmail。

reply via email to

[Prev in Thread] Current Thread [Next in Thread]