Skip to content

Commit ed6f152

Browse files
committed
Fix whitespace and line endings
1 parent 24872cc commit ed6f152

11 files changed

+1842
-1842
lines changed

Binomial.cpp

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/*
2-
3-
3D Zernike Moments
4-
Copyright (C) 2003 by Computer Graphics Group, University of Bonn
5-
http://www.cg.cs.uni-bonn.de/project-pages/3dsearch/
6-
2+
3+
3D Zernike Moments
4+
Copyright (C) 2003 by Computer Graphics Group, University of Bonn
5+
http://www.cg.cs.uni-bonn.de/project-pages/3dsearch/
6+
77
Code by Marcin Novotni: marcin@cs.uni-bonn.de
8-
8+
99
for more information, see the paper:
1010
11-
@inproceedings{novotni-2003-3d,
12-
author = {M. Novotni and R. Klein},
13-
title = {3{D} {Z}ernike Descriptors for Content Based Shape Retrieval},
14-
booktitle = {The 8th ACM Symposium on Solid Modeling and Applications},
15-
pages = {216--225},
16-
year = {2003},
17-
month = {June},
18-
institution = {Universit\"{a}t Bonn},
11+
@inproceedings{novotni-2003-3d,
12+
author = {M. Novotni and R. Klein},
13+
title = {3{D} {Z}ernike Descriptors for Content Based Shape Retrieval},
14+
booktitle = {The 8th ACM Symposium on Solid Modeling and Applications},
15+
pages = {216--225},
16+
year = {2003},
17+
month = {June},
18+
institution = {Universit\"{a}t Bonn},
1919
conference = {The 8th ACM Symposium on Solid Modeling and Applications, June 16-20, Seattle, WA}
20-
}
21-
*---------------------------------------------------------------------------*
20+
}
21+
*---------------------------------------------------------------------------*
2222
* *
2323
* License *
2424
* *
@@ -35,43 +35,43 @@ for more information, see the paper:
3535
* License along with this library; if not, write to the Free Software *
3636
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
3737
* *
38-
\*===========================================================================*/
39-
40-
template<class T>
41-
void Binomial<T>::ComputePascalsTriangle ()
42-
{
43-
// allocate storage for the pascal triangle of size determined by max_
44-
pascalsTriangle_.resize (max_+1);
45-
46-
for (int i=0; i<max_+1; ++i)
47-
{
48-
pascalsTriangle_[i].resize (max_+1-i);
49-
for (int j=0; j<max_+1-i; ++j)
50-
{
51-
// the values are ones on the edges of the triangle
52-
if (!i || !j)
53-
{
54-
pascalsTriangle_[i][j] = (T)1;
55-
}
56-
// use the familiar addition to generate values on lower levels
57-
else
58-
{
59-
pascalsTriangle_[i][j] = pascalsTriangle_[i][j-1] + pascalsTriangle_[i-1][j];
60-
}
61-
}
62-
}
63-
}
64-
65-
template<class T>
66-
T Binomial<T>::Get (int _i, int _j)
67-
{
68-
// the values are computed only first time this function is called
69-
if (!pascalsTriangle_.size ())
70-
{
71-
ComputePascalsTriangle ();
72-
}
73-
74-
assert (_i>=0 && _j>=0 && _i>=_j);
75-
76-
return pascalsTriangle_[_j][_i-_j];
77-
}
38+
\*===========================================================================*/
39+
40+
template<class T>
41+
void Binomial<T>::ComputePascalsTriangle ()
42+
{
43+
// allocate storage for the pascal triangle of size determined by max_
44+
pascalsTriangle_.resize (max_+1);
45+
46+
for (int i=0; i<max_+1; ++i)
47+
{
48+
pascalsTriangle_[i].resize (max_+1-i);
49+
for (int j=0; j<max_+1-i; ++j)
50+
{
51+
// the values are ones on the edges of the triangle
52+
if (!i || !j)
53+
{
54+
pascalsTriangle_[i][j] = (T)1;
55+
}
56+
// use the familiar addition to generate values on lower levels
57+
else
58+
{
59+
pascalsTriangle_[i][j] = pascalsTriangle_[i][j-1] + pascalsTriangle_[i-1][j];
60+
}
61+
}
62+
}
63+
}
64+
65+
template<class T>
66+
T Binomial<T>::Get (int _i, int _j)
67+
{
68+
// the values are computed only first time this function is called
69+
if (!pascalsTriangle_.size ())
70+
{
71+
ComputePascalsTriangle ();
72+
}
73+
74+
assert (_i>=0 && _j>=0 && _i>=_j);
75+
76+
return pascalsTriangle_[_j][_i-_j];
77+
}

