//=============================================================================
/*! cast to _zgematrix */
inline _zgematrix dgematrix::to_zgematrix() const
{VERBOSE_REPORT;
zgematrix newmat(m,n);
for(long i=0; i<m*n; i++){
newmat.array[i] =comple(array[i],0.0);
}
return _(newmat);
}
//=============================================================================
/*! cast to dgematrix_small */
template<long _m, long _n>
inline dgematrix_small<_m,_n> dgematrix::to_dgematrix_small() const
{VERBOSE_REPORT;
#ifdef CPPL_DEBUG
if( m!=_m || n!=_n ){
std::cerr << "[ERROR]@dgematrix::to_dgematrix_small() const" << std::endl
<< "size mismatch." << std::endl
<< "Your input was from " << m << "x" << n << " to " << _m << "x" << _n << "." << std::endl;
exit(1);
}
#endif//CPPL_DEBUG
dgematrix_small<_m,_n> newmat;
for(long i=0; i<m; i++){
for(long j=0; j<n; j++){
newmat(i,j) =(*this)(i,j);
}
}
return newmat;
}