You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_rotmg.c 2.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*****************************************************************************
  2. Copyright (c) 2011, Lab of Parallel Software and Computational Science,ICSAS
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are
  6. met:
  7. 1. Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. 2. Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in
  11. the documentation and/or other materials provided with the
  12. distribution.
  13. 3. Neither the name of the ISCAS nor the names of its contributors may
  14. be used to endorse or promote products derived from this software
  15. without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  20. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  22. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  25. USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. **********************************************************************************/
  27. #include "common_utest.h"
  28. void test_drotmg()
  29. {
  30. double te_d1, tr_d1;
  31. double te_d2, tr_d2;
  32. double te_x1, tr_x1;
  33. double te_y1, tr_y1;
  34. double te_param[5];
  35. double tr_param[5];
  36. int i=0;
  37. te_d1= tr_d1=0.21149573940783739;
  38. te_d2= tr_d2=0.046892057172954082;
  39. te_x1= tr_x1=-0.42272687517106533;
  40. te_y1= tr_y1=0.42211309121921659;
  41. for(i=0; i<5; i++){
  42. te_param[i]=tr_param[i]=0.0;
  43. }
  44. //OpenBLAS
  45. BLASFUNC(drotmg)(&te_d1, &te_d2, &te_x1, &te_y1, te_param);
  46. //reference
  47. BLASFUNC_REF(drotmg)(&tr_d1, &tr_d2, &tr_x1, &tr_y1, tr_param);
  48. CU_ASSERT_DOUBLE_EQUAL(te_d1, tr_d1, CHECK_EPS);
  49. CU_ASSERT_DOUBLE_EQUAL(te_d2, tr_d2, CHECK_EPS);
  50. CU_ASSERT_DOUBLE_EQUAL(te_x1, tr_x1, CHECK_EPS);
  51. CU_ASSERT_DOUBLE_EQUAL(te_y1, tr_y1, CHECK_EPS);
  52. for(i=0; i<5; i++){
  53. CU_ASSERT_DOUBLE_EQUAL(te_param[i], tr_param[i], CHECK_EPS);
  54. }
  55. }