"...Experimental/Multimaps/EllpackIndexMultimapValues_impl.h" did not exist on "f917518c65cbbca3f687e1db3edeccbbede21674"
Newer
Older
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/***************************************************************************
tnlIterativeSolver_impl.h - description
-------------------
begin : Oct 19, 2012
copyright : (C) 2012 by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TNLITERATIVESOLVER_IMPL_H_
#define TNLITERATIVESOLVER_IMPL_H_
#include <float.h>
template< typename Real, typename Index >
tnlIterativeSolver< Real, Index> :: tnlIterativeSolver()
: maxIterations( 0 ),
currentIteration( 0 ),
maxResidue( 0 ),
minResidue( DBL_MAX ),
currentResidue( 0 ),
solverMonitor( 0 ),
refreshRate( 1 )
{
};
template< typename Real, typename Index >
void tnlIterativeSolver< Real, Index> :: setMaxIterations( const Index& maxIterations )
{
this -> maxIterations = maxIterations;
}
template< typename Real, typename Index >
const Index& tnlIterativeSolver< Real, Index> :: getMaxIterations() const
{
return this -> maxIterations;
}
template< typename Real, typename Index >
void tnlIterativeSolver< Real, Index> :: resetIterations()
{
this -> currentIteration = 0;
}
template< typename Real, typename Index >
bool tnlIterativeSolver< Real, Index> :: nextIteration()
{
if( this -> solverMonitor &&
this -> currentIteration % this -> refreshRate == 0 )
solverMonitor -> refresh();
this -> currentIteration ++;
if( this -> getResidue() > this -> getMinResidue() && this -> currentIteration > 10 )
return false;
return true;
}
template< typename Real, typename Index >
const Index& tnlIterativeSolver< Real, Index> :: getIterations() const
{
return this -> currentIteration;
}
template< typename Real, typename Index >
void tnlIterativeSolver< Real, Index> :: setMaxResidue( const Real& maxResidue )
{
this -> maxResidue = maxResidue;
}
template< typename Real, typename Index >
const Real& tnlIterativeSolver< Real, Index> :: getMaxResidue() const
{
return this -> maxResidue;
}
template< typename Real, typename Index >
void tnlIterativeSolver< Real, Index> :: setMinResidue( const Real& minResidue )
{
this -> minResidue = minResidue;
}
template< typename Real, typename Index >
const Real& tnlIterativeSolver< Real, Index> :: getMinResidue() const
{
return this -> minResidue;
}
template< typename Real, typename Index >
void tnlIterativeSolver< Real, Index> :: setResidue( const Real& residue )
{
this -> currentResidue = residue;
}
template< typename Real, typename Index >
const Real& tnlIterativeSolver< Real, Index> :: getResidue() const
{
return this -> currentResidue;
}
template< typename Real, typename Index >
void tnlIterativeSolver< Real, Index> :: setRefreshRate( const Index& refreshRate )
{
this -> refreshRate = refreshRate;
}
template< typename Real, typename Index >
void tnlIterativeSolver< Real, Index> :: setSolverMonitor( tnlIterativeSolverMonitor< Real, Index >& solverMonitor )
{
this -> solverMonitor = &solverMonitor;
}
template< typename Real, typename Index >
void tnlIterativeSolver< Real, Index> :: refreshSolverMonitor()
{
if( this -> solverMonitor )
{
this -> solverMonitor -> setIterations( this -> getIterations() );
this -> solverMonitor -> setResidue( this -> getResidue() );
this -> solverMonitor -> refresh();
}
}
#ifdef TEMPLATE_EXPLICIT_INSTANTIATION
extern template class tnlIterativeSolver< float, int >;
extern template class tnlIterativeSolver< double, int >;
extern template class tnlIterativeSolver< float, long int >;
extern template class tnlIterativeSolver< double, long int >;
#ifdef HAVE_CUDA
extern template class tnlIterativeSolver< float, int >;
extern template class tnlIterativeSolver< double, int >;
extern template class tnlIterativeSolver< float, long int >;
extern template class tnlIterativeSolver< double, long int >;
#endif
#endif
#endif /* TNLITERATIVESOLVER_IMPL_H_ */