dotproduct: Computes the dot product of two iterable objects

Description Usage Arguments Value Examples

View source: R/dotproduct.r

Description

Returns the dot product of two numeric iterables of equal length

Usage

1
dotproduct(vec1, vec2)

Arguments

vec1

the first

vec2

the second iterable object

Value

the dot product of the iterators

Examples

1
2
3
4
5
6
7
it <- iterators::iter(1:3)
it2 <- iterators::iter(4:6)
dotproduct(it, it2) # 32

it <- iterators::iter(1:4)
it2 <- iterators::iter(7:10)
dotproduct(1:4, 7:10) # 90

itertools2 documentation built on May 30, 2017, 7:17 a.m.