*** empty log message ***

This commit is contained in:
jiri
2005-01-31 23:08:03 +00:00
parent 46d841aabf
commit 2af0920423
12 changed files with 150 additions and 31 deletions

View File

@@ -484,6 +484,24 @@ for(i=0;i<nn;++i)
}
}
//get diagonal, do not construct a new object, but store in existing one, important for huge CI matrices
template <class T>
void SparseMat<T>::diagonalof(NRVec<T> &r) const
{
#ifdef DEBUG
if(nn!=mm) laerror("diagonalof() non-square sparse matrix");
#endif
matel<T> *l=list;
r=(T)0;
while(l)
{
if(l->row == l->col) r[l->row]+= l->elem;
l= l->next;
}
}
//constructor dense matrix from sparse
export template <class T>
NRMat<T>::NRMat(const SparseMat<T> &rhs)