MCPcopy Index your code
hub / github.com/geekcomputers/Python / axpy

Function axpy

linear-algebra-python/src/lib.py:226–238  ·  view source on GitHub ↗

input: a 'scalar' and two vectors 'x' and 'y' output: a vector computes the axpy operation

(scalar, x, y)

Source from the content-addressed store, hash-verified

224
225
226def axpy(scalar, x, y):
227 """
228 input: a 'scalar' and two vectors 'x' and 'y'
229 output: a vector
230 computes the axpy operation
231 """
232 # precondition
233 assert (
234 isinstance(x, Vector)
235 and (isinstance(y, Vector))
236 and (isinstance(scalar, int) or isinstance(scalar, float))
237 )
238 return x * scalar + y
239
240
241def randomVector(N, a, b):

Callers 1

test_axpyMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_axpyMethod · 0.68