matrix.h cstring stdlib.h dub::Matrix dub::TMat dub #ifndefDOXY_GENERATOR_TEST_FIXTURES_APP_MATRIX_H_ #defineDOXY_GENERATOR_TEST_FIXTURES_APP_MATRIX_H_ #include<cstring> #include<stdlib.h>//malloc namespacedub{ classMatrix{ public: Matrix():data_(NULL),rows_(0),cols_(0){} Matrix(introws,intcols):rows_(rows),cols_(cols){ data_=(double*)malloc(size()*sizeof(double)); } ~Matrix(){ if(data_)free(data_); } size_tsize(){ returnrows_*cols_; } doublecols(){ returncols_; } doublerows(){ returnrows_; } template<classT> T*give_me_tea(){ returnnewT(); } operatorsize_t(){ returnsize(); } voidmul(TMat<int>other){ //dummy } voiddo_something(inti,boolfast=false){ } voiduse_other_lib(conststd::string&name){ //dummy } int*ptr(){ //dummy } private: double*data_; size_trows_; size_tcols_; }; template<classT> classTMat{ public: TMat():data_(NULL),rows_(0),cols_(0){} TMat(introws,intcols):rows_(rows),cols_(cols){ data_=(T*)malloc(size()*sizeof(T)); } //testconstructorwithTparameter TMat(Tdummy){ } ~TMat(){ if(data_)free(data_); } size_tsize(){ returnrows_*cols_; } size_tcols(){ returncols_; } size_trows(){ returnrows_; } voidfill(Tvalue){ //dummy } FunkyThing(doublev[7]){ } Tget(size_trow,size_tcol){ returndata_[row*cols_+col]; } private: T*data_; size_trows_; size_tcols_; }; typedefTMat<float>FloatMat; typedefFloatMatFMatrix; }//dub #endif//DOXY_GENERATOR_TEST_FIXTURES_APP_MATRIX_H_