Unfixed number of variables.

From: Kurda Yon (kurdayon_at_yahoo.com)
Date: 07/23/04

  • Next message: Gary Strand: "Re: Help :Writing potable unformated files in fortran"
    Date: 23 Jul 2004 09:51:51 -0700
    
    

    Hi,

    I have the following problem. I need to define a function which does
    not have a fixed number of arguments and additionally one of the
    arguments must be another function. For example I have three functions
    (defined somewhere):
        f1 = f1(x1,x2,x3)
        f2 = f2(x1,x2)
        f3 = f3(x1,x2,x3,x4)
    Each of the mentioned functions has a fixed number of real variables.
    Now I need to describe new function "F" which work in the following
    way:
       F(x1,x2,x3,f1) = f1(1*x1,2*x2,3*x3)
       F(x1,x2,f2) = f2(1*x1,2*x2)
       and so on.
    Moreover function "F" has to be able calculate number of arguments
    before the last one (that in the considered example is "f1" and "f2")
    and check if this number is equal to the proper number of variables of
    the function that are placed in the position of the last arguments of
    "F".
        F(x1,f3) ---- output ----> error
    The main problem is that, I do not know how one can define function
    with unfixed number of variables, and how one can calculate allowed
    number of variables for some function.

    Can you help me?


  • Next message: Gary Strand: "Re: Help :Writing potable unformated files in fortran"