From 62e45bce1d242949803c81ce00415165a9aae529 Mon Sep 17 00:00:00 2001 From: jiri Date: Sun, 17 Sep 2006 18:44:40 +0000 Subject: [PATCH] *** empty log message *** --- fourindex.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fourindex.h b/fourindex.h index 6344994..d759769 100644 --- a/fourindex.h +++ b/fourindex.h @@ -735,6 +735,19 @@ if(a::operator() ((i-2)*(i-1)/2+j-1, (a-2)*(a-1)/2+b-1); return (minus&1)? -val:val; } + inline void set(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; +} + };