Exemplo n.º 1
0
void RowEchelon<T>::set(const MatrixT& A,const MatrixT& B)
{
  if(!B.isEmpty())
    Assert(A.m == B.m);
  R=A;
  EB=B;
  RowEchelonDecompose(R,EB,Epsilon);
  Assert(IsRowEchelon(R));
  //ReduceRowEchelon(R,EB);
  //Assert(IsReducedRowEchelon(R));

  firstEntry.clear();
  calcFirstEntries();
}
Exemplo n.º 2
0
void SparseMatrixTemplate_RM<T>::mulTranspose(const MatrixT& a,MatrixT& x) const
{
  if(a.m != n) {
    FatalError("A matrix has incorrect # of rows");
  }
  if(x.isEmpty()) x.resize(n,a.n);
  if(n != x.m) {
    FatalError("X matrix has incorrect # of rows");
  }
  if(a.n != x.n) {
    FatalError("X matrix has incorrect # of columns");
  }
  for(int i=0;i<a.n;i++) {
    VectorT ai,xi;
    a.getColRef(i,ai);
    x.getColRef(i,xi);
    mulTranspose(ai,xi);
  }
}