Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ACTION_ROT
00016 #define ACTION_ROT
00017 #include "utilities.h"
00018 #include "STL_interface.hh"
00019 #include <string>
00020 #include "init/init_function.hh"
00021 #include "init/init_vector.hh"
00022 #include "init/init_matrix.hh"
00023
00024 using namespace std;
00025
00026 template<class Interface>
00027 class Action_rot {
00028
00029 public :
00030
00031
00032 BTL_DONT_INLINE Action_rot( int size ):_size(size)
00033 {
00034 MESSAGE("Action_rot Ctor");
00035
00036
00037 typename Interface::stl_matrix tmp;
00038 init_vector<pseudo_random>(A_stl,_size);
00039 init_vector<pseudo_random>(B_stl,_size);
00040
00041
00042 Interface::vector_from_stl(A_ref,A_stl);
00043 Interface::vector_from_stl(A,A_stl);
00044 Interface::vector_from_stl(B_ref,B_stl);
00045 Interface::vector_from_stl(B,B_stl);
00046 }
00047
00048
00049 Action_rot( const Action_rot & )
00050 {
00051 INFOS("illegal call to Action_rot Copy Ctor");
00052 exit(1);
00053 }
00054
00055
00056 BTL_DONT_INLINE ~Action_rot( void ){
00057 MESSAGE("Action_rot Dtor");
00058 Interface::free_vector(A);
00059 Interface::free_vector(B);
00060 Interface::free_vector(A_ref);
00061 Interface::free_vector(B_ref);
00062 }
00063
00064
00065 static inline std::string name( void )
00066 {
00067 return "rot_" + Interface::name();
00068 }
00069
00070 double nb_op_base( void ){
00071 return 6.0*_size;
00072 }
00073
00074 BTL_DONT_INLINE void initialize( void ){
00075 Interface::copy_vector(A_ref,A,_size);
00076 Interface::copy_vector(B_ref,B,_size);
00077 }
00078
00079 BTL_DONT_INLINE void calculate( void ) {
00080 BTL_ASM_COMMENT("#begin rot");
00081 Interface::rot(A,B,0.5,0.6,_size);
00082 BTL_ASM_COMMENT("end rot");
00083 }
00084
00085 BTL_DONT_INLINE void check_result( void ){
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 }
00100
00101 private :
00102
00103 typename Interface::stl_vector A_stl;
00104 typename Interface::stl_vector B_stl;
00105
00106 typename Interface::gene_vector A_ref;
00107 typename Interface::gene_vector B_ref;
00108
00109 typename Interface::gene_vector A;
00110 typename Interface::gene_vector B;
00111
00112 int _size;
00113 };
00114
00115
00116 #endif