Pipal  1.2.0
Penalty Interior-Point ALgorithm
Loading...
Searching...
No Matches
Pipal Namespace Reference

Namespace for the Pipal library. More...

Classes

struct  Acceptance
 Class for managing the acceptance criteria of the solver. More...
struct  Direction
 Class for managing the current search direction of the solver. More...
struct  Input
 Input structure holding all the data defining the optimization problem. More...
struct  Iterate
 Class for managing the current iterate of the solver. More...
class  Output
 Pretty-printing and timing utilities for solver output. More...
struct  Parameter
 Internal parameters for the solver algorithm. More...
class  Problem
 Problem class for the Pipal library. More...
class  ProblemWrapper
 Wrapper class for the Problem class. More...
class  Solver
 Solver class for the Pipal library. More...

Typedefs

using Integer = PIPAL_DEFAULT_INTEGER_TYPE
 The Integer type as used for the API.
template<typename Real>
using Vector = Eigen::Vector<Real, Eigen::Dynamic>
template<typename Real>
using Matrix = Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic>
template<typename Real>
using SparseMatrix = Eigen::SparseMatrix<Real>
template<typename Real>
using Array = Eigen::Array<Real, Eigen::Dynamic, 1>
using Indices = Eigen::Array<Integer, Eigen::Dynamic, 1>
using Mask = Eigen::Array<bool, Eigen::Dynamic, 1>
using Algorithm = enum class Algorithm : Integer {CONSERVATIVE = 0, ADAPTIVE = 1}
 Enumeration for the algorithm choice.
using Counter
 Internal counters for solver statistics.

Functions

static Indices find (Mask const &mask)
 Select elements from a vector based on a boolean mask.
template<typename Real>
static void insert_block (SparseMatrix< Real > &mat, SparseMatrix< Real > const &blk, Integer const row_offset, Integer const col_offset)
 Insert a sparse block into a sparse matrix at the specified offsets.
template<typename Real>
static void insert_block (SparseMatrix< Real > &mat, SparseMatrix< Real > const &blk, Indices const row_index, Indices const col_index, Integer const row_offset, Integer const col_offset)
 Insert a sparse block into a sparse matrix at the specified offsets.

Detailed Description

Penalty-interior-point algorithm (Pipal) is a library for nonlinear constrained optimization with inequality constraints (it does not explicitly handle equality constraints). Precisely speaking, it will compute the solution to the optimization problem

\[ \begin{array}{l} \text{minimize} ~ f(\mathbf{x}) \\ \text{subject to} ~ \mathbf{c}(\mathbf{x}) \leq \mathbf{0} \end{array} \text{,} \]

where \(\mathbf{x} \in \mathbb{R}^n\) is the vector of optimization variables, \(f: \mathbb{R}^n \to \mathbb{R}\) is the objective function, and \(\mathbf{c}: \mathbb{R}^n \to \mathbb{R}^m\) are the constraints.

Note
To create an equality constraint \( h(\mathbf{x}) = 0 \), one can define two inequality constraints \( h(\mathbf{x}) \leq 0 \) and \( -h(\mathbf{x}) \leq 0 \).

This code is mostly based on the descriptions provided in this reference:

  • Frank E. Curtis. A penalty-interior-point algorithm for nonlinear constrained optimization. Mathematical Programming Computation (2012) 4:181-209. DOI: 10.1007/s12532-012-0041-4.

Typedef Documentation

◆ Algorithm

using Pipal::Algorithm = enum class Algorithm : Integer {CONSERVATIVE = 0, ADAPTIVE = 1}

The Algorithm enumeration defines the possible algorithm choices for the solver. The options are CONSERVATIVE and ADAPTIVE.

◆ Array

template<typename Real>
using Pipal::Array = Eigen::Array<Real, Eigen::Dynamic, 1>

◆ Counter

Initial value:
struct Counter
{
Integer f{0};
Integer g{0};
Integer H{0};
Integer k{0};
Integer M{0};
Counter() = default;
Counter(Counter const &) = delete;
Counter & operator=(Counter const &) = delete;
}
PIPAL_DEFAULT_INTEGER_TYPE Integer
The Integer type as used for the API.
Definition Types.hxx:110
struct Counter { Integer f{0}; Integer g{0}; Integer H{0}; Integer k{0}; Integer M{0}; Counter()=default; Counter(Counter const &)=delete; Counter &operator=(Counter const &)=delete; } Counter
Internal counters for solver statistics.
Definition Types.hxx:285

◆ Indices

using Pipal::Indices = Eigen::Array<Integer, Eigen::Dynamic, 1>

◆ Integer

The Integer type, #define the preprocessor symbol PIPAL_DEFAULT_INTEGER_TYPE. The default value is int.

◆ Mask

using Pipal::Mask = Eigen::Array<bool, Eigen::Dynamic, 1>

◆ Matrix

template<typename Real>
using Pipal::Matrix = Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic>

◆ SparseMatrix

template<typename Real>
using Pipal::SparseMatrix = Eigen::SparseMatrix<Real>

◆ Vector

template<typename Real>
using Pipal::Vector = Eigen::Vector<Real, Eigen::Dynamic>

Function Documentation

◆ find()

Indices Pipal::find ( Mask const & mask)
static
Parameters
[in]maskThe boolean mask.
Returns
The selected elements from the input vector.

◆ insert_block() [1/2]

template<typename Real>
void Pipal::insert_block ( SparseMatrix< Real > & mat,
SparseMatrix< Real > const & blk,
Indices const row_index,
Indices const col_index,
Integer const row_offset,
Integer const col_offset )
static
Template Parameters
RealFloating-point type used by the algorithm.
CheckZeroWhether to skip zero entries when inserting.
Parameters
[in,out]matSparse matrix where to insert the block.
[in]blkSparse matrix block to insert.
[in]row_indexRow indices in the block matrix.
[in]col_indexColumn indices in the block matrix.
[in]row_offsetRow offset in the sparse matrix.
[in]col_offsetColumn offset in the sparse matrix.

◆ insert_block() [2/2]

template<typename Real>
void Pipal::insert_block ( SparseMatrix< Real > & mat,
SparseMatrix< Real > const & blk,
Integer const row_offset,
Integer const col_offset )
static
Template Parameters
RealFloating-point type used by the algorithm.
CheckZeroWhether to skip zero entries when inserting.
Parameters
[in,out]matSparse matrix where to insert the block.
[in]blkSparse matrix block to insert.
[in]row_offsetRow offset in the sparse matrix.
[in]col_offsetColumn offset in the sparse matrix.