rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
pointdouble.hh
Go to the documentation of this file.
1/*
2* This file is part of rasdaman community.
3*
4* Rasdaman community is free software: you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation, either version 3 of the License, or
7* (at your option) any later version.
8*
9* Rasdaman community is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16*
17* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18rasdaman GmbH.
19*
20* For more information please see <http://www.rasdaman.org>
21* or contact Peter Baumann via <baumann@rasdaman.com>.
22*/
23
24#ifndef R_DOUBLEPOINT_HH
25#define R_DOUBLEPOINT_HH
26
27#include "raslib/mddtypes.hh"
28#include "raslib/point.hh"
29
30#include <iosfwd>
31#include <vector>
32
33//@ManMemo: Module: {\bf raslib}
45{
46public:
49
50 r_PointDouble(r_Dimension dim, double value);
51
52 //@Man: 'variading constructors'
54
55
56 explicit r_PointDouble(const r_Point &pt);
57
58 explicit r_PointDouble(const std::vector<double> &content);
59
61 r_PointDouble(const r_PointDouble &vectorArg);
62
65
67 double operator[](size_t) const;
69 double &operator[](size_t);
70
73
75 int compare_with(const r_PointDouble &p) const;
82 bool operator==(const r_PointDouble &vectorArg) const;
83
84 bool operator!=(const r_PointDouble &vectorArg) const;
85
86 bool operator<(const r_PointDouble &vectorArg) const;
93 r_PointDouble operator+(const r_PointDouble &vectorArg) const;
94
96 r_PointDouble operator-(const r_PointDouble &vectorArg) const;
97
99 r_PointDouble operator*(const r_PointDouble &vectorArg) const;
100
102 r_PointDouble operator*(double scalarArg) const;
103
107 r_PointDouble &operator+=(const r_PointDouble &a) noexcept(false);
108 r_PointDouble &operator-=(const r_PointDouble &a) noexcept(false);
109 r_PointDouble &operator*=(const r_PointDouble &a) noexcept(false);
110 r_PointDouble &operator*=(double a) noexcept;
111
113 double dotProduct(const r_PointDouble &r) const;
114
117
119 void print_status(std::ostream &s) const;
120
122 const std::vector<double> &getVectorContent() const;
123
126
127private:
129 std::vector<double> points;
130};
131
132#endif
Class r_PointDouble represents an n-dimensional point of double coordinates.
Definition pointdouble.hh:45
r_PointDouble(const r_PointDouble &vectorArg)
copy constructor
r_PointDouble & operator+=(const r_PointDouble &a) noexcept(false)
Same as above but of the form PointA op= PointB; PointA is modified in place.
r_PointDouble & operator*=(double a) noexcept
r_PointDouble & operator*=(const r_PointDouble &a) noexcept(false)
r_Dimension dimension() const
same as std::vector::size()
const r_PointDouble & operator=(const r_PointDouble &)
assignment: cleanup + copy
r_PointDouble operator*(double scalarArg) const
scalar multiplication
bool operator==(const r_PointDouble &vectorArg) const
Returns 0 if this == p, -1 if this < p, 1 if this > p (considering the coordinates in lexicographic o...
r_PointDouble(r_Dimension dim, double value)
r_PointDouble operator*(const r_PointDouble &vectorArg) const
diagonal extension of multiplication across the cartesian product
r_Point toIntPoint() const
converts the stored vector to an r_Point (integer vertices)
bool operator<(const r_PointDouble &vectorArg) const
r_PointDouble & operator-=(const r_PointDouble &a) noexcept(false)
r_PointDouble(const r_Point &pt)
const std::vector< double > & getVectorContent() const
returns the stored vector
r_PointDouble operator+(const r_PointDouble &vectorArg) const
Two points are equal if they have the same number of dimensions and the same values.
bool operator!=(const r_PointDouble &vectorArg) const
int compare_with(const r_PointDouble &p) const
compares this point with the given point.
r_PointDouble(const std::vector< double > &content)
double dotProduct(const r_PointDouble &r) const
scalar product
r_PointDouble operator-(const r_PointDouble &vectorArg) const
std::vector subtraction
~r_PointDouble()
destructor: cleanup dynamic memory
double operator[](size_t) const
subscriptor for read access
void print_status(std::ostream &s) const
writes the state of the object to the specified stream
r_PointDouble(r_Dimension)
constructor getting dimensionality for stream initializing
double & operator[](size_t)
subscriptor for write access
Class r_Point represents an n-dimensional point vector.
Definition point.hh:43
std::uint32_t r_Dimension
number of dimensions in r_Point and r_Minterval.
Definition mddtypes.hh:56