From 7618bbd3255eeb917841a44b86718e3b8b6501b3 Mon Sep 17 00:00:00 2001 From: jiri Date: Sun, 17 Sep 2006 23:58:58 +0000 Subject: [PATCH] *** empty log message *** --- fourindex.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fourindex.h b/fourindex.h index 9f563a4..4008494 100644 --- a/fourindex.h +++ b/fourindex.h @@ -749,6 +749,19 @@ if(i::operator() ((i-2)*(i-1)/2+j-1, (a-2)*(a-1)/2+b-1) = minus? -elem : elem; } + inline void add(unsigned int i, unsigned int j, unsigned int a, unsigned int b, T elem) +{ +#ifdef DEBUG +if(i<1||i>nocc ||j<1||j>nocc|| a<1||a>nvrt||b<1||b>nvrt) laerror("T2ijab_aces fourindex out of range"); +if (!NRMat::v) laerror("access to unallocated fourindex_dense"); +if(i==j||a==b && elem) laerror("antisymmetry violation in fourindex_dense"); +#endif +int minus=0; +if(i::operator() ((i-2)*(i-1)/2+j-1, (a-2)*(a-1)/2+b-1) += minus? -elem : elem; +} + };