Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1992
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1992

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Determinant function in Mathematica

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Re: Determinant function in Mathematica
  • From: "Lawrence M. Seiford, IEOR, UMass, 413/545-1658." <SEIFORD at ecs.umass.edu>
  • Date: Fri, 17 Apr 1992 12:51 -0500

Thought I'd compare Allan's code and System Det under 1.2 and 2.0
I'll leave the analysis (and conclusions) to the reader.
larry

>Here's some quicker V2.0 code (though it is still looks to less than 2/3 the
>speed of Det in Version 1.2 - I don't have a copy of V1.2 to hand to check this
>}.
>
>NewDet[M_] :=
>Plus@@Times@@(
>                Append[Transpose[Transpose[M[[#]],{1,1}]&/@#],Signature/@#]&@
>                Permutations[Range[Length[M]]]
>        )
>
>Transpose[M,{1,1}] is very quick at extracting the diagonal of M.

Using Matheamtica 2.0 the timings were
Mathematica 2.0 for DEC RISC
Copyright 1988-91 Wolfram Research, Inc.
Cannot connect to license server.  Retrying.
 -- Terminal graphics initialized --

In[1]:= NewDet[M_] :=
        Plus@@Times@@(
               Append[Transpose[Transpose[M[[#]],{1,1}]&/@#],Signature/@#]&@
                    Permutations[Range[Length[M]]]
                )

In[2]:=  a[n_] := Table[ StringJoin["a",ToString[i],ToString[j]], {i,1,n},
                       {j,1,n}]

In[3]:= Do[ Print[ First[ Timing[ NewDet[ a[t]]]]], {t,1,7}]
0.0333333 Second
0.05 Second
0.1 Second
0.2 Second
0.6 Second
3.05 Second
22.4167 Second

In[4]:= Do[ Print[ First[ Timing[ Det[ a[t]]]]], {t,1,7}]
0. Second
0.05 Second
0.266667 Second
1. Second
5.85 Second
71.5833 Second
2888.48 Second

**********************************
Using Mathematica 1.2 (DEC RISC) the timings were

In[3]:= Do[ Print[ First[ Timing[ NewDet[ a[t]]]]], {t,1,7}]
0.
0.0166667 Second
0.0333333 Second
0.0666667 Second
0.25 Second
1.55 Second
12.3833 Second

In[4]:= Do[ Print[ First[ Timing[ Det[ a[t]]]]], {t,1,7}]
0.
0.0166667 Second
0.0333333 Second
0.0666667 Second
0.216667 Second
1.33333 Second
10.2667 Second

*********************************
And the winner is........






  • Prev by Date: ANOVA
  • Next by Date: [no subject]
  • Previous by thread: Re: Determinant function in Mathematica
  • Next by thread: Determinant function in Mathematica