public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Need help!
@ 1999-11-30 14:54 balaji.srinivasan.1
  1999-11-30 17:09 ` sparse matrix Gerhard Heinzel
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: balaji.srinivasan.1 @ 1999-11-30 14:54 UTC (permalink / raw)
  To: help-gcc

Hello,
I had two questions.Please do reply if you have the reply to any one of
them.Both pertain to gcc on RedHat Linux 6.0
1)Though sizeof(long double) gives 12 and sizeof(double) gives 8 the
precision seems to be exactly the same!!!(around 1e-18).After 18 decimal
places the calculation goes awry.It works fine on say, Solaris

2)Does anybody know of any sparse matrix routines that can be compiled on
and run on gcc on Linux

Thanks in advance,
Balaji

^ permalink raw reply	[flat|nested] 8+ messages in thread

* sparse matrix
  1999-11-30 14:54 Need help! balaji.srinivasan.1
@ 1999-11-30 17:09 ` Gerhard Heinzel
  1999-11-30 23:28   ` Gerhard Heinzel
  1999-11-30 21:10 ` Need help! Anthony
  1999-11-30 23:28 ` balaji.srinivasan.1
  2 siblings, 1 reply; 8+ messages in thread
From: Gerhard Heinzel @ 1999-11-30 17:09 UTC (permalink / raw)
  To: help-gcc

On Tue, 30 Nov 1999, balaji.srinivasan.1 wrote:

> 2)Does anybody know of any sparse matrix routines that can be compiled on
> and run on gcc on Linux

I am using netlib/sparse very successfully.
Although it has a memory leak/bug in the final 
disallocation of memory, it runs fast and fine.
PS: This question maybe better placed in sci.math.num-analysis.

Gerhard


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Need help!
  1999-11-30 14:54 Need help! balaji.srinivasan.1
  1999-11-30 17:09 ` sparse matrix Gerhard Heinzel
@ 1999-11-30 21:10 ` Anthony
  1999-11-30 23:27   ` Tim Prince
  1999-11-30 23:28   ` Anthony
  1999-11-30 23:28 ` balaji.srinivasan.1
  2 siblings, 2 replies; 8+ messages in thread
From: Anthony @ 1999-11-30 21:10 UTC (permalink / raw)
  To: help-gcc

balaji.srinivasan.1 wrote:
> 
> Hello,
> I had two questions.Please do reply if you have the reply to any one of
> them.Both pertain to gcc on RedHat Linux 6.0
> 1)Though sizeof(long double) gives 12 and sizeof(double) gives 8 the
> precision seems to be exactly the same!!!(around 1e-18).After 18 decimal
> places the calculation goes awry.It works fine on say, Solaris
That's because of the intel fpu, in fact all the arithemtics are done in
the 
FPU using the same register st0 st1 ... so the precision is the same but
the
compiler discard bits when he store back numbers from the fpu to memory.
and
when you have a well optimized code the compiler try to minismise
fpu->mem
transfer using as much as possible st register. So it is hard to enforce
usage of "real" double even using temp variable, you may try volatile
or gcc -O0.
(note i may be wrong)

> 
> 2)Does anybody know of any sparse matrix routines that can be compiled on
> and run on gcc on Linux

dunno but you may check http://www.che.wisc.edu/octave/ wich is a GNU
clone
of matlab 

> 
> Thanks in advance,
> Balaji

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Need help!
  1999-11-30 21:10 ` Need help! Anthony
@ 1999-11-30 23:27   ` Tim Prince
  1999-11-30 23:28     ` Tim Prince
  1999-11-30 23:28   ` Anthony
  1 sibling, 1 reply; 8+ messages in thread
From: Tim Prince @ 1999-11-30 23:27 UTC (permalink / raw)
  To: help-gcc

>to enforce
>usage of "real" double even using temp variable, you may try volatile
>or gcc -O0.
>(note i may be wrong)

While older versions of gcc usually had -O0 implying -ffloat-store, the latter
is more likely to accomplish this in recent versions.

>sizeof(long double) gives 12

