资源简介
Eigen为用C++模板开发的用于矩阵、向量等线性代数操作的开源代码,这里是从官网下载的Eigen最新版本
代码片段和文件信息
#include
#include “BenchUtil.h“
#include “basicbenchmark.h“
int main(int argc char *argv[])
{
DISABLE_SSE_EXCEPTIONS();
// this is the list of matrix type and size we want to bench:
// ((suffix) (matrix size) (number of iterations))
#define MODES ((3d)(3)(4000000)) ((4d)(4)(1000000)) ((Xd)(4)(1000000)) ((Xd)(20)(10000))
// #define MODES ((Xd)(20)(10000))
#define _GENERATE_HEADER(RARGEL) << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_HEAD(EL)) << “-“ \
<< BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1EL)) << “x“ \
<< BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1EL)) << “ / “
std::cout BOOST_PP_SEQ_FOR_EACH(_GENERATE_HEADER ~ MODES ) << endl;
const int tries = 10;
#define _RUN_BENCH(RARGEL) \
std::cout << ARG( \
BOOST_PP_CAT(Matrix BOOST_PP_SEQ_HEAD(EL)) (\
BOOST_PP_SEQ_ELEM(1EL)BOOST_PP_SEQ_ELEM(1EL)) BOOST_PP_SEQ_ELEM(2EL) tries) \
<< “ “;
BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH benchBasic MODES );
std::cout << endl;
BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH benchBasic MODES );
std::cout << endl;
return 0;
}
- 上一篇:模拟生态系统
- 下一篇:C语言程序设计基础(PDF格式)
评论
共有 条评论