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
Why don't use Matlab instead?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  21 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Rex_chaos  
View profile  
 More options Jun 10 2002, 6:30 am
Newsgroups: sci.math.num-analysis
From: rex_ch...@21cn.com (Rex_chaos)
Date: 10 Jun 2002 03:30:43 -0700
Local: Mon, Jun 10 2002 6:30 am
Subject: Why don't use Matlab instead?
Hi,
  I am using C++ for numerical computing. However, after having
compared with Matlab, I found some algorithms(like multiplication of
matrices) implemented with C++ are not faster then the same one in
Matlab. I counted the time spending on the both algorithm and result
that

                                        Matlab      C++
  multipication of matrices(500x500)    1.4s        5s(not including
building the matrix)

It's disappointing that C++ is much slower than a intepreted languages
(like Matlab). If so, why so many people devote them in developing a
numerical library in C/C++/Fortran? Why don't they use Matlab instead?


 
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.
Charles R. Bond  
View profile  
 More options Jun 10 2002, 9:11 am
Newsgroups: sci.math.num-analysis
From: "Charles R. Bond" <cb...@ix.netcom.com>
Date: Mon, 10 Jun 2002 06:16:22 -0700
Local: Mon, Jun 10 2002 9:16 am
Subject: Re: Why don't use Matlab instead?

Rex_chaos wrote:
> Hi,
>   I am using C++ for numerical computing. However, after having
> compared with Matlab, I found some algorithms(like multiplication of
> matrices) implemented with C++ are not faster then the same one in
> Matlab. I counted the time spending on the both algorithm and result
> that

>                                         Matlab      C++
>   multipication of matrices(500x500)    1.4s        5s(not including
> building the matrix)

> It's disappointing that C++ is much slower than a intepreted languages
> (like Matlab). If so, why so many people devote them in developing a
> numerical library in C/C++/Fortran? Why don't they use Matlab instead?

There's probably more than one reason. But note that the overhead of the
interpreter is probably negligible when compared to the time required to
perform the matrix multiplication. It is possible in either language to
write code which runs as fast as the processor is capable -- so my
conclusion is that there *is* a need to develop a (fast) numerical library
in C/C++, not that no one should write one.

--
There are two things you must never attempt to prove: the impossible --
and the obvious.
http://www.crbond.com


 
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.
Johan Kullstam  
View profile  
 More options Jun 10 2002, 10:03 am
Newsgroups: sci.math.num-analysis
From: Johan Kullstam <kulls...@ne.mediaone.net>
Date: 10 Jun 2002 10:03:42 -0400
Local: Mon, Jun 10 2002 10:03 am
Subject: Re: Why don't use Matlab instead?

rex_ch...@21cn.com (Rex_chaos) writes:
> Hi,
>   I am using C++ for numerical computing. However, after having
> compared with Matlab, I found some algorithms(like multiplication of
> matrices) implemented with C++ are not faster then the same one in
> Matlab. I counted the time spending on the both algorithm and result
> that

>                                         Matlab      C++
>   multipication of matrices(500x500)    1.4s        5s(not including
> building the matrix)

> It's disappointing that C++ is much slower than a intepreted languages
> (like Matlab).

the interpreter merely parses "A*B" and then calls a compiled
subroutine to perform the multiplication.  matlab is written in C.

you might want to check out ATLAS.  it is an optimizing BLAS (basic
linear algrebra).  modern processors can be finicky beasts due to the
cache layout and instruction scheduling and BLAS tries a number of
feeding patterns to get high performance for particular CPUs.

> If so, why so many people devote them in developing a
> numerical library in C/C++/Fortran? Why don't they use Matlab
> instead?

what do you think matlab is written in?

--
Johan KULLSTAM <kullstj...@attbi.com> sysengr


 
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.
Vivien Mallet  
View profile  
 More options Jun 10 2002, 11:18 am
Newsgroups: sci.math.num-analysis
From: Vivien_Mal...@Yahoo.com (Vivien Mallet)
Date: 10 Jun 2002 08:18:32 -0700
Local: Mon, Jun 10 2002 11:18 am
Subject: Re: Why don't use Matlab instead?

>   I am using C++ for numerical computing. However, after having
> compared with Matlab, I found some algorithms(like multiplication of
> matrices) implemented with C++ are not faster then the same one in
> Matlab.

Matlab is slightly faster for basic operations like multiplication.

> I counted the time spending on the both algorithm and result
> that

>                                         Matlab      C++
>   multipication of matrices(500x500)    1.4s        5s(not including
> building the matrix)

I am surprised by the difference.  Could you send me your C++ code?  I
think your C++ code should be a lot faster.

> It's disappointing that C++ is much slower than a intepreted languages
> (like Matlab). If so, why so many people devote them in developing a
> numerical library in C/C++/Fortran? Why don't they use Matlab instead?

Matlab simple operations are efficient because they are optimized.  If
you write basic operations in C++ by yourself, you will never get the
same performances.  Matlab matrix/vector multiplication was probably
written in assembler or, at least, with advanced considerations on
memory operations.  That is why it is faster.

Nevertheless, you can reach the same performances providing you use
the right routines.  If you have an optimized matrix/vector product
(as in BLAS), you will reach the same performances.  That's the reason
why using C++ is not a problem.  But, you should use optimized
routines and, for example, use C++ to manage memory and higher level
calculations.  C++ libraries often provides a convenient interface and
use BLAS/LAPACK (for example) in order to be efficient.

Finally, Matlab turns out to be very slow when you use high level
routines.  Matrices manipulations are convenient but not as fast as
what you could do in C++.  For professional projects, you cannot
imagine working with Matlab.  Many interesting routines are written in
Fortran, C or C++.  Creating a project, adding components is quite
convenient in C++.  And, Matlab program are interpreted which is of
course slow (and you lose memory).  As for I/O operations, Matlab is
not as convenient as C++.  And so on and so forth...

There are many other reasons why one should use C++ (or C or Fortran
77/90) instead of Matlab (slow, licences, ...).

Notice that you can compile your Matlab functions.  And, to be
convinced that Matlab is slow, you can compile some of your Matlab
functions...
[ If you compile Matlab functions, do not use notations like M(5:10) =
10, use loops instead (even if it is slower while running under
Matlab...)! ]

Best regards,
Vivien.


 
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.
Jack Walker  
View profile  
 More options Jun 10 2002, 2:24 pm
Newsgroups: sci.math.num-analysis
From: jack_wal...@my-deja.com (Jack Walker)
Date: 10 Jun 2002 11:24:31 -0700
Local: Mon, Jun 10 2002 2:24 pm
Subject: Re: Why don't use Matlab instead?

Also note that modern matlab uses ATLAS.

Jack Walker


 
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.
Shaun  
View profile  
 More options Jun 10 2002, 2:48 pm
Newsgroups: sci.math.num-analysis
From: elvis_costell...@yahoo.com (Shaun)
Date: 10 Jun 2002 11:48:14 -0700
Local: Mon, Jun 10 2002 2:48 pm
Subject: Re: Why don't use Matlab instead?

rex_ch...@21cn.com (Rex_chaos) wrote in message <news:f7a7417.0206100230.39bbb6cd@posting.google.com>...
> Hi,
>   I am using C++ for numerical computing. However, after having
> compared with Matlab, I found some algorithms(like multiplication of
> matrices) implemented with C++ are not faster then the same one in
> Matlab. I counted the time spending on the both algorithm and result
> that

>                                         Matlab      C++
>   multipication of matrices(500x500)    1.4s        5s(not including
> building the matrix)

> It's disappointing that C++ is much slower than a intepreted languages
> (like Matlab). If so, why so many people devote them in developing a
> numerical library in C/C++/Fortran? Why don't they use Matlab instead?

While I can't speak much about Matlab, it seems C++ is always a difficult
language to use when performance is an issue.  For the case of matrix
multiplication on Intel processors, it is very likely that Matlab uses
hardware features such as MMX, SSE, or SSE2 to speed up the calculation
while your C++ matrix libraries do not.  For Motorola PowerPC processors
the hardware to look out for is the Altivec unit.

