![]() |
Blitz Support : |
From: Julian Cummings (cummings_at_[hidden])
Date: 2003-09-03 21:34:13
Hello Tyson,
Your comments below regarding the two ET systems are quite correct.
I started helping out with Blitz maintenance issues a little over a year
ago,
and I noticed some gaps in the completeness of the "new" ET. The main
difference between the new and old ET systems is that the new one uses
the fact that Arrays and array expression types can be defined as
inheriting
from an ETBase class to simplify declaration of functions that act on
combinations of these types. In making repairs to the new ET system,
I set up an alternate set of functors using the Fn_ naming convention and
using macros instead of code generators to manage this. The only real
difference between the Fn_ classes and the older _bz_ classes is that the
old functors derived from base classes in order to organize them into
unary and binary categories (presumably for class hierarchy diagrams or
something). I dropped that in my version of these functors.
I still have dreams of someday migrating the vector and matrix classes over
to the new ET system and then dropping the old ET stuff entirely. But
there
is quite a bit of work involved in doing this. There are operations for
vector
and matrix types that do not make sense for array types, and vice versa.
Also,
the expression support for TinyVectors is presently convolved with that for
regular Vectors. This means, for example, that one can perform elementwise
addition of a Vector and a TinyVector. While this might be useful in some
particular situations, I would prefer to see TinyVector (and TinyMatrix,
which
currently has no real ET support) treated as concrete data types rather
than container
types. This means they would provide their own unary and binary
operators and
math functions, and then they would interact with Arrays and other
container types
in expressions just the way that built-in scalar types do now. There is
a TVMET
library in existence now which has taken the TinyVector and TinyMatrix
concepts
of Blitz and fully fleshed out the ET support for these classes,
independent of
Blitz Arrays. It might be possible to reintegrate the TVMET classes
into Blitz
as a way of shortening the process of moving all classes to the new ET
system.
I haven't looked carefully at TVMET, but I intend to do that.
So that is the current situation. I still plan to migrate the
elementwise operations
on Vector and Matrix types to the new ET system in the future. The
Vector-specific
functions defined by vecglobs.cc could be simplified greatly by doing
this, and we
could dispose of the generator programs and a great deal of duplicated
code. But it's
not clear that too many people are aware of or use the Vector and Matrix
classes in
Blitz, and support for the standard Matrix ops is missing. Also, I need
to see how
the TVMET library fits in here before attempting this upgrade. I can't
really give
an ETA on any of this because I can only play with this in my "spare"
time. But of
course, any help from volunteers would be greatly appreciated!
Regards, Julian C.
Tyson Whitehead wrote:
>Hi. I've been reading some of Blitz source code with regards to unary and
>binary funcations and am somewhat confused about the fact that there seems to
>be two styles of binary and unary functions.
>
>Ones that are prepended with _bz_ and ones that are prepended with Fn_. It
>looks like the Fn_ version is what the system is currently using (spread
>between funcs.h, array/funcs.h, and array/newet-macros.h) .
>
>Am I right in saying that the Fn_ versions represent the new ET style (i.e.
>using defines to role out the required templates), and the _bz_ versions are
>the old ET style (i.e. generated code in the .files)?
>
>There seems to be a bunch of redundancy surrounding the mathfunc.h file. It
>declares a whole slug of the old style _bz_ functions despite the fact that
>they have all already been declared with the Fn_ prefix. Persumably this is
>being done because the (autogenerated) TinyVector and the Matrix code hasn't
>been updated yet to reflect the Fn_ prefix?
>
>Am I right in guessing that the plan was to drop autogeneration in the
>TinyVector and Matrix code, in favor of defines, as well? Is this still on
>the game plan, or has the code been dropped in the middle of a 'transition to
>defines' state?
>
>Thanks -T
>
>PS: Pretty cool stuff by the way -- I'm way impressed that Todd had this kind
>of C++ ability at the Masters level...
>
>PPS: Please CC me as I am not a member of this mailing group
>
>
>
-- Dr. Julian C. Cummings E-mail: cummings_at_[hidden] California Institute of Technology Phone: 626-395-2543 1200 E. California Blvd., Mail Code 158-79 Fax: 626-584-5917 Pasadena, CA 91125