Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Matlab faster than C++ ???
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nasser M. Abbasi  
View profile  
 More options May 15 2012, 9:40 am
Newsgroups: comp.soft-sys.matlab
From: "Nasser M. Abbasi" <n...@12000.org>
Date: Tue, 15 May 2012 08:40:37 -0500
Local: Tues, May 15 2012 9:40 am
Subject: Re: Matlab faster than C++ ???
On 5/15/2012 6:18 AM, dpb wrote:

> On 5/15/2012 2:48 AM, Tian wrote:
>> Kevin<cuforw...@hotmail.com>  wrote in message
>> Of course, Matlab cannot be faster than C++,...

> Where does the "of course" come into play?

> --

It really all depends on what is being done in terms
of use of external math libraries or not.

Matlab, on intel hardware (may be on AMD also), will
use intel's MKL, a very highly optimized math library
http://en.wikipedia.org/wiki/Math_Kernel_Library

"Intel's Math Kernel Library (MKL) is a library of
optimized, math routines for science, engineering,
and financial applications. Core math functions
include BLAS, LAPACK, ScaLAPACK, Sparse Solvers,
Fast Fourier Transforms, and Vector Math."

So, if someone on Matlab is doing  say x=A\b or A*B,
then Matlab will do this as fast as any body else,
since it will end up making a call to the MKL.

(Actually Matlab's A*B is faster than Fortran's
MATMULT(A,B) based on what I read on the net.
http://gcc.gnu.org/onlinedocs/gfortran/MATMUL.html

You can google this.

But for generic operations, i.e. pure m code,
then would expect C++ generated compiled code, which
does an equivalent algorithm to be faster than Matlab's.

That is why it is good to always try to use Matlab's
build-in functions. They most likely end up making
calls to such libraries as MKL and will be much
faster than home grown pure m code.

--Nasser


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.