Check out this link for some ideas on improving performance on your own:

http://www.intel.com/software/products/college/ia32/strmsimd/

Intel has a ton of whitepapers here with example source code outlining
performance enhancements for various numerical methods.  

HTH,
Shaun


 
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.
E. Robert Tisdale  
View profile  
 More options Jun 10 2002, 2:57 pm
Newsgroups: sci.math.num-analysis
From: "E. Robert Tisdale" <E.Robert.Tisd...@jpl.nasa.gov>
Date: Mon, 10 Jun 2002 11:33:45 -0400
Local: Mon, Jun 10 2002 11:33 am
Subject: Re: Why don't use Matlab instead?

Rex_chaos wrote:
> I am using C++ for numerical computing.
> However, after having compared with Matlab,
> I found some algorithms(like multiplication of matrices)
> implemented with C++ are not faster then the same one in Matlab.
> I counted the time spending on the both algorithm and result that

>                                         Matlab                  C++
>   multipication of matrices(500x500)    1.4s                    5s

> It's disappointing that C++ are much slower
> than a interpreted languages (like Matlab).

Matrix-matrix multiplication is NOT interpreted in Matlab.
It is an atomic operation.  I believe that Matlab is still using
an optimized version of the BLAS library subroutine dgemm.
Install ATLAS and call dgemm from it.
You should get precisely the same performance
that you get from Matlab.
The ATLAS version of dgemm is implemented in C
and is as fast or faster than most implementations in Fortran 77.

The problem is not that C++ is slow
but that you are not a very good numerical programmer yet.
It takes a lot of time and experience.  Be patient.

Is C++ a best choice for numerical computing?

It is certainly as good as any other choice for numerical computing.


 
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.
Peter O. Brackett  
View profile  
 More options Jun 10 2002, 5:57 pm
Newsgroups: sci.math.num-analysis
From: "Peter O. Brackett" <ab...@ix.netcom.com>
Date: Mon, 10 Jun 2002 17:56:56 -0400
Local: Mon, Jun 10 2002 5:56 pm
Subject: Re: Why don't use Matlab instead?
Hell...what a complete waste!

Why re-invent the wheel!

It's all been done several times over, many years ago and widely available
and completely debugged in *modern* Fortran 90/95 subroutine libraries!

What is it about computer science?  Stupidity, or...

As Marvin Minsky once said... "An ounce of perspective is worth at leat 50
points of IQ!"

Those who don't study and learn from history are "condemned to repeat it
over and over again... and it seems at ever diminishing efficiency!"

Look to modern Fortran, it's all there!

--Peter
   Indialantic By-the-Sea, FL

"Rex_chaos" <rex_ch...@21cn.com> wrote in message

news:f7a7417.0206100230.39bbb6cd@posting.google.com...


 
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.
Chip Eastham  
View profile  
 More options Jun 10 2002, 10:52 pm
Newsgroups: sci.math.num-analysis
From: "Chip Eastham" <east...@bellsouth.net>
Date: Tue, 11 Jun 2002 02:52:09 GMT
Local: Mon, Jun 10 2002 10:52 pm
Subject: Re: Why don't use Matlab instead?

"Jack Walker" <jack_wal...@my-deja.com> wrote in message

news:b4220662.0206101024.efa1631@posting.google.com...
> Johan Kullstam <kulls...@ne.mediaone.net> wrote in message

<news:m3bsajkz7l.fsf@sysengr.res.ray.com>...

It's been nearly ten years, but I once tried to match the MSDOS Matlab
matrix multiply speed
by tweaking the code for a competing product produced by the software
company I worked for
at the time.  In pure C code, using pointers in somewhat skillful fashion, I
could do no better than
a factor of 6 slower than Matlab.  Using inline assembler in the innermost
loop of the multiply, I
could only get to a factor of 3.  This was back in an era when Borland's C++
compiler was king,
and Microsoft C was essentially unusable for serious production.  Things
have changed a lot, but
I believe that Intel makes a hand-coded assembler BLAS that is impossible to
match with any high
level language compiler.

