FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Math » Symbolic
Maple's linear algebra routine and higher precision arithmetic
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
Ronald Haynes
science forum beginner


Joined: 10 Feb 2005
Posts: 5

PostPosted: Mon May 29, 2006 3:19 pm    Post subject: Maple's linear algebra routine and higher precision arithmetic Reply with quote

Hi, does Maple's linear algebra routine MatrixInverse play nicely with the
Digits command? If I set Digits:=50 and compute a Matrix Inverse will the
arithmetic all be done to 50 digits?

Thanks,
R Haynes
Back to top
Robert B. Israel
science forum Guru


Joined: 24 Mar 2005
Posts: 2151

PostPosted: Mon May 29, 2006 5:44 pm    Post subject: Re: Maple's linear algebra routine and higher precision arithmetic Reply with quote

In article <pan.2006.05.29.15.19.31.155994@acadiau.ca>,
Ronald Haynes <ronald.haynes@acadiau.ca> wrote:
Quote:
Hi, does Maple's linear algebra routine MatrixInverse play nicely with the
Digits command? If I set Digits:=50 and compute a Matrix Inverse will the
arithmetic all be done to 50 digits?

Yes, it will (if the original matrix involves floats). Note that
"to 50 digits" doesn't mean that the results are accurate to 50 digits,
but rather that the calculations are done with Digits set to 50.

Robert Israel israel@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
Back to top
Ronald Haynes
science forum beginner


Joined: 10 Feb 2005
Posts: 5

PostPosted: Mon May 29, 2006 6:47 pm    Post subject: Re: Maple's linear algebra routine and higher precision arithmetic Reply with quote

Hi, many thanks... I just want to test the validity of some lower
precision results with results generated by increasing levels of precision.

Would defining the matrix entries as -1.0 4.0 1.0 do the trick to force
floats?

Thanks,
R Haynes

On Mon, 29 May 2006 17:44:19 +0000, Robert Israel wrote:


Quote:
In article <pan.2006.05.29.15.19.31.155994@acadiau.ca>,
Ronald Haynes <ronald.haynes@acadiau.ca> wrote:
Hi, does Maple's linear algebra routine MatrixInverse play nicely with the
Digits command? If I set Digits:=50 and compute a Matrix Inverse will the
arithmetic all be done to 50 digits?

Yes, it will (if the original matrix involves floats). Note that
"to 50 digits" doesn't mean that the results are accurate to 50 digits,
but rather that the calculations are done with Digits set to 50.

Robert Israel israel@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
Back to top
Ronald Bruck
science forum Guru


Joined: 05 Jun 2005
Posts: 356

PostPosted: Mon May 29, 2006 8:12 pm    Post subject: Re: Maple's linear algebra routine and higher precision arithmetic Reply with quote

In article <pan.2006.05.29.18.47.40.640507@acadiau.ca>, Ronald Haynes
<ronald.haynes@acadiau.ca> wrote:

Quote:
Hi, many thanks... I just want to test the validity of some lower
precision results with results generated by increasing levels of precision.

Would defining the matrix entries as -1.0 4.0 1.0 do the trick to force
floats?

In Maple--yes. If you do this in Mathematica you're well-advised to
use a notation like N[-1,64], N[4, 64], N[1,64]. The "4.0" will be
read as a standard double-precision floating-point number.
(Mathematica doesn't have a "Digits" command--each number has its own
intrinsic precision.)

But you asked about Maple, not Mathematica, so this is just for your
general edification...

--
Ron Bruck

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Back to top
Ronald Haynes
science forum beginner


Joined: 10 Feb 2005
Posts: 5

PostPosted: Wed May 31, 2006 3:21 pm    Post subject: Re: Maple's linear algebra routine and higher precision arithmetic Reply with quote

On Mon, 29 May 2006 13:12:03 -0700, Ronald Bruck wrote:

Quote:
In article <pan.2006.05.29.18.47.40.640507@acadiau.ca>, Ronald Haynes
ronald.haynes@acadiau.ca> wrote:

Hi, many thanks... I just want to test the validity of some lower
precision results with results generated by increasing levels of precision.

Would defining the matrix entries as -1.0 4.0 1.0 do the trick to force
floats?

In Maple--yes. If you do this in Mathematica you're well-advised to
use a notation like N[-1,64], N[4, 64], N[1,64]. The "4.0" will be
read as a standard double-precision floating-point number.
(Mathematica doesn't have a "Digits" command--each number has its own
intrinsic precision.)

But you asked about Maple, not Mathematica, so this is just for your
general edification...

Hi, upon simple testing this does not seem to work. i.e. setting
Digits:=1 and computing the inverse does not give different results from
setting Digits:=100 and computing the inverse.

Sometime ago I recall hearing that Maple was changing that way it dealt
with linear algebra routines --- maybe by using NAG routines (or similar)
under the hood? If Maple is actually using compiled routines how could
Digits:= whatever actually have an effect, I would presume the routines
would be double precision by default and not be affected by a change of
Digits (except possibly by rounding the input matrix). In my case the
matrix is integer valued. In fact only a slight modification of the
tridiag(-1,4,-1) matrix.

Any further thoughts?
Thanks,
R Haynes
Back to top
Robert B. Israel
science forum Guru


Joined: 24 Mar 2005
Posts: 2151

PostPosted: Wed May 31, 2006 4:00 pm    Post subject: Re: Maple's linear algebra routine and higher precision arithmetic Reply with quote

In article <pan.2006.05.31.15.21.21.254816@acadiau.ca>,
Ronald Haynes <ronald.haynes@acadiau.ca> wrote:
Quote:
On Mon, 29 May 2006 13:12:03 -0700, Ronald Bruck wrote:

In article <pan.2006.05.29.18.47.40.640507@acadiau.ca>, Ronald Haynes
ronald.haynes@acadiau.ca> wrote:

Hi, many thanks... I just want to test the validity of some lower
precision results with results generated by increasing levels of precision.

Would defining the matrix entries as -1.0 4.0 1.0 do the trick to force
floats?

In Maple--yes. If you do this in Mathematica you're well-advised to
use a notation like N[-1,64], N[4, 64], N[1,64]. The "4.0" will be
read as a standard double-precision floating-point number.
(Mathematica doesn't have a "Digits" command--each number has its own
intrinsic precision.)

But you asked about Maple, not Mathematica, so this is just for your
general edification...

Hi, upon simple testing this does not seem to work. i.e. setting
Digits:=1 and computing the inverse does not give different results from
setting Digits:=100 and computing the inverse.

Sometime ago I recall hearing that Maple was changing that way it dealt
with linear algebra routines --- maybe by using NAG routines (or similar)
under the hood? If Maple is actually using compiled routines how could
Digits:= whatever actually have an effect, I would presume the routines
would be double precision by default and not be affected by a change of
Digits (except possibly by rounding the input matrix). In my case the
matrix is integer valued. In fact only a slight modification of the
tridiag(-1,4,-1) matrix.

The environment variable UseHardwareFloats determines whether
floating-point operations on Arrays are done in hardware
(which is essentially double-precision) or software (with whatever
setting of Digits is current). The default value is "deduced",
meaning that hardware is used if Digits <= evalhf(Digits) (i.e.
the precision of hardware floating-point, which is 14 on my Windows
system), and software is used if Digits > evalhf(Digits). Compiled
NAG code is used for both hardware and software floating-point
computations in LinearAlgebra.

Thus:

Quote:
A:= <<7.0, 2.0>|<3.0, 5.0>>;

Digits:= 1;
A^(-1); # this will use hardware floats


[ 0.172413793103448260 -0.103448275862068950]
[ ]
[-0.0689655172413792956 0.241379310344827569 ]

Quote:
UseHardwareFloats:= false:
A^(-1); # now it will use software floats with Digits = 1


[ 0.1 -0.06]
[ ]
[-0.04 0.2 ]

Quote:
UseHardwareFloats:= deduced: Digits:= 40:
A^(-1); # this will use software floats with Digits = 40


[0.1724137931034482758620689655172413793104 ,

-0.1034482758620689655172413793103448275862]

[-0.06896551724137931034482758620689655172416 ,

0.2413793103448275862068965517241379310345]

Robert Israel israel@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Tue Dec 12, 2017 9:53 pm | All times are GMT
Forum index » Science and Technology » Math » Symbolic
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Linear operator and determinant aline Math 0 Wed Nov 29, 2006 2:37 am
No new posts Help with Boolean Algebra Questions!!! mcbivens@umes.edu Math 0 Thu Sep 14, 2006 6:58 pm
No new posts Help with Boolean Algebra Questions!!! mcbivens@umes.edu Math 0 Thu Sep 14, 2006 6:58 pm
No new posts noncommutative algebra book recommendation? adomplayer@yahoo.com Math 2 Wed Jul 19, 2006 9:35 pm
No new posts approximating infinite linear programming problems diegotorquemada@yahoo.com Math 0 Mon Jul 17, 2006 10:29 am

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Electronics forum |  Medicine forum |  Unix/Linux blog |  Unix/Linux documentation |  Unix/Linux forums  |  send newsletters
 


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0242s ][ Queries: 16 (0.0044s) ][ GZIP on - Debug on ]