~ubuntu-branches/ubuntu/utopic/blitz++/utopic

« back to all changes in this revision

Viewing changes to blitz/bench.h

  • Committer: Package Import Robot
  • Author(s): Christophe Trophime
  • Date: 2012-07-06 09:15:30 UTC
  • mfrom: (11.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120706091530-vzrb8zf0vpbf8tp9
Tags: 1:0.10-1
* New upstream release
  Closes: #679407
* debian/rules:
  - update for new release
  - add override_dh_auto_test target
  - regenerate configure and Makefile.am
* debian/control:
  - add libtool, automake to BuildDepends
* debian/libblitz-doc.install
  - modify path for html files
* remove uneeded patches
* add examples.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
1
2
/***************************************************************************
2
3
 * blitz/bench.h      Benchmark classes
3
4
 *
4
 
 * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU General Public License
8
 
 * as published by the Free Software Foundation; either version 2
 
5
 * $Id$
 
6
 *
 
7
 * Copyright (C) 1997-2011 Todd Veldhuizen <tveldhui@acm.org>
 
8
 *
 
9
 * This file is a part of Blitz.
 
10
 *
 
11
 * Blitz is free software: you can redistribute it and/or modify 
 
12
 * it under the terms of the GNU Lesser General Public License
 
13
 * as published by the Free Software Foundation, either version 3
9
14
 * of the License, or (at your option) any later version.
10
15
 *
11
 
 * This program is distributed in the hope that it will be useful,
 
16
 * Blitz is distributed in the hope that it will be useful,
12
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
 
19
 * GNU Lesser General Public License for more details.
15
20
 *
16
 
 * Suggestions:          blitz-dev@oonumerics.org
17
 
 * Bugs:                 blitz-bugs@oonumerics.org
 
21
 * You should have received a copy of the GNU Lesser General Public 
 
22
 * License along with Blitz.  If not, see <http://www.gnu.org/licenses/>.
 
23
 * 
 
24
 * Suggestions:          blitz-devel@lists.sourceforge.net
 
25
 * Bugs:                 blitz-support@lists.sourceforge.net    
18
26
 *
19
27
 * For more information, please see the Blitz++ Home Page:
20
 
 *    http://oonumerics.org/blitz/
 
28
 *    https://sourceforge.net/projects/blitz/
21
29
 *
22
30
 ***************************************************************************/
23
31
 
24
32
#ifndef BZ_BENCH_H
25
33
#define BZ_BENCH_H
26
34
 
27
 
#ifndef BZ_MATRIX_H
28
 
 #include <blitz/matrix.h>
29
 
#endif
30
 
 
31
 
#ifndef BZ_TIMER_H
32
 
 #include <blitz/timer.h>
33
 
#endif
34
 
 
 
35
#include <blitz/matrix.h>
 
36
#include <blitz/timer.h>
 
37
 
 
38
#if defined(BZ_HAVE_STD)
 
39
#include <cmath>
 
40
#else
35
41
#include <math.h>
 
42
#endif
36
43
 
37
44
BZ_NAMESPACE(blitz)
38
45
 
66
73
    double getRate(unsigned implementation, unsigned setting) const;
67
74
 
68
75
    void saveMatlabGraph(const char* filename) const;
 
76
    void savePylabGraph(const char* filename) const;
69
77
 
70
78
public:
71
79
    // Virtual functions
80
88
    { return 19; }
81
89
 
82
90
    virtual T_parameter getParameterSetting(unsigned i) const
83
 
    { return ::pow(10.0, (i+1)/4.0); }
 
91
    { return BZ_MATHFN_SCOPE(pow)(10.0, (i+1)/4.0); }
84
92
 
85
93
    virtual long getIterationSetting(unsigned i) const
86
94
    { return 1000000L / getParameterSetting(i); }