I agree with Johan and others who point out that the "interpreted" aspects
of Matlab are beside the
point here, as the basic linear algebra subroutine is consuming the major
CPU cycles.

Matlab can be used to develop applications ("toolboxes") of a low level of
aesthetic sensibility, but
of course using the toolbox requires a Matlab license.  So perhaps the most
common reason to do
an application in C++ is to make it freely redistributable.

regards, chip
(replace bellsouth by icx to reply)


 
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.
Daniel Jaeggi  
View profile  
 More options Jun 11 2002, 6:35 am
Newsgroups: sci.math.num-analysis
From: Daniel Jaeggi <jae...@spamfilter.embl-heidelberg.de>
Date: Tue, 11 Jun 2002 12:34:10 +0200
Local: Tues, Jun 11 2002 6:34 am
Subject: Re: Why don't use Matlab instead?
I'll completely second that - for matrix work, F90 is fast, easy and
elegant. Each to their own, I suppose.....

Daniel


 
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.
Ben  
View profile  
 More options Jun 11 2002, 7:49 am
Newsgroups: sci.math.num-analysis
From: Ben <benoit_lepret...@mailREMOVETHIS.schneider.fr>
Date: Tue, 11 Jun 2002 13:43:39 +0200
Local: Tues, Jun 11 2002 7:43 am
Subject: Re: Why don't use Matlab instead?
Rex_chaos a écrit :

> Hi,
>   I am using C++ for numerical computing. However, after having
> compared with Matlab, I found some algorithms(like multiplication of
> matrices) implemented with C++ are not faster then the same one in
> Matlab. I counted the time spending on the both algorithm and result
> that

>                                         Matlab      C++
>   multipication of matrices(500x500)    1.4s        5s(not including
> building the matrix)

> It's disappointing that C++ is much slower than a intepreted languages
> (like Matlab). If so, why so many people devote them in developing a
> numerical library in C/C++/Fortran? Why don't they use Matlab instead?

Hi,

As the others say, Matlab doesn't really do the mult in Matlab language.
It calls up an very well optimized subroutine for that. That's the
case for every Matlab built-in function

If you really want to compare, try writing your own matrix mult
routine in pure scalar Matlab (no vectorization), with 'for'
loops, etc.

You will most probably find out that Matlab is _way_ slower than C
for that type of low level programming !
Careful Matlab programmers use built-in functions and vectorization
whenever possible, to speed up the execution and make up for Matlab's
slowness. The drawback of vectorization is that the code may be
less clear to read.

Ben


 
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.
Victor Eijkhout  
View profile  
 More options Jun 11 2002, 2:35 pm
Newsgroups: sci.math.num-analysis
From: eijkh...@cs.utk.edu (Victor Eijkhout)
Date: Tue, 11 Jun 2002 14:16:10 -0400
Local: Tues, Jun 11 2002 2:16 pm
Subject: Re: Why don't use Matlab instead?

Daniel Jaeggi <jae...@spamfilter.embl-heidelberg.de> wrote:
> I'll completely second that - for matrix work, F90 is fast, easy and
> elegant.

Except that I've seen too many examples where the compiler makes dozens
of needless copies every time you do array sections. And gone is your
performance.

V.


 
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.
Dan Tex1  
View profile  
 More options Jun 12 2002, 11:15 pm
Newsgroups: sci.math.num-analysis
From: dant...@aol.com (Dan Tex1)
Date: 13 Jun 2002 03:15:22 GMT
Local: Wed, Jun 12 2002 11:15 pm
Subject: Re: Why don't use Matlab instead?

>From: eijkh...@cs.utk.edu  (Victor Eijkhout)
>Date: 6/11/02 11:16 AM Pacific Daylight Time
>Message-id: <1fdma8p.az766ly4drggN%eijkh...@cs.utk.edu>

>Daniel Jaeggi <jae...@spamfilter.embl-heidelberg.de> wrote:

>> I'll completely second that - for matrix work, F90 is fast, easy and
>> elegant.

>Except that I've seen too many examples where the compiler makes dozens
>of needless copies every time you do array sections. And gone is your
>performance.

>V.

If you are doing non-continuous sections...  that's pretty much what you should
expect.  If your data is continuous ( and not addressed with s l o w  
pointer-ridden code ) you shouldn't have that problem unless you have a crappy
compiler.

If unsure...  don't use array sections, especially if you want fast runtime
codes.  After all...  what other language can do efficient array sections??

Dan  :-)


 
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.
Dan Tex1  
View profile  
 More options Jun 12 2002, 11:50 pm
Newsgroups: sci.math.num-analysis
From: dant...@aol.com (Dan Tex1)
Date: 13 Jun 2002 03:50:06 GMT
Local: Wed, Jun 12 2002 11:50 pm
Subject: Re: Why don't use Matlab instead?
From: rex_ch...@21cn.com  (Rex_chaos)

Out of curiousity,  I just wrote a fortran program to do your described
multiply.  I used the Lahey F95 compiler with no special optimizations set and
took special steps to be sure that the compiler would not "optimize out" of the
calculations.  I also used the Standard Matrix Multiplication function of
fortran rather than attempt to write my own loops.  Using 4 byte Floating point
data, it took between 1.3 and 1.37 seconds per run.   I also did it using 8
byte reals.  It consistently took only 1.7 seconds to run.

These test were on a Windows98 computer with an Athlon 750 cpu, running several
applications in the background, including AOL, Explorer, DOS and a mid-sized
editor.

Dan  :-)


 
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.
Victor Eijkhout  
View profile  
 More options Jun 13 2002, 9:35 am
Newsgroups: sci.math.num-analysis
From: eijkh...@cs.utk.edu (Victor Eijkhout)
Date: Thu, 13 Jun 2002 09:11:51 -0400
Local: Thurs, Jun 13 2002 9:11 am
Subject: Re: Why don't use Matlab instead?
Dan  Tex1 <dant...@aol.com> wrote:

> >Except that I've seen too many examples where the compiler makes dozens
> >of needless copies every time you do array sections. And gone is your
> >performance.

> >V.

> If you are doing non-continuous sections...  that's pretty much what you
> should expect.

No, if A(5,5) and you take A(2:3,2:3) no copy should be necessary, but
it usually is still taken. That array section could be described
internally in the time-honoured Lapack way with M=2, LDA=5.

V.


 
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.
Daniel Jaeggi  
View profile  
 More options Jun 13 2002, 10:09 am
Newsgroups: sci.math.num-analysis
From: Daniel Jaeggi <jae...@spamfilter.embl-heidelberg.de>
Date: Thu, 13 Jun 2002 16:08:43 +0200
Local: Thurs, Jun 13 2002 10:08 am
Subject: Re: Why don't use Matlab instead?

> No, if A(5,5) and you take A(2:3,2:3) no copy should be necessary, but
> it usually is still taken. That array section could be described
> internally in the time-honoured Lapack way with M=2, LDA=5.

> V.

Fair points, but then any language has features with which you can
clobber your performance. But in my experience, there are far fewer of
these (when talking about numerical computation) in Fortran.

Without turning this into a fortran discussion, I take it your solution
to avoiding sections is to write as you would in f77 when passing arrays?

Back to the original point, you really can't get much simpler than C =
matmul(A,B)

dan


 
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.
Victor Eijkhout  
View profile  
 More options Jun 13 2002, 11:21 am
Newsgroups: sci.math.num-analysis
From: eijkh...@cs.utk.edu (Victor Eijkhout)
Date: Thu, 13 Jun 2002 11:02:03 -0400
Local: Thurs, Jun 13 2002 11:02 am
Subject: Re: Why don't use Matlab instead?

Daniel Jaeggi <jae...@spamfilter.embl-heidelberg.de> wrote:
> Without turning this into a fortran discussion, I take it your solution
> to avoiding sections is to write as you would in f77 when passing arrays?

Ugly as all heck, but: yes.

V.


 
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.
Discussion subject changed to "Octave over C++ or Matlab, was: Why don't use Matlab instead?" by Robert Dodier
Robert Dodier  
View profile  
 More options Jun 13 2002, 4:13 pm
Newsgroups: sci.math.num-analysis
From: robert_dod...@yahoo.com (Robert Dodier)
Date: 13 Jun 2002 13:13:40 -0700
Local: Thurs, Jun 13 2002 4:13 pm
Subject: Octave over C++ or Matlab, was: Why don't use Matlab instead?

rex_ch...@21cn.com (Rex_chaos) wrote:
>   I am using C++ for numerical computing. However, after having
> compared with Matlab, I found some algorithms(like multiplication of
> matrices) implemented with C++ are not faster then the same one in
> Matlab. [...]
> It's disappointing that C++ is much slower than a intepreted languages
> (like Matlab). If so, why so many people devote them in developing a
> numerical library in C/C++/Fortran? Why don't they use Matlab instead?

As others have pointed out, Matlab executes vectorized expressions
using highly optimized, special purpose subroutines. That's why it
is much faster than a naive algorithm written in C++.

Matlab scripts are also much easier to comprehend than equivalent
programs in C++. You need not worry about memory allocation,
declarations, and other such baggage. Also, writing a vectorized
expression is much clearer that an equivalent for-loop in C++.

The only down side is that Matlab is pretty expensive. I recommend
Octave, an open source implementation of the Matlab script language,
very highly. Octave, like Matlab, uses BLAS to achieve high
performance. See http://www.octave.org/ for more info.

I have written a variety of number crunching programs in
a variety of languages, and I strongly recommend that you
start your work in an appropriate high-level language such as
Matlab/Octave, S+/R, IDL, or what have you. Maybe later on you
will decide to rewrite some or all the code in a C/C++, Fortran,
Java, etc. Or you might never need to do so.

For what it's worth,

Robert Dodier
--
``He wins most who toys with the dies.'' -- David O'Bedlam


 
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.
Raymond Toy  
View profile  
 More options Jun 13 2002, 6:03 pm
Newsgroups: sci.math.num-analysis
From: Raymond Toy <t...@rtp.ericsson.se>
Date: 13 Jun 2002 18:00:18 -0400
Local: Thurs, Jun 13 2002 6:00 pm
Subject: Re: Octave over C++ or Matlab, was: Why don't use Matlab instead?

>>>>> "Robert" == Robert Dodier <robert_dod...@yahoo.com> writes:

    Robert> declarations, and other such baggage. Also, writing a vectorized
    Robert> expression is much clearer that an equivalent for-loop in C++.

This goes both ways.  Because matlab is intepreted (it was when I last
used it, maybe it's different now?), loops don't run so fast, so you
go out of your way to operate on matrices, slicing an array this way,
reshaping it, slicing it another, etc.  The equivalent C/C++ code
would have been a simple loop.

The fact that matrices/vectors in Matlab are 1-based indices sometimes
also makes things less clear when the algorithm descriptions use
0-based indices.

Everything has it's advantages and disadvantages.

Ray


 
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.
Discussion subject changed to "Why don't use Matlab instead?" by Rex_chaos
Rex_chaos  
View profile  
 More options Jun 18 2002, 7:28 am
Newsgroups: sci.math.num-analysis
From: rex_ch...@21cn.com (Rex_chaos)
Date: 18 Jun 2002 04:28:30 -0700
Local: Tues, Jun 18 2002 7:28 am
Subject: Re: Why don't use Matlab instead?
dant...@aol.com (Dan  Tex1) wrote in message <news:20020612235006.07541.00000288@mb-df.aol.com>...

Can you send me the source code? I have written a program to do the
same thing with Fortran 90. However, I found it's as slow as my C++
version.

 
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.
Dan Tex1  
View profile  
 More options Jun 19 2002, 12:07 am
Newsgroups: sci.math.num-analysis
From: dant...@aol.com (Dan Tex1)
Date: 19 Jun 2002 04:06:44 GMT
Local: Wed, Jun 19 2002 12:06 am
Subject: Re: Why don't use Matlab instead?

The CHECK is in the mail....  email that is ( source and executable ).

Dan  :-)


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »