00001 #ifndef Impala_Core_Vector_SetPart_h
00002 #define Impala_Core_Vector_SetPart_h
00003
00004 #include "Core/Vector/VectorSet.h"
00005 #include "Core/Array/SetPart.h"
00006
00007 namespace Impala
00008 {
00009 namespace Core
00010 {
00011 namespace Vector
00012 {
00013
00014
00015 template <class ArrayT>
00016 inline void
00017 SetPart(VectorSet<ArrayT>* dst, VectorSet<ArrayT>* src, int dstColumn)
00018 {
00019 ILOG_VAR(Impala.Core.Vector.SetPart);
00020 if (!(src->HasConstVectorSize() && dst->HasConstVectorSize()))
00021 {
00022 ILOG_ERROR("Works for constant vector size only");
00023 return;
00024 }
00025 ArrayT* dstStorage = dst->GetStorage();
00026 ArrayT* srcStorage = src->GetStorage();
00027 Array::SetPart(dstStorage, srcStorage, dstColumn, 0);
00028 }
00029
00030 template <class ArrayT>
00031 inline void
00032 SetPart(VectorSet<ArrayT>* dst, VectorSet<ArrayT>* src, int srcColumn,
00033 int nrColumn, int dstColumn)
00034 {
00035 ILOG_VAR(Impala.Core.Vector.SetPart);
00036 if (!(src->HasConstVectorSize() && dst->HasConstVectorSize()))
00037 {
00038 ILOG_ERROR("Works for constant vector size only");
00039 return;
00040 }
00041 ArrayT* dstStorage = dst->GetStorage();
00042 ArrayT* srcStorage = src->GetStorage();
00043 Array::SetPart(dstStorage, srcStorage, srcColumn, 0, nrColumn, src->Size(),
00044 dstColumn, 0);
00045 }
00046
00047 }
00048 }
00049 }
00050
00051 #endif