but 2 of the bytes are left vacant, for convenience of alignment, so they do
nothing for precision or range.  The values in <float.h> are more likely to
express the precision available.
Tim Prince
tprince@computer.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Need help!
  1999-11-30 21:10 ` Need help! Anthony
  1999-11-30 23:27   ` Tim Prince
@ 1999-11-30 23:28   ` Anthony
  1 sibling, 0 replies; 8+ messages in thread
From: Anthony @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

balaji.srinivasan.1 wrote:
> 
> Hello,
> I had two questions.Please do reply if you have the reply to any one of
> them.Both pertain to gcc on RedHat Linux 6.0
> 1)Though sizeof(long double) gives 12 and sizeof(double) gives 8 the
> precision seems to be exactly the same!!!(around 1e-18).After 18 decimal
> places the calculation goes awry.It works fine on say, Solaris
That's because of the intel fpu, in fact all the arithemtics are done in
the 
FPU using the same register st0 st1 ... so the precision is the same but
the
compiler discard bits when he store back numbers from the fpu to memory.
and
when you have a well optimized code the compiler try to minismise
fpu->mem
transfer using as much as possible st register. So it is hard to enforce
usage of "real" double even using temp variable, you may try volatile
or gcc -O0.
(note i may be wrong)

> 
> 2)Does anybody know of any sparse matrix routines that can be compiled on
> and run on gcc on Linux

dunno but you may check http://www.che.wisc.edu/octave/ wich is a GNU
clone
of matlab 

> 
> Thanks in advance,
> Balaji

^ permalink raw reply	[flat|nested] 8+ messages in thread

* sparse matrix
  1999-11-30 17:09 ` sparse matrix Gerhard Heinzel
@ 1999-11-30 23:28   ` Gerhard Heinzel
  0 siblings, 0 replies; 8+ messages in thread
From: Gerhard Heinzel @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

On Tue, 30 Nov 1999, balaji.srinivasan.1 wrote:

> 2)Does anybody know of any sparse matrix routines that can be compiled on
> and run on gcc on Linux

I am using netlib/sparse very successfully.
Although it has a memory leak/bug in the final 
disallocation of memory, it runs fast and fine.
PS: This question maybe better placed in sci.math.num-analysis.

Gerhard


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Need help!
  1999-11-30 23:27   ` Tim Prince
@ 1999-11-30 23:28     ` Tim Prince
  0 siblings, 0 replies; 8+ messages in thread
From: Tim Prince @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

>to enforce
>usage of "real" double even using temp variable, you may try volatile
>or gcc -O0.
>(note i may be wrong)

While older versions of gcc usually had -O0 implying -ffloat-store, the latter
is more likely to accomplish this in recent versions.

>sizeof(long double) gives 12

but 2 of the bytes are left vacant, for convenience of alignment, so they do
nothing for precision or range.  The values in <float.h> are more likely to
express the precision available.
Tim Prince
tprince@computer.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Need help!
  1999-11-30 14:54 Need help! balaji.srinivasan.1
  1999-11-30 17:09 ` sparse matrix Gerhard Heinzel
  1999-11-30 21:10 ` Need help! Anthony
@ 1999-11-30 23:28 ` balaji.srinivasan.1
  2 siblings, 0 replies; 8+ messages in thread
From: balaji.srinivasan.1 @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

Hello,
I had two questions.Please do reply if you have the reply to any one of
them.Both pertain to gcc on RedHat Linux 6.0
1)Though sizeof(long double) gives 12 and sizeof(double) gives 8 the
precision seems to be exactly the same!!!(around 1e-18).After 18 decimal
places the calculation goes awry.It works fine on say, Solaris

2)Does anybody know of any sparse matrix routines that can be compiled on
and run on gcc on Linux

Thanks in advance,
Balaji

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-11-30 23:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-30 14:54 Need help! balaji.srinivasan.1
1999-11-30 17:09 ` sparse matrix Gerhard Heinzel
1999-11-30 23:28   ` Gerhard Heinzel
1999-11-30 21:10 ` Need help! Anthony
1999-11-30 23:27   ` Tim Prince
1999-11-30 23:28     ` Tim Prince
1999-11-30 23:28   ` Anthony
1999-11-30 23:28 ` balaji.srinivasan.1

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).