Parma Polyhedra Library requirements
C++ mip values

C++ mip values

PPL-SPEC-001467
1. Mixed integer problem values
UID: PPL-SPEC-001467
STATUS: APPROVED
COMPONENT: MIP_SOLVER
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

A problem of dimension n shall denote the points in Rn satisfying its stored equalities and non-strict inequalities, with coordinates in integer_space_dimensions() restricted to integers. Other coordinates shall remain unrestricted real coordinates. The objective shall be an affine linear expression, including its constant term. The mode shall select minimization or maximization. Stored constraints shall retain their mathematical meaning independently of subsequent source mutations.

The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply.

RATIONALE:

Integer restrictions change feasibility and optimality, while coordinates outside the selected subset remain real.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of MIP_Problem or the concrete type named below.

class MIP_Problem;
enum MIP_Problem_Status {
  UNFEASIBLE_MIP_PROBLEM, UNBOUNDED_MIP_PROBLEM, OPTIMIZED_MIP_PROBLEM
};
VERIFICATION_CRITERIA:

Check real, integer and mixed coordinates, negative values, affine objective constants and independently enumerated bounded models.

BIBLIOGRAPHY:

Schrijver99 | Whole work; background on linear and integer optimization.

SOURCE:

src/MIP_Problem.cc; src/MIP_Problem_defs.hh; src/MIP_Problem_inlines.hh; src/MIP_Problem_templates.hh; src/MIP_Problem_types.hh; tests/MIP_Problem/enumeratedmodels1.cc; tests/MIP_Problem/mipproblem1.cc.

PPL-SPEC-001468
2. Trivial mixed integer construction and dimensions
UID: PPL-SPEC-001468
STATUS: APPROVED
COMPONENT: MIP_SOLVER
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Construction from dim shall create a problem with no explicit constraints or integer coordinates, zero objective and maximization mode. The default dimension shall be zero. Dimension queries shall report its ambient extent and the supported maximum. An extent greater than the maximum, including the reserved non-dimension value, shall raise std::length_error.

The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply.

RATIONALE:

The unrestricted problem and its ambient dimension are meaningful even before any solve request.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of MIP_Problem or the concrete type named below.

explicit MIP_Problem(dimension_type dim=0);
static dimension_type max_space_dimension();
dimension_type space_dimension() const;
VERIFICATION_CRITERIA:

Check zero/nonzero defaults, origin feasibility, constant optimum, maximum reporting and excessive dimensions.

SOURCE:

src/MIP_Problem.cc; src/MIP_Problem_defs.hh; src/MIP_Problem_inlines.hh; src/MIP_Problem_templates.hh; src/MIP_Problem_types.hh; tests/MIP_Problem/exceptions1.cc; tests/MIP_Problem/mipproblem1.cc; tests/MIP_Problem/mipproblem3.cc.

PPL-SPEC-001469
3. Mixed integer construction from constraints
UID: PPL-SPEC-001469
STATUS: APPROVED
COMPONENT: MIP_SOLVER
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

System construction shall copy its canonical admitted constraints, objective and mode. Range construction shall copy the constraints in the valid half-open input range; the overload with int_vars shall additionally select those integer coordinates. Omitted objectives and modes shall mean zero and maximization.

The common iterator type shall satisfy Constraint_Input_Iterator: it shall support implicit copying of a traversal lvalue, prefix increment, a boolean inequality test, and a dereferenced result implicitly convertible to const Constraint&. It shall additionally provide operator-> for constraint metadata. C++20 inputs with distinct sentinel types or value/proxy results can use std::common_iterator when its standard copyability requirements are met. The adapter shall preserve single-pass traversal and caller-owned rows; the constructed problem shall own its acquired constraints.

An excessive ambient dimension shall raise std::length_error. Strict rows shall follow 🔗 1. Integer-supported strict MIP admission. Unsupported strict support or constraint, objective or integer-coordinate dimensions greater than dim shall raise std::invalid_argument. Failed construction shall release every constraint copy already acquired.

The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply.

RATIONALE:

Admission must precede mathematical solving, and partial acquisition must not leak owned constraints.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of MIP_Problem or the concrete type named below.

MIP_Problem(dimension_type dim, const Constraint_System& cs,
            const Linear_Expression& obj=Linear_Expression::zero(),
            Optimization_Mode mode=MAXIMIZATION);
template<class In>
  requires Constraint_Input_Iterator<In>
MIP_Problem(dimension_type dim, In first, In last,
            const Linear_Expression& obj=Linear_Expression::zero(),
            Optimization_Mode mode=MAXIMIZATION);
template<class In>
  requires Constraint_Input_Iterator<In>
MIP_Problem(dimension_type dim, In first, In last,
            const Variables_Set& int_vars,
            const Linear_Expression& obj=Linear_Expression::zero(),
            Optimization_Mode mode=MAXIMIZATION);
VERIFICATION_CRITERIA:

Check constrained overload admission and standard common-iterator adapters for non-common sentinels, single-pass reference/value/proxy inputs, source independence, failed acquisition and allocation failure followed by retry. Exercise metadata and row-dimension rejection using live borrowed MIP constraint iterators, including rejection before any copy and after an acquired prefix. Check that the owner retains its value and the failed construction releases its copies. Check all constructor forms, single-pass ranges, integer-supported strict rows, rejected continuous-support strict/dimensioned inputs, source independence and allocation failure after each acquired constraint.

