TVM  0.9.4
tvm::scheme::internal::Assignment Class Reference

#include <tvm/scheme/internal/Assignment.h>

Public Types

using RHSFunction = const Eigen::VectorXd &(constraint::abstract::LinearConstraint::*)() const
 
using MatrixFunction = MatrixRef(AssignmentTarget::*)(int, int) const
 
using VectorFunction = VectorRef(AssignmentTarget::*)() const
 

Public Member Functions

 Assignment (LinearConstraintPtr source, SolvingRequirementsPtr req, const AssignmentTarget &target, const VariableVector &variables, const hint::internal::Substitutions *const subs=nullptr, double scalarizationWeight=1)
 
 Assignment (LinearConstraintPtr source, const AssignmentTarget &target, const VariablePtr &variables, bool first)
 
 Assignment (const Assignment &)=delete
 
 Assignment (Assignment &&)=default
 
Assignmentoperator= (const Assignment &)=delete
 
Assignmentoperator= (Assignment &&)=default
 
AssignmentTargettarget (IWontForgetToCallUpdates={})
 
bool changeScalarWeightIsAllowed ()
 
bool changeVectorWeightIsAllowed ()
 
void onUpdatedSource ()
 
void onUpdatedTarget ()
 
void onUpdatedMapping (const VariableVector &newVar, bool updateMatrixtarget=true)
 
void onUpdateWeights (bool scalar=true, bool vector=true)
 
void run ()
 

Static Public Member Functions

static Assignment reprocess (const Assignment &, const VariableVector &, const hint::internal::Substitutions *const)
 
static Assignment reprocess (const Assignment &, const VariablePtr &, bool)
 

Static Public Attributes

static double big_
 

Detailed Description

A class whose role is to assign efficiently the matrix and vector(s) of a LinearConstraint to a part of matrix and vector(s) specified by a ResolutionScheme and a mapping of variables. This is done while taking into account the possible convention differences between the constraint and the scheme, as well as the requirements on the constraint.

Member Typedef Documentation

◆ MatrixFunction

using tvm::scheme::internal::Assignment::MatrixFunction = MatrixRef (AssignmentTarget::*)(int, int) const

Pointer type to a method of AssignmentTarget returning a matrix block. It is used to make a selection between A(), AFirstHalf() and ASecondHalf().

◆ RHSFunction

using tvm::scheme::internal::Assignment::RHSFunction = const Eigen::VectorXd & (constraint::abstract::LinearConstraint::*)() const

Pointer type to a method of LinearConstraint returning a vector. It is used to make a selection between e(), l() and u().

◆ VectorFunction

using tvm::scheme::internal::Assignment::VectorFunction = VectorRef (AssignmentTarget::*)() const

Pointer type to a method of AssignementTarget returning a vector segment. It is used to make a selection between b(), bFirstHalf(), bSecondHalf(), l() and u().

Constructor & Destructor Documentation

◆ Assignment() [1/4]

tvm::scheme::internal::Assignment::Assignment ( LinearConstraintPtr  source,
SolvingRequirementsPtr  req,
const AssignmentTarget target,
const VariableVector variables,
const hint::internal::Substitutions *const  subs = nullptr,
double  scalarizationWeight = 1 
)

Assignment constructor

Parameters
sourceThe linear constraints whose matrix and vector(s) will be assigned.
reqSolving requirements attached to this constraint.
targetThe target of the assignment.
variablesThe vector of variables corresponding to the target. It must be such that its total dimension is equal to the column size of the target matrix.
scalarizationWeightAn additional scalar weight to apply on the constraint, used by the solver to emulate priority.

◆ Assignment() [2/4]

tvm::scheme::internal::Assignment::Assignment ( LinearConstraintPtr  source,
const AssignmentTarget target,
const VariablePtr variables,
bool  first 
)

Version for bounds

Parameters
firstwhether this is the first assignment of bounds for this variable (first assignment just copy vectors while the following ones need to perform min/max operations).

◆ Assignment() [3/4]

tvm::scheme::internal::Assignment::Assignment ( const Assignment )
delete

◆ Assignment() [4/4]

tvm::scheme::internal::Assignment::Assignment ( Assignment &&  )
default

Member Function Documentation

◆ changeScalarWeightIsAllowed()

bool tvm::scheme::internal::Assignment::changeScalarWeightIsAllowed ( )

Change the weight.

◆ changeVectorWeightIsAllowed()

bool tvm::scheme::internal::Assignment::changeVectorWeightIsAllowed ( )

◆ onUpdatedMapping()

void tvm::scheme::internal::Assignment::onUpdatedMapping ( const VariableVector newVar,
bool  updateMatrixtarget = true 
)

To be called when the variables change.

◆ onUpdatedSource()

void tvm::scheme::internal::Assignment::onUpdatedSource ( )

To be called when the source has been resized

◆ onUpdatedTarget()

void tvm::scheme::internal::Assignment::onUpdatedTarget ( )

To be called when the target has been resized and/or range has changed

◆ onUpdateWeights()

void tvm::scheme::internal::Assignment::onUpdateWeights ( bool  scalar = true,
bool  vector = true 
)

To be called after changing the weights.

◆ operator=() [1/2]

Assignment& tvm::scheme::internal::Assignment::operator= ( Assignment &&  )
default

◆ operator=() [2/2]

Assignment& tvm::scheme::internal::Assignment::operator= ( const Assignment )
delete

◆ reprocess() [1/2]

static Assignment tvm::scheme::internal::Assignment::reprocess ( const Assignment ,
const VariablePtr ,
bool   
)
static

◆ reprocess() [2/2]

static Assignment tvm::scheme::internal::Assignment::reprocess ( const Assignment ,
const VariableVector ,
const hint::internal::Substitutions * const   
)
static

◆ run()

void tvm::scheme::internal::Assignment::run ( )

Perform the assignment.

◆ target()

AssignmentTarget& tvm::scheme::internal::Assignment::target ( IWontForgetToCallUpdates  = {})

Member Data Documentation

◆ big_

double tvm::scheme::internal::Assignment::big_
static

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