From: "Diana Webster" <dkweb@arlut.utexas.edu>
Subject: Re: Looking for Ada Technique Name and References
Date: 2000/02/21
Date: 2000-02-21T21:00:02+00:00 [thread overview]
Message-ID: <88s90i$8mi$1@ns3.arlut.utexas.edu> (raw)
In-Reply-To: 88kh6q$j4j$1@coward.ks.cc.utah.edu
This technique is called "composition" in mathematics, i.e., the composition
of two functions,
i.e, sum (average (xnum)). Most programming languages support this.
John Halleck <nahaj@u.cc.utah.edu> wrote in message
news:88kh6q$j4j$1@coward.ks.cc.utah.edu...
> > John Halleck (nahaj@u.cc.utah.edu) wrote:
> > : I would appreciate it if someone could give me the name and a
> > : print reference for the following technique.
>
> > Someone Replied:
>
> > It is called overloading.
>
> It uses overloading, but that was not the technique I was trying
> to get accross.
>
> The technique in question is turning the what is normally written
> as two function calls (More or less:)
> "*" (Transpose (A), B)
> into a type mark and a single function call to a special function
> that can handle it all more effeciently.
>
> >
> > : Background:
> >
> > : Many matrix methods are written in the form A := Transpose(B)*C
> > : But, actually forming the transpose is expensive, and you are
better
> > : off just writing a second matrix multiply routine that takes the
> > : two matrices and treats the one as a transpose without actually
> > : doing the transpose.
> >
> > : Below is a technique that allows one to write it as one normally
> > : sees it written, but lets the Ada compiler do the selection of
> > : an appropriate routine.
> >
> > : Is there a name for this technique? Does it appear already
documented
> > : somewhere?
> >
> >
: --------------------------------------------------------------------------
----
> >
> > : -- ...
> >
> > : type Matrix is array (positive range <>, positive range <>) of Float;
> > : type Transpose is new Matrix;
> >
> > : -- ...
> >
> > : -- This is just a matrix multiply routine.
> > : function "*" (Left : Matrix; Right : Matrix) return Matrix;
> >
> > : -- This routine multiplies the transpose of Left by Right.
> > : function "*" (Left : Transpose; Right : Matrix) return Matrix;
> >
> > : ----------
> >
> > : -- Examples:
> > : A, B, C, D, E: Matrix;
> >
> > : -- ...
> >
> > : A := B * C; -- Matrix multiply.
> > : D := Transpose (E) * F; -- D gets the result of multiplying E'F
> > : -- (By selecting the appropriate routine.
> >
> > : ---------------------------------------------------------------------
next prev parent reply other threads:[~2000-02-21 0:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <88kegp$iso$1@coward.ks.cc.utah.edu>
[not found] ` <88kh6q$j4j$1@coward.ks.cc.utah.edu>
2000-02-18 0:00 ` Looking for Ada Technique Name and References Tucker Taft
2000-02-21 0:00 ` Diana Webster [this message]
2000-02-22 0:00 ` John Halleck
2000-02-22 0:00 ` Vladimir Olensky
2000-02-22 0:00 ` John Halleck
2000-02-22 0:00 ` tmoran
2000-02-22 0:00 ` David Starner
2000-02-23 0:00 ` tmoran
2000-02-23 0:00 ` Nick Roberts
2000-02-22 0:00 ` Jon S Anthony
2000-02-28 0:00 ` Charles D. Hixson
2000-02-28 0:00 ` Jon S Anthony
2000-02-29 0:00 ` Charles Hixson
2000-02-29 0:00 ` Brian Rogoff
2000-02-29 0:00 ` Jon S Anthony
2000-02-29 0:00 ` Brian Rogoff
2000-02-29 0:00 ` Jon S Anthony
2000-03-01 0:00 ` Brian Rogoff
2000-03-01 0:00 ` Jon S Anthony
2000-03-01 0:00 ` Charles Hixson
2000-03-04 0:00 ` Nick Roberts
2000-02-29 0:00 ` Wes Groleau
2000-02-29 0:00 ` Gautier
2000-03-01 0:00 ` Wes Groleau
2000-02-22 0:00 ` Gautier
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox