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.
enforce_bounds()[source]

Element-wise enforcement of design bounds.

equals_init_design()[source]

Sets this vector equal to the initial design point.

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:
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:
equals_total_gradient(at_primal, at_state, at_adjoint, scale=1.0)[source]

Computes in-place the total derivative of the objective function.

Parameters:
restrict_to_design()[source]

Set target state variables to zero, leaving design variables untouched.

Used only for IDF problems.

restrict_to_target()[source]

Set design variables to zero, leaving target state variables untouched.

Used only for IDF problems.

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:
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:
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:
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:
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:
restrict_to_idf()[source]

Set regular dual terms to zero, leaving IDF constraint terms untouched.

Used only for IDF problems.

restrict_to_regular()[source]

Set IDF constraints terms to zero, leaving regular dual terms untouched.

Used only for IDF problems.

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: