MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / axpy

Function axpy

linear_algebra_python/src/lib.py:167–176  ·  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

165
166
167def axpy(scalar,x,y):
168 """
169 input: a 'scalar' and two vectors 'x' and 'y'
170 output: a vector
171 computes the axpy operation
172 """
173 # precondition
174 assert(isinstance(x,Vector) and (isinstance(y,Vector)) \
175 and (isinstance(scalar,int) or isinstance(scalar,float)))
176 return (x*scalar + y)
177
178
179def randomVector(N,a,b):

Callers 1

test_axpyMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_axpyMethod · 0.68