[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to multiply 2 sequences ?

Subject: Re: How to multiply 2 sequences ?
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Wed, 7 Nov 2007 14:57:40 +0000
Re:  How to multiply 2 sequences ?
On 07/11/2007, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> >
> > It seems that you are trying to obtain the scalar product of
> > two vectors:
> >
> > X = {x1, x2, ... , xn}
> >
> > Y = {y1, y2, ... , yn}
> >
> > X.Y = x1.y1 + x2.y2 + ... + xn.yn
> >
>
> If that is indeed the requirement (and I wasn't able to work it out from the
> posting) then it can be done in XPath 2.0 (without any help from FXSL) as
>
> sum(for $i in 1 to count($x) return $x[$i] * $y[$i])

My guess was for the sum of the cross product:

sum(for $a in $x, $b in $y return $a * $b)

...i guess we'll find out at some point



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.