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 /
18 rasdaman 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 {
46 public:
48  explicit r_PointDouble(r_Dimension);
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 
72  const r_PointDouble &operator=(const r_PointDouble &);
73 
75  int compare_with(const r_PointDouble &p) const;
81  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;
92  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 
116  r_Dimension dimension() const;
117 
119  void print_status(std::ostream &s) const;
120 
122  const std::vector<double> &getVectorContent() const;
123 
125  r_Point toIntPoint() const;
126 
127 private:
129  std::vector<double> points;
130 };
131 
132 #endif
mddtypes.hh
r_PointDouble::operator!=
bool operator!=(const r_PointDouble &vectorArg) const
r_Dimension
std::uint32_t r_Dimension
number of dimensions in r_Point and r_Minterval.
Definition: mddtypes.hh:56
r_PointDouble::operator-=
r_PointDouble & operator-=(const r_PointDouble &a) noexcept(false)
r_PointDouble::compare_with
int compare_with(const r_PointDouble &p) const
compares this point with the given point.
r_PointDouble::operator+
r_PointDouble operator+(const r_PointDouble &vectorArg) const
Two points are equal if they have the same number of dimensions and the same values.
point.hh
r_PointDouble::dotProduct
double dotProduct(const r_PointDouble &r) const
scalar product
r_PointDouble::dimension
r_Dimension dimension() const
same as std::vector::size()
r_PointDouble::operator=
const r_PointDouble & operator=(const r_PointDouble &)
assignment: cleanup + copy
r_PointDouble::operator==
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::operator[]
double operator[](size_t) const
subscriptor for read access
r_Point
Class r_Point represents an n-dimensional point vector.
Definition: point.hh:42
r_PointDouble
Class r_PointDouble represents an n-dimensional point of double coordinates.
Definition: pointdouble.hh:44
r_PointDouble::print_status
void print_status(std::ostream &s) const
writes the state of the object to the specified stream
r_PointDouble::operator*
r_PointDouble operator*(const r_PointDouble &vectorArg) const
diagonal extension of multiplication across the cartesian product
r_PointDouble::r_PointDouble
r_PointDouble(r_Dimension)
constructor getting dimensionality for stream initializing
r_PointDouble::operator-
r_PointDouble operator-(const r_PointDouble &vectorArg) const
std::vector subtraction
r_PointDouble::toIntPoint
r_Point toIntPoint() const
converts the stored vector to an r_Point (integer vertices)
r_PointDouble::operator+=
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<
bool operator<(const r_PointDouble &vectorArg) const
r_PointDouble::getVectorContent
const std::vector< double > & getVectorContent() const
returns the stored vector
r_PointDouble::~r_PointDouble
~r_PointDouble()
destructor: cleanup dynamic memory
r_PointDouble::operator*=
r_PointDouble & operator*=(const r_PointDouble &a) noexcept(false)