9#ifndef GLAMER_veronoi_h
10#define GLAMER_veronoi_h
20 ~Point_Nd(){x.clear();};
22 Point_Nd(
const Point_Nd &p){
23 for(
int i=0;i<dim;++i) x[i]=p.x[i];
25 Point_Nd & operator=(
const Point_Nd &p){
26 if(
this == &p)
return *
this;
27 for(
int i=0;i<dim;++i) x[i]=p.x[i];
30 Point_Nd & operator=(
const Point &p){
31 for(
int i=0;i<dim;++i) x[i]=p.x[i];
35 Point_Nd & operator+=(
const Point &p){
36 for(
int i=0;i<dim;++i) x[i]+=p.x[i];
39 Point_Nd operator+(
const Point_Nd &p)
const{
41 for(
int i=0;i<dim;++i) tmp.x[i] = x[i] + p.x[i];
44 Point_Nd operator-(
const Point_Nd &p)
const{
46 for(
int i=0;i<dim;++i) tmp.x[i] = x[i] - p.x[i];
49 Point_Nd & operator+=(
const Point_Nd &p){
50 for(
int i=0;i<dim;++i) x[i]+=p.x[i];
53 Point_Nd & operator/=(PosType value){
54 for(
int i=0;i<dim;++i) x[i]/=value;
57 Point_Nd & operator/(PosType value){
58 for(
int i=0;i<dim;++i) x[i]/=value;
61 Point_Nd & operator*=(PosType value){
62 for(
int i=0;i<dim;++i) x[i]*=value;
66 PosType operator*(
const Point_Nd &p){
68 for(
int i=0;i<dim;++i) sum += x[i]*p.x[i];
78 return sqrt((*
this)*(*
this));
81 PosType & operator[](
size_t i){
return x[i];}
83 std::vector<PosType> x;
89 Simplex_Nd(
int D,Point_Nd *points){
91 for(
int i=0;i<D+1;++i) vecs[i] = &points[i];
94 Point_Nd & RandomPointWithin();
95 double Volume(){
return volume;}
97 std::vector<Point_Nd *> vecs;
A point on the source or image plane that contains a position and the lensing quantities.
Definition point.h:414