Skip to content

Add logic to deduplicate complementarity vector efficiently#22

Merged
nurkanovic merged 2 commits intomainfrom
bugfix/fix-nonuniqe-comps
Apr 2, 2025
Merged

Add logic to deduplicate complementarity vector efficiently#22
nurkanovic merged 2 commits intomainfrom
bugfix/fix-nonuniqe-comps

Conversation

@apozharski
Copy link
Member

Currently if the G or H vector contains duplicates we throw errors (as happens in e.g. cross-complementarity).

Here we use the casadi element hashes to deduplicate this list first when calculating the index sets.

@nosnoc-ci-bot
Copy link

nosnoc-ci-bot commented Apr 2, 2025

Summary - mpecopt coverage

Summary
Generated on: 04/02/2025 - 10:41:27
Coverage date: 04/02/2025 - 10:41:14
Parser: Cobertura
Assemblies: 2
Classes: 47
Files: 47
Line coverage: 31.5% (1192 of 3774)
Covered lines: 1192
Uncovered lines: 2582
Coverable lines: 3774
Total lines: 5978
Covered branches: 0
Total branches: 0
Method coverage: Feature is only available for sponsors
Tag: 27_14217606323

Coverage

- 15.6%
Name Line Branch
**** 15.6% ****
addaptive_active_set_identification 0%
BNLPProjectionStrategy
check_feasiblity_of_lpec 0%
check_if_B_stationary 0%
create_comparison_table 0%
create_lpec_functions 100%
create_lpec_subproblem 48.9%
create_mpec_functions 68.7%
create_phase_i_nlp_solver 0%
create_phase_i_nlp_solver_dev 0%
determine_multipliers_based_stationary_point 14.6%
fast_B_stationarity_check 0%
find_active_sets 100%
find_active_sets_piece_nlp 68%
find_nonscalar 90%
HomotopySolverOptions 100%
HomotopySteering
InitializationStrategy
lpec_fallback_strategy 0%
lpec_fallback_strategy_phase_ii 0%
lpec_solver 20%
LpecSolver
LPECSolverOptions 100%
mpec_active_set_generate_problem_functions 0%
mpec_active_set_nosnoc 0%
mpec_active_set_preprocess 0%
mpec_homotopy_solver 0%
mpec_optimizer 0%
mpecopt_phase_ii 0%
nice_plot_colors 0%
PieceNLPStartegy
plot_lpec 0%
print_iter_details 0%
print_iter_header 100%
print_iter_header_objective 0%
print_iter_line 100%
print_iter_line_objective 0%
print_iter_stats 91.6%
print_iter_stats_objective 0%
print_iter_summary 100%
print_iter_summary_scholtes 0%
print_phase_i 100%
print_phase_ii 100%
project_to_bounds 100%
unfold_struct 0%
mpecopt - 62.2%
Name Line Branch
mpecopt 62.2% ****
mpecopt.Options 100%
mpecopt.Solver 61.6%

@nurkanovic nurkanovic self-assigned this Apr 2, 2025
@nurkanovic nurkanovic self-requested a review April 2, 2025 11:59
Copy link
Member

@nurkanovic nurkanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nurkanovic nurkanovic merged commit dd1ec01 into main Apr 2, 2025
12 checks passed
@nurkanovic nurkanovic deleted the bugfix/fix-nonuniqe-comps branch April 2, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants