Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cortex-js/compute-engine
/ vectorAdd
Function
vectorAdd
examples/compile-vector-operations.js:16–18 ·
view source on GitHub ↗
(a, b)
Source
from the content-addressed store, hash-verified
14
15
// Define vector operation functions
16
function
vectorAdd(a, b) {
17
return
a.map((v, i) => v + b[i]);
18
}
19
20
function
vectorMultiply(a, b) {
21
return
a.map((v, i) => v * b[i]);
Callers
nothing calls this directly
Calls
1
map
Method · 0.65
Tested by
no test coverage detected