1 core.vectors.DotProduct
core.vectors.DotProduct(left, right)Dot product of two vectors: x · y = x[0]y[0] + x[1]y[1] + … + x[n-1]*y[n-1].
This is a scalar expression representing the inner product.
1.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| left | VectorVariable | VectorExpression | First vector. | required |
| right | VectorVariable | VectorExpression | Second vector. | required |
1.2 Example
x = VectorVariable(“x”, 3) y = VectorVariable(“y”, 3) d = DotProduct(x, y) d.evaluate({“x[0]”: 1, “x[1]”: 2, “x[2]”: 3, “y[0]”: 4, “y[1]”: 5, “y[2]”: 6}) 32.0
1.3 Methods
| Name | Description |
|---|---|
| evaluate | Evaluate the dot product given variable values. |
| get_variables | Return all variables this expression depends on. |
1.3.1 evaluate
core.vectors.DotProduct.evaluate(values)Evaluate the dot product given variable values.
1.3.2 get_variables
core.vectors.DotProduct.get_variables()Return all variables this expression depends on.