*** empty log message ***

This commit is contained in:
jiri
2006-10-21 20:14:13 +00:00
parent 5633366c1f
commit d7be38877c
2 changed files with 19 additions and 0 deletions

18
mat.cc
View File

@@ -243,6 +243,24 @@ for(int i=fromrow; i<=torow; ++i)
return r;
}
template <typename T>
void NRMat<T>::storesubmatrix(const int fromrow, const int fromcol, const NRMat &rhs)
{
int tocol=fromcol+rhs.ncols()-1;
int torow=fromrow+rhs.nrows()-1;
#ifdef DEBUG
if(fromrow <0 ||fromrow >=nn||torow >=nn ||fromcol<0||fromcol>=mm||tocol>=mm) laerror("bad indices in storesubmatrix");
#endif
int n=torow-fromrow+1;
int m=tocol-fromcol+1;
for(int i=fromrow; i<=torow; ++i)
#ifdef MATPTR
memcpy(v[i]+fromcol,rhs.v[i-fromrow],m*sizeof(T));
#else
memcpy(v+i*mm+fromcol,rhs.v+(i-fromrow)*m,m*sizeof(T));
#endif
}
// transpose Mat
template <typename T>