22 #include <CGAL/Cartesian.h>
23 #include <CGAL/Gmpq.h>
27 #include <CGAL/Lazy_exact_nt.h>
28 #include <CGAL/Linear_algebraCd.h>
29 #include <CGAL/double.h>
30 #include <CGAL/Arr_segment_traits_2.h>
31 #include <CGAL/Arr_default_dcel.h>
32 #include <CGAL/Arrangement_2.h>
33 #include <CGAL/IO/Arr_iostream.h>
34 #include <CGAL/Arr_walk_along_line_point_location.h>
35 #include <CGAL/Arr_naive_point_location.h>
36 #include <CGAL/Polygon_2.h>
37 #include <CGAL/Polygon_2_algorithms.h>
38 #include <CGAL/intersections.h>
39 #include <CGAL/Bbox_2.h>
40 #include <CGAL/Random.h>
42 #include <CGAL/Extended_cartesian.h>
43 #include <CGAL/Nef_polyhedron_2.h>
52 typedef CGAL::Lazy_exact_nt<CGAL::Gmpq>
NT;
59 typedef CGAL::Arr_segment_traits_2<Kernel>
Traits;
62 typedef CGAL::Vector_2<Kernel>
Vector;
72 typedef Traits::X_monotone_curve_2
Curve;
78 typedef CGAL::Line_2<Kernel>
Line;
81 typedef CGAL::Ray_2<Kernel>
Rayon;
99 typedef CGAL::Linear_algebraCd<double>
LA;
114 typedef CGAL::Arr_dcel_base<CGAL::Arr_vertex_base<Point2>,
128 extern CGAL::Random *
rnd;
160 Seg(Halfedge_handle);
171 void print(
bool endsOnly=
false);
198 iterator ou_s = std::find(begin(),end(),s);
200 std::clog <<
"LineTes::Seg_list::suppress : item to suppress not found"
224 iterator ou_s = std::find(begin(),end(),s);
226 std::clog <<
"LineTes::Seg_sublist::suppress : item to suppress not found"
299 std::ostream& out=std::clog);
300 void write(std::ostream&);
301 void read(std::istream&);
305 Seg_list all_segments;
306 Halfedge_handle split_edge(Halfedge_handle,X_monotone_curve_2,
308 Halfedge_handle merge_edge(Halfedge_handle, Halfedge_handle,
310 Halfedge_handle add_edge(X_monotone_curve_2,Vertex_handle,
312 Face_handle remove_edge(Halfedge_handle);
383 LineTes::Halfedge_handle next_hf;
384 LineTes::Halfedge_handle prev_hf;
399 LineTes::Vertex_handle
v;
400 LineTes::Halfedge_handle
e;
477 Split(Halfedge_handle,
double=.5,
double=CGAL_PI/2);
482 inline Halfedge_handle
get_e1(){
return e1;}
490 inline Halfedge_handle
get_e2(){
return e2;}
520 Merge(Halfedge_handle);
523 inline Halfedge_handle
get_e(){
return e;}
527 inline Halfedge_handle e1(){
return e->twin()->next();}
528 inline Halfedge_handle e2(){
return e->next();}
529 inline Point2 p1(){
return e->source()->point();}
530 inline Point2 p2(){
return e->target()->point();}
541 Flip(Halfedge_handle);
544 inline Halfedge_handle
get_e1(){
return e1;}
546 inline Halfedge_handle
get_e2(){
return e2;}
606 Seg_sublist blocking_segments;
607 Seg_sublist non_blocking_segments;
609 Halfedge_handle random_halfedge();
610 inline double total_internal_length(){
614 Halfedge_handle length_weighted_random_halfedge();
615 Halfedge_handle alt_length_weighted_random_halfedge();
616 std::vector<Halfedge_handle> alt_length_weighted_random_halfedge(
unsigned int);
628 template <
typename T>
638 template <
typename T>
640 template <
typename T>
642 template <
typename T>
644 template <
typename T>
651 *
this = (*this)+incr;
669 for(
unsigned int i=0; i!= x2.
vertices.size(); i++) {
672 for(
unsigned int i=0; i!= x2.
edges.size(); i++) {
675 for(
unsigned int i=0; i!= x2.
faces.size(); i++) {
678 for(
unsigned int i=0; i!= x2.
segs.size(); i++) {
689 for(
unsigned int i=0; i!= x.
vertices.size(); i++) {
692 for(
unsigned int i=0; i!= x.
edges.size(); i++) {
695 for(
unsigned int i=0; i!= x.
faces.size(); i++) {
698 for(
unsigned int i=0; i!= x.
segs.size(); i++) {
718 for(
unsigned int i=0; i!= x2.
vertices.size(); i++) {
721 for(
unsigned int i=0; i!= x2.
edges.size(); i++) {
724 for(
unsigned int i=0; i!= x2.
faces.size(); i++) {
727 for(
unsigned int i=0; i!= x2.
segs.size(); i++) {
741 std::ostream&
operator<<(std::ostream &,
const CatVector &);
742 double sum(
const CatVector &);
748 CatMatrix
outer(
const CatVector &,
const CatVector &);
756 std::vector<double (*)(Segment,TTessel*)>
edges;
757 std::vector<double (*)(Polygon,TTessel*)>
faces;
877 double p_split_merge;
918 CatVector sum_stat_merges;
919 CatVector sum_stat_flips;
920 std::vector<CatVector> stat_splits;
921 std::vector<CatVector> stat_flips;
944 void Step(
unsigned int=1);
946 unsigned int Run(
double=0.05,
unsigned int=100);
952 inline std::vector<double>
GetValues() {
return values;};
955 CatVector previous_theta;
963 std::vector<CatVector> estimates;
964 std::vector<double> values;
976 Arrangement::Halfedge_handle*,
981 void set_junction(LineTes::Halfedge_handle,LineTes::Halfedge_handle);
Markovian T-tessellation.
Definition: ttessel.h:849
Split()
Default constructor that creates an empty Split object.
Definition: ttessel.cpp:1889
void set_segment(LineTes::Seg_handle s)
Define the segment containing the halfedge.
Definition: ttessel.h:372
void read(std::istream &)
Read a LineTes object from an input stream.
Definition: ttessel.cpp:1205
CatVector GetEstimate()
Access to the current parameter estimate.
Definition: ttessel.cpp:3265
void del_features_segs()
Remove all segment features from the energy formula.
Definition: ttessel.cpp:2848
Halfedge_handle get_e()
Return a handle to the suppressed edge.
Definition: ttessel.h:523
bool get_dir()
Test halfedge direction against the segment direction.
Definition: ttessel.h:351
LineTes::Halfedge_handle e
incident halfedge
Definition: ttessel.h:400
std::vector< double(*)(Point2, TTessel *)> vertices
vertex features (vector of functions)
Definition: ttessel.h:755
Representation of a modification to be applied to a line tessellation.
Definition: ttessel.h:426
Polygon get_window()
Return the domain that is tessellated.
Definition: ttessel.h:284
Storage structure for categorized items.
Definition: ttessel.h:629
LineTes::Halfedge_handle get_next_hf()
Return next halfedge along the segment.
Definition: ttessel.h:346
double GetValue(CatVector)
Return log-pseudo-likelihood value.
Definition: ttessel.cpp:3126
std::vector< double > GetValues()
Return all intermediate log-pseudolikelihood values.
Definition: ttessel.h:952
double get_window_perimeter()
Return the perimeter of the tessellated domain.
Definition: ttessel.cpp:477
std::vector< T > edges
a vector of T objects
Definition: ttessel.h:631
Segment in a line tessellation.
Definition: ttessel.h:157
bool is_valid()
Check a split is valid.
Definition: ttessel.cpp:2054
void print(bool endsOnly=false)
Print on standard output the segment points.
Definition: ttessel.cpp:791
bool is_valid(bool verbose=false)
Check whether the LineTes object is valid.
Definition: ttessel.cpp:239
bool are_aligned(Point2 p, Point2 q, Point2 r, bool verbose=false)
Test whether three points are aligned.
Definition: ttessel.cpp:3313
void AddGivenSplit(TTessel::Split)
Add a given dummy split.
Definition: ttessel.cpp:3110
Halfedge_handle split_from_vertex(Vertex_handle, Halfedge_handle, Point2)
Split a tessellation cell from a vertex to an edge.
Definition: ttessel.cpp:153
std::vector< CatVector > GetEstimates()
Return all intermediate parameter estimates.
Definition: ttessel.h:949
bool is_valid(bool verbose=false)
Check validity of a T-tessellation param verbose : if true, details are sent to std::clog. Default to false.
Definition: ttessel.cpp:1532
std::vector< Point2 > del_vertices
list of deleted vertices
Definition: ttessel.h:427
Split_list split_sample(Size)
Return a random sample of splits.
Definition: ttessel.cpp:1594
double angle_between_vectors(Vector v1, Vector v2)
Return the angle between two planar vectors.
Definition: ttessel.cpp:3758
Halfedge_handle get_e2()
Return a handle to the split edge.
Definition: ttessel.h:546
Halfedge_handle get_e2()
Return a handle to one of the split edges.
Definition: ttessel.h:490
Halfedge_handle halfedges_end()
Return the halfedge handle ending the segment.
Definition: ttessel.cpp:716
double face_sum_of_angles(Polygon, TTessel *)
Measure the deviation of a T-tessellation face from a rectangle.
Definition: ttessel.cpp:3788
bool is_valid()
Check a merge is valid.
Definition: ttessel.cpp:2219
Flip propose_flip()
Propose a flip applicable to the T-tessellation.
Definition: ttessel.cpp:1577
Seg_sublist_iterator blocking_segments_end()
Return an iterator pointing to the past-the-end internal blocking segment.
Definition: ttessel.cpp:1677
Pseudo-likelihood inference of a Gibsian T-tessellation with alternate updates.
Definition: ttessel.h:937
CatItems< CatVector > CatMatrix
Storage structure for matrices (vector of vectors) of doubles associated with categories vertices...
Definition: ttessel.h:746
TTessel * get_ttessel()
Return the pointer to the associated TTessel object.
Definition: ttessel.h:787
Dcel::Size Size
Number type used for indexing tessellation features.
Definition: ttessel.h:122
double precompute_lengthening(Arrangement::Halfedge_handle, Arrangement::Halfedge_handle *, Point2 *)
Predict added length when lengthening an edge in an arrangement.
Definition: ttessel.cpp:3373
std::vector< Segment > add_edges
list of new edges
Definition: ttessel.h:430
Traits::Segment_2 Segment
CGAL class representing a line segment from a tessellation.
Definition: ttessel.h:68
double minus_is_segment_internal(std::vector< Point2 > s, TTessel *t)
Return -1.
Definition: ttessel.h:1009
Sublist of Seg objects.
Definition: ttessel.h:213
FMatrix asFMatrix(const CatMatrix &)
Generate a FMatrix object from a CatMatrix object.
Definition: ttessel.cpp:2569
Point2 get_p1()
Get the location of the new vertex on one of the new edge.
Definition: ttessel.h:486
List of Seg objects.
Definition: ttessel.h:187
Merge_list::iterator Merge_list_iterator
Iterator for accessing merges in a list.
Definition: ttessel.h:569
bool is_on_boundary(Seg_handle s)
Test whether a segment lies on the domain boundary.
Definition: ttessel.h:292
void print_blocking_segments()
Print on standard output all blocking segments.
Definition: ttessel.cpp:1727
void AddSplits(Size)
Increment the sample of dummy splits.
Definition: ttessel.cpp:3095
a segment is shortened, another one is lengthened
Definition: ttessel.h:865
void SetStepSize(double lambda)
Set step size used in Newton's method.
Definition: ttessel.h:943
std::vector< Polygon > del_faces
list of deleted faces
Definition: ttessel.h:431
merge (of two faces separated by a non-blocking segment)
Definition: ttessel.h:864
Seg_sublist::iterator Seg_sublist_iterator
Iterator for accessing segments in a sublist of segments.
Definition: ttessel.h:239
Flip_list::iterator Flip_list_iterator
Iterator for accessing flips in a list.
Definition: ttessel.h:572
std::vector< Flip > Flip_list
A list of flips.
Definition: ttessel.h:563
void del_features_edges()
Remove all edge features from the energy formula.
Definition: ttessel.cpp:2840
void set_prev_hf(LineTes::Halfedge_handle)
Set the previous halfedge along the segment.
Definition: ttessel.cpp:1289
Point2 p
location of new vertex added by lengthening
Definition: ttessel.h:402
CGAL::Line_2< Kernel > Line
CGAL class representing an infinite line.
Definition: ttessel.h:78
std::vector< std::vector< Point2 > > del_segs
list of deleted segments
Definition: ttessel.h:433
void print_non_blocking_segments()
Print on standard output all non-blocking segments.
Definition: ttessel.cpp:1736
double segment_size_2(std::vector< Point2 >, TTessel *)
Return the squared number of edges on a segment of a T-tessellation.
Definition: ttessel.cpp:3918
Flip_list all_flips()
Return all possible flips.
Definition: ttessel.cpp:1645
A split that can be applied to a T-tessellation.
Definition: ttessel.h:474
Set of vertex, edge, face and segment features.
Definition: ttessel.h:754
Split propose_split()
Propose a split applicable to the T-tessellation.
Definition: ttessel.cpp:1566
void remove_lvertices(Size imax=0, bool verbose=false)
Remove all L-vertices from a line tessellation.
Definition: ttessel.cpp:1059
ModifCounts step(unsigned long int=1)
Proceed to update(s) of the SMF chain.
Definition: ttessel.cpp:3003
int proposed_S
number of proposed splits
Definition: ttessel.h:831
LineTes::Halfedge_handle compute_next_hf(LineTes::Halfedge_handle)
Compute the next halfedge along a segment.
Definition: ttessel.cpp:3459
void set_halfedge_handle(Halfedge_handle)
Set the halfedge handle identifying a segment.
Definition: ttessel.cpp:752
Point2 pointSource()
Return the point starting the segment.
Definition: ttessel.cpp:765
Size number_of_segments()
Return the total number of segments.
Definition: ttessel.h:263
CGAL::Vector_2< Kernel > Vector
The CGAL class used for representing vectors.
Definition: ttessel.h:62
void del_theta_edges()
Remove all theta components associated with edge features.
Definition: ttessel.cpp:2788
void del_theta_faces()
Remove all theta components associated with face features.
Definition: ttessel.cpp:2792
bool check_all_halfedges(bool verbose=false)
Check all halfedges of a line tessellation.
Definition: ttessel.cpp:280
std::vector< Point2 > Points
Class representing a series of points.
Definition: ttessel.h:93
Merge propose_merge()
Propose a merge applicable to the T-tessellation.
Definition: ttessel.cpp:1571
double edge_length(Segment, TTessel *)
Return the length of an internal T-tessellation segment.
Definition: ttessel.cpp:3667
void del_features_faces()
Remove all face features from the energy formula.
Definition: ttessel.cpp:2844
std::vector< Point2 > add_vertices
list of new vertices
Definition: ttessel.h:428
void add_theta_edges(double)
Add a theta component for a edge feature in the energy formula.
Definition: ttessel.cpp:2768
Halfedge_handle get_halfedge_handle()
Return the halfedge handle identifying the segment.
Definition: ttessel.h:169
Discrete approximation of the log-pseudolikelihood of a Gibbsian T-tessellation.
Definition: ttessel.h:892
std::vector< Polygon > add_faces
list of new faces
Definition: ttessel.h:432
void set_ttessel(TTessel *)
Define the T-tessellation whose energy is to be monitored.
Definition: ttessel.cpp:2608
CGAL::Arr_dcel_base< CGAL::Arr_vertex_base< Point2 >, LineTes_halfedge, CGAL::Arr_face_base > Dcel
Class used as a template parameter for the Arrangement class.
Definition: ttessel.h:116
Energy * get_energy()
Get the energy function of the model to be simulated.
Definition: ttessel.h:858
std::vector< double(*)(Segment, TTessel *)> edges
edge features
Definition: ttessel.h:756
bool compare_ivertices(IVertex v1, IVertex v2)
Comparison of I-vertices based on length variation.
Definition: ttessel.h:412
void set_length()
Update the length attribute of a halfedge.
Definition: ttessel.cpp:1278
double GetStepSize()
Return step size used in Newton's method.
Definition: ttessel.h:941
Seg_sublist_iterator blocking_segments_begin()
Return an iterator pointing to the first internal blocking segment.
Definition: ttessel.cpp:1671
void del_theta_segs()
Remove all theta components associated with segment features.
Definition: ttessel.cpp:2796
double seg_number(std::vector< Point2 >, TTessel *)
Return 1.
Definition: ttessel.cpp:3683
Size number_of_window_edges()
Return the number of sides of the tessellated domain.
Definition: ttessel.cpp:472
Seg_list_iterator segments_end()
Return an iterator pointing to the end of the list of tessellation segments.
Definition: ttessel.h:258
Size number_of_blocking_segments()
Return the number of internal blocking segments.
Definition: ttessel.cpp:1660
void print_all_segments(bool endsOnly=false)
Print on standard output the segment points.
Definition: ttessel.cpp:488
Dynamic T-tessellation.
Definition: ttessel.h:445
bool check_halfedge_segment(LineTes::Halfedge_handle e, bool verbose=false)
Check the segment attribute of a halfedge.
Definition: ttessel.cpp:421
double get_value()
Return the current value of the energy for the associated T-tessellation.
Definition: ttessel.h:790
std::vector< std::vector< Point2 > > add_segs
list of new segments
Definition: ttessel.h:434
void set_smf_prob(double, double)
Set the probabilities of proposing a split and a merge.
Definition: ttessel.cpp:2880
void set_length(double l)
Set the length attribute of an halfedge.
Definition: ttessel.h:365
Seg_sublist_iterator non_blocking_segments_end()
Return an iterator pointing to the past-the-end internal non-blocking segment.
Definition: ttessel.cpp:1689
LineTes::Halfedge_handle find_halfedge(LineTes &, Point2, Point2)
Find a tessellation halfedge ending at two given points.
Definition: ttessel.cpp:3532
unsigned int Run(double=0.05, unsigned int=100)
Iterate the estimation algorithm until convergence.
Definition: ttessel.cpp:3283
void add_theta_faces(double)
Add a theta component for a face feature in the energy formula.
Definition: ttessel.cpp:2774
TTessel()
Empty constructor.
Definition: ttessel.cpp:1328
std::vector< T > vertices
a vector of T objects
Definition: ttessel.h:630
Halfedge class used by the LineTes class.
Definition: ttessel.h:338
const CatItems< T > operator+(const CatItems< T > &, const CatItems< T > &)
Addition operator for CatItems objects.
Definition: ttessel.h:666
int proposed_M
number of proposed merges
Definition: ttessel.h:833
LineTes::Face_handle NULL_FACE_HANDLE
Null value for a LineTes face handle.
Definition: ttessel.cpp:20
CatVector get_theta()
Return the theta parameter.
Definition: ttessel.h:792
void del_theta_vertices()
Remove all theta components associated with vertex features.
Definition: ttessel.cpp:2784
double get_total_internal_length()
Sum of all halfedge lengths.
Definition: ttessel.h:600
std::vector< T > faces
a vector of T objects
Definition: ttessel.h:632
void del_features_vertices()
Remove all vertex features from the energy formula.
Definition: ttessel.cpp:2836
const CatItems< T > operator*(const double &, const CatItems< T > &)
Product of a CatItems object with a scalar.
Definition: ttessel.h:687
void add_theta_vertices(double)
Add a theta component for a vertex feature in the energy formula.
Definition: ttessel.cpp:2762
CGAL::Aff_transformation_2< Kernel > Transformation
CGAL class representing an affine transformation.
Definition: ttessel.h:87
double get_length()
Return the halfedge length.
Definition: ttessel.h:354
bool check_halfedge_next_hf(LineTes::Halfedge_handle e, bool verbose=false)
Check the next neighbour of a halfedge along its segment.
Definition: ttessel.cpp:410
void set_theta(CatVector par)
Set the theta parameter.
Definition: ttessel.h:794
Face_handle suppress_edge(Halfedge_handle)
Suppress an edge from the tessellation.
Definition: ttessel.cpp:186
virtual void insert_window(Rectangle)
Define the rectangular domain delimiting the tessellation.
Definition: ttessel.cpp:41
CGAL::Random * rnd
LiTe random generator.
Definition: ttessel.cpp:21
void write(std::ostream &)
Write a LineTes object to an output stream.
Definition: ttessel.cpp:1181
bool check_all_segments(bool verbose=false)
Test whether all segments of a tessellation are valid.
Definition: ttessel.cpp:259
Split_list::iterator Split_list_iterator
Iterator for accessing splits in a list.
Definition: ttessel.h:566
std::vector< double(*)(std::vector< Point2 >, TTessel *)> segs
segment features
Definition: ttessel.h:758
unsigned long int number_of_internal_vertices(TTessel &)
Return the total number of internal vertices.
Definition: ttessel.cpp:3632
void fill(CatVector &, FVector &)
Fill a CatVector object with the elements of a FVector object.
Definition: ttessel.cpp:2486
A merge that can be applied to a T-tessellation.
Definition: ttessel.h:517
Definition: ttessel.h:131
ModType
Types of modifications applicable to a T-tessellation.
Definition: ttessel.h:862
ModType propose_modif_type()
Draw a type of modification (split or merge or flip)
Definition: ttessel.cpp:2889
void Step(unsigned int=1)
Proceed to several iterations of the estimation algorithm.
Definition: ttessel.cpp:3227
bool check_halfedge(LineTes::Halfedge_handle e, bool verbose=false)
Test whether a halfedge is valid.
Definition: ttessel.cpp:322
double sum_of_min_angles(TTessel *)
Return the sum of smallest angles on all faces of a T-tessellation.
Definition: ttessel.cpp:3881
split (of a face)
Definition: ttessel.h:863
Point2 get_p2()
Get the location of the new vertex on one of the new edge.
Definition: ttessel.h:494
Energy * GetEnergy()
Get the Energy data member.
Definition: ttessel.h:898
Polygon face2poly(TTessel::Face_handle)
Returns a Polygon object representing a face of the tessellation.
Definition: ttessel.cpp:3815
virtual ModList modified_elements()
Return the list of tessellation elements that are modified.
Definition: ttessel.cpp:1877
int accepted_S
number of accepted splits
Definition: ttessel.h:832
Polygons all_faces()
Return all faces of the tessellation as polygons.
Definition: ttessel.cpp:1695
virtual ModList modified_elements()
Return the list of tessellation elements modified by a flip.
Definition: ttessel.cpp:2290
void set_dir()
Update the direction attribute of a halfedge.
Definition: ttessel.cpp:1299
Point2 get_p2()
Return a handle to the new vertex.
Definition: ttessel.h:548
double sum_of_angles_obt(TTessel *)
Return the sum of obtuse angles on all faces of a T-tessellation.
Definition: ttessel.cpp:3896
void clear()
Clear a tessellation.
Definition: ttessel.cpp:226
Seg_sublist_iterator non_blocking_segments_begin()
Return an iterator pointing to the first internal non-blocking segment.
Definition: ttessel.cpp:1683
CatMatrix outer(const CatVector &, const CatVector &)
Outer product of two CatVector objects.
Definition: ttessel.cpp:2584
PLInferenceNOIS(Energy *, bool=false, double=1.0)
Generate a PLInferenceNOIS object.
Definition: ttessel.cpp:3211
const CatItems< T > operator-(const CatItems< T > &, const CatItems< T > &)
Subtraction of two CatItems objects.
Definition: ttessel.h:707
double is_point_inside_window(Point2, LineTes *)
Test whether a point is in the interior of the tessellated domain.
Definition: ttessel.cpp:3651
void printRCALI(std::ostream &)
Print the tessellation in a format supported by califlopp.
Definition: ttessel.cpp:1823
LineTes()
Empty LineTes constructor.
Definition: ttessel.cpp:33
Energy of a Gibbsian random T-tessellation.
Definition: ttessel.h:781
CGAL::Iso_rectangle_2< Kernel > Rectangle
CGAL class representing a rectangle with horizontal and vertical sides.
Definition: ttessel.h:75
Halfedge_handle get_e1()
Return a handle to one of the split edges.
Definition: ttessel.h:482
LineTes::Seg_handle segment()
Return a handle of the segment containing the halfedge.
Definition: ttessel.h:361
void add_features_faces(double(*)(Polygon, TTessel *))
Add a face feature in the energy formula.
Definition: ttessel.cpp:2823
bool suppress(Seg_handle s)
Delete a Seg object and remove it from the segment list.
Definition: ttessel.h:197
std::vector< Merge > Merge_list
A list of merges.
Definition: ttessel.h:560
Abstract class representing a modification of a T-tessellation.
Definition: ttessel.h:454
double min_angle(Polygon, TTessel *)
Return the smallest angle in a tessellation face.
Definition: ttessel.cpp:3843
bool suppress(Seg_handle s)
Remove a segment from the segment list.
Definition: ttessel.h:223
CGAL::Lazy_exact_nt< CGAL::Gmpq > NT
The CGAL numeric type used for exact computations in LiTe.
Definition: ttessel.h:52
LineTes::Seg_handle get_segment()
Return a handle of the segment containing the halfedge.
Definition: ttessel.h:357
int accepted_F
number of accepted flips
Definition: ttessel.h:836
std::vector< double(*)(Polygon, TTessel *)> faces
face featuress
Definition: ttessel.h:757
Split_list poisson_splits(double)
Return a Poisson sample of splits.
Definition: ttessel.cpp:1615
virtual ModList modified_elements()
Compute the elements of a T-tessellation that are modified by a merge.
Definition: ttessel.cpp:2113
bool check_halfedge_prev_hf(LineTes::Halfedge_handle e, bool verbose=false)
Check the previous neighbour of a halfedge along its segment.
Definition: ttessel.cpp:365
Merge_list all_merges()
Return all possible merges.
Definition: ttessel.cpp:1633
Size number_of_non_blocking_segments()
Return the number of internal non-blocking segments.
Definition: ttessel.cpp:1665
Seg_list::iterator Seg_list_iterator
Iterator for accessing segments in a list.
Definition: ttessel.h:236
LineTes::Halfedge_handle esplit
halfedge split by lengthening
Definition: ttessel.h:401
int accepted_M
number of accepted merges
Definition: ttessel.h:834
bool check_segment(Seg_handle s, bool verbose=false)
Test whether a segment of a tessellation is valid.
Definition: ttessel.cpp:303
void add_features_segs(double(*)(std::vector< Point2 >, TTessel *))
Add a segment feature in the energy formula.
Definition: ttessel.cpp:2832
double face_number(Polygon, TTessel *)
Return 1.
Definition: ttessel.cpp:3722
std::ostream & operator<<(std::ostream &, const CatVector &)
Print a CatVector to an output stream.
Definition: ttessel.cpp:2520
double changed_length
smallest length variation
Definition: ttessel.h:403
int proposed_F
number of proposed flips
Definition: ttessel.h:835
CatVector statistic_variation(TTessel::Modification &)
Compute the statistic variation.
Definition: ttessel.cpp:2660
Seg * Seg_handle
Pointer to a Seg object.
Definition: ttessel.h:179
void ClearSplits()
Remove all dummy splits.
Definition: ttessel.cpp:3117
CGAL::Cartesian< NT > Kernel
The CGAL type of coordinates used in LiTe.
Definition: ttessel.h:55
std::vector< T > segs
a vector of T objects
Definition: ttessel.h:633
friend std::ostream & operator<<(std::ostream &, const PseudoLikDiscrete &)
Send T-tessellation pseudolikelihood data to an output stream.
Definition: ttessel.cpp:3188
Points list_of_points()
Return the list of vertices (as points) lying along the segment.
Definition: ttessel.cpp:775
Flip()
Default constructor that returns an empty Flip object.
Definition: ttessel.cpp:2235
bool is_one_edge_segment()
Test whether a halfedge starting a segment is also ending the segment.
Definition: ttessel.h:378
LineTes::Halfedge_handle NULL_HALFEDGE_HANDLE
Null value for a LineTes halfedge handle.
Definition: ttessel.cpp:18
virtual void insert_window(Rectangle)
Define the rectangular domain to be tessellated.
Definition: ttessel.cpp:1366
CGAL::Arrangement_2< Traits, Dcel > Arrangement
Class representing a tessellation.
Definition: ttessel.h:119
Seg_list_iterator segments_begin()
Return an iterator pointing to the beginning of the list of tessellation segments.
Definition: ttessel.h:254
Size number_of_edges()
Return the number of edges along the segment.
Definition: ttessel.cpp:724
bool is_a_T_vertex(LineTes::Vertex_handle, bool verbose=false)
Test whether a vertex of a line tessellation is a T-vertex.
Definition: ttessel.cpp:3579
std::vector< Segment > del_edges
list of deleted edges
Definition: ttessel.h:429
const CatItems< T > & operator-=(const CatItems< T > &)
Decrement operator for CatItems objects.
Definition: ttessel.h:658
Halfedge_handle update(Split)
Split a T-tessellation.
Definition: ttessel.cpp:1392
void SetEnergy(Energy *e)
Set the Energy data member.
Definition: ttessel.h:901
Point2 pointTarget()
Return the point ending the segment.
Definition: ttessel.cpp:770
std::vector< double > asVectorOfDoubles(const CatVector &)
Generate a vector of doubles from a CatVector object.
Definition: ttessel.cpp:2499
LA::Matrix FMatrix
Class used for representing a matrix.
Definition: ttessel.h:106
LineTes::Halfedge_handle compute_prev_hf(LineTes::Halfedge_handle)
Compute the previous halfedge along a segment.
Definition: ttessel.cpp:3430
bool number_of_edges_is_greater_than(unsigned int)
Test on the number of edges of the segment.
Definition: ttessel.cpp:735
void set_next_hf(LineTes::Halfedge_handle)
Set the next halfedge along the segment.
Definition: ttessel.cpp:1284
bool halfedge_exists(LineTes::Halfedge_handle)
Test whether a halfedge handle is indeed a halfedge handle of a tessellation.
Definition: ttessel.cpp:341
void add_theta_segs(double)
Add a theta component for a segment feature in the energy formula.
Definition: ttessel.cpp:2780
A flip that can be applied to a T-tessellation.
Definition: ttessel.h:538
CGAL::Polygon_2< Kernel > Polygon
CGAL class representing a polygon.
Definition: ttessel.h:90
LineTes::Seg_handle NULL_SEG_HANDLE
Null value for a LineTes segment handle.
Definition: ttessel.cpp:19
void add(Seg_handle s)
Add a segment at the end of the segment list.
Definition: ttessel.h:216
void add_value(double delta)
Increment the current value of the energy.
Definition: ttessel.h:796
double is_segment_internal(std::vector< Point2 >, TTessel *)
Test whether a segment of a T-tessellation is internal.
Definition: ttessel.cpp:3698
void set_junction(LineTes::Halfedge_handle, LineTes::Halfedge_handle)
Set neighbour relationships between two halfedges.
Definition: ttessel.cpp:3486
CatVector GetGradient(CatVector)
Return pseudo-likelihood gradient.
Definition: ttessel.cpp:3151
LineTes_halfedge()
Basic constructor.
Definition: ttessel.cpp:1270
bool exist_halfedge(LineTes &, LineTes::Halfedge_handle)
Test whether a halfedge handle is valid.
Definition: ttessel.cpp:3516
void add(Seg_handle s)
Add a segment at the end of the segment list.
Definition: ttessel.h:190
Data summarizing changes occuring through SMF iterations.
Definition: ttessel.h:830
LineTes::Vertex_handle v
handle of the I-vertex
Definition: ttessel.h:399
Merge()
Default constructor that generates an empty Merge object.
Definition: ttessel.cpp:2106
CGAL::Ray_2< Kernel > Rayon
CGAL class representing a half-line.
Definition: ttessel.h:81
CGAL::Arr_segment_traits_2< Kernel > Traits
The CGAL arrangement traits class used for representing tessellations.
Definition: ttessel.h:59
virtual ModList modified_elements()
Compute elements of a T-tessellation that are modified by a split.
Definition: ttessel.cpp:1954
LineTes::Halfedge_handle get_prev_hf()
Return previous halfedge along the segment.
Definition: ttessel.h:343
CGAL::Direction_2< Kernel > Direction
CGAL class representing a direction in the plane.
Definition: ttessel.h:84
void clear()
Empty the T-tessellation.
Definition: ttessel.cpp:1517
void add_features_vertices(double(*)(Point2, TTessel *))
Add a vertex feature in the energy formula.
Definition: ttessel.cpp:2805
CGAL::Linear_algebraCd< double > LA
Class used for basic linear algebra.
Definition: ttessel.h:99
Seg()
Empty constructor.
Definition: ttessel.cpp:699
const CatItems< T > & operator+=(const CatItems< T > &)
Increment operator for CatItems objects.
Definition: ttessel.h:650
Data about removal of an I-vertex.
Definition: ttessel.h:398
std::vector< CatVector > GetSplitStatistics()
Return the split term of the discrete approximation of the log-pseudolikelihood.
Definition: ttessel.h:906
Traits::Point_2 Point2
CGAL class representing a point from a tessellation.
Definition: ttessel.h:65
double face_area_2(Polygon, TTessel *)
Return the squared face area of a tessellation face.
Definition: ttessel.cpp:3731
Segment clip_segment_by_convex_polygon(Segment, Polygon)
Clip a segment by a convex polygon.
Definition: ttessel.cpp:3342
void add_features_edges(double(*)(Segment, TTessel *))
Add an edge feature in the energy formula.
Definition: ttessel.cpp:2814
double variation(TTessel::Modification &)
Compute the energy variation.
Definition: ttessel.cpp:2740
Halfedge_handle split_from_edge(Halfedge_handle, Point2, Halfedge_handle, Point2)
Split a tessellation cell from an edge to another one.
Definition: ttessel.cpp:129
Halfedge_handle get_e1()
Return a handle to the suppressed edge.
Definition: ttessel.h:544
Seg_handle insert_segment(Segment)
Insert a new line segment in a line tessellation.
Definition: ttessel.cpp:815
double sum_of_faces_squared_areas(TTessel *)
Return the sum of squared areas of all faces of a T-tessellation.
Definition: ttessel.cpp:3866
double sum_of_segment_squared_sizes(TTessel *t)
Return the sum of squared numbers of edges on all segments of a T-tessellation.
Definition: ttessel.cpp:3934
Polygonal tessellation of a bounded rectangular domain.
Definition: ttessel.h:146
void remove_ivertices(Size imax=0, bool verbose=false)
Remove all I-vertices from a line tessellation.
Definition: ttessel.cpp:920
std::vector< CatVector > GetFlipStatistics()
Return the flip term of the discrete approximation of the log-pseudolikelihood.
Definition: ttessel.h:909
double Hasting_ratio(TTessel::Split &, double *)
Compute the Hastings ratio for a given split.
Definition: ttessel.cpp:2904
CatItems< double > CatVector
Storage structure for vector of doubles associated with categories vertices, edges, faces or segs.
Definition: ttessel.h:736
FVector asFVector(const CatVector &)
Generate a FVector object from CatVector object.
Definition: ttessel.cpp:2513
double sum(const CatVector &)
Compute the sum of components of a CatVector object.
Definition: ttessel.cpp:2550
Traits::X_monotone_curve_2 Curve
CGAL class representing a curve (line segment) from a tessellation.
Definition: ttessel.h:72
bool is_a_T_tessellation(bool verbose=false, std::ostream &out=std::clog)
Test whether a line tessellation is a T-tessellation.
Definition: ttessel.cpp:1143
int is_on_boundary(Halfedge_handle)
Test whether a halfedge lies along the domain boundary.
Definition: ttessel.cpp:500
std::vector< Split > Split_list
A list of splits.
Definition: ttessel.h:557
bool shorten
true if smallest length variation due to shortening
Definition: ttessel.h:404
Halfedge_handle halfedges_start()
Return the halfedge handle starting the segment.
Definition: ttessel.cpp:708
void set_energy(Energy *e)
Set the energy function of the model to be simulated.
Definition: ttessel.h:855
LA::Vector FVector
Class used for representing a vector (in the linear algebra sense)
Definition: ttessel.h:103
bool IsEmpty()
Test whether a CatItems object is empty.
Definition: ttessel.cpp:2471
CatMatrix GetHessian(CatVector)
Return the Hessian of the log-pseudolikelihood.
Definition: ttessel.cpp:3172
bool check_halfedge_dir(LineTes::Halfedge_handle e, bool verbose=false)
Check the direction attribute of a halfedge.
Definition: ttessel.cpp:458
bool check_halfedge_neighbours(LineTes::Halfedge_handle e, bool verbose=false)
Check the neighbours of a halfedge along its segment.
Definition: ttessel.cpp:355
double face_shape(Polygon, TTessel *)
Definition: ttessel.cpp:3749