public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* question
@ 2002-08-23 13:09 Klauko Mota
  2002-09-01 14:32 ` question Brian Gough
  0 siblings, 1 reply; 7+ messages in thread
From: Klauko Mota @ 2002-08-23 13:09 UTC (permalink / raw)
  To: gsl-discuss


Can I use the gsl libraries with fortran90? What should I do to compiler
the code?

		******************************************
		* Klauko Mota                            *
		* Instituto de Física                    *
		* Campus da Praia Vermelha               *
		* Avenida Litorânea, s/n, Boa Viagem     *
		* Cep.: 24210-340, Niteroi - RJ - Brazil *
		* Voice: +55-21-2620-6735                *
		* Fax: +55-21-2620-3881                  *
		* e-mail: klauko@if.uff.br               *
		******************************************


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

* Re: question
  2002-08-23 13:09 question Klauko Mota
@ 2002-09-01 14:32 ` Brian Gough
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Gough @ 2002-09-01 14:32 UTC (permalink / raw)
  To: Klauko Mota; +Cc: gsl-discuss

> From: Klauko Mota <klauko@if.uff.br>
> Can I use the gsl libraries with fortran90?

Perhaps, but it's not recommended.

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

* Re: Question
  2005-02-01 22:04   ` Question Gerard Jungman
@ 2005-02-02 18:00     ` Brian Gough
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Gough @ 2005-02-02 18:00 UTC (permalink / raw)
  To: gsl-discuss

Gerard Jungman writes:
 > Unfortunately, some compilers are truly brain-damaged and
 > will claim that the prototypes do not match if you remove
 > that 'const' from the declaration. As I recall, there was
 > a complaint to this effect several years ago; I think it
 > was an HP compiler.

That's right..  I think their man page claimed that functions with
const arguments could be compiled with a different calling convention,
and so the prototypes had to match.

-- 
Brian Gough

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

* Re: Question
  2005-02-01 21:28 ` Question John Lamb
  2005-02-01 22:04   ` Question Gerard Jungman
@ 2005-02-01 22:12   ` Jordi Burguet Castell
  1 sibling, 0 replies; 7+ messages in thread
From: Jordi Burguet Castell @ 2005-02-01 22:12 UTC (permalink / raw)
  To: gsl-discuss; +Cc: John Lamb

On Tuesday 01 February 2005 22:28, John Lamb wrote:
> Przemyslaw Sliwa wrote:
> [...]
> Nonetheless, it is often a good idea to declare an automatic function
> parameter const in the function definition. This forces the compiler to
> check that you don't change the parameter value in the body of the
> function. Similarly, it is a good idea to declare any variable const if
> you don't intend to change it.

IMHO, you lose more with the potential confusion for the programmer than what 
you may earn.

jordi

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

* Re: Question
  2005-02-01 21:28 ` Question John Lamb
@ 2005-02-01 22:04   ` Gerard Jungman
  2005-02-02 18:00     ` Question Brian Gough
  2005-02-01 22:12   ` Question Jordi Burguet Castell
  1 sibling, 1 reply; 7+ messages in thread
From: Gerard Jungman @ 2005-02-01 22:04 UTC (permalink / raw)
  To: gsl-discuss

On Tue, 2005-02-01 at 21:28 +0000, John Lamb wrote:
> Przemyslaw Sliwa wrote:

> > I was just wondering what means
> > 
> > double gsl_cdf_ugaussian_Pinv (const double P)


> I think you are right, const is not required and you don't need to worry 
> about it when calling the function. This is certainly true in C++.

Unfortunately, some compilers are truly brain-damaged and
will claim that the prototypes do not match if you remove
that 'const' from the declaration. As I recall, there was
a complaint to this effect several years ago; I think it
was an HP compiler.

Anyway, it may be unnecessary now. It certainly is silly.

-- 
Gerard Jungman <jungman@lanl.gov>
Los Alamos National Laboratory

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

* Re: Question
  2005-02-01 18:30 Question Przemyslaw Sliwa
@ 2005-02-01 21:28 ` John Lamb
  2005-02-01 22:04   ` Question Gerard Jungman
  2005-02-01 22:12   ` Question Jordi Burguet Castell
  0 siblings, 2 replies; 7+ messages in thread
From: John Lamb @ 2005-02-01 21:28 UTC (permalink / raw)
  To: gsl-discuss

Przemyslaw Sliwa wrote:
> All,
> 
> I was just wondering what means
> 
> double gsl_cdf_ugaussian_Pinv (const double P)
> 
> Correct me if I am wrong but it seems the const word is not required
> in this case and we cannot change the value of P.
> 

I think you are right, const is not required and you don't need to worry 
about it when calling the function. This is certainly true in C++.

Nonetheless, it is often a good idea to declare an automatic function 
parameter const in the function definition. This forces the compiler to 
check that you don't change the parameter value in the body of the 
function. Similarly, it is a good idea to declare any variable const if 
you don't intend to change it.

You can declare the function as

double gsl_cdf_ugaussian_Pinv (double);

and define it as

double gsl_cdf_ugaussian_Pinv (const double P){
...
}

but it may be better to make the two match precisely either because you 
may want to use some editing tools that rely on a match or because you 
want the code to work on a compiler that can't work oout that the 
declaration and definition do match.

-- 
JDL

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

* Question
@ 2005-02-01 18:30 Przemyslaw Sliwa
  2005-02-01 21:28 ` Question John Lamb
  0 siblings, 1 reply; 7+ messages in thread
From: Przemyslaw Sliwa @ 2005-02-01 18:30 UTC (permalink / raw)
  To: gsl-discuss

All,

I was just wondering what means

double
gsl_cdf_ugaussian_Pinv (const double P)

Correct me if I am wrong but it seems the const word is not required in this case and we cannot change the value of P.

Thanks for help,

Pshemek


--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


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

end of thread, other threads:[~2005-02-02 18:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-23 13:09 question Klauko Mota
2002-09-01 14:32 ` question Brian Gough
2005-02-01 18:30 Question Przemyslaw Sliwa
2005-02-01 21:28 ` Question John Lamb
2005-02-01 22:04   ` Question Gerard Jungman
2005-02-02 18:00     ` Question Brian Gough
2005-02-01 22:12   ` Question Jordi Burguet Castell

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).