Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Refactor #9

Draft
wants to merge 80 commits into
base: master
Choose a base branch
from
Draft

[WIP] Refactor #9

wants to merge 80 commits into from

Conversation

exAClior
Copy link
Collaborator

@exAClior exAClior commented Mar 5, 2025

This pull request includes significant changes to the NCTSSOS project, focusing on restructuring the codebase, introducing new functionalities, and adding comprehensive tests. The most important changes include the reorganization of module imports, the introduction of new types and methods for polynomial optimization problems, and the addition of extensive test cases.

Reorganization and Module Imports:

  • src/NCTSSOS.jl: Reorganized module imports, removing unused ones and consolidating includes and exports.

New Types and Methods:

  • src/moment_solver.jl: Introduced MomentMethod type and related methods for handling moment matrices in optimization problems.
  • src/pop.jl: Added PolynomialOptimizationProblem type and associated methods for defining and manipulating polynomial optimization problems.
  • src/solver_utils.jl: Implemented utility functions such as remove_zero_degree, star, and symmetric_canonicalize for handling polynomial variables and monomials.
  • src/sos_solver.jl: Added dualize method for creating dual optimization models.

Testing Enhancements:

  • test/moment_solver.jl: Added test cases for MomentMethod and its methods, including initialization and example usage.
  • test/pop.jl: Introduced tests for PolynomialOptimizationProblem to verify the correctness of variable and constraint handling.
  • test/solver_utils.jl: Added tests for utility functions to ensure proper manipulation of polynomial variables and monomials.
  • test/sos_solver.jl: Included tests for the dualize method to validate dual model creation and optimization.

These changes collectively enhance the functionality, maintainability, and test coverage of the NCTSSOS project.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove this file.

src/NCTSSOS.jl Outdated
export PolynomialOptimizationProblem

include("moment_solver.jl")
export MomentMethod, init_moment_vector!, constrain_moment_matrix!, make_sdp, set_total_basis2var_dict!, get_total_basis2var_dict
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do not export API unless this is very nessesary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Move export lines together.

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.

2 participants