Menu

[r156]: / trunk / test / dssmatrix / dssmatrix-misc / main.cpp  Maximize  Restore  History

Download this file

53 lines (43 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*****************************************************************************/
/* noname */
/*****************************************************************************/
//=============================================================================
#include <ctime>
#include "cpplapack.h"
//=============================================================================
/*! main */
int main(int argc, char** argv)
{
srand(unsigned(time(NULL)));
int N(5);
//////// A ////////
CPPL::dssmatrix A(N);
A.put(0,0, 1.);
A.put(3,2, 2.);
A.put(1,3, 3.);
A.put(3,4, 4.);
A.put(1,2, 5.);
A.put(2,2, 6.);
A.put(4,1, 7.);
A.put(1,1, 8.);
std::cout << "A =\n" << A << std::endl;
//////// B ////////
CPPL::dssmatrix B(A);
for(long i=0; i<B.n; i++){
B.del(i,i);
}
std::cout << "B =\n" << B << std::endl;
//////// reorder A ////////
//A.checkup();
std::cout << "==============================================" << std::endl;
A.reorder(0);
A.checkup();
std::cout << "##############################################" << std::endl;
//////// reorder B ////////
//B.checkup();
std::cout << "==============================================" << std::endl;
B.reorder(1);
B.checkup();
return 0;
}
/*****************************************************************************/
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.