axpy#

AnsSolver.axpy(obj, val1, val2)#

Perform the matrix operation: self= val1*obj + val2*self.

Parameters:
objAnsVec or AnsMat

AnsMath object.

val1float

Ratio applied to the AnsMath object.

val2float

Ratio applied to the self object.

Returns:
AnsVec or AnsMat

Matrix operation result of self= val1*obj + val2*self.

Examples

>>> dim = 2
>>> m1 = mm.ones(dim, dim)
>>> m2 = mm.rand(dim, dim)
>>> m1.axpy(m2, 3, 4)
>>> m1.asarray()
array([[5.251066  , 6.16097347], [6.99155442, 6.79767208]])