*** empty log message ***
This commit is contained in:
7
smat.cc
7
smat.cc
@@ -19,6 +19,7 @@ template class NRSMat< complex<double> >;
|
||||
template class NRSMat<int>;
|
||||
template class NRSMat<short>;
|
||||
template class NRSMat<char>;
|
||||
template class NRSMat<unsigned long>;
|
||||
|
||||
|
||||
|
||||
@@ -343,7 +344,7 @@ ostream& operator<<(ostream &s, const NRSMat<T> &x)
|
||||
s << n << ' ' << n << '\n';
|
||||
for(i=0;i<n;i++)
|
||||
{
|
||||
for(j=0; j<n;j++) s << x(i,j) << (j==n-1 ? '\n' : ' ');
|
||||
for(j=0; j<n;j++) s << (typename LA_traits_io<T>::IOtype)x(i,j) << (j==n-1 ? '\n' : ' ');
|
||||
}
|
||||
return s;
|
||||
}
|
||||
@@ -356,7 +357,8 @@ istream& operator>>(istream &s, NRSMat<T> &x)
|
||||
s >> n >> m;
|
||||
if(n!=m) laerror("input symmetric matrix not square");
|
||||
x.resize(n);
|
||||
for(i=0;i<n;i++) for(j=0; j<m;j++) s>>x(i,j);
|
||||
typename LA_traits_io<T>::IOtype tmp;
|
||||
for(i=0;i<n;i++) for(j=0; j<m;j++) {s>>tmp; x(i,j)=tmp;}
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -374,4 +376,5 @@ INSTANTIZE(complex<double>)
|
||||
INSTANTIZE(int)
|
||||
INSTANTIZE(short)
|
||||
INSTANTIZE(char)
|
||||
INSTANTIZE(unsigned long)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user