Blitz logo

Blitz Support :

From: Andrius Kurtinaitis (andrius.kurtinaitis_at_[hidden])
Date: 2003-12-11 04:54:49


Hello,

I just looked into <blitz/array/functorExpr.h> and i did not see any
difference between blitz-declared functions and functors except that
when when using functors, you can use class or instance methods (which
also operate on scalars). Also, in the case of instance methods you can
  use the instance variables when evaluating the expression.
Am i right?

Andrius

Julian Cummings wrote:
> Just an aside: this example is not a proper trinary function. A trinary
> function would act on three arrays of data. What you have here is a
> function that acts on a single array of data and requires two additional
> scalar input parameters. Such a function would best be captured in
> blitz by implementing it as a functor object that is initialized with
> values for the two scalar parameters. The functor would store these
> parameters as member data and operate on an array by providing an
> operator() method. See <blitz/array/functorExpr.h> for details.
>
> -- Julian C.
>
> P.S. Apparently, trinary and ternary are synonyms, but ternary is the
> more commonly used term for an operator taking three arguments.
>