Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::SOCP Class Reference

Wrapper for Second-Order Cone Programming implementation, by Miguel S. More...

#include <MathAlgo/SOCP.hh>

+ Inheritance diagram for BIAS::SOCP:
+ Collaboration diagram for BIAS::SOCP:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
int Compute (int L, int m, const std::vector< int > &N, const Vector< double > &f, const std::vector< Matrix< double > > &A, const std::vector< Vector< double > > &b, const std::vector< Vector< double > > &c, const std::vector< double > &d, Vector< double > &x, std::vector< Vector< double > > &z, std::vector< double > &w)
 Solve Second-Order Cone Programming instance with L constraints. More...
 
int Compute (int m, int n, const Vector< double > &f, const Matrix< double > &A, const Vector< double > &b, const Vector< double > &c, double d, Vector< double > &x, Vector< double > &z, double &w)
 Solve single-constraint Second-Order Cone Programming instance. More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
double GetAbsoluteTolerance () const
 Get absolute tolerance used to determine convergence. More...
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
int GetMaxIterations () const
 Get maximal number of iterations performed by SOCP algorithm. More...
 
double GetNu () const
 Get parameter nu that controls the rate of convergence. More...
 
double GetRelativeTolerance () const
 Get relative tolerance used to determine convergence. More...
 
double GetTargetValue () const
 Get target value used in convergence criterion. More...
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetAbsoluteTolerance (double tol)
 Set absolute tolerance used to determine convergence. More...
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void SetMaxIterations (int iter)
 Set maximal number of iterations performed by SOCP algorithm. More...
 
void SetNu (double nu)
 Set parameter nu that controls the rate of convergence. More...
 
void SetRelativeTolerance (double tol)
 Set relative tolerance used to determine convergence. More...
 
void SetTargetValue (double target)
 Set target value used in convergence criterion only when relative tolerance given is < 0. More...
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
 SOCP ()
 Create SOCP solver with default parameters. More...
 
 ~SOCP ()
 Release memory used. More...
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

Wrapper for Second-Order Cone Programming implementation, by Miguel S.

Lobo et al. from Stanford university provided at http://www.stanford.edu/~boyd/old_software/socp/ See User's Guide [1] and [2] for details about the algorithm and socp/README.txt for information about the authors.

Solves Second-Order Cone Programming (SOCP) problems defined by:

min f^T * x s.t. ||A_i * x + b_i|| <= c_i * x + d_i for i = 1, ..., L

[1] M. S. Lobo, L. Vandenberghe, S. Boyd: SOCP Software for Second-Order Cone Programming - User's Guide, April 1997. [2] M. S. Lobo, L. Vandenberghe, S. Boyd, H. Lebret: Second-Order Cone Programming: Interior-Point Methods and Engineering Applications, Linear Algebra and Applications, 1997.

See Also
socp/socp.h
Author
esquivel 05/2012
Examples:
ExampleSOCP.cpp.

Definition at line 57 of file SOCP.hh.

Constructor & Destructor Documentation

SOCP::SOCP ( )

Create SOCP solver with default parameters.

Definition at line 33 of file SOCP.cpp.

SOCP::~SOCP ( )

Release memory used.

Definition at line 42 of file SOCP.cpp.

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

int SOCP::Compute ( int  L,
int  m,
const std::vector< int > &  N,
const Vector< double > &  f,
const std::vector< Matrix< double > > &  A,
const std::vector< Vector< double > > &  b,
const std::vector< Vector< double > > &  c,
const std::vector< double > &  d,
Vector< double > &  x,
std::vector< Vector< double > > &  z,
std::vector< double > &  w 
)

Solve Second-Order Cone Programming instance with L constraints.

Compute vector x minimizing f * x subject to the constraints ||A_i * x + b_i|| <= c_i * x + d_i for i = 1, ..., L starting with the given solution x.

