|
TVM
0.9.4
|
#include <tvm/hint/abstract/SubstitutionCalculatorImpl.h>


Public Member Functions | |
| virtual | ~SubstitutionCalculatorImpl ()=default |
| void | update () |
| void | premultiplyByASharpAndSTranspose (MatrixRef outA, MatrixRef outS, const MatrixConstRef &in, bool minus) const |
| void | postMultiplyByN (MatrixRef out, const MatrixConstRef &in, bool add=false) const |
| void | postMultiplyByN (MatrixRef out, const MatrixConstRef &in, Range r, bool add=false) const |
| const Eigen::MatrixXd & | N () const |
| Eigen::DenseIndex | m () const |
| Eigen::DenseIndex | n () const |
| Eigen::DenseIndex | r () const |
Protected Member Functions | |
| SubstitutionCalculatorImpl (const std::vector< LinearConstraintPtr > &cstr, const std::vector< VariablePtr > &x, int rank) | |
| void | constant (bool c) |
| bool | constant () const |
| MatrixConstRef | A () const |
| bool | isSimple () const |
| virtual void | update_ ()=0 |
| virtual void | premultiplyByASharpAndSTranspose_ (MatrixRef outA, MatrixRef outS, const MatrixConstRef &in, bool minus) const =0 |
| virtual void | postMultiplyByN_ (MatrixRef out, const MatrixConstRef &in, bool add) const |
| virtual void | postMultiplyByN_ (MatrixRef out, const MatrixConstRef &in, Range r, bool add) const |
| void | fillA () |
Protected Attributes | |
| Eigen::MatrixXd | N_ |
| std::vector< LinearConstraintPtr > | constraints_ |
| VariableVector | variables_ |
Friends | |
| class | SubstitutionCalculator |
Given a set of variables aggregated as x, and a set of constraints that, once aggregated, writes A x + ..., this base class proposes a set of operations related to A that are useful for performing substitutions. The operations revolve around 3 matrices:
The choice of A^#, N and S is implemented by derivation of this base class. A generic implementation is given by GenericCalculator::Impl
|
virtualdefault |
|
protected |
Constructor
| cstr | the list of constraints |
| x | the list of variables |
| rank | the rank of A |
|
protected |
Return the matrix A
|
protected |
Return whether A is constant
|
protected |
Specify whether A is constant (in which case only the first update will actually perform computations.
|
protected |
Copy in A_ the values of the relevant jacobian matrices.
|
inlineprotected |
Return true if there is only one variable and one constraint
|
inline |
Number of lines of A (i.e. sum of the constraints' sizes.
| const Eigen::MatrixXd& tvm::hint::abstract::SubstitutionCalculatorImpl::N | ( | ) | const |
Return N as a dense matrix.
|
inline |
Size of x (i.e. sum of the size of the variables to be substituted.
| void tvm::hint::abstract::SubstitutionCalculatorImpl::postMultiplyByN | ( | MatrixRef | out, |
| const MatrixConstRef & | in, | ||
| bool | add = false |
||
| ) | const |
Compute out = in * N. If add is true, perform out += in * N instead.
| void tvm::hint::abstract::SubstitutionCalculatorImpl::postMultiplyByN | ( | MatrixRef | out, |
| const MatrixConstRef & | in, | ||
| Range | r, | ||
| bool | add = false |
||
| ) | const |
Compute out = in * N(r,:). If add is true, perform out += in * N(r,:) instead.
|
protectedvirtual |
Computations for postMultiplyByN()
Reimplemented in tvm::hint::internal::DiagonalCalculator::Impl.
|
protectedvirtual |
Computations for postMultiplyByN(). By default it uses N()
| void tvm::hint::abstract::SubstitutionCalculatorImpl::premultiplyByASharpAndSTranspose | ( | MatrixRef | outA, |
| MatrixRef | outS, | ||
| const MatrixConstRef & | in, | ||
| bool | minus | ||
| ) | const |
If \minus = \false, perform outA = A^# * in and outS = S^T * in otherwise perform outA = - A^# * in and outS = S^T * in
|
protectedpure virtual |
Computations for premultiplyByASharpAndSTranspose()
Implemented in tvm::hint::internal::GenericCalculator::Impl, and tvm::hint::internal::DiagonalCalculator::Impl.
|
inline |
Rank of A
| void tvm::hint::abstract::SubstitutionCalculatorImpl::update | ( | ) |
Update the internal computations based on the current value of A, i.e the current values of the constraints' jacobian matrices.
|
protectedpure virtual |
Handle for the derived class to perform the computations in update()
Implemented in tvm::hint::internal::GenericCalculator::Impl, and tvm::hint::internal::DiagonalCalculator::Impl.
|
friend |
|
protected |
The list of constraints.
|
protected |
The matrix N
|
protected |
The list of variables.