Пример #1
0
void DiagonalMatrixTemplate<T>::postMultiplyInverse(const MatrixT& a,MatrixT& x) const
{
  Assert(this->n == a.n);
  x.resize(a.m,this->n);
  MyT xrow,arow;
  for(int i=0;i<a.m;i++) {
    x.getRowRef(i,xrow);
    a.getRowRef(i,arow);
    xrow.componentDiv(arow,*this);
  }
}
Пример #2
0
void DiagonalMatrixTemplate<T>::preMultiplyInverse(const MatrixT& a,MatrixT& x) const
{
  Assert(this->n == a.m);
  x.resize(this->n,a.n);
  ItT v=this->begin();
  MyT xrow,arow;
  for(int i=0;i<this->n;i++,v++) {
    x.getRowRef(i,xrow);
    a.getRowRef(i,arow);
    xrow.div(arow,*v);
  }
}
Пример #3
0
void DiagonalMatrixTemplate<T>::postMultiplyTranspose(const MatrixT& a,MatrixT& x) const
{
  Assert(this->n == a.m);
  x.resize(a.n,this->n);
  MyT xrow,acol;
  for(int i=0;i<a.n;i++) {
    x.getRowRef(i,xrow);
    a.getColRef(i,acol);
    xrow.componentMul(acol,*this);
  }
}
Пример #4
0
void NRQRDecomposition<T>::getQ(MatrixT& Q) const
{
  int n=c.n;
  Q.resize(n,n);
  VectorT Qi;
  Q.set(0);
  for(int i=0;i<n;i++) {
    Q.getRowRef(i,Qi);
    Qi(i)=1;
    QBackSub(Qi,Qi);
  }
}
Пример #5
0
void DiagonalMatrixTemplate<T>::preMultiplyTranspose(const MatrixT& a,MatrixT& x) const
{
  Assert(this->n == a.n);
  x.resize(this->n,a.m);
  ItT v=this->begin();
  MyT xrow,acol;
  for(int i=0;i<this->n;i++,v++) {
    x.getRowRef(i,xrow);
    a.getColRef(i,acol);
    xrow.mul(acol,*v);
  }
}