From 8ed1014ddc019a336111e0e6896602598beb37fe Mon Sep 17 00:00:00 2001 From: jiri Date: Thu, 5 Mar 2015 15:18:46 +0000 Subject: [PATCH] *** empty log message *** --- fourindex.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/fourindex.h b/fourindex.h index 78ab995..a4da395 100644 --- a/fourindex.h +++ b/fourindex.h @@ -290,6 +290,7 @@ protected: public: + void resize(I n) {nn=n;} fourindex_ext(const int file, const fourindexsymtype s=undefined_symmetry, const I n=0, const unsigned int b=1024) :current(NULL),fd(file),nread(0),symmetry(s),nn(n) { struct statfs sfs; @@ -648,6 +649,28 @@ std::istream& operator>>(std::istream &s, fourindex &x) return s; } +template +std::istream& operator>>(std::istream &s, fourindex_ext &x) + { + int n; + s >> n; + x.resize(n); + typename LA_traits_io::IOtype i,j,k,l; + typename LA_traits_io::IOtype elem; + + s >> i >> j >>k >>l; + while(i!= (typename LA_traits_io::IOtype)-1 && j!= (typename LA_traits_io::IOtype)-1 && k != (typename LA_traits_io::IOtype)-1 && l!= (typename LA_traits_io::IOtype)-1) + { + s>>elem; + x.put((I)i,(I)j,(I)k,(I)l,(T)elem); + s >> i >> j >>k >>l; + } + + x.flush(); + return s; + } + + /////////////////////densely stored fourindex/////////////////////////////////// //not all symmetry cases implemented yet, but a general template declaration used