ratt-ru / meqtrees

A library for implementing radio astronomical Measurement Equations
http://meqtrees.net
10 stars 2 forks source link

Rework CompoundFunction into a TensorFunction #263

Closed gijzelaerr closed 10 years ago

gijzelaerr commented 10 years ago
at 2005-09-22 16:10:31 Oleg Smirnov reported:

Rework CompoundFunction into a TensorFunction

gijzelaerr commented 10 years ago

Original comment thread migrated from bugzilla

at 2005-09-22 16:10:31 Oleg Smirnov replied:

CompoundFunctions currently have their flag mask disabled completely (it wouldn't work properly previously due to sizing issues). Fix this!!!

at 2006-04-19 18:00:52 Oleg Smirnov replied:

Lots of nodes now need to operate on tensor results, with some specific tensor layout implied or expected. (E.g. UVW, LMN, AzEl, the future MeqFunctional). All these need to handle perturbed values in some consistent way, a-la the MeqFunction class, but extended to tensors. Therefore I volunteer to rework CompoundFunction into a TensorFunction class, which provides a base for evaluating a tensor function with tensor arguments. The crux of it is the method:

virtual void evaluate (std::vector<Vells > &out, const Request &req,const LoShape &shape, const std::vector< std::vector<const Vells> > &in);

Here in[child_number][vellset_number] gives the set of input Vells, and out[i] gives the Nth output vells. The business of evaluate() is to compute the function of the inputs and store it in out[]. TensorFunction::getResult() will then take care of iterating over all spids in the child results, and calling evaluate() for each combination of spids.

A similar virtual method to handle flags will be provided.

at 2006-05-01 16:14:29 Oleg Smirnov replied:

Done, see MEQ/TensorFunction.{cc,h}

LMN and VisPhaseShift are two good examples of how to use this class, I have not converted the other noes over yet.