TVM  0.9.4
tvm::scheme::internal Namespace Reference

Classes

class  Assignment
 
class  AssignmentTarget
 
class  NoArg
 
class  ParseArg_
 
class  ParseNoArg_
 
class  ParseArg
 
class  hasNoArgCtor
 
class  ArgCount
 
class  ArgCount< T >
 
class  CachedResult
 
class  CachedResult< MatrixType, true >
 
class  use_assign_cache
 
class  use_assign_cache< MatrixType, MIN, W, GENERAL, EXTERNAL >
 
class  use_assign_cache< MatrixType, MAX, W, GENERAL, EXTERNAL >
 
class  use_assign_cache< MatrixType, A, W, GENERAL, CONSTANT >
 
class  use_product_cache
 
class  use_product_cache< MatrixType, A, DIAGONAL, GENERAL, EXTERNAL >
 
class  use_product_cache< MatrixType, A, DIAGONAL, GENERAL, CONSTANT >
 
class  AssignBase
 
class  AssignBase< COPY >
 
class  AssignBase< ADD >
 
class  AssignBase< SUB >
 
class  AssignBase< MIN >
 
class  AssignBase< MAX >
 
class  WeightMultBase
 
class  WeightMultBase< NONE >
 
class  WeightMultBase< MINUS >
 
class  WeightMultBase< SCALAR >
 
class  WeightMultBase< DIAGONAL >
 
class  MatrixMultBase
 
class  MatrixMultBase< MatrixType, IDENTITY >
 
class  MatrixMultBase< MatrixType, GENERAL >
 
class  MatrixMultBase< MatrixType, INVERSE_DIAGONAL >
 
class  MatrixMultBase< MatrixType, CUSTOM >
 
class  SourceBase
 
class  SourceBase< MatrixType, ZERO >
 
class  CompiledAssignment
 
class  CompiledAssignment< MatrixType, A, W, M, ZERO >
 
class  CompiledAssignment< MatrixType, COPY, W, M, ZERO >
 
class  CompiledAssignment< MatrixType, MIN, W, M, ZERO >
 
class  CompiledAssignment< MatrixType, MAX, W, M, ZERO >
 
class  CompiledAssignmentWrapper
 
class  LinearizedProblemComputationData
 
class  MatrixAssignment
 
class  VectorSubstitutionAssignement
 
class  VectorAssignment
 
class  ProblemComputationData
 
class  ProblemDefinitionEvent
 
class  ResolutionSchemeBase
 
class  LevelAbilities
 
class  SchemeAbilities
 

Typedefs

template<typename MatrixType >
using isVector = typename std::conditional< MatrixType::ColsAtCompileTime==1, std::true_type, std::false_type >::type
 
template<typename MatrixType >
using isMatrix = typename std::conditional< MatrixType::ColsAtCompileTime !=1, std::true_type, std::false_type >::type
 

Enumerations

enum class  TargetType { Linear , Quadratic }
 
enum  AssignType {
  COPY , ADD , SUB , MIN ,
  MAX
}
 
enum  WeightMult { NONE , MINUS , SCALAR , DIAGONAL }
 
enum  MatrixMult { IDENTITY , GENERAL , INVERSE_DIAGONAL , CUSTOM }
 
enum  Source { EXTERNAL , ZERO , CONSTANT }
 

Functions

template<typename T >
std::true_type hasNoArgCtorDummy (const T &)
 
template<typename T >
decltype(hasNoArgCtorDummy(T(NoArg()))) hasNoArgCtor_ (int)
 
template<typename >
std::false_type hasNoArgCtor_ (...)
 
template<typename Problem , typename Scheme >
ProblemComputationDatagetComputationData (Problem &problem, const Scheme &resolutionScheme)
 
bool TVM_DLLAPI isBound (const ConstraintPtr &c)
 
bool TVM_DLLAPI isBound (const ConstraintPtr &c, const hint::internal::Substitutions &subs)
 
bool TVM_DLLAPI isBound (const ConstraintPtr &c, const std::vector< VariablePtr > &x, const std::vector< std::shared_ptr< function::BasicLinearFunction >> &xsub)
 
bool TVM_DLLAPI canBeUsedAsBound (const ConstraintPtr &c, const hint::internal::Substitutions &subs, constraint::Type targetConvention)
 
bool TVM_DLLAPI canBeUsedAsBound (const ConstraintPtr &c, const std::vector< VariablePtr > &x, const std::vector< std::shared_ptr< function::BasicLinearFunction >> &xsub, constraint::Type targetConvention)
 

Variables

constexpr int GeneralLevel = -1
 
constexpr int NoLimit = GeneralLevel
 

Typedef Documentation

◆ isMatrix

template<typename MatrixType >
using tvm::scheme::internal::isMatrix = typedef typename std::conditional<MatrixType::ColsAtCompileTime != 1, std::true_type, std::false_type>::type

◆ isVector

template<typename MatrixType >
using tvm::scheme::internal::isVector = typedef typename std::conditional<MatrixType::ColsAtCompileTime == 1, std::true_type, std::false_type>::type

