Return information

When SCS terminates it will return an ScsInfo struct containing the following fields.

Name

Type

Description

iter

scs_int

Number of iterations taken

status

char *

Status string (e.g., ‘solved’)

lin_sys_solver

char *

Linear system solver used

status_val

scs_int

Status integer exit flag

scale_updates

scs_int

Number of updates to the scale parameter (see Dynamic scale updating)

pobj

scs_float

Primal objective

dobj

scs_float

Dual objective

res_pri

scs_float

Primal residual (see termination conditions)

res_dual

scs_float

Dual residual (see termination conditions)

gap

scs_float

Absolute duality gap (see termination conditions)

res_infeas

scs_float

Primal infeasibility residual (see termination conditions)

res_unbdd_a

scs_float

Dual infeasibility residual involving \(A\) (see termination conditions)

res_unbdd_p

scs_float

Dual infeasibility residual involving \(P\) (see termination conditions)

comp_slack

scs_float

Complementary slackness (\(s^\top y\)), should be very close to zero

setup_time

scs_float

Time taken for setup (milliseconds)

solve_time

scs_float

Time taken for solve (milliseconds)

scale

scs_float

Final scale parameter, useful for initializing next solve (see Dynamic scale updating)

rejected_accel_steps

scs_int

Number of times an AA update was rejected by the safeguarding check (see Acceleration)

accepted_accel_steps

scs_int

Number of times an AA update was accepted by the safeguarding check (see Acceleration)

aa_stats

AaStats

Detailed AA solve diagnostics, including rejection causes, last rank, last weight norm, and last regularization

lin_sys_time

scs_float

Total time (milliseconds) spent in the linear system solver

cone_time

scs_float

Total time (milliseconds) spent in the cone projection

accel_time

scs_float

Total time (milliseconds) spent in the acceleration routine

Anderson acceleration statistics

The aa_stats field contains detailed diagnostics from the Anderson acceleration linear solves. These counters are useful for diagnosing whether AA is active and, when AA updates are rejected, why they were rejected.

Name

Type

Description

iter

scs_int

Internal AA iteration counter

n_accept

scs_int

Number of AA updates accepted by aa_apply before safeguarding

n_reject_lapack

scs_int

Number of AA updates rejected because the LAPACK solve failed

n_reject_rank0

scs_int

Number of AA updates rejected because rank truncation produced rank zero

n_reject_nonfinite

scs_int

Number of AA updates rejected because the AA weight norm was non-finite

n_reject_weight_cap

scs_int

Number of AA updates rejected because the AA weight norm exceeded the configured cap

n_safeguard_reject

scs_int

Number of AA updates rejected by the safeguarding check

last_rank

scs_int

Rank used in the most recent AA solve

last_aa_norm

scs_float

AA weight norm from the most recent AA solve, or NaN if no AA solve was attempted

last_regularization

scs_float

Regularization value used in the most recent AA solve