From 41d8c626401fa8cb959a557a149e4f91ceb7f727 Mon Sep 17 00:00:00 2001 From: jiri Date: Fri, 7 Apr 2006 05:00:44 +0000 Subject: [PATCH] *** empty log message *** --- fourindex.h | 3 +++ smat.h | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/fourindex.h b/fourindex.h index ab1c1c7..4c5d0f0 100644 --- a/fourindex.h +++ b/fourindex.h @@ -524,6 +524,9 @@ istream& operator>>(istream &s, fourindex &x) //we use a general template forward declaration, but then it has to be done differently for (almost) each case //by means of partial template specialization +//note - loops for the twoelectronrealmullikan integral to be unique and in canonical order +// i=1..n, j=1..i, k=1..i, l=1..(i==k?j:k) + template class fourindex_dense; //make it as a derived class in order to be able to use it in a base class context - "supermatrix" operations diff --git a/smat.h b/smat.h index 0cf95ac..5ec2bb6 100644 --- a/smat.h +++ b/smat.h @@ -283,12 +283,38 @@ inline T SMat_index(T i, T j) return (i>=j) ? i*(i+1)/2+j : j*(j+1)/2+i; } +template +inline T SMat_index_igej(T i, T j) +{ +return i*(i+1)/2+j; +} + +template +inline T SMat_index_ilej(T i, T j) +{ +return j*(j+1)/2+i; +} + + template inline T SMat_index_1(T i, T j) { return (i>=j)? i*(i-1)/2+j-1 : j*(j-1)/2+i-1; } +template +inline T SMat_index_1igej(T i, T j) +{ +return i*(i-1)/2+j-1; +} + +template +inline T SMat_index_1ilej(T i, T j) +{ +return j*(j-1)/2+i-1; +} + + // access the element, 2-dim array case template inline T & NRSMat::operator()(const int i, const int j)