*** empty log message ***
This commit is contained in:
parent
1e83e35cb1
commit
30b5975c15
9
mat.cc
9
mat.cc
@ -18,19 +18,20 @@ extern ssize_t write(int, const void *, size_t);
|
||||
|
||||
//row of
|
||||
template <typename T>
|
||||
const NRVec<T> NRMat<T>::row(const int i) const
|
||||
const NRVec<T> NRMat<T>::row(const int i, int l) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if(i<0||i>=nn) laerror("illegal index in row()");
|
||||
#endif
|
||||
NRVec<T> r(mm);
|
||||
if(l < 0) l=mm;
|
||||
NRVec<T> r(l);
|
||||
LA_traits<T>::copy(&r[0],
|
||||
#ifdef MATPTR
|
||||
v[i]
|
||||
#else
|
||||
v+i*mm
|
||||
v+i*l
|
||||
#endif
|
||||
,mm);
|
||||
,l);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
4
mat.h
4
mat.h
@ -70,8 +70,8 @@ public:
|
||||
const NRVec<T> operator*(const NRVec<T> &rhs) const {NRVec<T> result(nn); result.gemv((T)0,*this,'n',(T)1,rhs); return result;}; // Mat * Vec
|
||||
const NRVec<T> rsum() const; //sum of rows
|
||||
const NRVec<T> csum() const; //sum of columns
|
||||
const NRVec<T> row(const int i) const; //row of, efficient
|
||||
const NRVec<T> column(const int j) const {NRVec<T> r(nn); for(int i=0; i<nn; ++i) r[i]= (*this)(i,j); return r;}; //column of, general but not very efficient
|
||||
const NRVec<T> row(const int i, int l= -1) const; //row of, efficient
|
||||
const NRVec<T> column(const int j, int l= -1) const {if(l<0) l=nn; NRVec<T> r(l); for(int i=0; i<l; ++i) r[i]= (*this)(i,j); return r;}; //column of, general but not very efficient
|
||||
const T* diagonalof(NRVec<T> &, const bool divide=0, bool cache=false) const; //get diagonal
|
||||
void gemv(const T beta, NRVec<T> &r, const char trans, const T alpha, const NRVec<T> &x) const {r.gemv(beta,*this,trans,alpha,x);};
|
||||
inline T* operator[](const int i); //subscripting: pointer to row i
|
||||
|
1
matexp.h
1
matexp.h
@ -258,7 +258,6 @@ if(mat.nrows()!=mat.ncols()||(unsigned int) mat.nrows() != (unsigned int)rhs.siz
|
||||
int power;
|
||||
//prepare the polynom of and effectively scale the matrix
|
||||
NRVec<typename LA_traits<V>::elementtype> taylor2=exp_aux<M,typename LA_traits<V>::elementtype>(mat,power,maxpower,maxtaylor);
|
||||
cerr <<"test power "<<power<<endl;
|
||||
|
||||
V tmp;
|
||||
|
||||
|
3
vec.cc
3
vec.cc
@ -274,6 +274,8 @@ NRVec< complex<double> > & NRVec< complex<double> >::normalize()
|
||||
|
||||
//stubs for linkage
|
||||
template<>
|
||||
NRVec<unsigned char> & NRVec<unsigned char>::normalize() {laerror("normalize() impossible for integer types"); return *this;}
|
||||
template<>
|
||||
NRVec<int> & NRVec<int>::normalize() {laerror("normalize() impossible for integer types"); return *this;}
|
||||
template<>
|
||||
NRVec<short> & NRVec<short>::normalize() {laerror("normalize() impossible for integer types"); return *this;}
|
||||
@ -535,6 +537,7 @@ else return memqsort<0,NRVec<T>,int,int>(*this,perm,from,to);
|
||||
template class NRVec<double>;
|
||||
template class NRVec<complex<double> >;
|
||||
template class NRVec<char>;
|
||||
template class NRVec<unsigned char>;
|
||||
template class NRVec<short>;
|
||||
template class NRVec<int>;
|
||||
template class NRVec<unsigned int>;
|
||||
|
Loading…
Reference in New Issue
Block a user