matrix_mult_simple.cpp

来自「矩阵运算源码最新版本」· C++ 代码 · 共 25 行

CPP
25
字号
#include <boost/numeric/mtl/mtl.hpp>int main(int argc, char* argv[]){    using namespace mtl; using namespace mtl::matrix;        const unsigned n= 100;    dense2D<double>                            A(n, n), B(n, n);    morton_dense<double, doppled_64_row_mask>  C(n, n);    hessian_setup(A, 3.0); hessian_setup(B, 1.0);     hessian_setup(C, 2.0);    // Corresponds to A= B * B;    mult(B, B, A);    A= B * B;   // use BLAS    A= B * C;   // use recursion + tiling from MTL4    A+= B * C;  // Increment A by the product of B and C    A-= B * C;  // Likewise with decrement    return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?