main.cpp

来自「lapack的c++版本之一.lapack是imsl,mkl,matlab等大部」· C++ 代码 · 共 40 行

CPP
40
字号
/*****************************************************************************//*                                 noname                                    *//*****************************************************************************///====================================================================[include]#include <iostream>#include <cstdlib>#include <ctime>#include "cpplapack.h"using namespace std;//=======================================================================[main]/*! main */int main(int argc, char** argv){  srand(time(NULL));  int M(5), N(5), CAP(4);    CPPL::dssmatrix A(M,N,CAP);  A.fput(0,0, 1.);  A.fput(3,2, 2.);  A.fput(1,2, 3.);  A.fput(4,1, 4.);  cout << "A =\n" << A << endl;    CPPL::dsymatrix B(N);  for(int i=0; i<A.n; i++){ for(int j=0; j<=i; j++){    B(i,j) =double( rand() /(RAND_MAX/10) );  }}  cout << "B =\n" << B << endl;    //cout << "A+B =\n" << A+B << endl;  cout << "A-B =\n" << A-B << endl;  cout << "A*B =\n" << A*B << endl;    return 0;}/*****************************************************************************/

⌨️ 快捷键说明

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