Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-09-14 22:01:07


"Manfred Doudar" wrote

> If your dot product is indeed an inner product, then an inner_product
> is what you should call your op - being explicit rather than suggestive
> is always better (, sorry, just that my mathematics grounding makes me
> speak out on this one).

Dunno, but FWIW , from the source code:

http://tinyurl.com/e7729

involving transform of a homogeneous 2D coordinate (3 elements) by a 2D
transform matrix (9 elements)
here's the resulting assembler of my latest CVS version in VC8 with
optimisation. I'm no expert but it looks pretty good to me

; 113 : // do runtime calc
; 114 : quan::fusion::dot_product dot;
; 115 : result_type result(
; 116 : dot(coordinate,col0),
; 117 : dot(coordinate,col1),
; 118 : dot(coordinate,col2)
; 119 : );

  00164 dd 44 24 1c fld QWORD PTR _coordinate$[esp+304]
  00168 8d b4 24 d4 00
 00 00 lea esi, DWORD PTR $T303578[esp+296]
  0016f dd 44 24 40 fld QWORD PTR $T303558[esp+296]
  00173 d8 c9 fmul ST(0), ST(1)
  00175 dd 44 24 14 fld QWORD PTR _coordinate$[esp+296]
  00179 dd 44 24 28 fld QWORD PTR $T303561[esp+296]
  0017d d8 c9 fmul ST(0), ST(1)
  0017f de c2 faddp ST(2), ST(0)
  00181 d9 ee fldz
  00183 dc c2 fadd ST(2), ST(0)
  00185 d9 cb fxch ST(3)
  00187 dc 4c 24 30 fmul QWORD PTR $T303559[esp+296]
  0018b d9 c9 fxch ST(1)
  0018d dc 8c 24 f0 00
 00 00 fmul QWORD PTR _rotation$[esp+296]
  00194 de c1 faddp ST(1), ST(0)
  00196 de c2 faddp ST(2), ST(0)
  00198 d9 c9 fxch ST(1)
  0019a dd 5c 24 14 fstp QWORD PTR _result$[esp+296]
  0019e dd 5c 24 1c fstp QWORD PTR _result$[esp+304]

// start of output routine
  001a2 e8 00 00 00 00 call tuple_delimiter

regards
Andy Little


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk