Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
surface
3rdparty
poisson4
vector.h
1
/*
2
Copyright (c) 2006, Michael Kazhdan and Matthew Bolitho
3
All rights reserved.
4
5
Redistribution and use in source and binary forms, with or without modification,
6
are permitted provided that the following conditions are met:
7
8
Redistributions of source code must retain the above copyright notice, this list of
9
conditions and the following disclaimer. Redistributions in binary form must reproduce
10
the above copyright notice, this list of conditions and the following disclaimer
11
in the documentation and/or other materials provided with the distribution.
12
13
Neither the name of the Johns Hopkins University nor the names of its contributors
14
may be used to endorse or promote products derived from this software without specific
15
prior written permission.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
18
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
19
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
20
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26
DAMAGE.
27
*/
28
29
#ifndef __VECTOR_HPP
30
#define __VECTOR_HPP
31
32
#define Assert assert
33
#include <assert.h>
34
35
36
namespace
pcl
37
{
38
namespace
poisson
39
{
40
template
<
class
T>
41
class
Vector
42
{
43
public
:
44
Vector
();
45
Vector
(
const
Vector<T>
& V );
46
Vector
( std::size_t N );
47
Vector
( std::size_t N, T* pV );
48
~Vector
();
49
50
const
T&
operator ()
(std::size_t i)
const
;
51
T&
operator ()
(std::size_t i);
52
const
T&
operator []
(std::size_t i)
const
;
53
T&
operator []
(std::size_t i);
54
55
void
SetZero
();
56
57
std::size_t
Dimensions
()
const
;
58
void
Resize
( std::size_t N );
59
60
Vector
operator *
(
const
T& A)
const
;
61
Vector
operator /
(
const
T& A)
const
;
62
Vector
operator -
(
const
Vector
& V)
const
;
63
Vector
operator +
(
const
Vector
& V)
const
;
64
65
Vector
&
operator *=
(
const
T& A);
66
Vector
&
operator /=
(
const
T& A);
67
Vector
&
operator +=
(
const
Vector
& V);
68
Vector
&
operator -=
(
const
Vector
& V);
69
70
Vector
&
AddScaled
(
const
Vector
& V,
const
T& scale);
71
Vector
&
SubtractScaled
(
const
Vector
& V,
const
T& scale);
72
static
void
Add
(
const
Vector
& V1,
const
T& scale1,
const
Vector
& V2,
const
T& scale2,
Vector
& Out);
73
static
void
Add
(
const
Vector
& V1,
const
T& scale1,
const
Vector
& V2,
Vector
& Out);
74
75
Vector
operator -
()
const
;
76
77
Vector
&
operator =
(
const
Vector
& V);
78
79
T
Dot
(
const
Vector
& V )
const
;
80
81
T
Length
()
const
;
82
83
T
Norm
( std::size_t Ln )
const
;
84
void
Normalize
();
85
86
bool
write
( FILE* fp )
const
;
87
bool
write
(
const
char
* fileName )
const
;
88
bool
read
( FILE* fp );
89
bool
read
(
const
char
* fileName );
90
91
T*
m_pV
;
92
protected
:
93
std::size_t
m_N
;
94
95
};
96
97
template
<
class
T,
int
Dim>
98
class
NVector
99
{
100
public
:
101
NVector
();
102
NVector
(
const
NVector
& V );
103
NVector
( std::size_t N );
104
NVector
( std::size_t N, T* pV );
105
~NVector
();
106
107
const
T*
operator ()
(std::size_t i)
const
;
108
T*
operator ()
(std::size_t i);
109
const
T*
operator []
(std::size_t i)
const
;
110
T*
operator []
(std::size_t i);
111
112
void
SetZero
();
113
114
std::size_t
Dimensions
()
const
;
115
void
Resize
( std::size_t N );
116
117
NVector
operator *
(
const
T& A)
const
;
118
NVector
operator /
(
const
T& A)
const
;
119
NVector
operator -
(
const
NVector
& V)
const
;
120
NVector
operator +
(
const
NVector
& V)
const
;
121
122
NVector
&
operator *=
(
const
T& A);
123
NVector
&
operator /=
(
const
T& A);
124
NVector
&
operator +=
(
const
NVector
& V);
125
NVector
&
operator -=
(
const
NVector
& V);
126
127
NVector
&
AddScaled
(
const
NVector
& V,
const
T& scale);
128
NVector
&
SubtractScaled
(
const
NVector
& V,
const
T& scale);
129
static
void
Add
(
const
NVector
& V1,
const
T& scale1,
const
NVector
& V2,
const
T& scale2,
NVector
& Out);
130
static
void
Add
(
const
NVector
& V1,
const
T& scale1,
const
NVector
& V2,
NVector
& Out);
131
132
NVector
operator -
()
const
;
133
134
NVector
&
operator =
(
const
NVector
& V);
135
136
T
Dot
(
const
NVector
& V )
const
;
137
138
T
Length
()
const
;
139
140
T
Norm
( std::size_t Ln )
const
;
141
void
Normalize
();
142
143
T*
m_pV
;
144
protected
:
145
std::size_t
m_N
;
146
147
};
148
149
}
150
}
151
152
153
#include "vector.hpp"
154
155
#endif
pcl::poisson::NVector::operator*
NVector operator*(const T &A) const
Definition
vector.hpp:360
pcl::poisson::NVector::Add
static void Add(const NVector &V1, const T &scale1, const NVector &V2, const T &scale2, NVector &Out)
Definition
vector.hpp:415
pcl::poisson::NVector::operator-=
NVector & operator-=(const NVector &V)
Definition
vector.hpp:452
pcl::poisson::NVector::operator[]
const T * operator[](std::size_t i) const
Definition
vector.hpp:350
pcl::poisson::NVector::AddScaled
NVector & AddScaled(const NVector &V, const T &scale)
Definition
vector.hpp:399
pcl::poisson::NVector::operator/=
NVector & operator/=(const T &A)
Definition
vector.hpp:383
pcl::poisson::NVector::operator-
NVector operator-() const
Definition
vector.hpp:442
pcl::poisson::NVector::Resize
void Resize(std::size_t N)
Definition
vector.hpp:309
pcl::poisson::NVector::Normalize
void Normalize()
Definition
vector.hpp:468
pcl::poisson::NVector::Dot
T Dot(const NVector &V) const
Definition
vector.hpp:483
pcl::poisson::NVector::m_N
std::size_t m_N
Definition
vector.h:145
pcl::poisson::NVector::operator()
const T * operator()(std::size_t i) const
Definition
vector.hpp:339
pcl::poisson::NVector::Dimensions
std::size_t Dimensions() const
Definition
vector.hpp:335
pcl::poisson::NVector::operator+
NVector operator+(const NVector &V) const
Definition
vector.hpp:390
pcl::poisson::NVector::Norm
T Norm(std::size_t Ln) const
Definition
vector.hpp:460
pcl::poisson::NVector::~NVector
~NVector()
Definition
vector.hpp:326
pcl::poisson::NVector::SubtractScaled
NVector & SubtractScaled(const NVector &V, const T &scale)
Definition
vector.hpp:407
pcl::poisson::NVector::m_pV
T * m_pV
Definition
vector.h:143
pcl::poisson::NVector::operator+=
NVector & operator+=(const NVector &V)
Definition
vector.hpp:425
pcl::poisson::NVector::SetZero
void SetZero()
Definition
vector.hpp:337
pcl::poisson::NVector::Length
T Length() const
Definition
vector.hpp:475
pcl::poisson::NVector::NVector
NVector()
Definition
vector.hpp:288
pcl::poisson::NVector::operator/
NVector operator/(const T &A) const
Definition
vector.hpp:375
pcl::poisson::NVector::operator=
NVector & operator=(const NVector &V)
Definition
vector.hpp:328
pcl::poisson::NVector::operator*=
NVector & operator*=(const T &A)
Definition
vector.hpp:368
pcl::poisson::Vector::operator()
const T & operator()(std::size_t i) const
Definition
vector.hpp:95
pcl::poisson::Vector::operator+
Vector operator+(const Vector &V) const
Definition
vector.hpp:146
pcl::poisson::Vector::SubtractScaled
Vector & SubtractScaled(const Vector &V, const T &scale)
Definition
vector.hpp:163
pcl::poisson::Vector::AddScaled
Vector & AddScaled(const Vector &V, const T &scale)
Definition
vector.hpp:155
pcl::poisson::Vector::Norm
T Norm(std::size_t Ln) const
Definition
vector.hpp:216
pcl::poisson::Vector::operator/=
Vector & operator/=(const T &A)
Definition
vector.hpp:139
pcl::poisson::Vector::read
bool read(FILE *fp)
Definition
vector.hpp:267
pcl::poisson::Vector::Normalize
void Normalize()
Definition
vector.hpp:224
pcl::poisson::Vector::operator+=
Vector & operator+=(const Vector &V)
Definition
vector.hpp:181
pcl::poisson::Vector::operator*
Vector operator*(const T &A) const
Definition
vector.hpp:116
pcl::poisson::Vector::Add
static void Add(const Vector &V1, const T &scale1, const Vector &V2, const T &scale2, Vector &Out)
Definition
vector.hpp:171
pcl::poisson::Vector::m_N
std::size_t m_N
Definition
vector.h:93
pcl::poisson::Vector::m_pV
T * m_pV
Definition
vector.h:91
pcl::poisson::Vector::Dimensions
std::size_t Dimensions() const
Definition
vector.hpp:91
pcl::poisson::Vector::Resize
void Resize(std::size_t N)
Definition
vector.hpp:63
pcl::poisson::Vector::operator[]
const T & operator[](std::size_t i) const
Definition
vector.hpp:106
pcl::poisson::Vector::SetZero
void SetZero()
Definition
vector.hpp:93
pcl::poisson::Vector::operator=
Vector & operator=(const Vector &V)
Definition
vector.hpp:84
pcl::poisson::Vector::~Vector
~Vector()
Definition
vector.hpp:82
pcl::poisson::Vector::Length
T Length() const
Definition
vector.hpp:231
pcl::poisson::Vector::write
bool write(FILE *fp) const
Definition
vector.hpp:276
pcl::poisson::Vector::operator-=
Vector & operator-=(const Vector &V)
Definition
vector.hpp:208
pcl::poisson::Vector::operator/
Vector operator/(const T &A) const
Definition
vector.hpp:131
pcl::poisson::Vector::operator-
Vector operator-() const
Definition
vector.hpp:198
pcl::poisson::Vector::operator*=
Vector & operator*=(const T &A)
Definition
vector.hpp:124
pcl::poisson::Vector::Vector
Vector()
Definition
vector.hpp:42
pcl::poisson::Vector::Dot
T Dot(const Vector &V) const
Definition
vector.hpp:239
pcl::poisson
Definition
allocator.h:36
pcl
Definition
convolution.h:46