/usr/include/linbox/benchmark.inl is in liblinbox-dev 1.4.2-5build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | /* Copyright (C) 2013 LinBox
* Written by Brice Boyer (briceboyer) <boyer.brice@gmail.com>
*
*
*
* ========LICENCE========
* This file is part of the library LinBox.
*
* LinBox is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* ========LICENCE========
*/
/*! @file benchmarks/benchmark.inl
* @ingroup benchmarks
* @brief Common header to ease benchmarking routines.
* We provide a class to easily populate and plot files that represent
* benchmarks.
*
* We use <a href="http://www.gnuplot.info/">gnuplot</a> for the plotting part
* or LaTeX to provide tables. A minimum knowledge of \c Gnuplot is a plus but
* the \c benchmark-* files should provide enough examples for creating
* standard (not too fancy) plots.
*
* We fall back to plain latex tabulars when gnuplot is not available. We plot
* graphs in files whose name is extended by a random 8-char string to avoid
* écraser files.
*
*/
#ifndef __LINBOX_benchmarks_benchmark_INL
#define __LINBOX_benchmarks_benchmark_INL
#include <stdlib.h>
#include "linbox/integer.h"
#include "linbox/util/debug.h"
#include "tests/test-common.h"
#include "linbox/util/timer.h"
#include <string>
#include <fstream>
//
// Chrono
//
namespace LinBox {
template<class MyTimer>
Chrono<MyTimer>::Chrono() :
_chrono_(),
_times_(0),
_total_(0)
{
_chrono_.clear();
}
template<class MyTimer>
Chrono<MyTimer>::~Chrono() {}
template<class MyTimer>
void Chrono<MyTimer>::clear()
{
_chrono_.clear();
_times_.resize(0);
_total_ = 0;
}
template<class MyTimer>
void Chrono<MyTimer>::start()
{
_chrono_.start();
}
template<class MyTimer>
void Chrono<MyTimer>::stop()
{
_chrono_.stop();
double split = _chrono_.userElapsedTime();
_times_.push_back( split );
_total_ += split ;
_chrono_.clear();
}
template<class MyTimer>
double Chrono<MyTimer>::time() const
{
return _total_ ;
}
template<class MyTimer>
dvector_t Chrono<MyTimer>::times() const
{
return _times_ ;
}
} // LinBox
//
// PlotData
//
namespace LinBox {
// set Series
template<>
svector_t & PlotData::refSeries(const size_t & i, Point::Labels)
{
linbox_check(i<size());
return (refSeries(i).PointLabels) ;
}
template<>
dvector_t & PlotData::refSeries(const size_t & i, Point::Values)
{
return (refSeries(i).Values) ;
}
template<>
dvector_t & PlotData::refSeries(const size_t & i, Point::Points)
{
return (refSeries(i).Points) ;
}
template<>
dvector_t & PlotData::refSeries(const size_t & i, Point::Times)
{
return (refSeries(i).Times) ;
}
// get Series
template<>
const svector_t & PlotData::getSeries(const size_t & i, Point::Labels) const
{
linbox_check(i<size());
return (getSeries(i).PointLabels) ;
}
template<>
const dvector_t & PlotData::getSeries(const size_t & i, Point::Values) const
{
return (getSeries(i).Values) ;
}
template<>
const dvector_t & PlotData::getSeries(const size_t & i, Point::Points) const
{
return (getSeries(i).Points) ;
}
template<>
const dvector_t & PlotData::getSeries(const size_t & i, Point::Times) const
{
return (getSeries(i).Times) ;
}
} // LinBox
#endif // __LINBOX_benchmarks_benchmark_INL
// Local Variables:
// mode: C++
// tab-width: 8
// indent-tabs-mode: nil
// c-basic-offset: 8
// End:
// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
|