⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 banded_matmat.cc

📁 一个通用的数学库
💻 CC
字号:
#include <iostream>using namespace std;#include <mtl/mtl.h>#include <mtl/matrix.h>#include <mtl/dense1D.h>#include <mtl/utils.h>intmain(){  typedef mtl::matrix<double,                  mtl::diagonal<>,                  mtl::banded<mtl::external>,                    mtl::column_major>::type DiagMatE;  typedef mtl::matrix<double,                  mtl::rectangle<>,                  mtl::dense<mtl::external>,                  mtl::column_major>::type MatrixE;  typedef mtl::matrix<double,                  mtl::rectangle<>,                  mtl::dense<mtl::internal>,                  mtl::column_major>::type MatrixI;  int N = 3;  double da [] = { 1, 3, 2, 2, 1, 2, 2, 2, 1 };  double dc [] = { 1, 3, 2};  MatrixE A(da, N, N);  DiagMatE C(dc, N, N, 0, 0);  MatrixI AxC(N,N);  cout << "Full A:" << endl;  mtl::print_all_matrix(A);  cout << "Diag C:" << endl;  mtl::print_all_banded(C,0,0);  cout << "Output AxC:" << endl;  //put C as the first parameter in mult   //since C is a banded matrix  mtl::mult(C,A,AxC);  mtl::print_all_matrix(AxC);  return 0;}

⌨️ 快捷键说明

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