[racket] Computing dot product via racket math library

From: Tobias Hammer (tobias.hammer at dlr.de)
Date: Thu Oct 24 11:16:51 EDT 2013

matrix-dot is what you want.

Tobias


On Thu, 24 Oct 2013 16:59:15 +0200, Dmitry Cherkassov  
<dcherkassov at gmail.com> wrote:

> I've tried using racket math library to compute dot product of two
> vectors, but haven't found the very function to compute it.
>
> What i've found so far is to use matrix* function, but two drawbacks:
>     1. I have to transpose the right multiple (extra overhead)
>     2. It yields single-element matrix:
>         > (matrix* (matrix ([1 2])) (matrix ([2] [1])))
>            (array #[#[4]])
>
>         So i need to extract it (for example calculating the determinant  
> :)
>
> So the questions are:
> A. Is there dot product function available?
> B. Is there any reason that matrix* yields single-element matrix (2)
>
>
> Thanks


-- 
---------------------------------------------------------
Tobias Hammer
DLR / Robotics and Mechatronics Center (RMC)
Muenchner Str. 20, D-82234 Wessling
Tel.: 08153/28-1487
Mail: tobias.hammer at dlr.de

Posted on the users mailing list.