diff --git a/src/op_unit_test.cc b/src/op_unit_test.cc index ad9228c..fd2d938 100644 --- a/src/op_unit_test.cc +++ b/src/op_unit_test.cc @@ -7,6 +7,7 @@ #include "multi_array_header.h" #include +#include namespace MAT = MultiArrayTools; @@ -19,6 +20,13 @@ namespace { using namespace MAT; + template + void swapFactory(std::shared_ptr& fptr) + { + auto nptr = std::make_shared(); + fptr = nptr; + } + template void swapFactory(std::shared_ptr& fptr, std::initializer_list ilist) { @@ -165,6 +173,52 @@ namespace { std::vector cv2; }; + class OpTest_Spin : public ::testing::Test + { + protected: + + typedef SpinRangeFactory SRF; + typedef SpinRange SR; + typedef MultiRangeFactory SR8F; + typedef SR8F::oType SR8; + + static const size_t s = 65536; + + OpTest_Spin() : data(s) + { + for(size_t i = 0; i != s; ++i){ + double arg = static_cast( i - s ) - 0.1; + data[i] = sin(arg)/arg; + } + + swapFactory(rfbptr); + srptr = std::dynamic_pointer_cast( rfbptr->create() ); + /* + swapMFactory(rfbptr, srptr, srptr, srptr, srptr, + srptr, srptr, srptr, srptr); + mrptr = std::dynamic_pointer_cas( rfbptr->create() ); + */ + } + + std::shared_ptr rfbptr; + std::shared_ptr srptr; + //std::shared_ptr mrptr; + std::vector data; + }; + + TEST_F(OpTest_Spin, Contract) + { + MultiArray ma(srptr, srptr, srptr, srptr, + srptr, srptr, srptr, srptr, data); + + auto alpha = MAT::getIndex(srptr); + auto beta = MAT::getIndex(srptr); + auto gamma = MAT::getIndex(srptr); + auto delta = MAT::getIndex(srptr); + + // !!! + } + TEST_F(OpTest_Performance, PCheck) { MultiArray ma2(mrptr, cv2);