File LMI.h

template<typename MT>
struct evaluate_lmi
template<typename NT>
struct evaluate_lmi<Eigen::Matrix<NT, Eigen::Dynamic, Eigen::Dynamic>>

Public Types

typedef Eigen::Matrix<NT, Eigen::Dynamic, Eigen::Dynamic> MT
typedef Eigen::Matrix<NT, Eigen::Dynamic, 1> VT

The type for Eigen vector.

Public Functions

inline void setVectorMatrix(int const &m, int const &d, std::vector<MT> &matrices)

Create the vectorMatrix, which has at each column the distinct elements of each A_i, i=1,…,d.

inline void evaluateWithoutA0(const VT &x, MT &res, bool complete_mat = false) const

Compute [x_1*A_1 + … + x_n A_n]

Parameters:
  • x[in] Input vector

  • res[out] Output matrix

Public Members

MT vectorMatrix
int _m
int _d
template<typename NT, typename MT, typename VT>
class LMI
#include <LMI.h>

This class handles a linear matrix inequality of the form [A_0 + \sum x_i A_i] A template specialization for dense Eigen matrices and vectors

Template Parameters:
  • NT – Numeric Type

  • MT – Matrix Type

  • VT – Vector Type

Public Functions

inline LMI()
inline LMI(std::vector<MT> &matrices)

Creates A LMI object

Parameters:

matrices[in] The matrices A_0, A_i

inline unsigned int dimension() const
Returns:

The dimension of vector x

inline std::vector<MT> getMatrices() const
Returns:

The matrices A0, A1, …, Ad

inline unsigned int sizeOfMatrices() const
Returns:

The size of the matrices

inline void evaluate(VT const &x, MT &ret, bool complete_mat = false) const

Evaluate A_0 + [A_0 + \sum x_i A_i ]

Parameters:
  • x[in] The input vector

  • ret[out] The output matrix

inline void evaluateWithoutA0(const VT &x, MT &res, bool complete_mat = false) const

Compute [x_1*A_1 + … + x_n A_n]

Parameters:
  • x[in] Input vector

  • res[out] Output matrix

inline void normalizedDeterminantGradient(VT r, VT const &e, VT &ret) const

Compute the gradient of the determinant of the LMI at p

Parameters:
  • p[in] Input parameter

  • Input[in] vector: lmi(p)*e = 0, e != 0

  • ret[out] The normalized gradient of the determinant of the LMI at p

inline MT *const getMatrix(const int i)
Parameters:

i – An indicator to a matrix

Returns:

Pointer to A_i

inline MT get_A0()
inline void set_A0(MT const &A0)
inline void print() const

Prints the matrices A0, …, An.

inline bool isNegativeSemidefinite(MT const &matrix) const
inline bool isNegativeSemidefinite(VT const &pos) const

evaluate LMI(pos) and check if its negative semidefinite

Parameters:

pos – a vector of our current position

Returns:

true is LMI(pos) is negative semidefinite

Public Members

evaluate_lmi<MT> lmi_evaluator
std::vector<MT> matrices

The matrices A_0, A_i.

unsigned int d

The dimension of the vector x.

unsigned int m

The size of the matrices A_i.

MT vectorMatrix

At each column keep the m*(m+1)/2 distinct elements of each matrix A_i, i=1,…,d.