SOURCE:

src/Constraint_types.hh; tests/constraintinput1.cc; tests/MIP_Problem/borrowediterator1.cc; src/MIP_Problem.cc; src/MIP_Problem_defs.hh; src/MIP_Problem_inlines.hh; src/MIP_Problem_templates.hh; src/MIP_Problem_types.hh; tests/MIP_Problem/constructorownership1.cc; tests/MIP_Problem/enumeratedmodels1.cc; tests/MIP_Problem/exceptions1.cc; tests/MIP_Problem/iteratoradmission1.cc.

PPL-SPEC-001470
4. Mixed integer copying, exchange and reset
UID: PPL-SPEC-001470
STATUS: APPROVED
COMPONENT: MIP_SOLVER
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Copying and assignment shall preserve the mathematical problem and permit independent later mutation and solving. Assignment shall return the receiver and support self-assignment. Exchange shall swap the complete problem and solver state; self-exchange shall preserve the value. clear shall reset to the zero-dimensional trivial problem. Destruction shall release owned constraints and solver storage.

The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply.

RATIONALE:

Cached optimization state is part of owned storage but must not compromise mathematical value independence.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of MIP_Problem or the concrete type named below.

MIP_Problem(const MIP_Problem&); ~MIP_Problem();
MIP_Problem& operator=(const MIP_Problem&);
void m_swap(MIP_Problem&); void clear();
void swap(MIP_Problem&, MIP_Problem&);
VERIFICATION_CRITERIA:

Copy unsolved, feasible, optimized, infeasible and unbounded states; modify each copy, self-assign, exchange and reset after solving.

SOURCE:

src/MIP_Problem.cc; src/MIP_Problem_defs.hh; src/MIP_Problem_inlines.hh; src/MIP_Problem_templates.hh; src/MIP_Problem_types.hh; tests/MIP_Problem/constructorownership1.cc; tests/MIP_Problem/mipfeasibilityhistories1.cc; tests/MIP_Problem/mipproblem1.cc; tests/MIP_Problem/persistenceadmission1.cc.

PPL-SPEC-001471
5. Mixed integer descriptor views and iterators
UID: PPL-SPEC-001471
STATUS: APPROVED
COMPONENT: MIP_SOLVER
APPLICABILITY: IF_CPP
VERIFICATION_METHODS: Test, Analysis, Inspection
LANGUAGE: CPP
VISIBILITY: Public
RELATIONS (Parent):
STATEMENT:

Descriptor accessors shall expose the stored objective, optimization mode and integer-coordinate subset. Constraint iterators shall expose const canonical admitted constraints in insertion order, as defined by 🔗 1. Integer-supported strict MIP admission, and support random-access movement, difference, dereference and comparison within the same live sequence. The end position shall not be dereferenced. Iterator arithmetic shall stay within that sequence and its end. Mutations that reallocate, clear, exchange or replace storage may invalidate borrowed views and iterators.

Default-constructed constraint iterators shall be singular and compare equal to one another. They shall support copying, assignment and destruction; dereference and movement require assignment from a valid iterator first. The constraint iterator shall satisfy the C++20 bidirectional-iterator and sized-sentinel concepts, permitting standard range adapters and algorithms.

The initialization, arithmetic, ownership and exceptional-completion conditions in 🔗 1. Optimization and ranking valid use shall apply.

RATIONALE:

Clients must be able to inspect the original problem without confusing it with a transformed simplex tableau.

INTERFACE:

Public header: <ppl.hh>; namespace Parma_Polyhedra_Library. Members of MIP_Problem or the concrete type named below.

class MIP_Problem::const_iterator {
public:
  using iterator_category = std::iterator_traits<std::vector<Constraint*>::const_iterator>::iterator_category;
  using difference_type = std::iterator_traits<std::vector<Constraint*>::const_iterator>::difference_type;
  using value_type = const Constraint;
  using pointer = const Constraint*;
  using reference = const Constraint&;
  const_iterator();
  difference_type operator-(const const_iterator&) const;
  const_iterator& operator++(); const_iterator operator++(int);
  const_iterator& operator--(); const_iterator operator--(int);
  const_iterator& operator+=(difference_type);
  const_iterator& operator-=(difference_type);
  const_iterator operator+(difference_type) const;
  const_iterator operator-(difference_type) const;
  reference operator*() const; pointer operator->() const;
  bool operator==(const const_iterator&) const;
  bool operator!=(const const_iterator&) const;
};
const_iterator constraints_begin() const;
const_iterator constraints_end() const;
const Linear_Expression& objective_function() const;
Optimization_Mode optimization_mode() const;
const Variables_Set& integer_space_dimensions() const;
VERIFICATION_CRITERIA:

Check insertion order, all iterator movement forms and distances, const access, empty ranges and descriptors after incremental changes. Check default construction, singular equality, assignment to live positions, and standard range iteration and copying.

SOURCE:

src/MIP_Problem.cc; src/MIP_Problem_defs.hh; src/MIP_Problem_inlines.hh; src/MIP_Problem_templates.hh; src/MIP_Problem_types.hh; tests/MIP_Problem/mipfeasibilityhistories1.cc; tests/MIP_Problem/mipproblem1.cc; tests/MIP_Problem/persistenceadmission1.cc; tests/MIP_Problem/iteratoradmission1.cc.