FastMathQ31.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "FastMathQ31.h"
  2. #include "Error.h"
  3. void FastMathQ31::test_cos_q31()
  4. {
  5. for(int i=0; i < this->nbSamples; i++)
  6. {
  7. *this->pDst++ = arm_cos_q31(*this->pSrc++);
  8. }
  9. }
  10. void FastMathQ31::test_sin_q31()
  11. {
  12. for(int i=0; i < this->nbSamples; i++)
  13. {
  14. *this->pDst++ = arm_sin_q31(*this->pSrc++);
  15. }
  16. }
  17. void FastMathQ31::test_sqrt_q31()
  18. {
  19. for(int i=0; i < this->nbSamples; i++)
  20. {
  21. arm_sqrt_q31(*this->pSrc++,this->pDst);
  22. this->pDst++;
  23. }
  24. }
  25. void FastMathQ31::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  26. {
  27. std::vector<Testing::param_t>::iterator it = params.begin();
  28. this->nbSamples = *it;
  29. samples.reload(FastMathQ31::SAMPLES_Q31_ID,mgr,this->nbSamples);
  30. output.create(this->nbSamples,FastMathQ31::OUT_SAMPLES_Q31_ID,mgr);
  31. this->pSrc=samples.ptr();
  32. this->pDst=output.ptr();
  33. }
  34. void FastMathQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  35. {
  36. }