📄 example.cc
字号:
// file: $isip/doc/examples/class/math/matrix/math_matrix_example_00/example.cc// version: $Id: example.cc,v 1.5 2000/12/28 21:23:53 hamaker Exp $//// isip include files//#include <MatrixDouble.h>// main program starts here// this example demonstrates the simple addition of two matrices//int main () { // declare two matrices // MatrixDouble a; MatrixDouble b; // assign the matrices. the first two arguments are the number of // rows and columns of the matrix, respectively. next comes a stream // of values that are assigned in row-order to the matrix. // a.assign(3, 3, L"4.0, 3.0, 1.0, 7.0, 0.0, 4.0, 2.0, 8.0, 1.0"); b.assign(3, 3, L"3.0, 7.0, 34.0, 6.0, 1.0, 88.0, 6.0, 3.0, 5.0"); // compute the sum and store it in a new matrix. note that the // dimensions of 'c' will be set automatically. // MatrixDouble c; c.add(a, b); // output the result to the console output // a.debug(L"a"); b.debug(L"b"); c.debug(L"a + b = "); // exit gracefully // Integral::exit();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -