00001 #ifndef Impala_Core_Array_Trait_M9N4poCxy_h
00002 #define Impala_Core_Array_Trait_M9N4poCxy_h
00003
00004 #include "Core/Array/Pattern/Categories.h"
00005
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Array
00011 {
00012 namespace Trait
00013 {
00014
00015
00018 template<class DstArrayT, class SrcArrayT>
00019 class M9N4poCxy
00020 {
00021 public:
00023 typedef Pattern::TagTransInVar TransVarianceCategory;
00024
00026 typedef Pattern::TagCallValue CallCategory;
00027
00028 typedef typename DstArrayT::StorType DstStorT;
00029 typedef typename DstArrayT::ArithType DstArithT;
00030 typedef typename SrcArrayT::ArithType SrcArithT;
00031
00033 void
00034 DoIt(DstStorT* Clx, DstStorT* Cly, DstStorT* Cllx, DstStorT* Clly,
00035 const SrcArithT& E, const SrcArithT& Ex, const SrcArithT& Ey,
00036 const SrcArithT& El, const SrcArithT& Elx, const SrcArithT& Ely,
00037 const SrcArithT& Ell, const SrcArithT& Ellx, const SrcArithT& Elly)
00038 {
00039 SrcArithT e2 = E*E;
00040 *Clx = (Elx*E - El*Ex) / e2;
00041 *Cly = (Ely*E - El*Ey) / e2;
00042 *Cllx = (Ellx*E - Ell*Ex) / e2;
00043 *Clly = (Elly*E - Ell*Ey) / e2;
00044 }
00045
00046 };
00047
00048 }
00049 }
00050 }
00051 }
00052
00053 #endif