1 core.vectors.L2Norm
core.vectors.L2Norm(vector)L2 (Euclidean) norm of a vector: ||x|| = sqrt(x[0]^2 + x[1]^2 + … + x[n-1]^2).
This is a scalar expression representing the Euclidean length.
1.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| vector | VectorVariable | VectorExpression | The vector to compute the norm of. | required |
1.2 Example
x = VectorVariable(“x”, 2) n = L2Norm(x) n.evaluate({“x[0]”: 3, “x[1]”: 4}) 5.0
1.3 Methods
| Name | Description |
|---|---|
| evaluate | Evaluate the L2 norm given variable values. |
| get_variables | Return all variables this expression depends on. |
1.3.1 evaluate
core.vectors.L2Norm.evaluate(values)Evaluate the L2 norm given variable values.
1.3.2 get_variables
core.vectors.L2Norm.get_variables()Return all variables this expression depends on.