NetOptim 1.2.6
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
OptScalingOracle< Graph, Mapping, Fn > Class Template Reference

Oracle for Optimal Matrix Scaling. More...

#include <optscaling_oracle.hpp>

Public Member Functions

 OptScalingOracle (const Graph &gra, Mapping &utx, Fn get_cost)
 Construct a new optscaling oracle object.
 
 OptScalingOracle (const OptScalingOracle &)=default
 Copy constructor.
 
 OptScalingOracle (OptScalingOracle &&)=default
 
OptScalingOracleoperator= (const OptScalingOracle &)=default
 
OptScalingOracleoperator= (OptScalingOracle &&)=default
 
 ~OptScalingOracle ()=default
 
auto assess_optim (const Vec &x, double &t) -> std::tuple< Cut, bool >
 Assess optimality at point x (cutting plane interface)
 
auto operator() (const Vec &x, double &t) -> std::tuple< Cut, bool >
 Function call operator for cutting_plane_optim()
 

Detailed Description

template<typename Graph, typename Mapping, typename Fn>
requires HasKeyType<Graph>
class OptScalingOracle< Graph, Mapping, Fn >

Oracle for Optimal Matrix Scaling.

This class implements a separation oracle for the optimal matrix scaling problem. It uses a network oracle internally to handle the feasibility constraints and provides cutting planes for optimization.

The oracle maintains:

Template Parameters
GraphType of the directed graph representing matrix sparsity
MappingType of vertex potential mapping (scaling factors)
FnType of the cost function (edge -> matrix entry pair)

Constructor & Destructor Documentation

◆ OptScalingOracle() [1/3]

template<typename Graph , typename Mapping , typename Fn >
OptScalingOracle< Graph, Mapping, Fn >::OptScalingOracle ( const Graph &  gra,
Mapping &  utx,
Fn  get_cost 
)
inline

Construct a new optscaling oracle object.

Parameters
[in]graThe graph representing matrix sparsity
[in,out]utxVertex potential mapping (scaling factors)
[in]get_costFunction to extract matrix entry pairs from edge data

◆ OptScalingOracle() [2/3]

template<typename Graph , typename Mapping , typename Fn >
OptScalingOracle< Graph, Mapping, Fn >::OptScalingOracle ( const OptScalingOracle< Graph, Mapping, Fn > &  )
explicitdefault

Copy constructor.

◆ OptScalingOracle() [3/3]

template<typename Graph , typename Mapping , typename Fn >
OptScalingOracle< Graph, Mapping, Fn >::OptScalingOracle ( OptScalingOracle< Graph, Mapping, Fn > &&  )
default

◆ ~OptScalingOracle()

template<typename Graph , typename Mapping , typename Fn >
OptScalingOracle< Graph, Mapping, Fn >::~OptScalingOracle ( )
default

Member Function Documentation

◆ assess_optim()

template<typename Graph , typename Mapping , typename Fn >
auto OptScalingOracle< Graph, Mapping, Fn >::assess_optim ( const Vec &  x,
double &  t 
) -> std::tuple<Cut, bool>
inline

Assess optimality at point x (cutting plane interface)

The optimal scaling problem minimizes the ratio \(\pi / \psi\). In log scale, the objective is \(s = \pi - \psi\). The algorithm maintains \(t\) as the best-so-far optimal value:

\[ f(x) = s - t = (\pi - \psi) - t \]

If \(f(x) < 0\), the solution improves; otherwise a cutting plane \((1, -1)\) is returned.

Parameters
[in]x(pi, psi) in log scale
[in,out]tthe best-so-far optimal value
Returns
tuple of (cut, whether gamma was updated)
See also
cutting_plane_optim

◆ operator()()

template<typename Graph , typename Mapping , typename Fn >
auto OptScalingOracle< Graph, Mapping, Fn >::operator() ( const Vec &  x,
double &  t 
) -> std::tuple<Cut, bool>
inline

Function call operator for cutting_plane_optim()

Parameters
[in]x(pi, psi) in log scale
[in,out]tthe best-so-far optimal value
Returns
tuple of (cut, whether gamma was updated)

◆ operator=() [1/2]

template<typename Graph , typename Mapping , typename Fn >
OptScalingOracle & OptScalingOracle< Graph, Mapping, Fn >::operator= ( const OptScalingOracle< Graph, Mapping, Fn > &  )
default

◆ operator=() [2/2]

template<typename Graph , typename Mapping , typename Fn >
OptScalingOracle & OptScalingOracle< Graph, Mapping, Fn >::operator= ( OptScalingOracle< Graph, Mapping, Fn > &&  )
default

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