Binomial.h

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/*
2-
3-
3D Zernike Moments
4-
Copyright (C) 2003 by Computer Graphics Group, University of Bonn
5-
http://www.cg.cs.uni-bonn.de/project-pages/3dsearch/
6-
2+
3+
3D Zernike Moments
4+
Copyright (C) 2003 by Computer Graphics Group, University of Bonn
5+
http://www.cg.cs.uni-bonn.de/project-pages/3dsearch/
6+
77
Code by Marcin Novotni: marcin@cs.uni-bonn.de
8-
8+
99
for more information, see the paper:
1010
11-
@inproceedings{novotni-2003-3d,
12-
author = {M. Novotni and R. Klein},
13-
title = {3{D} {Z}ernike Descriptors for Content Based Shape Retrieval},
14-
booktitle = {The 8th ACM Symposium on Solid Modeling and Applications},
15-
pages = {216--225},
16-
year = {2003},
17-
month = {June},
18-
institution = {Universit\"{a}t Bonn},
11+
@inproceedings{novotni-2003-3d,
12+
author = {M. Novotni and R. Klein},
13+
title = {3{D} {Z}ernike Descriptors for Content Based Shape Retrieval},
14+
booktitle = {The 8th ACM Symposium on Solid Modeling and Applications},
15+
pages = {216--225},
16+
year = {2003},
17+
month = {June},
18+
institution = {Universit\"{a}t Bonn},
1919
conference = {The 8th ACM Symposium on Solid Modeling and Applications, June 16-20, Seattle, WA}
20-
}
21-
*---------------------------------------------------------------------------*
20+
}
21+
*---------------------------------------------------------------------------*
2222
* *
2323
* License *
2424
* *
@@ -35,66 +35,66 @@ for more information, see the paper:
3535
* License along with this library; if not, write to the Free Software *
3636
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
3737
* *
38-
\*===========================================================================*/
39-
40-
#ifndef BINOMIAL_H
41-
#define BINOMIAL_H
42-
43-
#include <vector>
44-
#include <assert.h>
45-
46-
using std::vector;
47-
48-
/**
49-
* A template class facilitating fast computation and retrieval of binomials.
50-
* The binomials are computed only once at first call of Get function according
51-
* to Pascal's Triangle.
52-
*/
53-
template<class T>
54-
class Binomial
55-
{
56-
public:
57-
typedef vector<T> VectorT;
58-
typedef vector<VectorT> VVectorT;
59-
60-
/** Retrieves the binomial _i "over" _j */
61-
static T Get (int _i, int _j);
62-
/** Sets the maximal value of upper binomial param to _max */
63-
static void SetMax (int _max);
64-
/** Gets the maximal value of upper binomial param */
65-
static int GetMax ();
66-
67-
private:
68-
/** Computed Pascal's Triangle */
69-
static void ComputePascalsTriangle ();
70-
71-
static VVectorT pascalsTriangle_;
72-
static int max_;
73-
};
74-
75-
76-
template<class T>
77-
inline void Binomial<T>::SetMax (int _max)
78-
{
79-
max_ = _max;
80-
ComputePascalsTriangle ();
81-
}
82-
83-
84-
template<class T>
85-
inline int Binomial<T>::GetMax ()
86-
{
87-
return max_;
88-
}
89-
90-
91-
template<class T>
92-
typename Binomial<T>::VVectorT Binomial<T>::pascalsTriangle_;
93-
94-
template<class T>
95-
int Binomial<T>::max_ = 60;
96-
97-
98-
#include "Binomial.cpp"
99-
100-
#endif
38+
\*===========================================================================*/
39+
40+
#ifndef BINOMIAL_H
41+
#define BINOMIAL_H
42+
43+
#include <vector>
44+
#include <assert.h>
45+
46+
using std::vector;
47+
48+
/**
49+
* A template class facilitating fast computation and retrieval of binomials.
50+
* The binomials are computed only once at first call of Get function according
51+
* to Pascal's Triangle.
52+
*/
53+
template<class T>
54+
class Binomial
55+
{
56+
public:
57+
typedef vector<T> VectorT;
58+
typedef vector<VectorT> VVectorT;
59+
60+
/** Retrieves the binomial _i "over" _j */
61+
static T Get (int _i, int _j);
62+
/** Sets the maximal value of upper binomial param to _max */
63+
static void SetMax (int _max);
64+
/** Gets the maximal value of upper binomial param */
65+
static int GetMax ();
66+
67+
private:
68+
/** Computed Pascal's Triangle */
69+
static void ComputePascalsTriangle ();
70+
71+
static VVectorT pascalsTriangle_;
72+
static int max_;
73+
};
74+
75+
76+
template<class T>
77+
inline void Binomial<T>::SetMax (int _max)
78+
{
79+
max_ = _max;
80+
ComputePascalsTriangle ();
81+
}
82+
83+
84+
template<class T>
85+
inline int Binomial<T>::GetMax ()
86+
{
87+
return max_;
88+
}
89+
90+
91+
template<class T>
92+
typename Binomial<T>::VVectorT Binomial<T>::pascalsTriangle_;
93+
94+
template<class T>
95+
int Binomial<T>::max_ = 60;
96+
97+
98+
#include "Binomial.cpp"
99+
100+
#endif

0 commit comments

Comments
 (0)