~ubuntu-branches/ubuntu/raring/rheolef/raring-proposed

« back to all changes in this revision

Viewing changes to nfem/quadrature/tqli.h

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito, Pierre Saramito, Sylvestre Ledru
  • Date: 2012-05-14 14:02:09 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120514140209-dzbdlidkotyflf9e
Tags: 6.1-1
[ Pierre Saramito ]
* New upstream release 6.1 (minor changes):
  - support arbitrarily polynomial order Pk
  - source code supports g++-4.7 (closes: #671996)

[ Sylvestre Ledru ]
* update of the watch file

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
19
/// 
20
20
/// =========================================================================
 
21
#include "rheolef/compiler.h"
21
22
#include <iterator>
22
23
#include <iostream>
23
24
#include "rheolef/pythag.h"
24
25
 
25
26
 
26
27
template <class T>
27
 
inline T SIGN(T a, T b) { return b >= T(0) ? fabs(a) : -fabs(a); }
 
28
inline T SIGN(T a, T b) { return b >= T(0) ? std::fabs(a) : -std::fabs(a); }
28
29
 
29
30
template <class Iterator1, class Iterator2, class Size>
30
31
void tqli (Iterator1 d, Iterator2 e, Size n)
38
39
            iter=0;
39
40
            do {
40
41
              for (m=l;m<=n-1;m++) {
41
 
                dd=fabs(d[m])+fabs(d[m+1]);
42
 
                if ((T)(fabs(e[m])+dd) == dd) break;
 
42
                dd=std::fabs(d[m])+std::fabs(d[m+1]);
 
43
                if ((T)(std::fabs(e[m])+dd) == dd) break;
43
44
              }
44
45
              if (m != l) {
45
46
                iter++;