You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Up to now, we can create a Constant object which is later considered as a free-variable, for example
kappa=Constant('kappa', is_real=True)
We would also like to allow the assignnment of a value to the Constant object, e.g.
kappa=Constant('kappa', 1.1)
In this case, kappa will not be treated as a free-variable by TerminalExpr, which will use subs to replace occurrences of the symbol kappa by its value.
The text was updated successfully, but these errors were encountered:
After a long discussion @ratnania and I propose to have the three classes ScalarConstant, VectorConstant, and MatrixConstant.
Objects of these types can be created through a unique Constant constructor, which will select the correct type based on the shape argument (which is 0 by default, corresponding to a scalar).
If the user does not provide a value to the constructor, the dtype must be specified and the resulting object is treated as an undefined constant of a specific type. If value is specified the dtype is calculated from it. If both value and dtype are present, the values are cast to the required type if this does not cause a conversion error.
For vectors and matrices the shape argument should always be provided for clarity. If the given value has a shape inconsistent with the one provided, an error will be raised.
Up to now, we can create a
Constant
object which is later considered as a free-variable, for exampleWe would also like to allow the assignnment of a value to the
Constant
object, e.g.In this case,
kappa
will not be treated as a free-variable byTerminalExpr
, which will usesubs
to replace occurrences of the symbolkappa
by its value.The text was updated successfully, but these errors were encountered: