SOPT
Sparse OPTimisation
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
DummyAlgorithm Struct Reference

Minimum set of functions and type aliases needed by reweighting. More...

Classes

struct  DiagnosticAndResult
 

Public Types

using Scalar = t_real
 
using t_Vector = Vector< Scalar >
 
using t_IsConverged = ConvergenceFunction< Scalar >
 

Public Member Functions

DiagnosticAndResult operator() (t_Vector const &x) const
 
DiagnosticAndResult operator() (DiagnosticAndResult const &warm) const
 

Static Public Member Functions

static t_Vector reweightee (DummyAlgorithm const &, t_Vector const &x)
 Applies Ψ^T * x. More...
 
static void set_weights (DummyAlgorithm &, t_Vector const &weights)
 sets the weights More...
 

Static Public Attributes

static t_Vector weights
 
static int called_with_x = 0
 
static int called_with_warm = 0
 
static int called_reweightee = 0
 
static int called_weights = 0
 

Detailed Description

Minimum set of functions and type aliases needed by reweighting.

The attributes are public and static so we can access them during the tests.

Definition at line 13 of file reweighted.cc.

Member Typedef Documentation

◆ Scalar

Definition at line 14 of file reweighted.cc.

◆ t_IsConverged

Definition at line 16 of file reweighted.cc.

◆ t_Vector

Definition at line 15 of file reweighted.cc.

Member Function Documentation

◆ operator()() [1/2]

DiagnosticAndResult DummyAlgorithm::operator() ( DiagnosticAndResult const &  warm) const
inline

Definition at line 28 of file reweighted.cc.

28  {
30  DiagnosticAndResult::x = warm.x.array() + 0.1;
31  return {};
32  }
static t_Vector x
Expected by reweighted algorithm.
Definition: reweighted.cc:20
static int called_with_warm
Definition: reweighted.cc:47

References DummyAlgorithm::DiagnosticAndResult::x.

◆ operator()() [2/2]

DiagnosticAndResult DummyAlgorithm::operator() ( t_Vector const &  x) const
inline

Definition at line 23 of file reweighted.cc.

23  {
24  ++called_with_x;
25  DiagnosticAndResult::x = x.array() + 0.1;
26  return {};
27  }
static int called_with_x
Definition: reweighted.cc:46

◆ reweightee()

static t_Vector DummyAlgorithm::reweightee ( DummyAlgorithm const &  ,
t_Vector const &  x 
)
inlinestatic

Applies Ψ^T * x.

Definition at line 35 of file reweighted.cc.

35  {
37  return x * 2;
38  }
static int called_reweightee
Definition: reweighted.cc:48

References called_reweightee.

Referenced by TEST_CASE().

◆ set_weights()

static void DummyAlgorithm::set_weights ( DummyAlgorithm ,
t_Vector const &  weights 
)
inlinestatic

sets the weights

Definition at line 40 of file reweighted.cc.

40  {
43  }
static t_Vector weights
Definition: reweighted.cc:45
static int called_weights
Definition: reweighted.cc:49

References called_weights, and weights.

Referenced by TEST_CASE().

Member Data Documentation

◆ called_reweightee

int DummyAlgorithm::called_reweightee = 0
static

Definition at line 48 of file reweighted.cc.

Referenced by reweightee(), and TEST_CASE().

◆ called_weights

int DummyAlgorithm::called_weights = 0
static

Definition at line 49 of file reweighted.cc.

Referenced by set_weights(), and TEST_CASE().

◆ called_with_warm

int DummyAlgorithm::called_with_warm = 0
static

Definition at line 47 of file reweighted.cc.

Referenced by TEST_CASE().

◆ called_with_x

int DummyAlgorithm::called_with_x = 0
static

Definition at line 46 of file reweighted.cc.

Referenced by TEST_CASE().

◆ weights

DummyAlgorithm::t_Vector DummyAlgorithm::weights
static

Definition at line 45 of file reweighted.cc.

Referenced by set_weights(), and TEST_CASE().


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