public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* Some (probably) ridiculous questions
@ 2001-12-19 13:20 Jean-Max Redonnet
  2001-12-19 13:20 ` Brian Gough
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Max Redonnet @ 2001-12-19 13:20 UTC (permalink / raw)
  To: gsl-discuss

Sorry, if this point is obvious, but I'm not very familiar with GSL and I 
would like to use it in the right way.

My question is : How to declare a function of multiple variables ?

I manage with parametric curves and surfaces, so I need functions of one or 
two parameters. Futhermore This functions should be vectorial.
For example : I need to deal with a ruled surface.
Its definition is
C0(u) : vectorial function with 3 components : C0x(u), C0y(u) and C0z(u)
C1(u) : idem with C1x(u), C1y(u) and C1z(u)
then surface S(u,v) is built from C0 and C1 with
S(u,v) = (1-v)C0(u) + vC1(u)

How can I define this with GSL ?

For moment I've defined a
  struct v3func
    {
      gsl_function fx;
      gsl_function fy;
      gsl_function fz;
    };

then, once declared
  struct v3func *C0;
I can do
  C0 = (struct v3func *)malloc(sizeof(struct v3func *));
  C0->fx.function = &C0_fx;
  C0->fy.function = &C0_fy;
  C0->fz.function = &C0_fz;
with C0_fx, C0_fy and C0_fz declared by
  double C0_fx(double u, void * params);
  double C0_fy(double u, void * params);
  double C0_fz(double u, void * params);

This seems to work. Idem for C1 (of course).

But I have a problem to declare S(u,v)...
I've tried to do the same with S_fx(double u, double v, void * params)
but compilation says : "assignment from incompatible pointer type"

Any help would be very appreciated...

-- 
===============================================================================
Jean-Max Redonnet
PhD University Paul Sabatier - Toulouse (France)
	mailto:redonnetNO@SPAMlgmt.ups-tlse.fr

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

end of thread, other threads:[~2001-12-19 13:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-19 13:20 Some (probably) ridiculous questions Jean-Max Redonnet
2001-12-19 13:20 ` Brian Gough
2001-12-19 13:20   ` Jean-Max Redonnet
2001-12-19 13:20     ` Brian Gough

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