[Top][All Lists]

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

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

From: Quentin Spencer
Subject: Re: MEX/Mkoctfile questions about matrices algorithms...why slower?
Date: Tue, 14 Nov 2006 16:50:58 -0600
User-agent: Thunderbird (X11/20061107)

钟 伟生 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.


reply via email to

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