trait-like definition to detect if an Eigen expression MatrixType is describing a vector.

Enumeration Type Documentation

◆ AssignType

Specify in which way from is assigned to to.

Enumerator
COPY 

to = from

ADD 

to += from

SUB 

to -= from

MIN 

to = min(to, from)

MAX 

to = max(to, from)

◆ MatrixMult

Specify if from is to be multiplied a matrix, and if so, what is the type of the matrix.

Enumerator
IDENTITY 

from

GENERAL 

M*from (vector case) or from*M (matrix case) where M is a matrix.

INVERSE_DIAGONAL 

inv(M) * from or from*inv(M) where M is diagonal

CUSTOM 

use a custom multiplier

◆ Source

The type of the source. Note there are two considerations for explicitly introducing the CONSTANT case (versus requiring the user to give a Ref to a constant vector):

  • we can deal with it more efficiently
  • we take care automatically of any change of size of to or of the multiplier matrix.
Enumerator
EXTERNAL 

source is an external vector or matrix (main use-case)

ZERO 

source is zero

CONSTANT 

source is a (non-zero) constant

◆ TargetType

Enumerator
Linear 
Quadratic 

◆ WeightMult

Specify whether from is to be multiplied by 1, -1 or a user specified scalar.

Enumerator
NONE 

from

MINUS 

-from

SCALAR 

s*from

DIAGONAL 

diag(d) * from

Function Documentation

◆ canBeUsedAsBound() [1/2]

bool TVM_DLLAPI tvm::scheme::internal::canBeUsedAsBound ( const ConstraintPtr c,
const hint::internal::Substitutions subs,
constraint::Type  targetConvention 
)

Check if the constraint can be used as a bound for a given target convention. For example l <= x <= u is a bound, but it cannot be transformed into x >= lb.

◆ canBeUsedAsBound() [2/2]

bool TVM_DLLAPI tvm::scheme::internal::canBeUsedAsBound ( const ConstraintPtr c,
const std::vector< VariablePtr > &  x,
const std::vector< std::shared_ptr< function::BasicLinearFunction >> &  xsub,
constraint::Type  targetConvention 
)

Version with separated substituted variables and substitution functions.

◆ getComputationData()

template<typename Problem , typename Scheme >
ProblemComputationData* tvm::scheme::internal::getComputationData ( Problem &  problem,
const Scheme &  resolutionScheme 
)
inline

Get the computation data linked to a particular resolution scheme. If this data does not exist, create it, using the resolution scheme as a factory

Parameters
Theresolution scheme for which we want to get back the computation data. It needs to have a method createComputationData.

◆ hasNoArgCtor_() [1/2]

template<typename >
std::false_type tvm::scheme::internal::hasNoArgCtor_ (   ...)

Overload that always exists. It will only be chosen if the other overload does not exist.

◆ hasNoArgCtor_() [2/2]

template<typename T >
decltype(hasNoArgCtorDummy(T(NoArg()))) tvm::scheme::internal::hasNoArgCtor_ ( int  )

Helper function that exists only if T has a constructor accepting NoArg. We use hasNoArgCtorDummy as a mean to enable SFINAE.

◆ hasNoArgCtorDummy()

template<typename T >
std::true_type tvm::scheme::internal::hasNoArgCtorDummy ( const T &  )

A dummy helper function to build hasNoArgCtor

◆ isBound() [1/3]

bool TVM_DLLAPI tvm::scheme::internal::isBound ( const ConstraintPtr c)

We consider as bound a constraint with a single variable and a diagonal, invertible jacobian. It would be possible to accept non-invertible sparse diagonal jacobians as well, in which case the zero elements of the diagonal would correspond to non-existing bounds, but this requires quite a lot of work for something that is unlikely to happen and could be expressed by changing the bound itself to +/- infinity.

◆ isBound() [2/3]

bool TVM_DLLAPI tvm::scheme::internal::isBound ( const ConstraintPtr c,
const hint::internal::Substitutions subs 
)

Assert if a constraint is a bound in the presence of substitutions

Parameters
cthe constraint
substhe set of substitutions We have a bound if c is a bound and the variable is not substituted or it is by an expression with a single variable and an invertible, diagonal jacobian.

◆ isBound() [3/3]

bool TVM_DLLAPI tvm::scheme::internal::isBound ( const ConstraintPtr c,
const std::vector< VariablePtr > &  x,
const std::vector< std::shared_ptr< function::BasicLinearFunction >> &  xsub 
)

Assert if a constraint is a bound in the presence of substitutions

Parameters
cthe constraint
xthe set of variables being substituted
xsubthe set of substitution functions corresponding to those variables. We have a bound if c is a bound and the variable is not substituted or it is by an expression with a single variable and an invertible, diagonal jacobian.

Variable Documentation

◆ GeneralLevel

constexpr int tvm::scheme::internal::GeneralLevel = -1
inlineconstexpr

Used to describe any level that is not explicitly specified.

◆ NoLimit

constexpr int tvm::scheme::internal::NoLimit = GeneralLevel
inlineconstexpr

Used to specify that a scheme can handle an unlimited number of levels.