Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: Problems in...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 17 Topic 8147 of 8774
Post > Topic >>

Re: Problems in passing a function to a subroutine

by nospam@[EMAIL PROTECTED] (Richard Maine) Apr 18, 2008 at 08:26 AM

deltaquattro <deltaquattro@[EMAIL PROTECTED]
> wrote:

> On 17 Apr, 21:31, nos...@[EMAIL PROTECTED]
 (Richard Maine) wrote:

> > Oh, but I forgot to mention on somewhat related method that I've used
in
> > comparable situations. Pass a single adjustable-size array for such
> > auxillary data.

> But this requires me to modify the interfaces in quad and in all the
> subroutines it calls, doesn't it? Because I now have to pass
> 
> func(x,p)
> 
> where p is the array of reals (parameters) instead than func. thanks

Yes, it does require a modification like that. However, it only requires
the single modification, which then works for a broad category of
functions. You don't have to remodify quad for every particular
function. It is basically just a way of formulating an interface to
"function of x plus some auxilary data" in a way that a single interface
can handle a lot of those kinds of cases. As it turns out, in my case, I
was't modifying old code. I was writing new code, which needed a
simillar flexibility. I wrote the code to have this kind of interface in
the first place.

The approaches with C void pointer and with polymorphism also require a
comparable modification, so this method is very much in the same
category from that perspective. That's why I called it "somewhat
related." See my prior post for (very brief) commentary about
distinctions among them.

-- 
Richard Maine                    | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle           |  -- Mark Twain
 




 17 Posts in Topic:
Problems in passing a function to a subroutine
deltaquattro <deltaqua  2008-04-17 03:00:56 
Re: Problems in passing a function to a subroutine
Arjen Markus <arjen.ma  2008-04-17 04:26:52 
Re: Problems in passing a function to a subroutine
deltaquattro <deltaqua  2008-04-17 04:55:53 
Re: Problems in passing a function to a subroutine
Arjen Markus <arjen.ma  2008-04-17 05:12:26 
Re: Problems in passing a function to a subroutine
Ron Shepard <ron-shepa  2008-04-17 11:53:52 
Re: Problems in passing a function to a subroutine
glen herrmannsfeldt <g  2008-04-17 10:31:11 
Re: Problems in passing a function to a subroutine
nospam@[EMAIL PROTECTED]   2008-04-17 12:07:48 
Re: Problems in passing a function to a subroutine
nospam@[EMAIL PROTECTED]   2008-04-17 12:31:54 
Re: Problems in passing a function to a subroutine
glen herrmannsfeldt <g  2008-04-17 12:02:53 
Re: Problems in passing a function to a subroutine
"jamesgiles@[EMAIL P  2008-04-17 12:50:54 
Re: Problems in passing a function to a subroutine
deltaquattro <deltaqua  2008-04-18 05:08:42 
Re: Problems in passing a function to a subroutine
nospam@[EMAIL PROTECTED]   2008-04-18 08:26:29 
Re: Problems in passing a function to a subroutine
deltaquattro <deltaqua  2008-04-18 07:01:08 
Re: Problems in passing a function to a subroutine
pa@[EMAIL PROTECTED] (Pi  2008-04-19 13:45:06 
Re: Problems in passing a function to a subroutine
Charles Coldwell <cold  2008-04-18 14:03:31 
Re: Problems in passing a function to a subroutine
nospam@[EMAIL PROTECTED]   2008-04-18 08:41:23 
Re: Problems in passing a function to a subroutine
glen herrmannsfeldt <g  2008-04-18 08:15:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 23:41:15 CDT 2008.