本文整理汇总了C++中TMatrix::inverse方法的典型用法代码示例。如果您正苦于以下问题:C++ TMatrix::inverse方法的具体用法?C++ TMatrix::inverse怎么用?C++ TMatrix::inverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMatrix
的用法示例。
在下文中一共展示了TMatrix::inverse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: align
void CPDNRigid<Scalar, Dim>::m_step()
{
Scalar N_P = this->P1_.sum();
if (!this->lr_)
{
TMatrix A = (this->P1_.asDiagonal()*G_ + paras_.lambda_*paras_.sigma2_*MatrixType<Scalar, Dim>::Matrix::Identity(this->M_, this->M_));
TMatrix B = this->PX_ - this->P1_.asDiagonal() * this->model_;
paras_.W_ = A.inverse() * B;
}
else
{
P1_correlation();
TMatrix A1 = ((1/(paras_.lambda_*paras_.sigma2_))*this->P1_).asDiagonal();
TMatrix A2 = Q_ * (S_.inverse() + Q_.transpose()*A1*Q_).inverse() * Q_.transpose();
TMatrix A_inv = A1 - A1 * A2 * A1;
TMatrix B = this->P1_.cwiseInverse().asDiagonal() * this->PX_ - this->model_;
paras_.W_ = A_inv * B;
}
align();
paras_.sigma2_ = 1/(N_P*Dim) * ((this->data_.transpose()*this->PT1_.asDiagonal()*this->data_).trace() -
2*(this->PX_.transpose()*this->T_).trace() + (this->T_.transpose()*this->P1_.asDiagonal()*this->T_).trace());
paras_.sigma2_ = fabs(paras_.sigma2_);
}
示例2: align
void CPDNRigid<T, D>::m_step()
{
T N_P = _P1.sum();
if (!_lr)
{
TMatrix A = (_P1.asDiagonal()*_G + _paras._lambda*_paras._sigma2*TMatrix::Identity(_M, _M));
TMatrix B = _PX - _P1.asDiagonal() * _model;
_paras._W = A.inverse() * B;
}
else
{
P1_correlation();
TMatrix A1 = ((1/(_paras._lambda*_paras._sigma2))*_P1).asDiagonal();
TMatrix A2 = _Q * (_S.inverse() + _Q.transpose()*A1*_Q).inverse() * _Q.transpose();
TMatrix A_inv = A1 - A1 * A2 * A1;
TMatrix B = _P1.cwiseInverse().asDiagonal() * _PX - _model;
_paras._W = A_inv * B;
}
align();
_paras._sigma2 = 1/(N_P*D) * ((_data.transpose()*_PT1.asDiagonal()*_data).trace() -
2*(_PX.transpose()*_T).trace() + (_T.transpose()*_P1.asDiagonal()*_T).trace());
_paras._sigma2 = abs(_paras._sigma2);
}