Permalink
Browse files

include <algorithm> where needed

std::min/std::max and others from <algorithm> were used without
explicitely including it. This seems to have led to problems when
compiling with VS 2013

also generally cleanup some includes
  • Loading branch information...
ypnos committed Apr 19, 2016
1 parent 614e322 commit ea6adbb3f6acba400f6b95ab06adb8525d7fc4ca
@@ -3,6 +3,7 @@
#ifdef GERBIL_CUDA
#include <vector>
#include <algorithm>
#include <opencv2/gpu/gpu.hpp>
#include <tbb/blocked_range2d.h>
@@ -1,4 +1,4 @@
/*
/*
Copyright(c) 2010 Johannes Jordan <johannes.jordan@cs.fau.de>.
This file may be licensed under the terms of of the GNU General Public
@@ -10,6 +10,7 @@
#define ILLUMINANT_H
#include <map>
#include <algorithm>
#include <cassert>
#include <cmath>
@@ -20,7 +21,7 @@ class Illuminant {
{ // precalculate real value at 560nm to do norming
norm560 = 100./at(560, true);
}
// calculate the weight such that all coeffs. in range <= 1.
inline void setNormalization(int wl1, int wl2) {
double maxv = 0.;
@@ -29,13 +30,13 @@ class Illuminant {
weight = 1./maxv;
}
inline double at(int wavelength, bool norm = false) const {
assert(wavelength > 0);
std::map<int, double>::iterator i = coeff.find(wavelength);
if (i != coeff.end())
return i->second * weight;
// black body calculation
double wl = wavelength * 0.000000001;
double wl_5 = std::pow(wl, -5);
@@ -47,7 +48,7 @@ class Illuminant {
}
return M * weight;
}
inline double at(float wavelength, bool norm = false) const {
return at((int)(wavelength + 0.5f), norm);
}
@@ -11,6 +11,7 @@
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
const float multi_img_base::ValueMin = -FLT_MAX;
const float multi_img_base::ValueMax = FLT_MAX;
@@ -115,7 +116,7 @@ multi_img::multi_img(const multi_img_base &a, const cv::Rect &roi)
multi_img::multi_img(const multi_img &a, unsigned int start, unsigned int end) : roi(a.roi)
{
minval = a.minval;
maxval = a.maxval;
maxval = a.maxval;
width = a.width;
height = a.height;
@@ -380,10 +381,10 @@ cv::PCA multi_img::pca(unsigned int components) const
rebuildPixels(true);
// create input matrix
cv::Mat_<Value> input(size(), (int)pixels.size());
cv::Mat_<Value> input(size(), (int)pixels.size());
for (size_t i = 0; i < pixels.size(); ++i) {
cv::Mat_<Value> in(pixels[i]);
cv::Mat_<Value> out(input.col((int)i));
cv::Mat_<Value> out(input.col((int)i));
in.copyTo(out);
}
@@ -1,4 +1,4 @@
/*
/*
Copyright(c) 2011 Johannes Jordan <johannes.jordan@cs.fau.de>.
This file may be licensed under the terms of of the GNU General Public
@@ -74,7 +74,7 @@ multi_img multi_img::spec_rescale(unsigned int newsize) const
return ret;
}
void multi_img::pixel2xyz(const Pixel &p, cv::Vec3f &v,
void multi_img::pixel2xyz(const Pixel &p, cv::Vec3f &v,
size_t dim, const std::vector<BandDesc> &meta, Value maxval)
{
int idx;
@@ -1,15 +1,13 @@
#include <cstddef>
#include <tbb/parallel_for.h>
#include <tbb/blocked_range.h>
#include <tbb/blocked_range2d.h>
#include <opencv2/core/core.hpp>
#include "multi_img_tbb.h"
#include "cieobserver.h"
#include <multi_img.h>
#include <multi_img/illuminant.h>
#include "multi_img_tbb.h"
#include "cieobserver.h"
#include <opencv2/core/core.hpp>
#include <tbb/parallel_for.h>
#include <cstddef>
#include <algorithm>
void RebuildPixels::operator()(const tbb::blocked_range<size_t> &r) const
{
@@ -1,6 +1,9 @@
#ifndef MULTI_IMG_TBB_H
#define MULTI_IMG_TBB_H
#include <multi_img.h>
#include <tbb/blocked_range.h>
#include <tbb/blocked_range2d.h>
// TODO doc
class RebuildPixels {
@@ -14,6 +14,8 @@
#include "widgets/mainwindow.h"
#include "app/gerbilapplication.h" // to connect queue exception signal
#include <algorithm>
//#define GGDBG_MODULE
#include "gerbil_gui_debug.h"
@@ -6,6 +6,7 @@
#include "../gerbil_gui_debug.h"
#include <QGLBuffer>
#include <algorithm>
// altmann, debugging helper function
bool assertBinSetsKeyDim(const std::vector<BinSet> &v, const ViewportCtx &ctx) {
@@ -9,7 +9,6 @@
#include <QGLBuffer>
#include <QGLFramebufferObject>
#include <limits>
#include <tbb/atomic.h>
#include <tbb/concurrent_vector.h>
#include <tbb/concurrent_hash_map.h>
@@ -22,6 +21,10 @@
#include <tbb/tbb_allocator.h>
#include <boost/functional/hash.hpp>
#include <limits>
#include <algorithm>
#include <functional>
/* N: number of bands,
* D: number of bins per band (discretization steps)
*/
View
@@ -11,12 +11,14 @@
#define VIEWPORT_H
#include "distviewcompute.h"
#include <QGraphicsScene>
#include <QGLWidget>
#include <vector>
#include <QLabel>
#include <QTimer>
#include <vector>
class Viewport : public QGraphicsScene
{
Q_OBJECT
@@ -7,6 +7,7 @@
#include <QDebug>
#include <QAction>
#include <limits>
#include <algorithm>
#include <gerbil_gui_debug.h>
View
@@ -1,5 +1,3 @@
#include "labeldock.h"
#include "ui_labeldock.h"
@@ -17,6 +15,7 @@
#include <gerbil_ostream_ops.h>
#include <iostream>
#include <algorithm>
//#define GGDBG_MODULE
#include "../gerbil_gui_debug.h"
View
@@ -3,20 +3,7 @@
#include "../gerbil_gui_debug.h"
// sigh, still no min(), max() in C++
double min(double a, double b) {
if(a<=b)
return a;
else
return b;
}
double max(double a, double b) {
if(a>=b)
return a;
else
return b;
}
#include <algorithm>
// for DEBUG
#ifdef GGDBG_MODULE
@@ -166,7 +153,7 @@ void NormDock::processMinValueChanged()
const double val = normMinBox->value();
ranges[normTarget].min = val;
//GGDBGM(ranges[normTarget].max << endl);
ranges[normTarget].max = max(val, ranges[normTarget].max);
ranges[normTarget].max = std::max(val, (double)ranges[normTarget].max);
//GGDBGM(ranges[normTarget].max << endl);
updateGUI();
}
@@ -176,7 +163,7 @@ void NormDock::processMaxValueChanged()
//GGDBG_CALL();
const double val = normMaxBox->value();
ranges[normTarget].max = val;
ranges[normTarget].min = min(val, ranges[normTarget].min);
ranges[normTarget].min = std::min(val, (double)ranges[normTarget].min);
updateGUI();
}
@@ -7,6 +7,7 @@
#include <QDebug>
#include <boost/make_shared.hpp>
#include <algorithm>
#define GGDBG_MODULE
#include "../gerbil_gui_debug.h"
@@ -3,9 +3,11 @@
#include <QApplication>
#include <QTimer>
#include <QGLWidget>
#include <QWheelEvent>
#include <cassert>
#include <stdexcept>
#include <QWheelEvent>
#include <algorithm>
//#define GGDBG_MODULE
#include <gerbil_gui_debug.h>
@@ -1,12 +1,14 @@
#include "widgets/autohidewidget.h"
#include <vole_config.h>
#include <boost/program_options.hpp>
#include <QGraphicsScene>
#include <QTimer>
#include <QPainter>
#include <QLayout>
#include <vole_config.h>
#include <boost/program_options.hpp>
#include <algorithm>
ENUM_MAGIC_CLS(AutohideWidget, border)
View
@@ -1,4 +1,4 @@
/*
/*
Copyright(c) 2010 Johannes Jordan <johannes.jordan@cs.fau.de>.
This file may be licensed under the terms of of the GNU General Public
@@ -14,6 +14,7 @@
#include <QGraphicsSceneEvent>
#include <iostream>
#include <cmath>
#include <algorithm>
ROIView::ROIView()
{
View
@@ -1,4 +1,4 @@
/*
/*
Copyright(c) 2011 Daniel Danner,
Johannes Jordan <johannes.jordan@cs.fau.de>.
@@ -11,6 +11,7 @@
#include <vector>
#include <map>
#include <algorithm>
/// fixed size for partition data type
#define K_MAX 70
@@ -19,6 +19,7 @@
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <cstdio>
#include <algorithm>
namespace seg_meanshift {
@@ -1,4 +1,4 @@
/*
/*
Copyright(c) 2010 Christian Riess <christian.riess@cs.fau.de>,
Felix Lugauer, Johannes Jordan <johannes.jordan@cs.fau.de>.
@@ -13,6 +13,7 @@
#include "similarity_measure.h"
#include <xmmintrin.h>
#include <emmintrin.h>
#include <algorithm>
namespace similarity_measures {
@@ -12,6 +12,7 @@
#include "similarity_measure.h"
#include <iostream>
#include <algorithm>
#include <limits>
namespace similarity_measures {
View
@@ -2,6 +2,8 @@
* The following include statement is for the IDE */
#include "isosom.h"
#include <algorithm>
template <size_t N>
IsoSOM<N>::IsoSOM(SOMConfig const& config, size_t nbands, bool randomize)
: GenSOM(config)

0 comments on commit ea6adbb

Please sign in to comment.