Learn R Programming

CARrampsOcl (version 0.1.4)

inprod: Function to compute inner product of two vectors.

Description

Function to compute inner product of two vectors.

Usage

inprod(v1, v2)

Arguments

v1
numeric vector
v2
numeric vector of same length as v1

Value

  • scalar; inner product of v1 and v2

Examples

Run this code
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function( v1, v2)
{
    sum( v1 * v2)
}

Run the code above in your browser using DataLab