DesignVector, StateVector and DualVector¶
-
class
kona.linalg.vectors.common.
DesignVector
(memory_obj, user_vector=None)[source]¶ Bases:
kona.linalg.vectors.common.KonaVector
Derived from the base abstracted vector. Contains member functions specific to design vectors.
-
convert_to_dual
(dual_vector)[source]¶ Copy target state variables from the design vector to the given dual vector.
Parameters: dual_vector (DualVectorEQ or CompositeDualVector) – Target for the vector space conversion.
-
equals_lagrangian_total_gradient
(at_primal, at_state, at_dual, at_adjoint, obj_scale=1.0, cnstr_scale=1.0)[source]¶ Computes in-place the total derivative of the Lagrangian.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
- at_dual (DualVectorEQ, DualVectorINEQ or CompositeDualVector) – Current lagrange multipliers.
- at_adjoint (StateVector) – Current adjoint variables for the Lagrangian (rhs = - dL/dU)
- obj_scale (float, optional) – Scaling for the objective function.
- cnstr_scale (float, optional) – Scaling for the constraints.
-
equals_objective_partial
(at_primal, at_state, scale=1.0)[source]¶ Computes in-place the partial derivative of the objective function with respect to design variables.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
- scale (float, optional) – Scaling for the objective function.
-
equals_total_gradient
(at_primal, at_state, at_adjoint, scale=1.0)[source]¶ Computes in-place the total derivative of the objective function.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
- at_adjoint (StateVector) – Current adjoint variables.
- scale (float, optional) – Scaling for the objective function.
-
-
class
kona.linalg.vectors.common.
StateVector
(memory_obj, user_vector=None)[source]¶ Bases:
kona.linalg.vectors.common.KonaVector
Derived from the base abstracted vector. Contains member functions specific to state vectors.
-
equals_constraint_adjoint
(at_primal, at_state, at_dual, state_work, scale=1.0)[source]¶ Computes in-place the adjoint variables for the constraint terms in the Lagrangian.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
- state_work (StateVector) – Temporary work vector of State type.
- scale (float, optional) – Scaling for the constraints.
-
equals_lagrangian_adjoint
(at_kkt, at_state, state_work, obj_scale=1.0, cnstr_scale=1.0)[source]¶ Computes in-place the adjoint variables for the augmented Lagrangian, linearized at the given KKT vector and state points.
Parameters: - at_kkt (ReducedKKTVector) – Current KKT point.
- at_state (StateVector) – Current state point.
- adj_work (StateVector) – Temporary work vector of State type.
- state_work (StateVector) – Temporary work vector of State type.
- obj_scale (float, optional) – Scaling for the objective function.
- cnstr_scale (float, optional) – Scaling for the constraints.
-
equals_objective_adjoint
(at_primal, at_state, state_work, scale=1.0)[source]¶ Computes in-place the adjoint variables for the objective function, linearized at the given primal and state points.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
- state_work (StateVector) – Temporary work vector of State type.
- scale (float, optional) – Scaling for the objective function.
-
equals_objective_partial
(at_primal, at_state, scale=1.0)[source]¶ Computes in-place the partial derivative of the objective function with respect to state variables.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
- scale (float, optional) – Scaling for the objective function.
-
equals_primal_solution
(at_primal)[source]¶ Performs a non-linear system solution at the given primal point and stores the result in-place.
Parameters: at_primal (DesignVector) – Current primal point.
-
equals_residual
(at_primal, at_state)[source]¶ Computes in-place the system residual vector.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
-
-
class
kona.linalg.vectors.common.
DualVectorEQ
(memory_obj, user_vector=None)[source]¶ Bases:
kona.linalg.vectors.common.DualVector
-
convert_to_design
(primal_vector)[source]¶ Copy target state variables from the dual vector into the given design vector.
Parameters: design_vector (DesignVector) – Source vector for target state variable data.
-
equals_constraints
(at_primal, at_state, scale=1.0)[source]¶ Evaluate all equality constraints at the given primal and state points, and store the result in-place.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
- scale (float, optional) – Scaling for the constraints.
-
-
class
kona.linalg.vectors.common.
DualVectorINEQ
(memory_obj, user_vector=None)[source]¶ Bases:
kona.linalg.vectors.common.DualVector
-
equals_constraints
(at_primal, at_state, scale=1.0)[source]¶ Evaluate all in-equality constraints at the given primal and state points, and store the result in-place.
Parameters: - at_primal (DesignVector or CompositePrimalVector) – Current primal point.
- at_state (StateVector) – Current state point.
- scale (float, optional) – Scaling for the constraints.
-