From rguenth at tat.physik.uni-tuebingen.de Mon Nov 3 12:36:19 2003 From: rguenth at tat.physik.uni-tuebingen.de (Richard Guenther) Date: Mon, 3 Nov 2003 13:36:19 +0100 (CET) Subject: [PATCH] Clean up Tensor.h Message-ID: Hi! I'm staring a lot on Tensor.h and TensorElement.h from time to time. And I think its very complicated and undocumented. Does anyone remember what exactly the TensorAssign<> template is doing? And why it was done this way instead of simple loops? Are the T1 and T2 argument templates really independend, or are they supposed to have the same tensor structure (Antisymmentric, Symmetric, etc.) and the same base type? Anyway, here's some first cleanup to reduce the code one has to look at ;) Tested on x86 using gcc3.3 and Intel icpc. Ok? Richard. 2003Nov03 Richard Guenther * src/Tiny/Tensor.h: remove default implementations of (Antisymmentric|Symmetric|Diagonal)TensorAssign<>. Use template template parameter specialization to get rid of Tensor<> and TensorEngine<> specialization duplicates. ===== Tensor.h 1.8 vs edited ===== --- 1.8/r2/src/Tiny/Tensor.h Mon Nov 3 11:03:34 2003 +++ edited/Tensor.h Mon Nov 3 13:02:25 2003 @@ -871,64 +871,36 @@ struct AntisymmetricTensorAssign; // 1D partial specialization: -template -struct AntisymmetricTensorAssign, - T2,Op,B1,L1,B2,L2> -{ - static void apply(TensorEngine<1,T,Antisymmetric> &x, const T2 &y, - Op op=Op()) - { } -}; -template -struct AntisymmetricTensorAssign, - T2,Op,B1,L1,B2,L2> +template