CompositeVector (base class)

class kona.linalg.vectors.composite.CompositeVector(vectors)[source]

Bases: object

Base class shell for all composite vectors.

divide_by(value)[source]

Used as the division operator.

Divides the vector by the given scalar value.

Parameters:value (float) – Vector to be added.
equals(rhs)[source]

Used as the assignment operator.

If val is a scalar, all vector elements are set to the scalar value.

If val is a vector, the two vectors are set equal.

Parameters:rhs (float or CompositeVector) – Right hand side term for assignment.
equals_ax_p_by(a, x, b, y)[source]

Performs a full a*X + b*Y operation between two vectors, and stores the result in place.

Parameters:
  • b (a,) – Coefficients for the operation.
  • y (x,) – Vectors for the operation
exp(vector)[source]

Computes the element-wise exponential of the given vector and stores it in place.

Parameters:vector (CompositeVector) –
infty

Infinity norm of the composite vector.

Returns:float
Return type:Infinity norm.
inner(vector)[source]

Computes an inner product with another vector.

Returns:float
Return type:Inner product.
log(vector)[source]

Computes the element-wise natural log of the given vector and stores it in place.

Parameters:vector (CompositeVector) –
minus(vector)[source]

Used as the subtraction operator.

Subtracts the incoming vector from the current vector in place.

Parameters:vector (CompositeVector) – Vector to be subtracted.
norm2

Computes the L2 norm of the vector.

Returns:float
Return type:L2 norm.
plus(vector)[source]

Used as the addition operator.

Adds the incoming vector to the current vector in place.

Parameters:vector (CompositeVector) – Vector to be added.
pow(power)[source]

Computes the element-wise power of the in-place vector.

Parameters:power (float) –
times(factor)[source]

Used as the multiplication operator.

Can multiply with scalars or element-wise with vectors.

Parameters:factor (float or CompositeVector) – Scalar or vector-valued multiplication factor.