L is the number of constraints, m is the number of variables. Vector N = (N_1, ..., N_L) specifies the problem size of the i-th constraint, i.e. A_i is a N_i x m matrix, b_i is a vector of size N_i, c_i is a vector of size m and d_i is a scalar. Both f and x are vectors of size m.

The vectors z_1, ..., z_L and scalars w_1, ..., w_L describe the solution to the dual problem. Each vector z_i is of size N_i. Note that a feasable dual solution must be given as a start point in addition to the primal solution x.

Returns
Returns < 0 in case of errors, 0 otherwise.
Examples:
ExampleSOCP.cpp.

Definition at line 46 of file SOCP.cpp.

References BIAS::Vector< T >::Size().

int SOCP::Compute ( int  m,
int  n,
const Vector< double > &  f,
const Matrix< double > &  A,
const Vector< double > &  b,
const Vector< double > &  c,
double  d,
Vector< double > &  x,
Vector< double > &  z,
double &  w 
)

Solve single-constraint Second-Order Cone Programming instance.

Compute vector x minimizing f * x subject to the constraint ||A * x + b|| <= c * x + d starting with the given solution x.

m is the number of variables, n specifies the problem size of the constraint, i.e. A is a n x m matrix, b is a vector of size n, c is a vector of size m and d is a scalar. Both f and x are vectors of size m. Vector z of size n and scalar w describe the solution to the dual problem. A feasable dual solution must be given as a start point in addition to the primal solution x.

Returns
Returns < 0 in case of errors, 0 otherwise.

Definition at line 145 of file SOCP.cpp.

References BIAS::Matrix< T >::GetCols(), BIAS::Matrix< T >::GetRows(), and BIAS::Vector< T >::Size().

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

double BIAS::SOCP::GetAbsoluteTolerance ( ) const
inline

Get absolute tolerance used to determine convergence.

Definition at line 98 of file SOCP.hh.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

int BIAS::SOCP::GetMaxIterations ( ) const
inline

Get maximal number of iterations performed by SOCP algorithm.

Definition at line 72 of file SOCP.hh.

double BIAS::SOCP::GetNu ( ) const
inline

Get parameter nu that controls the rate of convergence.

Definition at line 81 of file SOCP.hh.

double BIAS::SOCP::GetRelativeTolerance ( ) const
inline

Get relative tolerance used to determine convergence.

Definition at line 106 of file SOCP.hh.

double BIAS::SOCP::GetTargetValue ( ) const
inline

Get target value used in convergence criterion.

Definition at line 90 of file SOCP.hh.

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void BIAS::SOCP::SetAbsoluteTolerance ( double  tol)
inline

Set absolute tolerance used to determine convergence.

See SOCP user guide [1] for details about this parameter.

Examples:
ExampleSOCP.cpp.

Definition at line 95 of file SOCP.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::SOCP::SetMaxIterations ( int  iter)
inline

Set maximal number of iterations performed by SOCP algorithm.

Examples:
ExampleSOCP.cpp.

Definition at line 69 of file SOCP.hh.

void BIAS::SOCP::SetNu ( double  nu)
inline

Set parameter nu that controls the rate of convergence.

   Recommended range is 5 to 50.
See Also
See SOCP user guide [1] for details about this parameter.
Examples:
ExampleSOCP.cpp.

Definition at line 78 of file SOCP.hh.

void BIAS::SOCP::SetRelativeTolerance ( double  tol)
inline

Set relative tolerance used to determine convergence.

See Also
See SOCP user guide [1] for details about this parameter.
Examples:
ExampleSOCP.cpp.

Definition at line 103 of file SOCP.hh.

void BIAS::SOCP::SetTargetValue ( double  target)
inline

Set target value used in convergence criterion only when relative tolerance given is < 0.

See Also
See SOCP user guide [1] for details about this parameter.
Examples:
ExampleSOCP.cpp.

Definition at line 87 of file SOCP.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.


The documentation for this class was generated from the following files: