pMinMax.h 1.83 KB
Newer Older
Pierre Aubert's avatar
Pierre Aubert committed
1 2 3 4 5 6 7 8 9 10 11 12 13
/***************************************
	Auteur : Pierre Aubert
	Mail : aubertp7@gmail.com
	Licence : CeCILL-C
****************************************/

#ifndef __PMIN_MAX_H__
#define __PMIN_MAX_H__

#include <stdio.h>
#include <math.h>
#include <iostream>

Pierre Aubert's avatar
Pierre Aubert committed
14
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
15 16
T pmin(const T & a, const T & b);

Pierre Aubert's avatar
Pierre Aubert committed
17
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
18 19 20 21 22 23 24 25
T pmax(const T & a, const T & b);

template <class T>
T pmin4(const T & x, const T & y, const T & z, const T & t);

template <class T>
T pmax4(const T & x, const T & y, const T & z, const T & t);

Pierre Aubert's avatar
Pierre Aubert committed
26
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
27 28
T pminTab(const T* tab, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
29
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
30 31
size_t pminTabPos(const T* tab, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
32
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
33 34
size_t pminTabPos(T & minVal, const T* tab, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
35
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
36 37
T pmaxTab(const T* tab, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
38
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
39 40
size_t pmaxTabPos(const T* tab, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
41
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
42 43
size_t pmaxTabPos(T & maxVal, const T* tab, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
44
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
45 46
void pminmaxTab(T & xmin, T & xmax, const T* tab, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
47
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
48 49
void pminVec(T * vecMin, const T* tab1, const T * tab2, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
50
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
51 52
void pmaxVec(T * vecMax, const T* tab1, const T * tab2, size_t size);

Pierre Aubert's avatar
Pierre Aubert committed
53
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
54 55
void pminmaxMatrix(T * tabMin, T * tabMax, size_t nbCol, const T* matrix, size_t nbRow);

Pierre Aubert's avatar
Pierre Aubert committed
56
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
57 58
void pminmaxMatrixPitch(T & xmin, T & xmax, const T* mat, size_t nbRow, size_t nbCol, size_t pitch);

Pierre Aubert's avatar
Pierre Aubert committed
59
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
60 61
void pminmaxTabXY(T & xmin, T & xmax, T & ymin, T & ymax, const T * tab, size_t sizeNbPair);

Pierre Aubert's avatar
Pierre Aubert committed
62
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
63 64
void tabXYtoTabXmY(T* tabX, const T* tabXY, size_t sizeTabX);

Pierre Aubert's avatar
Pierre Aubert committed
65
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
66 67
void tabXYtoTabXmYonX(T* tabX, const T* tabXY, size_t sizeTabX);

Pierre Aubert's avatar
Pierre Aubert committed
68
template<typename T>
Pierre Aubert's avatar
Pierre Aubert committed
69 70 71 72 73 74 75 76 77
size_t getNumberOfDiffrentValues(const T * tab, size_t size, float threshold);



#include "pMinMax_impl.h"

#endif