Menu

[r34]: / trunk / include / _zhematrix- / _zhematrix-misc.hpp  Maximize  Restore  History

Download this file

58 lines (49 with data), 1.6 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
53
54
55
56
//=============================================================================
/*! nullify all the matrix data */
inline void _zhematrix::nullify() const
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] _zhematrix::nullify() const"
<< std::endl;
#endif//CPPL_VERBOSE
N=0;
Array=NULL;
Darray=NULL;
}
//=============================================================================
/*! destroy all the matrix data */
inline void _zhematrix::destroy() const
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] _zhematrix::destroy() const"
<< std::endl;
#endif//CPPL_VERBOSE
#ifdef CPPL_DEBUG
std::cerr << "# [NOTE] _zhematrix::destroy() "
<< " An array at " << Array
<< " is going to be destroyed." << std::endl;
#endif//CPPL_DEBUG
delete [] Array; Array=NULL;
delete [] Darray; Darray=NULL;
}
//=============================================================================
/*! complete the upper-right components */
inline void _zhematrix::complete() const
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] _zhematrix::complete() const"
<< std::endl;
#endif//CPPL_VERBOSE
for(long i=0; i<N; i++){
for(long j=0; j<i; j++){
Darray[i][j] =std::conj(Darray[j][i]);
}
#ifdef CPPL_DEBUG
if(std::fabs(std::imag(operator()(i,i))) > CPPL_EPS){
std::cerr << "[WARNING] _zhematrix::complete() const" << std::endl
<< "The " << i << "th diagonal component of the _zhematrix"
<< "is not a real number." << std::endl;
}
#endif//CPPL_DEBUG
}
}
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.