mirror of https://github.com/CGAL/cgal
Merge pull request #3895 from sloriot/CGAL-clean_up_tabs_trailingspaces
Replace tabs with spaces and remove trailing whitespaces
This commit is contained in:
commit
16fc8d1fe2
|
|
@ -21,7 +21,7 @@ for f in *
|
|||
do
|
||||
if [ -d "$f/package_info/$f" ]
|
||||
then
|
||||
echo "$f " >> ./tmp.txt
|
||||
echo "$f" >> ./tmp.txt
|
||||
fi
|
||||
done
|
||||
LC_ALL=C sort ./tmp.txt > ./.travis/packages.txt
|
||||
|
|
|
|||
|
|
@ -1,138 +1,138 @@
|
|||
AABB_tree
|
||||
Advancing_front_surface_reconstruction
|
||||
Algebraic_foundations
|
||||
Algebraic_kernel_d
|
||||
Algebraic_kernel_for_circles
|
||||
Algebraic_kernel_for_spheres
|
||||
Alpha_shapes_2
|
||||
Alpha_shapes_3
|
||||
Apollonius_graph_2
|
||||
Arithmetic_kernel
|
||||
Arrangement_on_surface_2
|
||||
BGL
|
||||
Barycentric_coordinates_2
|
||||
Boolean_set_operations_2
|
||||
Bounding_volumes
|
||||
Box_intersection_d
|
||||
CGAL_Core
|
||||
CGAL_ImageIO
|
||||
CGAL_ipelets
|
||||
Cartesian_kernel
|
||||
Circular_kernel_2
|
||||
Circular_kernel_3
|
||||
Circulator
|
||||
Classification
|
||||
Combinatorial_map
|
||||
Cone_spanners_2
|
||||
Convex_decomposition_3
|
||||
Convex_hull_2
|
||||
Convex_hull_3
|
||||
Convex_hull_d
|
||||
Distance_2
|
||||
Distance_3
|
||||
Envelope_2
|
||||
Envelope_3
|
||||
Filtered_kernel
|
||||
Generalized_map
|
||||
Generator
|
||||
Geomview
|
||||
GraphicsView
|
||||
HalfedgeDS
|
||||
Hash_map
|
||||
Heat_method_3
|
||||
Homogeneous_kernel
|
||||
Hyperbolic_triangulation_2
|
||||
Inscribed_areas
|
||||
Installation
|
||||
Interpolation
|
||||
Intersections_2
|
||||
Intersections_3
|
||||
Interval_skip_list
|
||||
Interval_support
|
||||
Inventor
|
||||
Jet_fitting_3
|
||||
Kernel_23
|
||||
Kernel_d
|
||||
LEDA
|
||||
Linear_cell_complex
|
||||
MacOSX
|
||||
Maintenance
|
||||
Matrix_search
|
||||
Mesh_2
|
||||
Mesh_3
|
||||
Mesher_level
|
||||
Minkowski_sum_2
|
||||
Minkowski_sum_3
|
||||
Modifier
|
||||
Modular_arithmetic
|
||||
Nef_2
|
||||
Nef_3
|
||||
Nef_S2
|
||||
NewKernel_d
|
||||
Number_types
|
||||
OpenNL
|
||||
Optimal_transportation_reconstruction_2
|
||||
Optimisation_basic
|
||||
Partition_2
|
||||
Periodic_2_triangulation_2
|
||||
Periodic_3_mesh_3
|
||||
Periodic_3_triangulation_3
|
||||
Periodic_4_hyperbolic_triangulation_2
|
||||
Point_set_2
|
||||
Point_set_3
|
||||
Point_set_processing_3
|
||||
Poisson_surface_reconstruction_3
|
||||
Polygon
|
||||
Polygon_mesh_processing
|
||||
Polygonal_surface_reconstruction
|
||||
Polyhedron
|
||||
Polyhedron_IO
|
||||
Polyline_simplification_2
|
||||
Polynomial
|
||||
Polytope_distance_d
|
||||
Principal_component_analysis
|
||||
Principal_component_analysis_LGPL
|
||||
Profiling_tools
|
||||
Property_map
|
||||
QP_solver
|
||||
Random_numbers
|
||||
Ridges_3
|
||||
STL_Extension
|
||||
Scale_space_reconstruction_3
|
||||
Scripts
|
||||
SearchStructures
|
||||
Segment_Delaunay_graph_2
|
||||
Segment_Delaunay_graph_Linf_2
|
||||
Set_movable_separability_2
|
||||
Shape_detection
|
||||
Skin_surface_3
|
||||
Snap_rounding_2
|
||||
Solver_interface
|
||||
Spatial_searching
|
||||
Spatial_sorting
|
||||
Straight_skeleton_2
|
||||
Stream_lines_2
|
||||
Stream_support
|
||||
Subdivision_method_3
|
||||
Surface_mesh
|
||||
Surface_mesh_approximation
|
||||
Surface_mesh_deformation
|
||||
Surface_mesh_parameterization
|
||||
Surface_mesh_segmentation
|
||||
Surface_mesh_shortest_path
|
||||
Surface_mesh_simplification
|
||||
Surface_mesh_skeletonization
|
||||
Surface_mesh_topology
|
||||
Surface_mesher
|
||||
Surface_sweep_2
|
||||
TDS_2
|
||||
TDS_3
|
||||
Testsuite
|
||||
Three
|
||||
Triangulation
|
||||
Triangulation_2
|
||||
Triangulation_3
|
||||
Union_find
|
||||
Visibility_2
|
||||
Voronoi_diagram_2
|
||||
wininst
|
||||
AABB_tree
|
||||
Advancing_front_surface_reconstruction
|
||||
Algebraic_foundations
|
||||
Algebraic_kernel_d
|
||||
Algebraic_kernel_for_circles
|
||||
Algebraic_kernel_for_spheres
|
||||
Alpha_shapes_2
|
||||
Alpha_shapes_3
|
||||
Apollonius_graph_2
|
||||
Arithmetic_kernel
|
||||
Arrangement_on_surface_2
|
||||
BGL
|
||||
Barycentric_coordinates_2
|
||||
Boolean_set_operations_2
|
||||
Bounding_volumes
|
||||
Box_intersection_d
|
||||
CGAL_Core
|
||||
CGAL_ImageIO
|
||||
CGAL_ipelets
|
||||
Cartesian_kernel
|
||||
Circular_kernel_2
|
||||
Circular_kernel_3
|
||||
Circulator
|
||||
Classification
|
||||
Combinatorial_map
|
||||
Cone_spanners_2
|
||||
Convex_decomposition_3
|
||||
Convex_hull_2
|
||||
Convex_hull_3
|
||||
Convex_hull_d
|
||||
Distance_2
|
||||
Distance_3
|
||||
Envelope_2
|
||||
Envelope_3
|
||||
Filtered_kernel
|
||||
Generalized_map
|
||||
Generator
|
||||
Geomview
|
||||
GraphicsView
|
||||
HalfedgeDS
|
||||
Hash_map
|
||||
Heat_method_3
|
||||
Homogeneous_kernel
|
||||
Hyperbolic_triangulation_2
|
||||
Inscribed_areas
|
||||
Installation
|
||||
Interpolation
|
||||
Intersections_2
|
||||
Intersections_3
|
||||
Interval_skip_list
|
||||
Interval_support
|
||||
Inventor
|
||||
Jet_fitting_3
|
||||
Kernel_23
|
||||
Kernel_d
|
||||
LEDA
|
||||
Linear_cell_complex
|
||||
MacOSX
|
||||
Maintenance
|
||||
Matrix_search
|
||||
Mesh_2
|
||||
Mesh_3
|
||||
Mesher_level
|
||||
Minkowski_sum_2
|
||||
Minkowski_sum_3
|
||||
Modifier
|
||||
Modular_arithmetic
|
||||
Nef_2
|
||||
Nef_3
|
||||
Nef_S2
|
||||
NewKernel_d
|
||||
Number_types
|
||||
OpenNL
|
||||
Optimal_transportation_reconstruction_2
|
||||
Optimisation_basic
|
||||
Partition_2
|
||||
Periodic_2_triangulation_2
|
||||
Periodic_3_mesh_3
|
||||
Periodic_3_triangulation_3
|
||||
Periodic_4_hyperbolic_triangulation_2
|
||||
Point_set_2
|
||||
Point_set_3
|
||||
Point_set_processing_3
|
||||
Poisson_surface_reconstruction_3
|
||||
Polygon
|
||||
Polygon_mesh_processing
|
||||
Polygonal_surface_reconstruction
|
||||
Polyhedron
|
||||
Polyhedron_IO
|
||||
Polyline_simplification_2
|
||||
Polynomial
|
||||
Polytope_distance_d
|
||||
Principal_component_analysis
|
||||
Principal_component_analysis_LGPL
|
||||
Profiling_tools
|
||||
Property_map
|
||||
QP_solver
|
||||
Random_numbers
|
||||
Ridges_3
|
||||
STL_Extension
|
||||
Scale_space_reconstruction_3
|
||||
Scripts
|
||||
SearchStructures
|
||||
Segment_Delaunay_graph_2
|
||||
Segment_Delaunay_graph_Linf_2
|
||||
Set_movable_separability_2
|
||||
Shape_detection
|
||||
Skin_surface_3
|
||||
Snap_rounding_2
|
||||
Solver_interface
|
||||
Spatial_searching
|
||||
Spatial_sorting
|
||||
Straight_skeleton_2
|
||||
Stream_lines_2
|
||||
Stream_support
|
||||
Subdivision_method_3
|
||||
Surface_mesh
|
||||
Surface_mesh_approximation
|
||||
Surface_mesh_deformation
|
||||
Surface_mesh_parameterization
|
||||
Surface_mesh_segmentation
|
||||
Surface_mesh_shortest_path
|
||||
Surface_mesh_simplification
|
||||
Surface_mesh_skeletonization
|
||||
Surface_mesh_topology
|
||||
Surface_mesher
|
||||
Surface_sweep_2
|
||||
TDS_2
|
||||
TDS_3
|
||||
Testsuite
|
||||
Three
|
||||
Triangulation
|
||||
Triangulation_2
|
||||
Triangulation_3
|
||||
Union_find
|
||||
Visibility_2
|
||||
Voronoi_diagram_2
|
||||
wininst
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ if ( CGAL_FOUND )
|
|||
include( ${CGAL_USE_FILE} )
|
||||
else ()
|
||||
message(STATUS "This project requires the CGAL library, and will not be compiled.")
|
||||
return()
|
||||
return()
|
||||
|
||||
endif()
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ find_package( Boost REQUIRED )
|
|||
# include for local directory
|
||||
if ( NOT Boost_FOUND )
|
||||
message(STATUS "This project requires the Boost library, and will not be compiled.")
|
||||
return()
|
||||
return()
|
||||
endif()
|
||||
|
||||
# include for local package
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ void naive_test(int k, const char* fname,
|
|||
CGAL::Aff_transformation_3<K> init2(CGAL::TRANSLATION, - K::Vector_3(
|
||||
(box.xmax()-box.xmin()),0,0));
|
||||
PMP::transform(init2, tm2);
|
||||
|
||||
|
||||
tmTree.build();
|
||||
K::Vector_3 unit_vec = (2.0/k * K::Vector_3((box.xmax()-box.xmin()),
|
||||
0,
|
||||
|
|
@ -56,9 +56,9 @@ void naive_test(int k, const char* fname,
|
|||
rot[7] = std::sin(CGAL_PI/4.0);
|
||||
rot[8] = std::cos(CGAL_PI/4.0);
|
||||
CGAL::Aff_transformation_3<K> R(rot[0], rot[1], rot[2],
|
||||
rot[3], rot[4], rot[5],
|
||||
rot[3], rot[4], rot[5],
|
||||
rot[6], rot[7], rot[8]);
|
||||
|
||||
|
||||
CGAL::Side_of_triangle_mesh<Surface_mesh, K> sotm1(tm);
|
||||
for(int i=1; i<k+1; ++i)
|
||||
{
|
||||
|
|
@ -68,10 +68,10 @@ void naive_test(int k, const char* fname,
|
|||
tmTree2.build();
|
||||
if(tmTree2.do_intersect(tmTree))
|
||||
++nb_inter;
|
||||
else
|
||||
else
|
||||
{
|
||||
if(sotm1(tm2.point(*tm2.vertices().begin())) != CGAL::ON_UNBOUNDED_SIDE)
|
||||
{
|
||||
{
|
||||
++nb_include;
|
||||
}
|
||||
else
|
||||
|
|
@ -101,16 +101,16 @@ void test_no_collision(int k, const char* fname,
|
|||
CGAL::Aff_transformation_3<K> init2(CGAL::TRANSLATION, - K::Vector_3(
|
||||
(box.xmax()-box.xmin()),0,0));
|
||||
PMP::transform(init2, tm2);
|
||||
|
||||
|
||||
tmTree.build();
|
||||
tmTree2.build();
|
||||
typedef boost::property_map<Surface_mesh, CGAL::vertex_point_t>::type VPM;
|
||||
VPM vpm2 = get(CGAL::vertex_point, tm2);
|
||||
|
||||
|
||||
K::Vector_3 unit_vec = (2.0/k * K::Vector_3((box.xmax()-box.xmin()),
|
||||
0,
|
||||
0));
|
||||
|
||||
|
||||
CGAL::Side_of_triangle_mesh<Surface_mesh, K,
|
||||
VPM, Tree> sotm1(tmTree);
|
||||
for(int i=1; i<k+1; ++i)
|
||||
|
|
@ -126,7 +126,7 @@ void test_no_collision(int k, const char* fname,
|
|||
rot[7] = std::sin(i*CGAL_PI/4.0);
|
||||
rot[8] = std::cos(i*CGAL_PI/4.0);
|
||||
CGAL::Aff_transformation_3<K> R(rot[0], rot[1], rot[2],
|
||||
rot[3], rot[4], rot[5],
|
||||
rot[3], rot[4], rot[5],
|
||||
rot[6], rot[7], rot[8]);
|
||||
CGAL::Aff_transformation_3<K> T1 = CGAL::Aff_transformation_3<K>(CGAL::TRANSLATION, i*unit_vec);
|
||||
CGAL::Aff_transformation_3<K> transfo = R*T1;
|
||||
|
|
@ -134,10 +134,10 @@ void test_no_collision(int k, const char* fname,
|
|||
CGAL::Interval_nt_advanced::Protector protector;
|
||||
if(tmTree2.do_intersect(tmTree))
|
||||
++nb_inter;
|
||||
else
|
||||
else
|
||||
{
|
||||
if(sotm1(transfo.transform(vpm2[*tm2.vertices().begin()])) != CGAL::ON_UNBOUNDED_SIDE)
|
||||
{
|
||||
{
|
||||
++nb_include;
|
||||
}
|
||||
else
|
||||
|
|
@ -158,7 +158,7 @@ int main(int argc, const char** argv)
|
|||
int k = (argc>1) ? atoi(argv[1]) : 10;
|
||||
const char* path = (argc>2)?argv[2]:"data/handle"
|
||||
".off";
|
||||
|
||||
|
||||
std::cout<< k<<" steps in "<<path<<std::endl;
|
||||
int nb_inter(0), nb_no_inter(0), nb_include(0),
|
||||
naive_inter(0), naive_no_inter(0), naive_include(0);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
|
|||
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" )
|
||||
|
||||
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
|
||||
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
|
||||
#${CGAL_Qt5_MOC_FILES}
|
||||
)
|
||||
# Link with Qt libraries
|
||||
|
|
|
|||
|
|
@ -4,103 +4,103 @@
|
|||
class Color_ramp
|
||||
{
|
||||
private :
|
||||
int m_nodes[256];
|
||||
unsigned char m_colors[4][256];
|
||||
int m_nodes[256];
|
||||
unsigned char m_colors[4][256];
|
||||
|
||||
public :
|
||||
Color_ramp()
|
||||
{
|
||||
build_thermal();
|
||||
}
|
||||
~Color_ramp() {}
|
||||
Color_ramp()
|
||||
{
|
||||
build_thermal();
|
||||
}
|
||||
~Color_ramp() {}
|
||||
|
||||
public :
|
||||
unsigned char r(unsigned int index) const { return m_colors[0][index%256]; }
|
||||
unsigned char g(unsigned int index) const { return m_colors[1][index%256]; }
|
||||
unsigned char b(unsigned int index) const { return m_colors[2][index%256]; }
|
||||
unsigned char r(unsigned int index) const { return m_colors[0][index%256]; }
|
||||
unsigned char g(unsigned int index) const { return m_colors[1][index%256]; }
|
||||
unsigned char b(unsigned int index) const { return m_colors[2][index%256]; }
|
||||
|
||||
private:
|
||||
|
||||
void rebuild()
|
||||
{
|
||||
// build nodes
|
||||
m_colors[3][0] = 1;
|
||||
m_colors[3][255] = 1;
|
||||
unsigned int nb_nodes = 0;
|
||||
for(int i=0;i<256;i++)
|
||||
{
|
||||
if(m_colors[3][i])
|
||||
{
|
||||
m_nodes[nb_nodes] = i;
|
||||
nb_nodes++;
|
||||
}
|
||||
}
|
||||
void rebuild()
|
||||
{
|
||||
// build nodes
|
||||
m_colors[3][0] = 1;
|
||||
m_colors[3][255] = 1;
|
||||
unsigned int nb_nodes = 0;
|
||||
for(int i=0;i<256;i++)
|
||||
{
|
||||
if(m_colors[3][i])
|
||||
{
|
||||
m_nodes[nb_nodes] = i;
|
||||
nb_nodes++;
|
||||
}
|
||||
}
|
||||
|
||||
// build color_ramp
|
||||
for(int k=0;k<3;k++)
|
||||
for(unsigned int i=0;i<(nb_nodes-1);i++)
|
||||
{
|
||||
int x1 = m_nodes[i];
|
||||
int x2 = m_nodes[i+1];
|
||||
int y1 = m_colors[k][x1];
|
||||
int y2 = m_colors[k][x2];
|
||||
float a = (float)(y2-y1) / (float)(x2-x1);
|
||||
float b = (float)y1 - a*(float)x1;
|
||||
for(int j=x1;j<x2;j++)
|
||||
m_colors[k][j] = (unsigned char)(a*(float)j+b);
|
||||
}
|
||||
}
|
||||
// build color_ramp
|
||||
for(int k=0;k<3;k++)
|
||||
for(unsigned int i=0;i<(nb_nodes-1);i++)
|
||||
{
|
||||
int x1 = m_nodes[i];
|
||||
int x2 = m_nodes[i+1];
|
||||
int y1 = m_colors[k][x1];
|
||||
int y2 = m_colors[k][x2];
|
||||
float a = (float)(y2-y1) / (float)(x2-x1);
|
||||
float b = (float)y1 - a*(float)x1;
|
||||
for(int j=x1;j<x2;j++)
|
||||
m_colors[k][j] = (unsigned char)(a*(float)j+b);
|
||||
}
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
for(int i=1;i<=254;i++)
|
||||
m_colors[3][i] = 0;
|
||||
m_colors[3][0] = 1;
|
||||
m_colors[3][255] = 1;
|
||||
}
|
||||
void reset()
|
||||
{
|
||||
for(int i=1;i<=254;i++)
|
||||
m_colors[3][i] = 0;
|
||||
m_colors[3][0] = 1;
|
||||
m_colors[3][255] = 1;
|
||||
}
|
||||
|
||||
public:
|
||||
void add_node(unsigned int index,
|
||||
unsigned char r,
|
||||
unsigned char g,
|
||||
unsigned char b)
|
||||
{
|
||||
m_colors[3][index] = 1;
|
||||
m_colors[0][index] = r;
|
||||
m_colors[1][index] = g;
|
||||
m_colors[2][index] = b;
|
||||
}
|
||||
void add_node(unsigned int index,
|
||||
unsigned char r,
|
||||
unsigned char g,
|
||||
unsigned char b)
|
||||
{
|
||||
m_colors[3][index] = 1;
|
||||
m_colors[0][index] = r;
|
||||
m_colors[1][index] = g;
|
||||
m_colors[2][index] = b;
|
||||
}
|
||||
|
||||
void build_red()
|
||||
{
|
||||
reset();
|
||||
m_colors[3][0] = 1;m_colors[0][0] = 128;m_colors[1][0] = 0;m_colors[2][0] = 0;
|
||||
m_colors[3][80] = 1;m_colors[0][80] = 255;m_colors[1][80] = 0;m_colors[2][80] = 0;
|
||||
m_colors[3][160] = 1;m_colors[0][160] = 255;m_colors[1][160] = 128;m_colors[2][160] = 0;
|
||||
m_colors[3][255] = 1;m_colors[0][255] = 255;m_colors[1][255] = 255;m_colors[2][255] = 255;
|
||||
rebuild();
|
||||
}
|
||||
void build_red()
|
||||
{
|
||||
reset();
|
||||
m_colors[3][0] = 1;m_colors[0][0] = 128;m_colors[1][0] = 0;m_colors[2][0] = 0;
|
||||
m_colors[3][80] = 1;m_colors[0][80] = 255;m_colors[1][80] = 0;m_colors[2][80] = 0;
|
||||
m_colors[3][160] = 1;m_colors[0][160] = 255;m_colors[1][160] = 128;m_colors[2][160] = 0;
|
||||
m_colors[3][255] = 1;m_colors[0][255] = 255;m_colors[1][255] = 255;m_colors[2][255] = 255;
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void build_thermal()
|
||||
{
|
||||
reset();
|
||||
m_colors[3][0] = 1;m_colors[0][0] = 0;m_colors[1][0] = 0;m_colors[2][0] = 0;
|
||||
m_colors[3][70] = 1;m_colors[0][70] = 128;m_colors[1][70] = 0;m_colors[2][70] = 0;
|
||||
m_colors[3][165] = 1;m_colors[0][165] = 255;m_colors[1][165] = 128;m_colors[2][165] = 0;
|
||||
m_colors[3][240] = 1;m_colors[0][240] = 255;m_colors[1][240] = 191;m_colors[2][240] = 128;
|
||||
m_colors[3][255] = 1;m_colors[0][255] = 255;m_colors[1][255] = 255;m_colors[2][255] = 255;
|
||||
rebuild();
|
||||
}
|
||||
void build_thermal()
|
||||
{
|
||||
reset();
|
||||
m_colors[3][0] = 1;m_colors[0][0] = 0;m_colors[1][0] = 0;m_colors[2][0] = 0;
|
||||
m_colors[3][70] = 1;m_colors[0][70] = 128;m_colors[1][70] = 0;m_colors[2][70] = 0;
|
||||
m_colors[3][165] = 1;m_colors[0][165] = 255;m_colors[1][165] = 128;m_colors[2][165] = 0;
|
||||
m_colors[3][240] = 1;m_colors[0][240] = 255;m_colors[1][240] = 191;m_colors[2][240] = 128;
|
||||
m_colors[3][255] = 1;m_colors[0][255] = 255;m_colors[1][255] = 255;m_colors[2][255] = 255;
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void build_blue()
|
||||
{
|
||||
reset();
|
||||
m_colors[3][0] = 1;m_colors[0][0] = 0;m_colors[1][0] = 0;m_colors[2][0] = 128;
|
||||
m_colors[3][80] = 1;m_colors[0][80] = 0;m_colors[1][80] = 0;m_colors[2][80] = 255;
|
||||
m_colors[3][160] = 1;m_colors[0][160] = 0;m_colors[1][160] = 255;m_colors[2][160] = 255;
|
||||
m_colors[3][255] = 1;m_colors[0][255] = 255;m_colors[1][255] = 255;m_colors[2][255] = 255;
|
||||
rebuild();
|
||||
}
|
||||
void build_blue()
|
||||
{
|
||||
reset();
|
||||
m_colors[3][0] = 1;m_colors[0][0] = 0;m_colors[1][0] = 0;m_colors[2][0] = 128;
|
||||
m_colors[3][80] = 1;m_colors[0][80] = 0;m_colors[1][80] = 0;m_colors[2][80] = 255;
|
||||
m_colors[3][160] = 1;m_colors[0][160] = 0;m_colors[1][160] = 255;m_colors[2][160] = 255;
|
||||
m_colors[3][255] = 1;m_colors[0][255] = 255;m_colors[1][255] = 255;m_colors[2][255] = 255;
|
||||
rebuild();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _COLOR_RAMP_H
|
||||
|
|
|
|||
|
|
@ -16,288 +16,288 @@
|
|||
MainWindow::MainWindow(QWidget* parent)
|
||||
: CGAL::Qt::DemosMainWindow(parent)
|
||||
{
|
||||
ui = new Ui::MainWindow;
|
||||
ui->setupUi(this);
|
||||
ui = new Ui::MainWindow;
|
||||
ui->setupUi(this);
|
||||
|
||||
// saves some pointers from ui, for latter use.
|
||||
m_pViewer = ui->viewer;
|
||||
// saves some pointers from ui, for latter use.
|
||||
m_pViewer = ui->viewer;
|
||||
|
||||
// does not save the state of the viewer
|
||||
m_pViewer->setStateFileName(QString());
|
||||
// does not save the state of the viewer
|
||||
m_pViewer->setStateFileName(QString());
|
||||
|
||||
// accepts drop events
|
||||
setAcceptDrops(true);
|
||||
// setups scene
|
||||
// accepts drop events
|
||||
setAcceptDrops(true);
|
||||
// setups scene
|
||||
m_pScene = new Scene();
|
||||
m_pViewer->setScene(m_pScene);
|
||||
m_pViewer->setScene(m_pScene);
|
||||
m_pViewer->setManipulatedFrame(m_pScene->manipulatedFrame());
|
||||
|
||||
// connects actionQuit (Ctrl+Q) and qApp->quit()
|
||||
connect(ui->actionQuit, SIGNAL(triggered()),
|
||||
this, SLOT(quit()));
|
||||
// connects actionQuit (Ctrl+Q) and qApp->quit()
|
||||
connect(ui->actionQuit, SIGNAL(triggered()),
|
||||
this, SLOT(quit()));
|
||||
|
||||
this->addRecentFiles(ui->menuFile, ui->actionQuit);
|
||||
connect(this, SIGNAL(openRecentFile(QString)),
|
||||
this, SLOT(open(QString)));
|
||||
this->addRecentFiles(ui->menuFile, ui->actionQuit);
|
||||
connect(this, SIGNAL(openRecentFile(QString)),
|
||||
this, SLOT(open(QString)));
|
||||
|
||||
readSettings();
|
||||
readSettings();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
if (event->mimeData()->hasFormat("text/uri-list"))
|
||||
event->acceptProposedAction();
|
||||
if (event->mimeData()->hasFormat("text/uri-list"))
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
void MainWindow::dropEvent(QDropEvent *event)
|
||||
{
|
||||
Q_FOREACH(QUrl url, event->mimeData()->urls()) {
|
||||
QString filename = url.toLocalFile();
|
||||
if(!filename.isEmpty()) {
|
||||
QTextStream(stderr) << QString("dropEvent(\"%1\")\n").arg(filename);
|
||||
open(filename);
|
||||
}
|
||||
}
|
||||
event->acceptProposedAction();
|
||||
Q_FOREACH(QUrl url, event->mimeData()->urls()) {
|
||||
QString filename = url.toLocalFile();
|
||||
if(!filename.isEmpty()) {
|
||||
QTextStream(stderr) << QString("dropEvent(\"%1\")\n").arg(filename);
|
||||
open(filename);
|
||||
}
|
||||
}
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
void MainWindow::updateViewerBBox()
|
||||
{
|
||||
m_pScene->update_bbox();
|
||||
const Scene::Bbox bbox = m_pScene->bbox();
|
||||
const double xmin = bbox.xmin();
|
||||
const double ymin = bbox.ymin();
|
||||
const double zmin = bbox.zmin();
|
||||
const double xmax = bbox.xmax();
|
||||
const double ymax = bbox.ymax();
|
||||
const double zmax = bbox.zmax();
|
||||
CGAL::qglviewer::Vec
|
||||
vec_min(xmin, ymin, zmin),
|
||||
vec_max(xmax, ymax, zmax);
|
||||
m_pViewer->setSceneBoundingBox(vec_min,vec_max);
|
||||
m_pViewer->camera()->showEntireScene();
|
||||
m_pScene->update_bbox();
|
||||
const Scene::Bbox bbox = m_pScene->bbox();
|
||||
const double xmin = bbox.xmin();
|
||||
const double ymin = bbox.ymin();
|
||||
const double zmin = bbox.zmin();
|
||||
const double xmax = bbox.xmax();
|
||||
const double ymax = bbox.ymax();
|
||||
const double zmax = bbox.zmax();
|
||||
CGAL::qglviewer::Vec
|
||||
vec_min(xmin, ymin, zmin),
|
||||
vec_max(xmax, ymax, zmax);
|
||||
m_pViewer->setSceneBoundingBox(vec_min,vec_max);
|
||||
m_pViewer->camera()->showEntireScene();
|
||||
}
|
||||
|
||||
void MainWindow::open(QString filename)
|
||||
{
|
||||
QFileInfo fileinfo(filename);
|
||||
if(fileinfo.isFile() && fileinfo.isReadable())
|
||||
{
|
||||
int index = m_pScene->open(filename);
|
||||
if(index >= 0)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("OFF open directory",
|
||||
fileinfo.absoluteDir().absolutePath());
|
||||
this->addToRecentFiles(filename);
|
||||
QFileInfo fileinfo(filename);
|
||||
if(fileinfo.isFile() && fileinfo.isReadable())
|
||||
{
|
||||
int index = m_pScene->open(filename);
|
||||
if(index >= 0)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("OFF open directory",
|
||||
fileinfo.absoluteDir().absolutePath());
|
||||
this->addToRecentFiles(filename);
|
||||
|
||||
// update bbox
|
||||
updateViewerBBox();
|
||||
// update bbox
|
||||
updateViewerBBox();
|
||||
m_pViewer->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::readSettings()
|
||||
{
|
||||
this->readState("MainWindow", Size|State);
|
||||
this->readState("MainWindow", Size|State);
|
||||
}
|
||||
|
||||
void MainWindow::writeSettings()
|
||||
{
|
||||
this->writeState("MainWindow");
|
||||
std::cerr << "Write setting... done.\n";
|
||||
this->writeState("MainWindow");
|
||||
std::cerr << "Write setting... done.\n";
|
||||
}
|
||||
|
||||
void MainWindow::quit()
|
||||
{
|
||||
writeSettings();
|
||||
close();
|
||||
writeSettings();
|
||||
close();
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
writeSettings();
|
||||
event->accept();
|
||||
writeSettings();
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionLoadPolyhedron_triggered()
|
||||
{
|
||||
QSettings settings;
|
||||
QString directory = settings.value("OFF open directory",
|
||||
QDir::current().dirName()).toString();
|
||||
QStringList filenames =
|
||||
QFileDialog::getOpenFileNames(this,
|
||||
tr("Load polyhedron..."),
|
||||
directory,
|
||||
tr("OFF files (*.off)\n"
|
||||
"All files (*)"));
|
||||
if(!filenames.isEmpty()) {
|
||||
Q_FOREACH(QString filename, filenames) {
|
||||
open(filename);
|
||||
}
|
||||
}
|
||||
QSettings settings;
|
||||
QString directory = settings.value("OFF open directory",
|
||||
QDir::current().dirName()).toString();
|
||||
QStringList filenames =
|
||||
QFileDialog::getOpenFileNames(this,
|
||||
tr("Load polyhedron..."),
|
||||
directory,
|
||||
tr("OFF files (*.off)\n"
|
||||
"All files (*)"));
|
||||
if(!filenames.isEmpty()) {
|
||||
Q_FOREACH(QString filename, filenames) {
|
||||
open(filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::setAddKeyFrameKeyboardModifiers(::Qt::KeyboardModifiers m)
|
||||
{
|
||||
m_pViewer->setAddKeyFrameKeyboardModifiers(m);
|
||||
m_pViewer->setAddKeyFrameKeyboardModifiers(m);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionInside_points_triggered()
|
||||
{
|
||||
bool ok;
|
||||
|
||||
const unsigned int nb_points = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Points",
|
||||
"#Points:",10000,1,100000000,9,&ok);
|
||||
bool ok;
|
||||
|
||||
if(!ok)
|
||||
return;
|
||||
const unsigned int nb_points = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Points",
|
||||
"#Points:",10000,1,100000000,9,&ok);
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_inside_points(nb_points);
|
||||
QApplication::restoreOverrideCursor();
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_inside_points(nb_points);
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionPoints_in_interval_triggered()
|
||||
{
|
||||
bool ok;
|
||||
|
||||
const unsigned int nb_points = (unsigned)
|
||||
bool ok;
|
||||
|
||||
const unsigned int nb_points = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Points",
|
||||
"#Points:",10000,1,100000000,9,&ok);
|
||||
"#Points:",10000,1,100000000,9,&ok);
|
||||
|
||||
if(!ok)
|
||||
return;
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
const double min =
|
||||
QInputDialog::getDouble(NULL, "min",
|
||||
"Min:",-0.1,-1000.0,1000.0,9,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
const double max =
|
||||
QInputDialog::getDouble(NULL, "max",
|
||||
"Max:",0.1,-1000.0,1000.0,9,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
const double min =
|
||||
QInputDialog::getDouble(NULL, "min",
|
||||
"Min:",-0.1,-1000.0,1000.0,9,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
const double max =
|
||||
QInputDialog::getDouble(NULL, "max",
|
||||
"Max:",0.1,-1000.0,1000.0,9,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_points_in(nb_points,min,max);
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_points_in(nb_points,min,max);
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionBoundary_segments_triggered()
|
||||
{
|
||||
bool ok;
|
||||
|
||||
const unsigned int nb_slices = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Slices",
|
||||
"Slices:",100,1,1000000,8,&ok);
|
||||
bool ok;
|
||||
|
||||
if(!ok)
|
||||
return;
|
||||
const unsigned int nb_slices = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Slices",
|
||||
"Slices:",100,1,1000000,8,&ok);
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_boundary_segments(nb_slices);
|
||||
QApplication::restoreOverrideCursor();
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_boundary_segments(nb_slices);
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionBoundary_points_triggered()
|
||||
{
|
||||
bool ok;
|
||||
bool ok;
|
||||
|
||||
const unsigned int nb_points = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Points",
|
||||
"Points:",1000,1,10000000,8,&ok);
|
||||
const unsigned int nb_points = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Points",
|
||||
"Points:",1000,1,10000000,8,&ok);
|
||||
|
||||
if(!ok)
|
||||
return;
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_boundary_points(nb_points);
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_boundary_points(nb_points);
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEdge_points_triggered()
|
||||
{
|
||||
bool ok;
|
||||
bool ok;
|
||||
|
||||
const unsigned int nb_points = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Points",
|
||||
"Points:",1000,1,10000000,8,&ok);
|
||||
const unsigned int nb_points = (unsigned)
|
||||
QInputDialog::getInt(NULL, "#Points",
|
||||
"Points:",1000,1,10000000,8,&ok);
|
||||
|
||||
if(!ok)
|
||||
return;
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_edge_points(nb_points);
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->generate_edge_points(nb_points);
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionBench_distances_triggered()
|
||||
{
|
||||
bool ok;
|
||||
const double duration = QInputDialog::getDouble(NULL, "Duration",
|
||||
"Duration (s):",1.0,0.01,1000,8,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
bool ok;
|
||||
const double duration = QInputDialog::getDouble(NULL, "Duration",
|
||||
"Duration (s):",1.0,0.01,1000,8,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
std::cout << std::endl << "Benchmark distances" << std::endl;
|
||||
m_pScene->benchmark_distances(duration);
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
std::cout << std::endl << "Benchmark distances" << std::endl;
|
||||
m_pScene->benchmark_distances(duration);
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionBench_intersections_triggered()
|
||||
{
|
||||
bool ok;
|
||||
const double duration = QInputDialog::getDouble(NULL, "Duration",
|
||||
"Duration (s):",1.0,0.01,1000.0,8,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
bool ok;
|
||||
const double duration = QInputDialog::getDouble(NULL, "Duration",
|
||||
"Duration (s):",1.0,0.01,1000.0,8,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
std::cout << std::endl << "Benchmark intersections" << std::endl;
|
||||
m_pScene->benchmark_intersections(duration);
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
std::cout << std::endl << "Benchmark intersections" << std::endl;
|
||||
m_pScene->benchmark_intersections(duration);
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionUnsigned_distance_function_to_facets_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->activate_cutting_plane();
|
||||
m_pScene->unsigned_distance_function();
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pScene->unsigned_distance_function();
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionUnsigned_distance_function_to_edges_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->activate_cutting_plane();
|
||||
m_pScene->unsigned_distance_function_to_edges();
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pScene->unsigned_distance_function_to_edges();
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionSigned_distance_function_to_facets_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->activate_cutting_plane();
|
||||
m_pScene->signed_distance_function();
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pScene->signed_distance_function();
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
|
|
@ -318,19 +318,19 @@ void MainWindow::on_actionCutting_plane_none_triggered()
|
|||
|
||||
void MainWindow::on_actionView_polyhedron_triggered()
|
||||
{
|
||||
m_pScene->toggle_view_poyhedron();
|
||||
m_pScene->toggle_view_poyhedron();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionView_points_triggered()
|
||||
{
|
||||
m_pScene->toggle_view_points();
|
||||
m_pScene->toggle_view_points();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionView_segments_triggered()
|
||||
{
|
||||
m_pScene->toggle_view_segments();
|
||||
m_pScene->toggle_view_segments();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
|
|
@ -342,13 +342,13 @@ void MainWindow::on_actionView_cutting_plane_triggered()
|
|||
|
||||
void MainWindow::on_actionClear_points_triggered()
|
||||
{
|
||||
m_pScene->clear_points();
|
||||
m_pScene->clear_points();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionClear_segments_triggered()
|
||||
{
|
||||
m_pScene->clear_segments();
|
||||
m_pScene->clear_segments();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
|
|
@ -360,52 +360,52 @@ void MainWindow::on_actionClear_cutting_plane_triggered()
|
|||
|
||||
void MainWindow::on_actionRefine_bisection_triggered()
|
||||
{
|
||||
bool ok;
|
||||
const double max_len =
|
||||
QInputDialog::getDouble(NULL, "Max edge len",
|
||||
"Max edge len:",0.1,0.001,100.0,9,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
bool ok;
|
||||
const double max_len =
|
||||
QInputDialog::getDouble(NULL, "Max edge len",
|
||||
"Max edge len:",0.1,0.001,100.0,9,&ok);
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->refine_bisection(max_len * max_len);
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->refine_bisection(max_len * max_len);
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionBench_memory_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->bench_memory();
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->bench_memory();
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionBench_construction_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->bench_construction();
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->bench_construction();
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionBench_intersections_vs_nbt_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->bench_intersections_vs_nbt();
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->bench_intersections_vs_nbt();
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionBench_distances_vs_nbt_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->bench_distances_vs_nbt();
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->bench_distances_vs_nbt();
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionRefine_loop_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->refine_loop();
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->refine_loop();
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_pViewer->update();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,79 +9,79 @@ class QDropEvent;
|
|||
class Scene;
|
||||
class Viewer;
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
|
||||
class MainWindow :
|
||||
public CGAL::Qt::DemosMainWindow
|
||||
class MainWindow :
|
||||
public CGAL::Qt::DemosMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
MainWindow(QWidget* parent = 0);
|
||||
~MainWindow();
|
||||
MainWindow(QWidget* parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
public slots:
|
||||
void updateViewerBBox();
|
||||
void open(QString filename);
|
||||
void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers);
|
||||
public slots:
|
||||
void updateViewerBBox();
|
||||
void open(QString filename);
|
||||
void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers);
|
||||
|
||||
protected slots:
|
||||
protected slots:
|
||||
|
||||
// settings
|
||||
void quit();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
// settings
|
||||
void quit();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
// drag & drop
|
||||
void dropEvent(QDropEvent *event);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
// drag & drop
|
||||
void dropEvent(QDropEvent *event);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
|
||||
// file menu
|
||||
void on_actionLoadPolyhedron_triggered();
|
||||
// file menu
|
||||
void on_actionLoadPolyhedron_triggered();
|
||||
|
||||
// edit menu
|
||||
// edit menu
|
||||
void on_actionSave_snapshot_triggered();
|
||||
void on_actionCopy_snapshot_triggered();
|
||||
void on_actionClear_points_triggered();
|
||||
void on_actionClear_segments_triggered();
|
||||
void on_actionClear_points_triggered();
|
||||
void on_actionClear_segments_triggered();
|
||||
void on_actionClear_cutting_plane_triggered();
|
||||
|
||||
// algorithm menu
|
||||
// algorithm menu
|
||||
void on_actionRefine_loop_triggered();
|
||||
void on_actionEdge_points_triggered();
|
||||
void on_actionInside_points_triggered();
|
||||
void on_actionBoundary_points_triggered();
|
||||
void on_actionRefine_bisection_triggered();
|
||||
void on_actionBoundary_segments_triggered();
|
||||
void on_actionEdge_points_triggered();
|
||||
void on_actionInside_points_triggered();
|
||||
void on_actionBoundary_points_triggered();
|
||||
void on_actionRefine_bisection_triggered();
|
||||
void on_actionBoundary_segments_triggered();
|
||||
void on_actionPoints_in_interval_triggered();
|
||||
void on_actionSigned_distance_function_to_facets_triggered();
|
||||
void on_actionUnsigned_distance_function_to_edges_triggered();
|
||||
void on_actionUnsigned_distance_function_to_facets_triggered();
|
||||
void on_actionSigned_distance_function_to_facets_triggered();
|
||||
void on_actionUnsigned_distance_function_to_edges_triggered();
|
||||
void on_actionUnsigned_distance_function_to_facets_triggered();
|
||||
void on_actionIntersection_cutting_plane_triggered();
|
||||
void on_actionCutting_plane_none_triggered();
|
||||
|
||||
// benchmark menu
|
||||
void on_actionBench_memory_triggered();
|
||||
void on_actionBench_distances_triggered();
|
||||
void on_actionBench_intersections_triggered();
|
||||
// benchmark menu
|
||||
void on_actionBench_memory_triggered();
|
||||
void on_actionBench_distances_triggered();
|
||||
void on_actionBench_intersections_triggered();
|
||||
|
||||
// benchmark against #triangles
|
||||
void on_actionBench_construction_triggered();
|
||||
void on_actionBench_distances_vs_nbt_triggered();
|
||||
void on_actionBench_intersections_vs_nbt_triggered();
|
||||
// benchmark against #triangles
|
||||
void on_actionBench_construction_triggered();
|
||||
void on_actionBench_distances_vs_nbt_triggered();
|
||||
void on_actionBench_intersections_vs_nbt_triggered();
|
||||
|
||||
// view menu
|
||||
void on_actionView_points_triggered();
|
||||
void on_actionView_segments_triggered();
|
||||
void on_actionView_polyhedron_triggered();
|
||||
// view menu
|
||||
void on_actionView_points_triggered();
|
||||
void on_actionView_segments_triggered();
|
||||
void on_actionView_polyhedron_triggered();
|
||||
void on_actionView_cutting_plane_triggered();
|
||||
|
||||
private:
|
||||
Scene* m_pScene;
|
||||
Viewer* m_pViewer;
|
||||
Ui::MainWindow* ui;
|
||||
Scene* m_pScene;
|
||||
Viewer* m_pViewer;
|
||||
Ui::MainWindow* ui;
|
||||
};
|
||||
|
||||
#endif // ifndef MAINWINDOW_H
|
||||
|
|
|
|||
|
|
@ -5,190 +5,190 @@
|
|||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <queue>
|
||||
|
||||
template <class Kernel, class Polyhedron>
|
||||
template <class Kernel, class Polyhedron>
|
||||
class CEdge
|
||||
{
|
||||
public:
|
||||
typedef typename Kernel::FT FT;
|
||||
typedef typename Polyhedron::Halfedge_handle Halfedge_handle;
|
||||
typedef typename Kernel::FT FT;
|
||||
typedef typename Polyhedron::Halfedge_handle Halfedge_handle;
|
||||
|
||||
private:
|
||||
FT m_sqlen;
|
||||
Halfedge_handle m_he;
|
||||
FT m_sqlen;
|
||||
Halfedge_handle m_he;
|
||||
|
||||
public:
|
||||
// life cycle
|
||||
CEdge(const Halfedge_handle& he)
|
||||
{
|
||||
m_sqlen = squared_len(he);
|
||||
m_he = he;
|
||||
}
|
||||
CEdge(const CEdge& edge)
|
||||
: m_sqlen(edge.sqlen()),
|
||||
m_he(edge.he())
|
||||
{
|
||||
}
|
||||
~CEdge() {}
|
||||
// life cycle
|
||||
CEdge(const Halfedge_handle& he)
|
||||
{
|
||||
m_sqlen = squared_len(he);
|
||||
m_he = he;
|
||||
}
|
||||
CEdge(const CEdge& edge)
|
||||
: m_sqlen(edge.sqlen()),
|
||||
m_he(edge.he())
|
||||
{
|
||||
}
|
||||
~CEdge() {}
|
||||
|
||||
public:
|
||||
// squared length of an edge
|
||||
static FT squared_len(Halfedge_handle he)
|
||||
{
|
||||
return CGAL::squared_distance(he->vertex()->point(),
|
||||
he->opposite()->vertex()->point());
|
||||
}
|
||||
// squared length of an edge
|
||||
static FT squared_len(Halfedge_handle he)
|
||||
{
|
||||
return CGAL::squared_distance(he->vertex()->point(),
|
||||
he->opposite()->vertex()->point());
|
||||
}
|
||||
|
||||
public:
|
||||
// accessors
|
||||
FT& sqlen() { return m_sqlen; }
|
||||
const FT sqlen() const { return m_sqlen; }
|
||||
// accessors
|
||||
FT& sqlen() { return m_sqlen; }
|
||||
const FT sqlen() const { return m_sqlen; }
|
||||
|
||||
Halfedge_handle he() { return m_he; }
|
||||
const Halfedge_handle he() const { return m_he; }
|
||||
Halfedge_handle he() { return m_he; }
|
||||
const Halfedge_handle he() const { return m_he; }
|
||||
};
|
||||
|
||||
// functor for priority queue
|
||||
template<class Edge>
|
||||
struct less // read more priority
|
||||
{
|
||||
bool operator()(const Edge& e1,
|
||||
const Edge& e2) const
|
||||
{
|
||||
return e1.sqlen() < e2.sqlen();
|
||||
}
|
||||
{
|
||||
bool operator()(const Edge& e1,
|
||||
const Edge& e2) const
|
||||
{
|
||||
return e1.sqlen() < e2.sqlen();
|
||||
}
|
||||
};
|
||||
|
||||
template <class Kernel, class Polyhedron>
|
||||
template <class Kernel, class Polyhedron>
|
||||
class Refiner
|
||||
{
|
||||
// types
|
||||
typedef typename Kernel::FT FT;
|
||||
typedef CEdge<Kernel, Polyhedron> Edge;
|
||||
typedef typename Polyhedron::Halfedge_handle Halfedge_handle;
|
||||
typedef typename Polyhedron::Edge_iterator Edge_iterator;
|
||||
typedef std::priority_queue<Edge,
|
||||
std::vector<Edge>,
|
||||
::less<Edge> > PQueue;
|
||||
// data
|
||||
PQueue m_queue;
|
||||
Polyhedron* m_pMesh;
|
||||
// types
|
||||
typedef typename Kernel::FT FT;
|
||||
typedef CEdge<Kernel, Polyhedron> Edge;
|
||||
typedef typename Polyhedron::Halfedge_handle Halfedge_handle;
|
||||
typedef typename Polyhedron::Edge_iterator Edge_iterator;
|
||||
typedef std::priority_queue<Edge,
|
||||
std::vector<Edge>,
|
||||
::less<Edge> > PQueue;
|
||||
// data
|
||||
PQueue m_queue;
|
||||
Polyhedron* m_pMesh;
|
||||
public :
|
||||
// life cycle
|
||||
Refiner(Polyhedron* pMesh)
|
||||
{
|
||||
m_pMesh = pMesh;
|
||||
}
|
||||
~Refiner() {}
|
||||
// life cycle
|
||||
Refiner(Polyhedron* pMesh)
|
||||
{
|
||||
m_pMesh = pMesh;
|
||||
}
|
||||
~Refiner() {}
|
||||
|
||||
public :
|
||||
|
||||
void fill_queue(const FT& max_sqlen)
|
||||
{
|
||||
for(Edge_iterator he = m_pMesh->edges_begin();
|
||||
he != m_pMesh->edges_end();
|
||||
he++)
|
||||
if(Edge::squared_len(he) > max_sqlen)
|
||||
m_queue.push(Edge(he));
|
||||
}
|
||||
void fill_queue(const FT& max_sqlen)
|
||||
{
|
||||
for(Edge_iterator he = m_pMesh->edges_begin();
|
||||
he != m_pMesh->edges_end();
|
||||
he++)
|
||||
if(Edge::squared_len(he) > max_sqlen)
|
||||
m_queue.push(Edge(he));
|
||||
}
|
||||
|
||||
void fill_queue()
|
||||
{
|
||||
for(Edge_iterator he = m_pMesh->edges_begin();
|
||||
he != m_pMesh->edges_end();
|
||||
he++)
|
||||
m_queue.push(Edge(he));
|
||||
}
|
||||
void fill_queue()
|
||||
{
|
||||
for(Edge_iterator he = m_pMesh->edges_begin();
|
||||
he != m_pMesh->edges_end();
|
||||
he++)
|
||||
m_queue.push(Edge(he));
|
||||
}
|
||||
|
||||
// run
|
||||
void run_nb_splits(const unsigned int nb_splits)
|
||||
{
|
||||
// fill queue
|
||||
fill_queue();
|
||||
// run
|
||||
void run_nb_splits(const unsigned int nb_splits)
|
||||
{
|
||||
// fill queue
|
||||
fill_queue();
|
||||
|
||||
unsigned int nb = 0;
|
||||
while(nb < nb_splits)
|
||||
{
|
||||
// get a copy of the candidate edge
|
||||
Edge edge = m_queue.top();
|
||||
m_queue.pop();
|
||||
unsigned int nb = 0;
|
||||
while(nb < nb_splits)
|
||||
{
|
||||
// get a copy of the candidate edge
|
||||
Edge edge = m_queue.top();
|
||||
m_queue.pop();
|
||||
|
||||
Halfedge_handle he = edge.he();
|
||||
// update point
|
||||
Halfedge_handle hnew = m_pMesh->split_edge(he);
|
||||
hnew->vertex()->point() = CGAL::midpoint(he->vertex()->point(),
|
||||
he->opposite()->vertex()->point());
|
||||
Halfedge_handle he = edge.he();
|
||||
// update point
|
||||
Halfedge_handle hnew = m_pMesh->split_edge(he);
|
||||
hnew->vertex()->point() = CGAL::midpoint(he->vertex()->point(),
|
||||
he->opposite()->vertex()->point());
|
||||
|
||||
// hit has been split into two edges
|
||||
m_queue.push(Edge(hnew));
|
||||
m_queue.push(Edge(he));
|
||||
// hit has been split into two edges
|
||||
m_queue.push(Edge(hnew));
|
||||
m_queue.push(Edge(he));
|
||||
|
||||
// split facet if possible
|
||||
if(!hnew->is_border())
|
||||
{
|
||||
m_pMesh->split_facet(hnew,hnew->next()->next());
|
||||
m_queue.push(Edge(hnew->next()));
|
||||
}
|
||||
// split facet if possible
|
||||
if(!hnew->is_border())
|
||||
{
|
||||
m_pMesh->split_facet(hnew,hnew->next()->next());
|
||||
m_queue.push(Edge(hnew->next()));
|
||||
}
|
||||
|
||||
// split facet if possible
|
||||
if(!hnew->opposite()->is_border())
|
||||
{
|
||||
m_pMesh->split_facet(hnew->opposite()->next(),
|
||||
hnew->opposite()->next()->next()->next());
|
||||
m_queue.push(Edge(hnew->opposite()->prev()));
|
||||
}
|
||||
// split facet if possible
|
||||
if(!hnew->opposite()->is_border())
|
||||
{
|
||||
m_pMesh->split_facet(hnew->opposite()->next(),
|
||||
hnew->opposite()->next()->next()->next());
|
||||
m_queue.push(Edge(hnew->opposite()->prev()));
|
||||
}
|
||||
|
||||
nb++;
|
||||
} // end while
|
||||
} // end run
|
||||
nb++;
|
||||
} // end while
|
||||
} // end run
|
||||
|
||||
|
||||
|
||||
// run
|
||||
unsigned int operator()(const FT& max_sqlen)
|
||||
{
|
||||
// fill queue
|
||||
fill_queue(max_sqlen);
|
||||
// run
|
||||
unsigned int operator()(const FT& max_sqlen)
|
||||
{
|
||||
// fill queue
|
||||
fill_queue(max_sqlen);
|
||||
|
||||
unsigned int nb_split = 0;
|
||||
while(!m_queue.empty())
|
||||
{
|
||||
// get a copy of the candidate edge
|
||||
Edge edge = m_queue.top();
|
||||
m_queue.pop();
|
||||
unsigned int nb_split = 0;
|
||||
while(!m_queue.empty())
|
||||
{
|
||||
// get a copy of the candidate edge
|
||||
Edge edge = m_queue.top();
|
||||
m_queue.pop();
|
||||
|
||||
Halfedge_handle he = edge.he();
|
||||
FT sqlen = Edge::squared_len(he);
|
||||
if(sqlen > max_sqlen)
|
||||
{
|
||||
// update point
|
||||
Halfedge_handle hnew = m_pMesh->split_edge(he);
|
||||
hnew->vertex()->point() = CGAL::midpoint(he->vertex()->point(),
|
||||
he->opposite()->vertex()->point());
|
||||
Halfedge_handle he = edge.he();
|
||||
FT sqlen = Edge::squared_len(he);
|
||||
if(sqlen > max_sqlen)
|
||||
{
|
||||
// update point
|
||||
Halfedge_handle hnew = m_pMesh->split_edge(he);
|
||||
hnew->vertex()->point() = CGAL::midpoint(he->vertex()->point(),
|
||||
he->opposite()->vertex()->point());
|
||||
|
||||
// hit has been split into two edges
|
||||
m_queue.push(Edge(hnew));
|
||||
m_queue.push(Edge(he));
|
||||
// hit has been split into two edges
|
||||
m_queue.push(Edge(hnew));
|
||||
m_queue.push(Edge(he));
|
||||
|
||||
// split facet if possible
|
||||
if(!hnew->is_border())
|
||||
{
|
||||
m_pMesh->split_facet(hnew,hnew->next()->next());
|
||||
m_queue.push(Edge(hnew->next()));
|
||||
}
|
||||
// split facet if possible
|
||||
if(!hnew->is_border())
|
||||
{
|
||||
m_pMesh->split_facet(hnew,hnew->next()->next());
|
||||
m_queue.push(Edge(hnew->next()));
|
||||
}
|
||||
|
||||
// split facet if possible
|
||||
if(!hnew->opposite()->is_border())
|
||||
{
|
||||
m_pMesh->split_facet(hnew->opposite()->next(),
|
||||
hnew->opposite()->next()->next()->next());
|
||||
m_queue.push(Edge(hnew->opposite()->prev()));
|
||||
}
|
||||
// split facet if possible
|
||||
if(!hnew->opposite()->is_border())
|
||||
{
|
||||
m_pMesh->split_facet(hnew->opposite()->next(),
|
||||
hnew->opposite()->next()->next()->next());
|
||||
m_queue.push(Edge(hnew->opposite()->prev()));
|
||||
}
|
||||
|
||||
nb_split++;
|
||||
} // end if(sqlen > max_sqlen)
|
||||
} // end while(!m_queue.empty())
|
||||
return nb_split;
|
||||
} // end run
|
||||
nb_split++;
|
||||
} // end if(sqlen > max_sqlen)
|
||||
} // end while(!m_queue.empty())
|
||||
return nb_split;
|
||||
} // end run
|
||||
};
|
||||
|
||||
#endif // _REFINER_H_
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ void Scene::update_bbox()
|
|||
}
|
||||
|
||||
void Scene::draw(CGAL::QGLViewer* viewer)
|
||||
{
|
||||
{
|
||||
if(!gl_init)
|
||||
initGL();
|
||||
if(!are_buffers_initialized)
|
||||
|
|
|
|||
|
|
@ -60,22 +60,22 @@ public:
|
|||
public:
|
||||
// types
|
||||
typedef CGAL::Bbox_3 Bbox;
|
||||
|
||||
|
||||
private:
|
||||
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Facet_Primitive;
|
||||
typedef CGAL::AABB_traits<Kernel, Facet_Primitive> Facet_Traits;
|
||||
typedef CGAL::AABB_tree<Facet_Traits> Facet_tree;
|
||||
|
||||
|
||||
typedef CGAL::AABB_halfedge_graph_segment_primitive<Polyhedron> Edge_Primitive;
|
||||
typedef CGAL::AABB_traits<Kernel, Edge_Primitive> Edge_Traits;
|
||||
typedef CGAL::AABB_tree<Edge_Traits> Edge_tree;
|
||||
|
||||
|
||||
typedef CGAL::qglviewer::ManipulatedFrame ManipulatedFrame;
|
||||
|
||||
|
||||
enum Cut_planes_types {
|
||||
NONE, UNSIGNED_FACETS, SIGNED_FACETS, UNSIGNED_EDGES, CUT_SEGMENTS
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
QGLContext* context;
|
||||
void draw(CGAL::QGLViewer*);
|
||||
|
|
@ -102,7 +102,7 @@ private:
|
|||
FT m_max_distance_function;
|
||||
typedef std::pair<Point,FT> Point_distance;
|
||||
Point_distance m_distance_function[100][100];
|
||||
|
||||
|
||||
// frame
|
||||
ManipulatedFrame* m_frame;
|
||||
bool m_view_plane;
|
||||
|
|
@ -112,10 +112,10 @@ private:
|
|||
// An aabb_tree indexing polyhedron facets/segments
|
||||
Facet_tree m_facet_tree;
|
||||
Edge_tree m_edge_tree;
|
||||
|
||||
|
||||
Cut_planes_types m_cut_plane;
|
||||
bool are_buffers_initialized;
|
||||
|
||||
|
||||
private:
|
||||
// utility functions
|
||||
Vector random_vector();
|
||||
|
|
@ -135,7 +135,7 @@ private:
|
|||
|
||||
template <typename Tree>
|
||||
void compute_distance_function(const Tree& tree);
|
||||
|
||||
|
||||
template <typename Tree>
|
||||
void sign_distance_function(const Tree& tree);
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ public:
|
|||
void clear_points() { m_points.clear(); changed(); }
|
||||
void clear_segments() { m_segments.clear(); changed(); }
|
||||
void clear_cutting_plane();
|
||||
|
||||
|
||||
// fast distance setter
|
||||
void set_fast_distance(bool b) { m_fast_distance = b; update_grid_size(); }
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ public:
|
|||
void refine_loop();
|
||||
void refine_bisection(const FT max_sqlen);
|
||||
|
||||
// distance functions
|
||||
// distance functions
|
||||
void signed_distance_function();
|
||||
void unsigned_distance_function();
|
||||
void unsigned_distance_function_to_edges();
|
||||
|
|
@ -215,7 +215,7 @@ public:
|
|||
bool m_view_segments;
|
||||
bool m_view_polyhedron;
|
||||
|
||||
// benchmarks
|
||||
// benchmarks
|
||||
enum {DO_INTERSECT,
|
||||
ANY_INTERSECTION,
|
||||
NB_INTERSECTIONS,
|
||||
|
|
@ -254,7 +254,7 @@ public:
|
|||
//timer sends a top when all the events are finished
|
||||
void timerEvent(QTimerEvent *);
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
// cutting plane
|
||||
void cutting_plane(bool override = false);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ void Viewer::mousePressEvent(QMouseEvent* e)
|
|||
m_pScene->cutting_plane(true);
|
||||
m_custom_mouse = true;
|
||||
}
|
||||
|
||||
|
||||
CGAL::QGLViewer::mousePressEvent(e);
|
||||
}
|
||||
|
||||
|
|
@ -55,10 +55,10 @@ void Viewer::mouseReleaseEvent(QMouseEvent* e)
|
|||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_pScene->cutting_plane(true);
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
|
||||
m_custom_mouse = false;
|
||||
}
|
||||
|
||||
|
||||
CGAL::QGLViewer::mouseReleaseEvent(e);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public:
|
|||
protected:
|
||||
virtual void mousePressEvent(QMouseEvent* e);
|
||||
virtual void mouseReleaseEvent(QMouseEvent* e);
|
||||
|
||||
|
||||
private:
|
||||
Scene* m_pScene;
|
||||
bool m_custom_mouse;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ std::size_t Scene::nb_digits(std::size_t value)
|
|||
}
|
||||
|
||||
// bench memory against number of facets in the tree
|
||||
// the tree is reconstructed each timer in the mesh
|
||||
// the tree is reconstructed each timer in the mesh
|
||||
// refinement loop
|
||||
void Scene::bench_memory()
|
||||
{
|
||||
|
|
@ -166,8 +166,8 @@ void Scene::bench_construction()
|
|||
Facet_tree tree2(faces(*m_pPolyhedron).first, faces(*m_pPolyhedron).second,*m_pPolyhedron);
|
||||
double duration_construction_and_kdtree = time2.time();
|
||||
|
||||
std::cout << m_pPolyhedron->size_of_facets() << "\t"
|
||||
<< duration_construction_alone << "\t"
|
||||
std::cout << m_pPolyhedron->size_of_facets() << "\t"
|
||||
<< duration_construction_alone << "\t"
|
||||
<< duration_construction_and_kdtree << std::endl;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
\ingroup PkgAABBTreeConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `AABBGeomTraits` defines the requirements for the first template parameter of the class `CGAL::AABB_traits<AABBGeomTraits, AABBPrimitive>`. It provides predicates and constructors to detect and compute intersections between query objects and the primitives stored in the AABB tree. In addition, it contains predicates and constructors to compute distances between a point query and the primitives stored in the AABB tree.
|
||||
The concept `AABBGeomTraits` defines the requirements for the first template parameter of the class `CGAL::AABB_traits<AABBGeomTraits, AABBPrimitive>`. It provides predicates and constructors to detect and compute intersections between query objects and the primitives stored in the AABB tree. In addition, it contains predicates and constructors to compute distances between a point query and the primitives stored in the AABB tree.
|
||||
|
||||
\cgalRefines `SearchGeomTraits_3`
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ The concept `AABBGeomTraits` defines the requirements for the first template par
|
|||
class AABBGeomTraits {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
|
@ -25,50 +25,50 @@ A number type model of `Field`.
|
|||
typedef unspecified_type FT;
|
||||
|
||||
/*!
|
||||
Sphere type, that should be consistent with the distance function chosen for the distance queries, namely the `Squared_distance_3` functor.
|
||||
*/
|
||||
typedef unspecified_type Sphere_3;
|
||||
Sphere type, that should be consistent with the distance function chosen for the distance queries, namely the `Squared_distance_3` functor.
|
||||
*/
|
||||
typedef unspecified_type Sphere_3;
|
||||
|
||||
/*!
|
||||
Point type.
|
||||
*/
|
||||
typedef unspecified_type Point_3;
|
||||
*/
|
||||
typedef unspecified_type Point_3;
|
||||
|
||||
/*!
|
||||
A functor object to detect intersections between two geometric objects.
|
||||
Provides the operators:
|
||||
`bool operator()(const Type_1& type_1, const Type_2& type_2);`
|
||||
where `Type_1` and `Type_2` are relevant types
|
||||
among `Ray_3`, `Segment_3`, `Line_3`, `Triangle_3`, `Plane_3` and `Bbox_3`. Relevant herein means that a line primitive (ray, segment, line) is tested against a planar or solid primitive (plane, triangle, box), and a solid primitive is tested against another solid primitive (box against box). The operator returns `true` iff `type_1` and `type_2` have a non empty intersection.
|
||||
*/
|
||||
typedef unspecified_type Do_intersect_3;
|
||||
A functor object to detect intersections between two geometric objects.
|
||||
Provides the operators:
|
||||
`bool operator()(const Type_1& type_1, const Type_2& type_2);`
|
||||
where `Type_1` and `Type_2` are relevant types
|
||||
among `Ray_3`, `Segment_3`, `Line_3`, `Triangle_3`, `Plane_3` and `Bbox_3`. Relevant herein means that a line primitive (ray, segment, line) is tested against a planar or solid primitive (plane, triangle, box), and a solid primitive is tested against another solid primitive (box against box). The operator returns `true` iff `type_1` and `type_2` have a non empty intersection.
|
||||
*/
|
||||
typedef unspecified_type Do_intersect_3;
|
||||
|
||||
/*!
|
||||
A functor object to construct the intersection between two geometric objects.
|
||||
This functor must support the result_of protocol, that is the return
|
||||
This functor must support the result_of protocol, that is the return
|
||||
type of the `operator()(A, B)` is `CGAL::cpp11::result<Intersect_3(A,B)>`.
|
||||
|
||||
Provides the operators:
|
||||
`CGAL::cpp11::result<Intersect_3(A,B)> operator()(const A& a, const B& b);`
|
||||
where `A` and `B` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`,
|
||||
`Triangle_3`, `Plane_3` and `Bbox_3`.
|
||||
Relevant herein means that a line primitive (ray, segment, line) is tested
|
||||
against a planar or solid primitive (plane, triangle, box).
|
||||
A model of `Kernel::Intersect_3` fulfills those requirements.
|
||||
*/
|
||||
typedef unspecified_type Intersect_3;
|
||||
Provides the operators:
|
||||
`CGAL::cpp11::result<Intersect_3(A,B)> operator()(const A& a, const B& b);`
|
||||
where `A` and `B` are any relevant types among `Ray_3`, `Segment_3`, `Line_3`,
|
||||
`Triangle_3`, `Plane_3` and `Bbox_3`.
|
||||
Relevant herein means that a line primitive (ray, segment, line) is tested
|
||||
against a planar or solid primitive (plane, triangle, box).
|
||||
A model of `Kernel::Intersect_3` fulfills those requirements.
|
||||
*/
|
||||
typedef unspecified_type Intersect_3;
|
||||
|
||||
/*!
|
||||
A functor object to construct the sphere centered at one point and passing through another one. Provides the operator:
|
||||
A functor object to construct the sphere centered at one point and passing through another one. Provides the operator:
|
||||
- `Sphere_3 operator()(const Point_3& p, const FT & sr)` which returns the sphere centered at `p` with `sr` as squared radius.
|
||||
*/
|
||||
typedef unspecified_type Construct_sphere_3;
|
||||
*/
|
||||
typedef unspecified_type Construct_sphere_3;
|
||||
|
||||
/*!
|
||||
A functor object to compute the point on a geometric primitive which is closest from a query. Provides the operator:
|
||||
`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` can be any of the following types : `Segment_3`, `Ray_3`, or `Triangle_3`.
|
||||
The operator returns the point on `type_2` which is closest to `p`.
|
||||
*/
|
||||
A functor object to compute the point on a geometric primitive which is closest from a query. Provides the operator:
|
||||
`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` can be any of the following types : `Segment_3`, `Ray_3`, or `Triangle_3`.
|
||||
The operator returns the point on `type_2` which is closest to `p`.
|
||||
*/
|
||||
typedef unspecified_type Construct_projected_point_3;
|
||||
|
||||
/*!
|
||||
|
|
@ -79,17 +79,17 @@ Provides the operator:
|
|||
typedef unspecified_type Compare_distance_3;
|
||||
|
||||
/*!
|
||||
A functor object to detect if a point lies inside a sphere or not.
|
||||
Provides the operator:
|
||||
`bool operator()(const Sphere_3& s, const Point_3& p);` which returns `true` iff the closed volume bounded by `s` contains `p`.
|
||||
*/
|
||||
typedef unspecified_type Has_on_bounded_side_3;
|
||||
A functor object to detect if a point lies inside a sphere or not.
|
||||
Provides the operator:
|
||||
`bool operator()(const Sphere_3& s, const Point_3& p);` which returns `true` iff the closed volume bounded by `s` contains `p`.
|
||||
*/
|
||||
typedef unspecified_type Has_on_bounded_side_3;
|
||||
|
||||
/*!
|
||||
A functor object to compute the squared radius of a sphere. Provides the operator:
|
||||
`FT operator()(const Sphere_3& s);` which returns the squared radius of `s`.
|
||||
*/
|
||||
typedef unspecified_type Compute_squared_radius_3;
|
||||
A functor object to compute the squared radius of a sphere. Provides the operator:
|
||||
`FT operator()(const Sphere_3& s);` which returns the squared radius of `s`.
|
||||
*/
|
||||
typedef unspecified_type Compute_squared_radius_3;
|
||||
|
||||
/*!
|
||||
A functor object to compute the squared distance between two points. Provides the operator:
|
||||
|
|
@ -126,29 +126,29 @@ typedef unspecified_type Equal_3;
|
|||
|
||||
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Returns the intersection detection functor.
|
||||
*/
|
||||
Do_intersect_3 do_intersect_3_object();
|
||||
Returns the intersection detection functor.
|
||||
*/
|
||||
Do_intersect_3 do_intersect_3_object();
|
||||
|
||||
/*!
|
||||
Returns the intersection constructor.
|
||||
*/
|
||||
Intersect_3 intersect_3_object();
|
||||
Returns the intersection constructor.
|
||||
*/
|
||||
Intersect_3 intersect_3_object();
|
||||
|
||||
/*!
|
||||
Returns the sphere constructor.
|
||||
*/
|
||||
Construct_sphere_3 construct_sphere_3_object();
|
||||
*/
|
||||
Construct_sphere_3 construct_sphere_3_object();
|
||||
|
||||
/*!
|
||||
Returns the closest point constructor.
|
||||
*/
|
||||
Returns the closest point constructor.
|
||||
*/
|
||||
Construct_projected_point_3 construct_projected_point_3_object();
|
||||
|
||||
/*!
|
||||
|
|
@ -157,14 +157,14 @@ Returns the compare distance constructor.
|
|||
Compare_distance_3 compare_distance_3_object();
|
||||
|
||||
/*!
|
||||
Returns the closest point constructor.
|
||||
*/
|
||||
Has_on_bounded_side_3 has_on_bounded_side_3_object();
|
||||
Returns the closest point constructor.
|
||||
*/
|
||||
Has_on_bounded_side_3 has_on_bounded_side_3_object();
|
||||
|
||||
/*!
|
||||
Returns the squared radius functor.
|
||||
*/
|
||||
Compute_squared_radius_3 compute_squared_radius_3_object();
|
||||
Returns the squared radius functor.
|
||||
*/
|
||||
Compute_squared_radius_3 compute_squared_radius_3_object();
|
||||
|
||||
/*!
|
||||
Returns the squared distance functor.
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
\ingroup PkgAABBTreeConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `AABBPrimitive` describes the requirements for the primitives stored in the AABB tree data structure. The concept encapsulates a type for the input datum (a geometric object) and an identifier (id) type through which those primitives are referred to. The concept `AABBPrimitive` also refines the concepts DefaultConstructible and Assignable.
|
||||
The concept `AABBPrimitive` describes the requirements for the primitives stored in the AABB tree data structure. The concept encapsulates a type for the input datum (a geometric object) and an identifier (id) type through which those primitives are referred to. The concept `AABBPrimitive` also refines the concepts DefaultConstructible and Assignable.
|
||||
|
||||
\sa `CGAL::AABB_tree<AABBTraits>`
|
||||
\sa `CGAL::AABB_tree<AABBTraits>`
|
||||
\sa `AABBPrimitiveWithSharedData`
|
||||
|
||||
\cgalHeading{Example}
|
||||
|
||||
The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for instance that the input objects are the triangle faces of a mesh stored as a `CGAL::Polyhedron_3`. The `Datum` would be a `Triangle_3` and the `Id` would be a polyhedron `Face_handle`. Method `datum()` can return either a `Triangle_3` constructed on the fly from the face handle or a `Triangle_3` stored internally. This provides a way for the user to trade memory for efficiency.
|
||||
The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for instance that the input objects are the triangle faces of a mesh stored as a `CGAL::Polyhedron_3`. The `Datum` would be a `Triangle_3` and the `Id` would be a polyhedron `Face_handle`. Method `datum()` can return either a `Triangle_3` constructed on the fly from the face handle or a `Triangle_3` stored internally. This provides a way for the user to trade memory for efficiency.
|
||||
|
||||
\cgalHasModel `CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_false,CacheDatum>`
|
||||
\cgalHasModel `CGAL::AABB_segment_primitive<Iterator,CacheDatum>`
|
||||
|
|
@ -22,18 +22,18 @@ The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for insta
|
|||
class AABBPrimitive {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
3D point type.
|
||||
*/
|
||||
typedef unspecified_type Point;
|
||||
3D point type.
|
||||
*/
|
||||
typedef unspecified_type Point;
|
||||
|
||||
/*!
|
||||
Type of input datum.
|
||||
*/
|
||||
typedef unspecified_type Datum;
|
||||
Type of input datum.
|
||||
*/
|
||||
typedef unspecified_type Datum;
|
||||
|
||||
/*!
|
||||
Point reference type returned by the function `point()`. It is convertible to the type `Point`.
|
||||
|
|
@ -46,29 +46,29 @@ Datum reference type returned by the function `datum()`. It is convertible to th
|
|||
typedef unspecified_type Datum_reference;
|
||||
|
||||
/*!
|
||||
Type of identifiers through which the input objects are referred to. It must be a model of the concepts DefaultConstructible and Assignable.
|
||||
*/
|
||||
typedef unspecified_type Id;
|
||||
Type of identifiers through which the input objects are referred to. It must be a model of the concepts DefaultConstructible and Assignable.
|
||||
*/
|
||||
typedef unspecified_type Id;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Returns the datum (geometric object) represented by the primitive.
|
||||
*/
|
||||
Datum_reference datum();
|
||||
Returns the datum (geometric object) represented by the primitive.
|
||||
*/
|
||||
Datum_reference datum();
|
||||
|
||||
/*!
|
||||
Returns the corresponding identifier. This identifier is only used as a reference for the objects in the output of the `AABB_tree` methods.
|
||||
*/
|
||||
Id id();
|
||||
Returns the corresponding identifier. This identifier is only used as a reference for the objects in the output of the `AABB_tree` methods.
|
||||
*/
|
||||
Id id();
|
||||
|
||||
/*!
|
||||
Returns a 3D point located on the geometric object represented by the primitive. This function is used to sort the primitives during the AABB tree construction as well as to construct the search KD-tree internal to the AABB tree used to accelerate distance queries.
|
||||
*/
|
||||
Point_reference reference_point();
|
||||
Returns a 3D point located on the geometric object represented by the primitive. This function is used to sort the primitives during the AABB tree construction as well as to construct the search KD-tree internal to the AABB tree used to accelerate distance queries.
|
||||
*/
|
||||
Point_reference reference_point();
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,34 +17,34 @@ The concept `AABBTraits` provides the geometric primitive types and methods for
|
|||
class AABBTraits {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Value type of the `Squared_distance` functor.
|
||||
*/
|
||||
typedef unspecified_type FT;
|
||||
Value type of the `Squared_distance` functor.
|
||||
*/
|
||||
typedef unspecified_type FT;
|
||||
|
||||
/*!
|
||||
Type of a 3D point.
|
||||
*/
|
||||
typedef unspecified_type Point_3;
|
||||
Type of a 3D point.
|
||||
*/
|
||||
typedef unspecified_type Point_3;
|
||||
|
||||
/*!
|
||||
Type of primitive.
|
||||
Type of primitive.
|
||||
Must be a model of the concepts `AABBPrimitive` or `AABBPrimitiveWithSharedData`.
|
||||
*/
|
||||
typedef unspecified_type Primitive;
|
||||
*/
|
||||
typedef unspecified_type Primitive;
|
||||
|
||||
/*!
|
||||
Bounding box type.
|
||||
*/
|
||||
typedef unspecified_type Bounding_box;
|
||||
Bounding box type.
|
||||
*/
|
||||
typedef unspecified_type Bounding_box;
|
||||
|
||||
/*!
|
||||
enum required for axis selection
|
||||
*/
|
||||
enum Axis {
|
||||
*/
|
||||
enum Axis {
|
||||
CGAL_X_AXIS,
|
||||
CGAL_Y_AXIS,
|
||||
CGAL_Z_AXIS
|
||||
|
|
@ -52,13 +52,13 @@ typedef unspecified_type Bounding_box;
|
|||
|
||||
/*!
|
||||
3D Point and Primitive Id type
|
||||
*/
|
||||
typedef std::pair<Point_3, Primitive::Id> Point_and_primitive_id;
|
||||
*/
|
||||
typedef std::pair<Point_3, Primitive::Id> Point_and_primitive_id;
|
||||
|
||||
/*!
|
||||
\deprecated
|
||||
\deprecated
|
||||
This requirement is deprecated and is no longer needed.
|
||||
*/
|
||||
*/
|
||||
typedef std::pair<Object, Primitive::Id> Object_and_primitive_id;
|
||||
|
||||
|
||||
|
|
@ -84,22 +84,22 @@ A functor object to split a range of primitives into two sub-ranges along the lo
|
|||
and have `Primitive` as value type. The operator is used for determining the primitives assigned to the two children nodes of a given node,
|
||||
assuming that the goal is to split the chosen axis dimension of the bounding box of the node. The primitives assigned to this node are passed as argument
|
||||
to the operator. It should modify the iterator range in such a way that its first half and its second half correspond to the two children nodes.
|
||||
*/
|
||||
typedef unspecified_type Split_primitives;
|
||||
*/
|
||||
typedef unspecified_type Split_primitives;
|
||||
|
||||
/*!
|
||||
A functor object to compute the bounding box of a set of primitives. Provides the operator:
|
||||
`Bounding_box operator()(Input_iterator begin, Input_iterator beyond);` %Iterator type `InputIterator` must have `Primitive` as value type.
|
||||
*/
|
||||
typedef unspecified_type Compute_bbox;
|
||||
A functor object to compute the bounding box of a set of primitives. Provides the operator:
|
||||
`Bounding_box operator()(Input_iterator begin, Input_iterator beyond);` %Iterator type `InputIterator` must have `Primitive` as value type.
|
||||
*/
|
||||
typedef unspecified_type Compute_bbox;
|
||||
|
||||
|
||||
// remove as not used any where in the code:
|
||||
// A functor object to specify the direction along which the bounding box should be split:
|
||||
// A functor object to specify the direction along which the bounding box should be split:
|
||||
// `Axis operator()(const Bounding_box& bbox);` which returns the
|
||||
// direction used for splitting `bbox`. It is usually the axis aligned
|
||||
// with the longest edge of `bbox`.
|
||||
// typedef unspecified_type Splitting_direction;
|
||||
// typedef unspecified_type Splitting_direction;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -111,20 +111,20 @@ typedef unspecified_type Compute_bbox;
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
A functor object to compute intersection predicates between the query and the nodes of the tree. Provides the operators:
|
||||
A functor object to compute intersection predicates between the query and the nodes of the tree. Provides the operators:
|
||||
- `bool operator()(const Query & q, const Bounding_box & box);` which returns `true` iff the query intersects the bounding box
|
||||
- `bool operator()(const Query & q, const Primitive & primitive);` which returns `true` iff the query intersects the primitive
|
||||
*/
|
||||
typedef unspecified_type Do_intersect;
|
||||
*/
|
||||
typedef unspecified_type Do_intersect;
|
||||
|
||||
/*!
|
||||
A functor object to compute the intersection of a query and a primitive. Provides the operator:
|
||||
`boost::optional<Intersection_and_primitive_id<Query>::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive.
|
||||
A functor object to compute the intersection of a query and a primitive. Provides the operator:
|
||||
`boost::optional<Intersection_and_primitive_id<Query>::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive.
|
||||
|
||||
\cgalHeading{Note on Backward Compatibility}
|
||||
Before the release 4.3 of \cgal, the return type of this function used to be `boost::optional<Object_and_primitive_id>`.
|
||||
*/
|
||||
typedef unspecified_type Intersection;
|
||||
*/
|
||||
typedef unspecified_type Intersection;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -135,68 +135,68 @@ typedef unspecified_type Intersection;
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
A functor object to compute distance comparisons between the query and the nodes of the tree. Provides the operators:
|
||||
A functor object to compute distance comparisons between the query and the nodes of the tree. Provides the operators:
|
||||
- `bool operator()(const Query & query, const Bounding_box& box, const Point & closest);` which returns `true` iff the bounding box is closer to `query` than `closest` is
|
||||
- `bool operator()(const Query & query, const Primitive & primitive, const Point & closest);` which returns `true` iff `primitive` is closer to the `query` than `closest` is
|
||||
*/
|
||||
typedef unspecified_type Compare_distance;
|
||||
*/
|
||||
typedef unspecified_type Compare_distance;
|
||||
|
||||
/*!
|
||||
A functor object to compute closest point from the query on a primitive. Provides the operator:
|
||||
`Point_3 operator()(const Query& query, const Primitive& primitive, const Point_3 & closest);` which returns the closest point to `query`, among `closest` and all points of the primitive.
|
||||
*/
|
||||
typedef unspecified_type Closest_point;
|
||||
A functor object to compute closest point from the query on a primitive. Provides the operator:
|
||||
`Point_3 operator()(const Query& query, const Primitive& primitive, const Point_3 & closest);` which returns the closest point to `query`, among `closest` and all points of the primitive.
|
||||
*/
|
||||
typedef unspecified_type Closest_point;
|
||||
|
||||
/*!
|
||||
A functor object to compute the squared distance between two points. Provides the operator:
|
||||
`FT operator()(const Point& query, const Point_3 & p);` which returns the squared distance between `p` and `q`.
|
||||
*/
|
||||
typedef unspecified_type Squared_distance;
|
||||
A functor object to compute the squared distance between two points. Provides the operator:
|
||||
`FT operator()(const Point& query, const Point_3 & p);` which returns the squared distance between `p` and `q`.
|
||||
*/
|
||||
typedef unspecified_type Squared_distance;
|
||||
|
||||
/*!
|
||||
A functor object to compare two points. Provides the operator:
|
||||
`bool operator()(const Point_3& p, const Point_3& q);}` which returns `true` if `p` is equal to `q`.
|
||||
*/
|
||||
typedef unspecified_type Equal_3;
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Returns the primitive splitting functor.
|
||||
*/
|
||||
Split_primitives split_primitives_object();
|
||||
Returns the primitive splitting functor.
|
||||
*/
|
||||
Split_primitives split_primitives_object();
|
||||
|
||||
/*!
|
||||
Returns the bounding box constructor.
|
||||
*/
|
||||
Compute_bbox compute_bbox_object();
|
||||
Returns the bounding box constructor.
|
||||
*/
|
||||
Compute_bbox compute_bbox_object();
|
||||
|
||||
/*!
|
||||
Returns the intersection detection functor.
|
||||
*/
|
||||
Do_intersect do_intersect_object();
|
||||
Returns the intersection detection functor.
|
||||
*/
|
||||
Do_intersect do_intersect_object();
|
||||
|
||||
/*!
|
||||
Returns the intersection constructor.
|
||||
*/
|
||||
Intersection intersection_object();
|
||||
Returns the intersection constructor.
|
||||
*/
|
||||
Intersection intersection_object();
|
||||
|
||||
/*!
|
||||
Returns the distance comparison functor.
|
||||
*/
|
||||
Compare_distance compare_distance_object();
|
||||
Returns the distance comparison functor.
|
||||
*/
|
||||
Compare_distance compare_distance_object();
|
||||
|
||||
/*!
|
||||
Returns the closest point constructor.
|
||||
*/
|
||||
Closest_point closest_point_object();
|
||||
Returns the closest point constructor.
|
||||
*/
|
||||
Closest_point closest_point_object();
|
||||
|
||||
/*!
|
||||
Returns the squared distance functor.
|
||||
*/
|
||||
Squared_distance squared_distance_object();
|
||||
*/
|
||||
Squared_distance squared_distance_object();
|
||||
|
||||
/*!
|
||||
Returns the equal functor.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ namespace CGAL {
|
|||
|
||||
/*!
|
||||
|
||||
\mainpage User Manual
|
||||
\mainpage User Manual
|
||||
\anchor Chapter_3D_Fast_Intersection_and_Distance_Computation
|
||||
\cgalAutoToc
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ closest point from a point query to a set of triangles.
|
|||
|
||||
Note that this component is not suited to the problem of finding all
|
||||
intersecting pairs of objects. We refer to the component
|
||||
\ref chapterBoxIntersection "Intersecting Sequences of dD Iso-oriented Boxes"
|
||||
\ref chapterBoxIntersection "Intersecting Sequences of dD Iso-oriented Boxes"
|
||||
which can find all intersecting pairs of iso-oriented boxes.
|
||||
|
||||
The AABB tree data structure takes as input an iterator range of
|
||||
|
|
@ -59,7 +59,7 @@ intersection *tests* which do not construct any intersection
|
|||
objects, from *intersections* which construct the intersection
|
||||
objects.
|
||||
|
||||
Tests:
|
||||
Tests:
|
||||
|
||||
- Function `AABB_tree::do_intersect()` tests if the input primitives are
|
||||
intersected by the query. This function is fast as it involves only
|
||||
|
|
@ -79,7 +79,7 @@ the intersections with respect to the query.
|
|||
the intersecting primitive id (if any) of the corresponding
|
||||
intersection object that is closest to the source of the ray.
|
||||
|
||||
Constructions:
|
||||
Constructions:
|
||||
|
||||
- Function `AABB_tree::all_intersections()` detects and constructs all
|
||||
intersection objects with the input primitives.
|
||||
|
|
@ -216,7 +216,7 @@ option which maximizes speed.
|
|||
\subsection aabb_tree_perf_cons Construction
|
||||
|
||||
The surface triangle mesh chosen for benchmarking the tree
|
||||
construction is the knot model (14,400 triangles) depicted by
|
||||
construction is the knot model (14,400 triangles) depicted by
|
||||
\cgalFigureRef{figAABB-tree-bench}. We measure the tree construction time (both
|
||||
AABB tree alone and AABB tree with internal KD-tree) for this model as
|
||||
well as for three denser versions subdivided through the Loop
|
||||
|
|
@ -254,7 +254,7 @@ the function `AABB_tree::accelerate_distance_queries()` which
|
|||
takes an iterator range as input.
|
||||
|
||||
| Number of triangles | AABB tree (in MBytes) | AABB tree with internal KD-tree (in MBytes)|
|
||||
| ----: | ----: | ----: |
|
||||
| ----: | ----: | ----: |
|
||||
18,400 | 1.10 | 2.76 |
|
||||
102,400 | 6.33 | 14.73 |
|
||||
1,022,400 | 59.56 | 151.31 |
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
|||
typedef K::FT FT;
|
||||
typedef K::Point_3 Point_3;
|
||||
typedef CGAL::Bbox_3 Bbox_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
|
||||
typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
|
||||
typedef CGAL::Polyhedron_3<K> Polyhedron_3;
|
||||
typedef CGAL::Timer Timer;
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ void triangle_mesh(const char* fname)
|
|||
|
||||
TriangleMesh tmesh;
|
||||
std::ifstream in(fname);
|
||||
in >> tmesh;
|
||||
in >> tmesh;
|
||||
Timer t;
|
||||
t.start();
|
||||
Tree tree(faces(tmesh).first, faces(tmesh).second, tmesh);
|
||||
|
|
@ -37,7 +37,7 @@ void triangle_mesh(const char* fname)
|
|||
}
|
||||
|
||||
|
||||
Bbox_3 bbox(boost::graph_traits<Surface_mesh>::face_descriptor fd,
|
||||
Bbox_3 bbox(boost::graph_traits<Surface_mesh>::face_descriptor fd,
|
||||
const Surface_mesh& p)
|
||||
{
|
||||
boost::graph_traits<Surface_mesh>::halfedge_descriptor hd = halfedge(fd,p);
|
||||
|
|
@ -59,11 +59,11 @@ void surface_mesh_cache_bbox(const char* fname)
|
|||
Surface_mesh tmesh;
|
||||
std::ifstream in(fname);
|
||||
in >> tmesh;
|
||||
|
||||
|
||||
Timer t;
|
||||
t.start();
|
||||
Bbox_pmap bb = tmesh.add_property_map<face_descriptor,Bbox_3>("f:bbox",Bbox_3()).first;
|
||||
|
||||
|
||||
for(face_descriptor fd : faces(tmesh)){
|
||||
put(bb, fd, bbox(fd,tmesh));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
// this is the type of data that the queries returns. For this example
|
||||
// we imagine that, for some reasons, we do not want to store the iterators
|
||||
// of the vector, but raw pointers. This is to show that the Id type
|
||||
// does not have to be the same as the one of the input parameter of the
|
||||
// does not have to be the same as the one of the input parameter of the
|
||||
// constructor.
|
||||
typedef const My_triangle* Id;
|
||||
|
||||
|
|
@ -62,14 +62,14 @@ private:
|
|||
public:
|
||||
My_triangle_primitive() {} // default constructor needed
|
||||
|
||||
// the following constructor is the one that receives the iterators from the
|
||||
// the following constructor is the one that receives the iterators from the
|
||||
// iterator range given as input to the AABB_tree
|
||||
My_triangle_primitive(Iterator it)
|
||||
: m_pt(&(*it)) {}
|
||||
|
||||
const Id& id() const { return m_pt; }
|
||||
|
||||
// utility function to convert a custom
|
||||
// utility function to convert a custom
|
||||
// point type to CGAL point type.
|
||||
Point convert(const My_point *p) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ typedef CGAL::Simple_cartesian<double> K;
|
|||
|
||||
|
||||
// The points are stored in a flat array of doubles
|
||||
// The triangles are stored in a flat array of indices
|
||||
// The triangles are stored in a flat array of indices
|
||||
// referring to an array of coordinates: three consecutive
|
||||
// coordinates represent a point, and three consecutive
|
||||
// indices represent a triangle.
|
||||
|
|
@ -60,7 +60,7 @@ private:
|
|||
public:
|
||||
My_triangle_primitive() {} // default constructor needed
|
||||
|
||||
// the following constructor is the one that receives the iterators from the
|
||||
// the following constructor is the one that receives the iterators from the
|
||||
// iterator range given as input to the AABB_tree
|
||||
My_triangle_primitive(Triangle_iterator a)
|
||||
: m_it(a) {}
|
||||
|
|
@ -69,18 +69,18 @@ public:
|
|||
|
||||
// on the fly conversion from the internal data to the CGAL types
|
||||
Datum datum() const
|
||||
{
|
||||
{
|
||||
Point_index_iterator p_it = m_it.base();
|
||||
Point p(*(point_container + 3 * (*p_it)),
|
||||
*(point_container + 3 * (*p_it) + 1),
|
||||
Point p(*(point_container + 3 * (*p_it)),
|
||||
*(point_container + 3 * (*p_it) + 1),
|
||||
*(point_container + 3 * (*p_it) + 2) );
|
||||
++p_it;
|
||||
Point q(*(point_container + 3 * (*p_it)),
|
||||
*(point_container + 3 * (*p_it) + 1),
|
||||
Point q(*(point_container + 3 * (*p_it)),
|
||||
*(point_container + 3 * (*p_it) + 1),
|
||||
*(point_container + 3 * (*p_it) + 2));
|
||||
++p_it;
|
||||
Point r(*(point_container + 3 * (*p_it)),
|
||||
*(point_container + 3 * (*p_it) + 1),
|
||||
Point r(*(point_container + 3 * (*p_it)),
|
||||
*(point_container + 3 * (*p_it) + 1),
|
||||
*(point_container + 3 * (*p_it) + 2));
|
||||
|
||||
return Datum(p, q, r); // assembles triangle from three points
|
||||
|
|
@ -88,9 +88,9 @@ public:
|
|||
|
||||
// one point which must be on the primitive
|
||||
Point reference_point() const
|
||||
{
|
||||
return Point(*(point_container + 3 * (*m_it)),
|
||||
*(point_container + 3 * (*m_it) + 1),
|
||||
{
|
||||
return Point(*(point_container + 3 * (*m_it)),
|
||||
*(point_container + 3 * (*m_it) + 1),
|
||||
*(point_container + 3 * (*m_it) + 2));
|
||||
}
|
||||
};
|
||||
|
|
@ -119,7 +119,7 @@ int main()
|
|||
triangles[6] = 0; triangles[7] = 3; triangles[8] = 2;
|
||||
|
||||
// constructs AABB tree
|
||||
Tree tree(Triangle_iterator(triangles),
|
||||
Tree tree(Triangle_iterator(triangles),
|
||||
Triangle_iterator(triangles+9));
|
||||
|
||||
// counts #intersections
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ struct My_point {
|
|||
: x(_x), y(_y), z(_z) {}
|
||||
};
|
||||
|
||||
// The triangles are stored in a flat array of indices
|
||||
// The triangles are stored in a flat array of indices
|
||||
// referring to an array of points: three consecutive
|
||||
// indices represent a triangle.
|
||||
typedef std::vector<size_t>::const_iterator Point_index_iterator;
|
||||
|
|
@ -71,7 +71,7 @@ private:
|
|||
public:
|
||||
My_triangle_primitive() {} // default constructor needed
|
||||
|
||||
// the following constructor is the one that receives the iterators from the
|
||||
// the following constructor is the one that receives the iterators from the
|
||||
// iterator range given as input to the AABB_tree
|
||||
My_triangle_primitive(Triangle_iterator a)
|
||||
: m_it(a) {}
|
||||
|
|
@ -80,7 +80,7 @@ public:
|
|||
|
||||
// on the fly conversion from the internal data to the CGAL types
|
||||
Datum datum() const
|
||||
{
|
||||
{
|
||||
Point_index_iterator p_it = m_it.base();
|
||||
const My_point& mp = (*point_container)[*p_it];
|
||||
Point p(mp.x, mp.y, mp.z);
|
||||
|
|
@ -96,7 +96,7 @@ public:
|
|||
|
||||
// one point which must be on the primitive
|
||||
Point reference_point() const
|
||||
{
|
||||
{
|
||||
const My_point& mp = (*point_container)[*m_it];
|
||||
return Point(mp.x, mp.y, mp.z);
|
||||
}
|
||||
|
|
@ -121,16 +121,16 @@ int main()
|
|||
points.push_back(a);
|
||||
points.push_back(b);
|
||||
points.push_back(c);
|
||||
points.push_back(d);
|
||||
points.push_back(d);
|
||||
|
||||
// generates indexed triangle set
|
||||
std::vector<size_t> triangles;
|
||||
triangles.push_back(0); triangles.push_back(1); triangles.push_back(2);
|
||||
triangles.push_back(0); triangles.push_back(1); triangles.push_back(3);
|
||||
triangles.push_back(0); triangles.push_back(3); triangles.push_back(2);
|
||||
triangles.push_back(0); triangles.push_back(1); triangles.push_back(2);
|
||||
triangles.push_back(0); triangles.push_back(1); triangles.push_back(3);
|
||||
triangles.push_back(0); triangles.push_back(3); triangles.push_back(2);
|
||||
|
||||
// constructs AABB tree
|
||||
Tree tree(Triangle_iterator(triangles.begin()),
|
||||
Tree tree(Triangle_iterator(triangles.begin()),
|
||||
Triangle_iterator(triangles.end()));
|
||||
|
||||
// counts #intersections
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
// Author(s) : Camille Wormser, Pierre Alliez
|
||||
// Example of an AABB tree used with a simple list of
|
||||
// Example of an AABB tree used with a simple list of
|
||||
// triangles (a triangle soup) stored into an array of points.
|
||||
|
||||
#include <iostream>
|
||||
|
|
@ -25,7 +25,7 @@ struct My_point {
|
|||
My_point (double _x, double _y, double _z) : x(_x), y(_y), z(_z) {}
|
||||
};
|
||||
|
||||
// The triangles are stored in a flat vector of points (a triangle soup):
|
||||
// The triangles are stored in a flat vector of points (a triangle soup):
|
||||
// three consecutive points represent a triangle
|
||||
typedef std::vector<My_point>::const_iterator Point_iterator;
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ private:
|
|||
public:
|
||||
My_triangle_primitive() {} // default constructor needed
|
||||
|
||||
// the following constructor is the one that receives the iterators from the
|
||||
// the following constructor is the one that receives the iterators from the
|
||||
// iterator range given as input to the AABB_tree
|
||||
My_triangle_primitive(Triangle_iterator a)
|
||||
: m_it(a) {}
|
||||
|
|
@ -76,7 +76,7 @@ public:
|
|||
// on the fly conversion from the internal data
|
||||
// to the CGAL types
|
||||
Datum datum() const
|
||||
{
|
||||
{
|
||||
Point_iterator p_it = m_it.base();
|
||||
Point p(p_it->x, p_it->y, p_it->z);
|
||||
++p_it;
|
||||
|
|
@ -89,7 +89,7 @@ public:
|
|||
|
||||
// returns one point which must be on the primitive
|
||||
Point reference_point() const
|
||||
{
|
||||
{
|
||||
return Point(m_it->x, m_it->y, m_it->z);
|
||||
}
|
||||
};
|
||||
|
|
@ -107,12 +107,12 @@ int main()
|
|||
My_point d(0.0, 0.0, 0.0);
|
||||
|
||||
std::vector<My_point> triangles;
|
||||
triangles.push_back(a); triangles.push_back(b); triangles.push_back(c);
|
||||
triangles.push_back(a); triangles.push_back(b); triangles.push_back(d);
|
||||
triangles.push_back(a); triangles.push_back(d); triangles.push_back(c);
|
||||
triangles.push_back(a); triangles.push_back(b); triangles.push_back(c);
|
||||
triangles.push_back(a); triangles.push_back(b); triangles.push_back(d);
|
||||
triangles.push_back(a); triangles.push_back(d); triangles.push_back(c);
|
||||
|
||||
// constructs AABB tree
|
||||
Tree tree(Triangle_iterator(triangles.begin()),
|
||||
Tree tree(Triangle_iterator(triangles.begin()),
|
||||
Triangle_iterator(triangles.end()));
|
||||
|
||||
// counts #intersections
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ void run(const HalfedgeGraph& graph){
|
|||
typename Kernel::Point_3 q(0.0, 1.0, 0.0);
|
||||
typename Kernel::Point_3 r(0.0, 0.0, 1.0);
|
||||
|
||||
// constructs the AABB tree and the internal search tree for
|
||||
// efficient distance queries.
|
||||
// constructs the AABB tree and the internal search tree for
|
||||
// efficient distance queries.
|
||||
Tree tree( CGAL::edges(graph).first,
|
||||
CGAL::edges(graph).second, graph);
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ void run(const HalfedgeGraph& graph){
|
|||
typename Kernel::Point_3 point_query(2.0, 2.0, 2.0);
|
||||
typename Kernel::Point_3 closest = tree.closest_point(point_query);
|
||||
|
||||
std::cerr << "closest point is: " << closest << std::endl;
|
||||
std::cerr << "closest point is: " << closest << std::endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
|
|
@ -50,7 +50,7 @@ int main()
|
|||
Point s(0.0, 0.0, 0.0);
|
||||
Polyhedron polyhedron;
|
||||
polyhedron.make_tetrahedron(p, q, r, s);
|
||||
|
||||
|
||||
run<K>(polyhedron);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ int main()
|
|||
Polyhedron polyhedron;
|
||||
polyhedron.make_tetrahedron(p, q, r, s);
|
||||
|
||||
// constructs the AABB tree and the internal search tree for
|
||||
// constructs the AABB tree and the internal search tree for
|
||||
// efficient distance queries.
|
||||
Tree tree( CGAL::edges(polyhedron).first,
|
||||
CGAL::edges(polyhedron).second,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ int main()
|
|||
Polyhedron polyhedron;
|
||||
polyhedron.make_tetrahedron(p, q, r, s);
|
||||
|
||||
// constructs AABB tree and computes internal KD-tree
|
||||
// constructs AABB tree and computes internal KD-tree
|
||||
// data structure to accelerate distance queries
|
||||
Tree tree(faces(polyhedron).first, faces(polyhedron).second, polyhedron);
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ int main()
|
|||
Polyhedron::Face_handle f = pp.second; // closest primitive id
|
||||
std::cout << "closest point: " << closest_point << std::endl;
|
||||
std::cout << "closest triangle: ( "
|
||||
<< f->halfedge()->vertex()->point() << " , "
|
||||
<< f->halfedge()->vertex()->point() << " , "
|
||||
<< f->halfedge()->next()->vertex()->point() << " , "
|
||||
<< f->halfedge()->next()->next()->vertex()->point()
|
||||
<< " )" << std::endl;
|
||||
|
|
|
|||
|
|
@ -80,10 +80,10 @@ int main()
|
|||
Plane_intersection plane_intersection = tree.any_intersection(plane_query);
|
||||
if(plane_intersection)
|
||||
{
|
||||
|
||||
|
||||
if(boost::get<Segment>(&(plane_intersection->first)))
|
||||
std::cout << "intersection object is a segment" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ struct Skip {
|
|||
};
|
||||
return(t == fd);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
|
@ -48,7 +48,7 @@ int main(int argc, char* argv[])
|
|||
Mesh mesh;
|
||||
input >> mesh;
|
||||
Tree tree(faces(mesh).first, faces(mesh).second, mesh);
|
||||
|
||||
|
||||
double d = CGAL::Polygon_mesh_processing::is_outward_oriented(mesh)?-1:1;
|
||||
|
||||
for(face_descriptor fd : faces(mesh)){
|
||||
|
|
@ -56,8 +56,8 @@ int main(int argc, char* argv[])
|
|||
Point p = CGAL::centroid(mesh.point(source(hd,mesh)),
|
||||
mesh.point(target(hd,mesh)),
|
||||
mesh.point(target(next(hd,mesh),mesh)));
|
||||
Vector v = CGAL::Polygon_mesh_processing::compute_face_normal(fd,mesh);
|
||||
|
||||
Vector v = CGAL::Polygon_mesh_processing::compute_face_normal(fd,mesh);
|
||||
|
||||
Ray ray(p,d * v);
|
||||
Skip skip(fd);
|
||||
Ray_intersection intersection = tree.first_intersection(ray, skip);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ int main()
|
|||
segments.push_back(Segment(a,c));
|
||||
segments.push_back(Segment(c,d));
|
||||
|
||||
// constructs the AABB tree and the internal search tree for
|
||||
// constructs the AABB tree and the internal search tree for
|
||||
// efficient distance computations.
|
||||
Tree tree(segments.begin(),segments.end());
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ int main()
|
|||
std::cout << tree.number_of_intersected_primitives(triangle_query)
|
||||
<< " intersections(s) with triangle" << std::endl;
|
||||
|
||||
// computes the closest point from a point query
|
||||
// computes the closest point from a point query
|
||||
Point point_query(2.0, 2.0, 2.0);
|
||||
Point closest = tree.closest_point(point_query);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ if ( CGAL_FOUND )
|
|||
endforeach()
|
||||
|
||||
else()
|
||||
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class AABB_face_graph_triangle_primitive
|
|||
{
|
||||
return std::make_pair(fd, &fg);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
/// \name Types
|
||||
|
|
@ -115,7 +115,7 @@ public:
|
|||
- `std::pair<boost::graph_traits<FaceGraph>::%face_descriptor, FaceGraph>` if `OneFaceGraphPerTree` is `CGAL::Tag_false`
|
||||
*/
|
||||
unspecified_type Id;
|
||||
|
||||
|
||||
/// @}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace CGAL {
|
|||
* and `AABBPrimitiveWithSharedData` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_true`.
|
||||
*
|
||||
* \tparam HalfedgeGraph is a model of the halfedge graph concept.
|
||||
* as key type and a \cgal Kernel `Point_3` as value type.
|
||||
* as key type and a \cgal Kernel `Point_3` as value type.
|
||||
* \tparam VertexPointPMap is a property map with `boost::graph_traits<HalfedgeGraph>::%vertex_descriptor`.
|
||||
* The default is `typename boost::property_map< HalfedgeGraph,vertex_point_t>::%const_type`.
|
||||
* \tparam OneHalfedgeGraphPerTree is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
|
|||
} else {
|
||||
FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter;
|
||||
FT t2 = ((bbox.max)(i) - *source_iter) / *direction_iter;
|
||||
|
||||
|
||||
t_near = (std::max)(t_near, (std::min)(t1, t2));
|
||||
t_far = (std::min)(t_far, (std::max)(t1, t2));
|
||||
|
||||
|
|
@ -300,7 +300,7 @@ public:
|
|||
public:
|
||||
Compute_bbox(const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
|
||||
:m_traits (traits) {}
|
||||
|
||||
|
||||
template<typename ConstPrimitiveIterator>
|
||||
typename AT::Bounding_box operator()(ConstPrimitiveIterator first,
|
||||
ConstPrimitiveIterator beyond) const
|
||||
|
|
@ -312,7 +312,7 @@ public:
|
|||
}
|
||||
return bbox;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
Compute_bbox compute_bbox_object() const {return Compute_bbox(*this);}
|
||||
|
|
@ -444,7 +444,7 @@ private:
|
|||
{
|
||||
return internal::Primitive_helper<AT>::get_datum(pr,*this).bbox();
|
||||
}
|
||||
|
||||
|
||||
|
||||
typedef enum { CGAL_AXIS_X = 0,
|
||||
CGAL_AXIS_Y = 1,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -215,7 +215,7 @@ template<typename Ray, typename SkipFunctor>
|
|||
boost::optional< typename AABB_tree<AABBTraits>::template Intersection_and_primitive_id<Ray>::Type >
|
||||
AABB_tree<AABBTraits>::first_intersection(const Ray& query,
|
||||
const SkipFunctor& skip) const {
|
||||
CGAL_static_assertion_msg((boost::is_same<Ray, typename AABBTraits::Ray_3>::value),
|
||||
CGAL_static_assertion_msg((boost::is_same<Ray, typename AABBTraits::Ray_3>::value),
|
||||
"Ray and Ray_3 must be the same type");
|
||||
|
||||
switch(size()) // copy-paste from AABB_tree::traversal
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#include <CGAL/internal/AABB_tree/AABB_node.h>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
namespace CGAL {
|
||||
|
||||
namespace internal { namespace AABB_tree {
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ public:
|
|||
: m_result(), m_traits(traits)
|
||||
{}
|
||||
|
||||
bool go_further() const {
|
||||
bool go_further() const {
|
||||
return !m_result;
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ public:
|
|||
}
|
||||
|
||||
Result result() const { return m_result; }
|
||||
bool is_intersection_found() const {
|
||||
bool is_intersection_found() const {
|
||||
return m_result;
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ public:
|
|||
const typename Primitive::Id& hint_primitive,
|
||||
const AABBTraits& traits)
|
||||
: m_closest_point(hint),
|
||||
m_closest_primitive(hint_primitive),
|
||||
m_closest_primitive(hint_primitive),
|
||||
m_traits(traits)
|
||||
{}
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ public:
|
|||
if( !m_traits.equal_3_object()(new_closest_point, m_closest_point) )
|
||||
{
|
||||
m_closest_primitive = primitive.id();
|
||||
m_closest_point = new_closest_point; // this effectively shrinks the sphere
|
||||
m_closest_point = new_closest_point; // this effectively shrinks the sphere
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ template<class Primitive>
|
|||
struct Point_result_type<Primitive,false>{ typedef typename Primitive::Point type; };
|
||||
|
||||
|
||||
//helper controlling whether extra data should be stored in the AABB_tree traits class
|
||||
//helper controlling whether extra data should be stored in the AABB_tree traits class
|
||||
template <class AABBTraits, bool has_shared_data=Has_nested_type_Shared_data<typename AABBTraits::Primitive>::value>
|
||||
struct Primitive_helper;
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ struct Primitive_helper<AABBTraits,true>{
|
|||
return p.reference_point(traits.shared_data());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <class AABBTraits>
|
||||
struct Primitive_helper<AABBTraits,false>{
|
||||
typedef typename Datum_result_type<typename AABBTraits::Primitive>::type Datum_type;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
This component implements a hierarchy of axis-aligned bounding boxes (a AABB tree) for efficient intersection and distance computations between 3D queries and sets of input 3D geometric objects.
|
||||
This component implements a hierarchy of axis-aligned bounding boxes (a AABB tree) for efficient intersection and distance computations between 3D queries and sets of input 3D geometric objects.
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ void test_all_intersection_query_types(Tree& tree)
|
|||
|
||||
// any_intersection
|
||||
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > r = tree.any_intersection(ray);
|
||||
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line);
|
||||
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line);
|
||||
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > s = tree.any_intersection(segment);
|
||||
|
||||
// any_intersected_primitive
|
||||
|
|
@ -162,7 +162,7 @@ void test_distance_speed(Tree& tree,
|
|||
// picks a random point in the tree bbox
|
||||
Point query = random_point_in<K>(tree.bbox());
|
||||
Point closest = tree.closest_point(query);
|
||||
(void) closest;
|
||||
(void) closest;
|
||||
nb++;
|
||||
}
|
||||
double speed = (double)nb / timer.time();
|
||||
|
|
@ -323,7 +323,7 @@ class Naive_implementations
|
|||
typedef typename Traits::Point_and_primitive_id Point_and_primitive_id;
|
||||
|
||||
typedef boost::optional<Object_and_primitive_id> Intersection_result;
|
||||
|
||||
|
||||
const Traits& m_traits;
|
||||
public:
|
||||
Naive_implementations(const Traits& traits):m_traits(traits){}
|
||||
|
|
@ -691,8 +691,8 @@ private:
|
|||
typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type
|
||||
Obj_type;
|
||||
|
||||
typedef
|
||||
std::vector<Obj_type>
|
||||
typedef
|
||||
std::vector<Obj_type>
|
||||
Obj_Id_vector;
|
||||
|
||||
Obj_Id_vector intersections_naive;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ if ( CGAL_FOUND )
|
|||
endforeach()
|
||||
|
||||
else()
|
||||
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const int runs = 10;
|
|||
template<typename Tree>
|
||||
struct FilterP {
|
||||
const Tree* t;
|
||||
|
||||
|
||||
template<typename T>
|
||||
bool operator()(const T& tt) { return !t->do_intersect(tt); }
|
||||
};
|
||||
|
|
@ -55,7 +55,7 @@ std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, lo
|
|||
}
|
||||
|
||||
template<typename K>
|
||||
boost::tuple<std::size_t, std::size_t, std::size_t, long> test(const char* name) {
|
||||
boost::tuple<std::size_t, std::size_t, std::size_t, long> test(const char* name) {
|
||||
typedef typename K::FT FT;
|
||||
typedef typename K::Ray_3 Ray;
|
||||
typedef typename K::Line_3 Line;
|
||||
|
|
@ -75,15 +75,15 @@ boost::tuple<std::size_t, std::size_t, std::size_t, long> test(const char* name)
|
|||
// Random seeded to 23, cube size equal to the magic number 2
|
||||
CGAL::Random r(23);
|
||||
CGAL::Random_points_in_cube_3<Point, CGAL::Creator_uniform_3<FT, Point> > g( 2., r);
|
||||
|
||||
|
||||
std::vector<Point> points;
|
||||
points.reserve(elements * 2);
|
||||
std::copy_n(g, elements * 2, std::back_inserter(points));
|
||||
|
||||
|
||||
// generate a bunch of happy random primitives
|
||||
std::vector<Line> lines;
|
||||
lines.reserve(elements);
|
||||
|
||||
|
||||
// forward
|
||||
for(std::size_t i = 0; i < points.size(); i += 2)
|
||||
{
|
||||
|
|
@ -112,13 +112,13 @@ boost::tuple<std::size_t, std::size_t, std::size_t, long> test(const char* name)
|
|||
// filter all primitives that do not intersect
|
||||
|
||||
FilterP<Tree> p = { &tree };
|
||||
|
||||
|
||||
lines.erase(std::remove_if(lines.begin(), lines.end(), p), lines.end());
|
||||
|
||||
rays.erase(std::remove_if(rays.begin(), rays.end(), p), rays.end());
|
||||
|
||||
segments.erase(std::remove_if(segments.begin(), segments.end(), p), segments.end());
|
||||
|
||||
|
||||
boost::tuple<std::size_t, std::size_t, std::size_t, long> tu;
|
||||
|
||||
{
|
||||
|
|
@ -130,7 +130,7 @@ boost::tuple<std::size_t, std::size_t, std::size_t, long> test(const char* name)
|
|||
long counter = 0L;
|
||||
tu = boost::make_tuple(intersect(lines.begin(), lines.end(), tree, counter),
|
||||
intersect(rays.begin(), rays.end(), tree, counter),
|
||||
intersect(segments.begin(), segments.end(), tree, counter),
|
||||
intersect(segments.begin(), segments.end(), tree, counter),
|
||||
// cant use counter here
|
||||
0);
|
||||
boost::get<3>(tu) = counter;
|
||||
|
|
@ -164,7 +164,7 @@ int main()
|
|||
std::cout << "| Epic kernel |";
|
||||
boost::tuple<std::size_t, std::size_t, std::size_t, long> t5 = test<CGAL::Exact_predicates_inexact_constructions_kernel>(filename);
|
||||
std::cout << " | " << std::endl;
|
||||
|
||||
|
||||
std::size_t a, b, c;
|
||||
long d;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,100 +29,100 @@
|
|||
template <class K>
|
||||
int test()
|
||||
{
|
||||
// types
|
||||
typedef typename K::FT FT;
|
||||
typedef typename K::Line_3 Line;
|
||||
typedef typename K::Point_3 Point;
|
||||
typedef typename K::Segment_3 Segment;
|
||||
// types
|
||||
typedef typename K::FT FT;
|
||||
typedef typename K::Line_3 Line;
|
||||
typedef typename K::Point_3 Point;
|
||||
typedef typename K::Segment_3 Segment;
|
||||
|
||||
// load polyhedron
|
||||
typedef CGAL::Polyhedron_3<K> Polyhedron;
|
||||
Polyhedron polyhedron;
|
||||
std::ifstream ifs("./data/tetrahedron.off");
|
||||
ifs >> polyhedron;
|
||||
// load polyhedron
|
||||
typedef CGAL::Polyhedron_3<K> Polyhedron;
|
||||
Polyhedron polyhedron;
|
||||
std::ifstream ifs("./data/tetrahedron.off");
|
||||
ifs >> polyhedron;
|
||||
|
||||
// construct tree from facets
|
||||
typedef typename CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
|
||||
typedef typename CGAL::AABB_traits<K,Primitive> Traits;
|
||||
typedef typename CGAL::AABB_tree<Traits> Tree;
|
||||
typedef typename Tree::Object_and_primitive_id Object_and_primitive_id;
|
||||
Tree tree(faces(polyhedron).first, faces(polyhedron).second, polyhedron);
|
||||
// construct tree from facets
|
||||
typedef typename CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
|
||||
typedef typename CGAL::AABB_traits<K,Primitive> Traits;
|
||||
typedef typename CGAL::AABB_tree<Traits> Tree;
|
||||
typedef typename Tree::Object_and_primitive_id Object_and_primitive_id;
|
||||
Tree tree(faces(polyhedron).first, faces(polyhedron).second, polyhedron);
|
||||
|
||||
// segment intersection query
|
||||
Point p((FT)-0.25, (FT)0.251, (FT)0.255);
|
||||
Point q((FT) 0.25, (FT)0.253, (FT)0.256);
|
||||
Segment pq(p,q);
|
||||
// segment intersection query
|
||||
Point p((FT)-0.25, (FT)0.251, (FT)0.255);
|
||||
Point q((FT) 0.25, (FT)0.253, (FT)0.256);
|
||||
Segment pq(p,q);
|
||||
|
||||
if(!tree.do_intersect(pq))
|
||||
{
|
||||
std::cerr << "no intersection found" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if(!tree.do_intersect(pq))
|
||||
{
|
||||
std::cerr << "no intersection found" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if(tree.number_of_intersected_primitives(pq) != 1)
|
||||
{
|
||||
std::cerr << "number of intersections different than one" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if(tree.number_of_intersected_primitives(pq) != 1)
|
||||
{
|
||||
std::cerr << "number of intersections different than one" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
boost::optional<Object_and_primitive_id> any;
|
||||
any = tree.any_intersection(pq);
|
||||
if(!any)
|
||||
{
|
||||
std::cerr << "did not find any intersection" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
Object_and_primitive_id op = *any;
|
||||
CGAL::Object object = op.first;
|
||||
Point point;
|
||||
if(CGAL::assign(point,object))
|
||||
{
|
||||
std::cout << "Intersection point: " << point << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "intersection does not assign to a point" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
boost::optional<Object_and_primitive_id> any;
|
||||
any = tree.any_intersection(pq);
|
||||
if(!any)
|
||||
{
|
||||
std::cerr << "did not find any intersection" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
Object_and_primitive_id op = *any;
|
||||
CGAL::Object object = op.first;
|
||||
Point point;
|
||||
if(CGAL::assign(point,object))
|
||||
{
|
||||
std::cout << "Intersection point: " << point << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "intersection does not assign to a point" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// line intersection query
|
||||
Line line_pq(p,q);
|
||||
if(!tree.do_intersect(line_pq))
|
||||
{
|
||||
std::cerr << "no intersection found with line" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if(tree.number_of_intersected_primitives(line_pq) != 2)
|
||||
{
|
||||
std::cerr << "number of intersections different than two with line" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
// line intersection query
|
||||
Line line_pq(p,q);
|
||||
if(!tree.do_intersect(line_pq))
|
||||
{
|
||||
std::cerr << "no intersection found with line" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if(tree.number_of_intersected_primitives(line_pq) != 2)
|
||||
{
|
||||
std::cerr << "number of intersections different than two with line" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// closest point query
|
||||
Point r((FT)0.0, (FT)0.0, (FT)3.0);
|
||||
Point closest((FT)0.0, (FT)0.0, (FT)1.0);
|
||||
Point result = tree.closest_point(r);
|
||||
if(result != closest)
|
||||
{
|
||||
std::cerr << "wrong closest point" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
// closest point query
|
||||
Point r((FT)0.0, (FT)0.0, (FT)3.0);
|
||||
Point closest((FT)0.0, (FT)0.0, (FT)1.0);
|
||||
Point result = tree.closest_point(r);
|
||||
if(result != closest)
|
||||
{
|
||||
std::cerr << "wrong closest point" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
if(test<CGAL::Simple_cartesian<float> >() == EXIT_FAILURE)
|
||||
return EXIT_FAILURE;
|
||||
if(test<CGAL::Simple_cartesian<float> >() == EXIT_FAILURE)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if(test<CGAL::Simple_cartesian<double> >() == EXIT_FAILURE)
|
||||
return EXIT_FAILURE;
|
||||
if(test<CGAL::Simple_cartesian<double> >() == EXIT_FAILURE)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if(test<CGAL::Exact_predicates_inexact_constructions_kernel>() == EXIT_FAILURE)
|
||||
return EXIT_FAILURE;
|
||||
if(test<CGAL::Exact_predicates_inexact_constructions_kernel>() == EXIT_FAILURE)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/***EMACS SETTINGS***/
|
||||
|
|
|
|||
|
|
@ -43,17 +43,17 @@ int main(void)
|
|||
std::cout << "error reading bunny" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Tree t1(faces(m).begin(), faces(m).end(), m);
|
||||
Tree2 t2(faces(m).begin(), faces(m).end(), m);
|
||||
Tree3 t3(faces(m).begin(), faces(m).end(), m);
|
||||
Tree4 t4(faces(m).begin(), faces(m).end(), m);
|
||||
|
||||
|
||||
t1.build();
|
||||
t2.build();
|
||||
t3.build();
|
||||
t4.build();
|
||||
|
||||
|
||||
Primitive p1(faces(m).begin(), m);
|
||||
Primitive2 p2(faces(m).begin(), m);
|
||||
Primitive3 p3(faces(m).begin(), m);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ int main()
|
|||
tree.all_intersected_primitives(triangle_query, devnull);
|
||||
assert(!tree.any_intersected_primitive(triangle_query));
|
||||
assert(!tree.any_intersection(triangle_query));
|
||||
//Cannot call tree.bbox();
|
||||
//Cannot call tree.bbox();
|
||||
tree.build();
|
||||
tree.clear();
|
||||
//Cannot call tree.closest_*(...)
|
||||
|
|
|
|||
|
|
@ -25,14 +25,14 @@ typedef K::Segment_3 Segment;
|
|||
typedef K::Ray_3 Ray;
|
||||
typedef CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick> > Mesh;
|
||||
typedef CGAL::AABB_face_graph_triangle_primitive<Mesh,
|
||||
CGAL::Default,
|
||||
CGAL::Default,
|
||||
CGAL::Tag_false> T_Primitive;
|
||||
typedef CGAL::AABB_traits<K, T_Primitive> T_Traits;
|
||||
typedef CGAL::AABB_tree<T_Traits> T_Tree;
|
||||
typedef T_Tree::Primitive_id T_Primitive_id;
|
||||
|
||||
typedef CGAL::AABB_halfedge_graph_segment_primitive<Mesh,
|
||||
CGAL::Default,
|
||||
CGAL::Default,
|
||||
CGAL::Tag_false> E_Primitive;
|
||||
typedef CGAL::AABB_traits<K, E_Primitive> E_Traits;
|
||||
typedef CGAL::AABB_tree<E_Traits> E_Tree;
|
||||
|
|
@ -61,8 +61,8 @@ int main()
|
|||
tree.insert(faces(m2).first, faces(m2).second, m2);
|
||||
tree.build();
|
||||
T_Tree::Bounding_box bbox = tree.bbox();
|
||||
Point bbox_center((bbox.xmin() + bbox.xmax()) / 2,
|
||||
(bbox.ymin() + bbox.ymax()) / 2,
|
||||
Point bbox_center((bbox.xmin() + bbox.xmax()) / 2,
|
||||
(bbox.ymin() + bbox.ymax()) / 2,
|
||||
(bbox.zmin() + bbox.zmax()) / 2);
|
||||
std::vector< T_Primitive_id > intersections;
|
||||
Ray ray(bbox_center+Vector(3,-0.25,0),bbox_center+Vector(-3,+0.25,0));
|
||||
|
|
@ -75,8 +75,8 @@ int main()
|
|||
Ray e_ray(Point(0,0,0),Point(0,1,1));
|
||||
e_tree.all_intersected_primitives(e_ray,
|
||||
std::back_inserter(e_intersections));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,8 +89,8 @@ int main()
|
|||
|
||||
Tree tree(faces(polyhedron).first, faces(polyhedron).second, polyhedron);
|
||||
Tree::Bounding_box bbox = tree.bbox();
|
||||
Vector bbox_center((bbox.xmin() + bbox.xmax()) / 2,
|
||||
(bbox.ymin() + bbox.ymax()) / 2,
|
||||
Vector bbox_center((bbox.xmin() + bbox.xmax()) / 2,
|
||||
(bbox.ymin() + bbox.ymax()) / 2,
|
||||
(bbox.zmin() + bbox.zmax()) / 2);
|
||||
boost::array<double, 3> extents;
|
||||
extents[0] = bbox.xmax() - bbox.xmin();
|
||||
|
|
@ -101,7 +101,7 @@ int main()
|
|||
std::cout << bbox << std::endl;
|
||||
std::cout << bbox_center << std::endl;
|
||||
std::cout << max_extent << std::endl;
|
||||
|
||||
|
||||
const int NB_RAYS = 1000;
|
||||
std::vector<Point> v1, v2;
|
||||
v1.reserve(NB_RAYS); v2.reserve(NB_RAYS);
|
||||
|
|
@ -119,7 +119,7 @@ int main()
|
|||
for(std::vector<Point>::iterator it = v2.begin(); it != v2.end(); ++it) {
|
||||
*it = *it + bbox_center;
|
||||
}
|
||||
|
||||
|
||||
// Generate NB_RAYS using v1 as source and v2 as target.
|
||||
std::vector<Ray> rays;
|
||||
rays.reserve(NB_RAYS);
|
||||
|
|
@ -143,7 +143,7 @@ int main()
|
|||
"Primitives mismatch.");
|
||||
std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), boost::none);
|
||||
std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl;
|
||||
std::cout << "Primitive method had to sort " << accum/NB_RAYS
|
||||
std::cout << "Primitive method had to sort " << accum/NB_RAYS
|
||||
<< " intersections on average." << std::endl;
|
||||
t.stop();
|
||||
std::cout << t.time() << std::endl;
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ int main()
|
|||
tree.insert(segments.begin(), segments.end());
|
||||
tree.build();
|
||||
assert(tree.closest_point(Point(-0.1, -0.1, -0.1)) == Point(0, 0, 0));
|
||||
assert(tree.closest_point(Point(-0.1, -0.1, -0.1), Point(0, 0, 0)) ==
|
||||
Point(0, 0, 0));
|
||||
assert(tree.closest_point(Point(-0.1, -0.1, -0.1), Point(0, 0, 0)) ==
|
||||
Point(0, 0, 0));
|
||||
assert(tree.closest_point_and_primitive(Point(-0.1, -0.1, -0.1)).second ==
|
||||
segments.begin());
|
||||
segments.begin());
|
||||
// Too lazy to call closest_point_and_primitive with a hint. The API is
|
||||
// strange. --Laurent Rineau, 2013/01/16
|
||||
assert(tree.do_intersect(plane_query) == true);
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ if ( CGAL_FOUND )
|
|||
endforeach()
|
||||
|
||||
else()
|
||||
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ struct On_the_fly_pair{
|
|||
typedef std::pair<Point, std::size_t> result_type;
|
||||
|
||||
On_the_fly_pair(const Pwn_vector& points) : points(points) {}
|
||||
|
||||
|
||||
result_type
|
||||
operator()(std::size_t i) const
|
||||
{
|
||||
|
|
@ -59,7 +59,7 @@ struct Priority_with_structure_coherence {
|
|||
|
||||
Structure& structure;
|
||||
double bound;
|
||||
|
||||
|
||||
Priority_with_structure_coherence(Structure& structure,
|
||||
double bound)
|
||||
: structure (structure), bound (bound)
|
||||
|
|
@ -111,10 +111,10 @@ int main (int argc, char* argv[])
|
|||
Pwn_vector points;
|
||||
|
||||
const char* fname = (argc>1) ? argv[1] : "data/cube.pwn";
|
||||
// Loading point set from a file.
|
||||
// Loading point set from a file.
|
||||
std::ifstream stream(fname);
|
||||
|
||||
if (!stream ||
|
||||
if (!stream ||
|
||||
!CGAL::read_xyz_points(stream,
|
||||
std::back_inserter(points),
|
||||
CGAL::parameters::point_map(Point_map()).
|
||||
|
|
@ -194,6 +194,6 @@ int main (int argc, char* argv[])
|
|||
std::cerr << "all done\n" << std::endl;
|
||||
|
||||
f.close();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -401,12 +401,12 @@ namespace CGAL {
|
|||
{
|
||||
if (vh->m_incident_border == nullptr) return false; //vh is interior
|
||||
if (vh->m_incident_border->first->first != nullptr)
|
||||
{
|
||||
if (vh->m_incident_border->second->first != nullptr)
|
||||
return ((vh->m_incident_border->first->second.second == i)||
|
||||
(vh->m_incident_border->second->second.second == i));
|
||||
return (vh->m_incident_border->first->second.second == i);
|
||||
}
|
||||
{
|
||||
if (vh->m_incident_border->second->first != nullptr)
|
||||
return ((vh->m_incident_border->first->second.second == i)||
|
||||
(vh->m_incident_border->second->second.second == i));
|
||||
return (vh->m_incident_border->first->second.second == i);
|
||||
}
|
||||
return false; //vh is still exterior
|
||||
}
|
||||
|
||||
|
|
@ -414,32 +414,32 @@ namespace CGAL {
|
|||
void remove_border_edge(Vertex_handle w, Vertex_handle v)
|
||||
{
|
||||
if (w->m_incident_border != nullptr)
|
||||
{
|
||||
if (w->m_incident_border->second->first == v)
|
||||
{
|
||||
w->m_incident_border->second->first = nullptr;
|
||||
set_interior_edge(w,v);
|
||||
return;
|
||||
}
|
||||
if (w->m_incident_border->first->first == v)
|
||||
{
|
||||
if (w->m_incident_border->second->first != nullptr)
|
||||
{
|
||||
Next_border_elt* tmp = w->m_incident_border->first;
|
||||
w->m_incident_border->first = w->m_incident_border->second;
|
||||
w->m_incident_border->second = tmp;
|
||||
w->m_incident_border->second->first = nullptr;
|
||||
set_interior_edge(w,v);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
w->m_incident_border->first->first = nullptr;
|
||||
set_interior_edge(w,v);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
if (w->m_incident_border->second->first == v)
|
||||
{
|
||||
w->m_incident_border->second->first = nullptr;
|
||||
set_interior_edge(w,v);
|
||||
return;
|
||||
}
|
||||
if (w->m_incident_border->first->first == v)
|
||||
{
|
||||
if (w->m_incident_border->second->first != nullptr)
|
||||
{
|
||||
Next_border_elt* tmp = w->m_incident_border->first;
|
||||
w->m_incident_border->first = w->m_incident_border->second;
|
||||
w->m_incident_border->second = tmp;
|
||||
w->m_incident_border->second->first = nullptr;
|
||||
set_interior_edge(w,v);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
w->m_incident_border->first->first = nullptr;
|
||||
set_interior_edge(w,v);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -448,12 +448,12 @@ namespace CGAL {
|
|||
|
||||
bool r1;
|
||||
if(w->m_ie_first == ie_sentinel){
|
||||
r1 = false;
|
||||
r1 = false;
|
||||
}else {
|
||||
typename std::list<Vertex_handle>::iterator b(w->m_ie_first), e(w->m_ie_last);
|
||||
e++;
|
||||
typename std::list<Vertex_handle>::iterator r = std::find(b, e, v);
|
||||
r1 = ( r != e);
|
||||
typename std::list<Vertex_handle>::iterator b(w->m_ie_first), e(w->m_ie_last);
|
||||
e++;
|
||||
typename std::list<Vertex_handle>::iterator r = std::find(b, e, v);
|
||||
r1 = ( r != e);
|
||||
}
|
||||
|
||||
return r1;
|
||||
|
|
@ -467,17 +467,17 @@ namespace CGAL {
|
|||
inline void set_interior_edge(Vertex_handle w, Vertex_handle v)
|
||||
{
|
||||
if(w->m_ie_last == ie_sentinel){ // empty set
|
||||
CGAL_assertion(w->m_ie_first == w->m_ie_last);
|
||||
w->m_ie_last = interior_edges.insert(w->m_ie_last, v);
|
||||
w->m_ie_first = w->m_ie_last;
|
||||
CGAL_assertion(w->m_ie_first == w->m_ie_last);
|
||||
w->m_ie_last = interior_edges.insert(w->m_ie_last, v);
|
||||
w->m_ie_first = w->m_ie_last;
|
||||
} else {
|
||||
typename std::list<Vertex_handle>::iterator e(w->m_ie_last);
|
||||
e++;
|
||||
typename std::list<Vertex_handle>::iterator e(w->m_ie_last);
|
||||
e++;
|
||||
#ifdef DEBUG
|
||||
typename std::list<Vertex_handle>::iterator r = std::find(w->m_ie_first, e, v);
|
||||
CGAL_assertion(r == e);
|
||||
typename std::list<Vertex_handle>::iterator r = std::find(w->m_ie_first, e, v);
|
||||
CGAL_assertion(r == e);
|
||||
#endif
|
||||
w->m_ie_last = interior_edges.insert(e, v);
|
||||
w->m_ie_last = interior_edges.insert(e, v);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -485,26 +485,26 @@ namespace CGAL {
|
|||
inline void remove_interior_edge(Vertex_handle w, Vertex_handle v)
|
||||
{
|
||||
if(w->m_ie_first == ie_sentinel){
|
||||
CGAL_assertion(w->m_ie_last == w->m_ie_first);
|
||||
CGAL_assertion(w->m_ie_last == w->m_ie_first);
|
||||
} else if(w->m_ie_first == w->m_ie_last){ // there is only one element
|
||||
if(*(w->m_ie_first) == v){
|
||||
interior_edges.erase(w->m_ie_first);
|
||||
w->m_ie_last = ie_sentinel;
|
||||
w->m_ie_first = w->m_ie_last;
|
||||
}
|
||||
if(*(w->m_ie_first) == v){
|
||||
interior_edges.erase(w->m_ie_first);
|
||||
w->m_ie_last = ie_sentinel;
|
||||
w->m_ie_first = w->m_ie_last;
|
||||
}
|
||||
} else {
|
||||
typename std::list<Vertex_handle>::iterator b(w->m_ie_first), e(w->m_ie_last);
|
||||
e++;
|
||||
typename std::list<Vertex_handle>::iterator r = std::find(b, e, v);
|
||||
if(r != e){
|
||||
if(r == w->m_ie_first){
|
||||
w->m_ie_first++;
|
||||
}
|
||||
if(r == w->m_ie_last){
|
||||
w->m_ie_last--;
|
||||
}
|
||||
interior_edges.erase(r);
|
||||
}
|
||||
typename std::list<Vertex_handle>::iterator b(w->m_ie_first), e(w->m_ie_last);
|
||||
e++;
|
||||
typename std::list<Vertex_handle>::iterator r = std::find(b, e, v);
|
||||
if(r != e){
|
||||
if(r == w->m_ie_first){
|
||||
w->m_ie_first++;
|
||||
}
|
||||
if(r == w->m_ie_last){
|
||||
w->m_ie_last--;
|
||||
}
|
||||
interior_edges.erase(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -514,20 +514,20 @@ namespace CGAL {
|
|||
inline void set_incidence_request(Vertex_handle w, const Incidence_request_elt& ir)
|
||||
{
|
||||
if(w->m_ir_last == sentinel ){
|
||||
CGAL_assertion(w->m_ir_first == w->m_ir_last);
|
||||
w->m_ir_last = incidence_requests.insert(w->m_ir_last, ir);
|
||||
w->m_ir_first = w->m_ir_last;
|
||||
CGAL_assertion(w->m_ir_first == w->m_ir_last);
|
||||
w->m_ir_last = incidence_requests.insert(w->m_ir_last, ir);
|
||||
w->m_ir_first = w->m_ir_last;
|
||||
} else {
|
||||
typename std::list<Incidence_request_elt>::iterator e(w->m_ir_last);
|
||||
e++;
|
||||
w->m_ir_last = incidence_requests.insert(e, ir);
|
||||
typename std::list<Incidence_request_elt>::iterator e(w->m_ir_last);
|
||||
e++;
|
||||
w->m_ir_last = incidence_requests.insert(e, ir);
|
||||
}
|
||||
}
|
||||
|
||||
inline bool is_incidence_requested(Vertex_handle w) const
|
||||
{
|
||||
if(w->m_ir_last == sentinel ){
|
||||
CGAL_assertion(w->m_ir_first == sentinel );
|
||||
CGAL_assertion(w->m_ir_first == sentinel );
|
||||
}
|
||||
return (w->m_ir_last != sentinel );
|
||||
}
|
||||
|
|
@ -540,10 +540,10 @@ namespace CGAL {
|
|||
inline Incidence_request_iterator incidence_request_end(Vertex_handle w)
|
||||
{
|
||||
if(w->m_ir_last != sentinel ){
|
||||
CGAL_assertion(w->m_ir_first != sentinel );
|
||||
Incidence_request_iterator it(w->m_ir_last);
|
||||
it++;
|
||||
return it;
|
||||
CGAL_assertion(w->m_ir_first != sentinel );
|
||||
Incidence_request_iterator it(w->m_ir_last);
|
||||
it++;
|
||||
return it;
|
||||
}
|
||||
return w->m_ir_last;
|
||||
}
|
||||
|
|
@ -551,11 +551,11 @@ namespace CGAL {
|
|||
inline void erase_incidence_request(Vertex_handle w)
|
||||
{
|
||||
if(w->m_ir_last != sentinel ){
|
||||
CGAL_assertion(w->m_ir_first != sentinel );
|
||||
w->m_ir_last++;
|
||||
incidence_requests.erase(w->m_ir_first, w->m_ir_last);
|
||||
w->m_ir_first = sentinel ;
|
||||
w->m_ir_last = sentinel ;
|
||||
CGAL_assertion(w->m_ir_first != sentinel );
|
||||
w->m_ir_last++;
|
||||
incidence_requests.erase(w->m_ir_first, w->m_ir_last);
|
||||
w->m_ir_first = sentinel ;
|
||||
w->m_ir_last = sentinel ;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -563,17 +563,17 @@ namespace CGAL {
|
|||
void re_init(Vertex_handle w)
|
||||
{
|
||||
if (w->m_incident_border != nullptr)
|
||||
{
|
||||
w->delete_border();
|
||||
}
|
||||
{
|
||||
w->delete_border();
|
||||
}
|
||||
|
||||
if(w->m_ir_first != sentinel ){
|
||||
CGAL_assertion(w->m_ir_last != sentinel );
|
||||
typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last);
|
||||
e++;
|
||||
incidence_requests.erase(b, e);
|
||||
w->m_ir_first = sentinel ;
|
||||
w->m_ir_last = sentinel ;
|
||||
CGAL_assertion(w->m_ir_last != sentinel );
|
||||
typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last);
|
||||
e++;
|
||||
incidence_requests.erase(b, e);
|
||||
w->m_ir_first = sentinel ;
|
||||
w->m_ir_last = sentinel ;
|
||||
}
|
||||
|
||||
w->m_incident_border = new_border();
|
||||
|
|
@ -587,10 +587,10 @@ namespace CGAL {
|
|||
{
|
||||
w->m_mark--;
|
||||
if(w->m_mark == 0)
|
||||
{
|
||||
w->delete_border();
|
||||
erase_incidence_request(w);
|
||||
}
|
||||
{
|
||||
w->delete_border();
|
||||
erase_incidence_request(w);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -621,21 +621,21 @@ namespace CGAL {
|
|||
void clear_vertex(Vertex_handle w)
|
||||
{
|
||||
if (w->m_incident_border != nullptr)
|
||||
{
|
||||
w->delete_border();
|
||||
}
|
||||
{
|
||||
w->delete_border();
|
||||
}
|
||||
if(w->m_ir_first != sentinel ){
|
||||
CGAL_assertion(w->m_ir_last != sentinel );
|
||||
typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last);
|
||||
e++;
|
||||
incidence_requests.erase(b, e);
|
||||
CGAL_assertion(w->m_ir_last != sentinel );
|
||||
typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last);
|
||||
e++;
|
||||
incidence_requests.erase(b, e);
|
||||
}
|
||||
|
||||
if(w->m_ie_first != ie_sentinel){
|
||||
CGAL_assertion(w->m_ie_last != ie_sentinel);
|
||||
typename std::list<Vertex_handle>::iterator b(w->m_ie_first), e(w->m_ie_last);
|
||||
e++;
|
||||
interior_edges.erase(b, e);
|
||||
CGAL_assertion(w->m_ie_last != ie_sentinel);
|
||||
typename std::list<Vertex_handle>::iterator b(w->m_ie_first), e(w->m_ie_last);
|
||||
e++;
|
||||
interior_edges.erase(b, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1315,7 +1315,7 @@ namespace CGAL {
|
|||
returns the infinite floating value that prevents a facet to be used.
|
||||
*/
|
||||
coord_type infinity() const { return std::numeric_limits<coord_type>::infinity(); }
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// For a border edge e we determine the incident facet which has the highest
|
||||
|
|
@ -1801,150 +1801,150 @@ namespace CGAL {
|
|||
return EXTERIOR_CASE;
|
||||
}
|
||||
else // c->vertex(i) is a border point (and now there's only 1
|
||||
// border incident to a point... _mark<1 even if th orientation
|
||||
// may be such as one vh has 2 successorson the same border...
|
||||
{
|
||||
// a ce niveau on peut tester si le recollement se fait en
|
||||
// maintenant la compatibilite d'orientation des bords (pour
|
||||
// surface orientable...) ou si elle est brisee...
|
||||
Edge_incident_facet edge_Ifacet_1(Edge(c, i, edge_Efacet.first.second),
|
||||
// border incident to a point... _mark<1 even if th orientation
|
||||
// may be such as one vh has 2 successorson the same border...
|
||||
{
|
||||
// a ce niveau on peut tester si le recollement se fait en
|
||||
// maintenant la compatibilite d'orientation des bords (pour
|
||||
// surface orientable...) ou si elle est brisee...
|
||||
Edge_incident_facet edge_Ifacet_1(Edge(c, i, edge_Efacet.first.second),
|
||||
edge_Efacet.second);
|
||||
Edge_incident_facet edge_Ifacet_2(Edge(c, i, edge_Efacet.first.third),
|
||||
Edge_incident_facet edge_Ifacet_2(Edge(c, i, edge_Efacet.first.third),
|
||||
edge_Efacet.second);
|
||||
|
||||
e1 = compute_value(edge_Ifacet_1);
|
||||
e2 = compute_value(edge_Ifacet_2);
|
||||
e1 = compute_value(edge_Ifacet_1);
|
||||
e2 = compute_value(edge_Ifacet_2);
|
||||
|
||||
if ((e1.first >= STANDBY_CANDIDATE)&&(e2.first >= STANDBY_CANDIDATE))
|
||||
return NOT_VALID_CONNECTING_CASE;
|
||||
if ((e1.first >= STANDBY_CANDIDATE)&&(e2.first >= STANDBY_CANDIDATE))
|
||||
return NOT_VALID_CONNECTING_CASE;
|
||||
|
||||
// vu compute value: les candidats oreilles fournis sont sans
|
||||
// aretes interieures et le sommet oppose n'est pas non plus interieur
|
||||
Edge_incident_facet ear1 = e1.second.second;
|
||||
Edge_incident_facet ear2 = e2.second.second;
|
||||
// vu compute value: les candidats oreilles fournis sont sans
|
||||
// aretes interieures et le sommet oppose n'est pas non plus interieur
|
||||
Edge_incident_facet ear1 = e1.second.second;
|
||||
Edge_incident_facet ear2 = e2.second.second;
|
||||
|
||||
int ear1_i = (6 - ear1.second
|
||||
- ear1.first.second
|
||||
- ear1.first.third);
|
||||
Cell_handle ear1_c = ear1.first.first;
|
||||
Border_elt result_ear1;
|
||||
int ear1_i = (6 - ear1.second
|
||||
- ear1.first.second
|
||||
- ear1.first.third);
|
||||
Cell_handle ear1_c = ear1.first.first;
|
||||
Border_elt result_ear1;
|
||||
|
||||
int ear2_i = (6 - ear2.second
|
||||
- ear2.first.second
|
||||
- ear2.first.third);
|
||||
Cell_handle ear2_c = ear2.first.first;
|
||||
Border_elt result_ear2;
|
||||
int ear2_i = (6 - ear2.second
|
||||
- ear2.first.second
|
||||
- ear2.first.third);
|
||||
Cell_handle ear2_c = ear2.first.first;
|
||||
Border_elt result_ear2;
|
||||
|
||||
Edge_like ear1_e, ear2_e;
|
||||
// pour maintenir la reconstruction d'une surface orientable :
|
||||
// on verifie que les bords se recollent dans des sens opposes
|
||||
if (ordered_key.first==v1)
|
||||
{
|
||||
ear1_e = Edge_like(c->vertex(i), ear1_c ->vertex(ear1_i));
|
||||
ear2_e = Edge_like(ear2_c ->vertex(ear2_i), c->vertex(i));
|
||||
}
|
||||
else
|
||||
{
|
||||
ear1_e = Edge_like(ear1_c ->vertex(ear1_i), c->vertex(i));
|
||||
ear2_e = Edge_like(c->vertex(i), ear2_c ->vertex(ear2_i));
|
||||
}
|
||||
Edge_like ear1_e, ear2_e;
|
||||
// pour maintenir la reconstruction d'une surface orientable :
|
||||
// on verifie que les bords se recollent dans des sens opposes
|
||||
if (ordered_key.first==v1)
|
||||
{
|
||||
ear1_e = Edge_like(c->vertex(i), ear1_c ->vertex(ear1_i));
|
||||
ear2_e = Edge_like(ear2_c ->vertex(ear2_i), c->vertex(i));
|
||||
}
|
||||
else
|
||||
{
|
||||
ear1_e = Edge_like(ear1_c ->vertex(ear1_i), c->vertex(i));
|
||||
ear2_e = Edge_like(c->vertex(i), ear2_c ->vertex(ear2_i));
|
||||
}
|
||||
|
||||
//maintient la surface orientable
|
||||
bool is_border_ear1 = is_ordered_border_elt(ear1_e, result_ear1);
|
||||
bool is_border_ear2 = is_ordered_border_elt(ear2_e, result_ear2);
|
||||
bool ear1_valid(false), ear2_valid(false);
|
||||
if (is_border_ear1&&(e1.first < STANDBY_CANDIDATE)&&
|
||||
(e1.first <= value)&&
|
||||
(result12.second==result_ear1.second))
|
||||
{
|
||||
ear1_valid = test_merge(ear1_e, result_ear1, v1,
|
||||
priority(*this, ear1_c, ear1.second)) != 0;
|
||||
}
|
||||
if (is_border_ear2&&(e2.first < STANDBY_CANDIDATE)&&
|
||||
(e2.first <= value)&&
|
||||
(result12.second==result_ear2.second))
|
||||
{
|
||||
ear2_valid = test_merge(ear2_e, result_ear2, v2,
|
||||
priority(*this, ear2_c, ear2.second)) != 0;
|
||||
}
|
||||
if ((!ear1_valid)&&(!ear2_valid))
|
||||
return NOT_VALID_CONNECTING_CASE;
|
||||
//maintient la surface orientable
|
||||
bool is_border_ear1 = is_ordered_border_elt(ear1_e, result_ear1);
|
||||
bool is_border_ear2 = is_ordered_border_elt(ear2_e, result_ear2);
|
||||
bool ear1_valid(false), ear2_valid(false);
|
||||
if (is_border_ear1&&(e1.first < STANDBY_CANDIDATE)&&
|
||||
(e1.first <= value)&&
|
||||
(result12.second==result_ear1.second))
|
||||
{
|
||||
ear1_valid = test_merge(ear1_e, result_ear1, v1,
|
||||
priority(*this, ear1_c, ear1.second)) != 0;
|
||||
}
|
||||
if (is_border_ear2&&(e2.first < STANDBY_CANDIDATE)&&
|
||||
(e2.first <= value)&&
|
||||
(result12.second==result_ear2.second))
|
||||
{
|
||||
ear2_valid = test_merge(ear2_e, result_ear2, v2,
|
||||
priority(*this, ear2_c, ear2.second)) != 0;
|
||||
}
|
||||
if ((!ear1_valid)&&(!ear2_valid))
|
||||
return NOT_VALID_CONNECTING_CASE;
|
||||
|
||||
IO_edge_type* p1;
|
||||
IO_edge_type* p2;
|
||||
IO_edge_type* p1;
|
||||
IO_edge_type* p2;
|
||||
|
||||
border_extend(ordered_key, result12,
|
||||
v1, v2, c->vertex(i),
|
||||
e1, e2, p1, p2);
|
||||
border_extend(ordered_key, result12,
|
||||
v1, v2, c->vertex(i),
|
||||
e1, e2, p1, p2);
|
||||
|
||||
if (ear1_valid&&ear2_valid&&(ear1_e==ear2_e))
|
||||
{
|
||||
if (e1.first < e2.first)
|
||||
{
|
||||
Validation_case res = validate(ear1, e1.first);
|
||||
if (!((res == EAR_CASE)||(res == FINAL_CASE)))
|
||||
std::cerr << "+++probleme de recollement : cas "
|
||||
<< res << std::endl;
|
||||
e2 = compute_value(edge_Ifacet_2);
|
||||
if (ear1_valid&&ear2_valid&&(ear1_e==ear2_e))
|
||||
{
|
||||
if (e1.first < e2.first)
|
||||
{
|
||||
Validation_case res = validate(ear1, e1.first);
|
||||
if (!((res == EAR_CASE)||(res == FINAL_CASE)))
|
||||
std::cerr << "+++probleme de recollement : cas "
|
||||
<< res << std::endl;
|
||||
e2 = compute_value(edge_Ifacet_2);
|
||||
|
||||
if (ordered_key.first == v1)
|
||||
p2 = set_again_border_elt(c->vertex(i), v2,
|
||||
Border_elt(e2, result2.second));
|
||||
else
|
||||
p2 = set_again_border_elt(v2, c->vertex(i),
|
||||
Border_elt(e2, result2.second));
|
||||
if (ordered_key.first == v1)
|
||||
p2 = set_again_border_elt(c->vertex(i), v2,
|
||||
Border_elt(e2, result2.second));
|
||||
else
|
||||
p2 = set_again_border_elt(v2, c->vertex(i),
|
||||
Border_elt(e2, result2.second));
|
||||
|
||||
_ordered_border.insert(Radius_ptr_type(e2.first, p2));
|
||||
}
|
||||
else
|
||||
{
|
||||
Validation_case res = validate(ear2, e2.first);
|
||||
if (!((res == EAR_CASE)||(res == FINAL_CASE)))
|
||||
std::cerr << "+++probleme de recollement : cas "
|
||||
<< res << std::endl;
|
||||
e1 = compute_value(edge_Ifacet_1);
|
||||
_ordered_border.insert(Radius_ptr_type(e2.first, p2));
|
||||
}
|
||||
else
|
||||
{
|
||||
Validation_case res = validate(ear2, e2.first);
|
||||
if (!((res == EAR_CASE)||(res == FINAL_CASE)))
|
||||
std::cerr << "+++probleme de recollement : cas "
|
||||
<< res << std::endl;
|
||||
e1 = compute_value(edge_Ifacet_1);
|
||||
|
||||
if (ordered_key.first == v1)
|
||||
p1 = set_again_border_elt(v1, c->vertex(i),
|
||||
Border_elt(e1, result1.second));
|
||||
else
|
||||
p1 = set_again_border_elt(c->vertex(i), v1,
|
||||
Border_elt(e1, result1.second));
|
||||
if (ordered_key.first == v1)
|
||||
p1 = set_again_border_elt(v1, c->vertex(i),
|
||||
Border_elt(e1, result1.second));
|
||||
else
|
||||
p1 = set_again_border_elt(c->vertex(i), v1,
|
||||
Border_elt(e1, result1.second));
|
||||
|
||||
_ordered_border.insert(Radius_ptr_type(e1.first, p1));
|
||||
}
|
||||
}
|
||||
else// les deux oreilles ne se recollent pas sur la meme arete...
|
||||
{
|
||||
// on resoud la singularite.
|
||||
if (ear1_valid)
|
||||
{
|
||||
Validation_case res = validate(ear1, e1.first);
|
||||
if (!((res == EAR_CASE)||(res == FINAL_CASE)))
|
||||
std::cerr << "+++probleme de recollement : cas "
|
||||
<< res << std::endl;
|
||||
}
|
||||
if (ear2_valid)
|
||||
{
|
||||
Validation_case res = validate(ear2, e2.first);
|
||||
if (!((res == EAR_CASE)||(res == FINAL_CASE)))
|
||||
std::cerr << "+++probleme de recollement : cas "
|
||||
<< res << std::endl;
|
||||
}
|
||||
// on met a jour la PQ s'il y a lieu... mais surtout pas
|
||||
// avant la resolution de la singularite
|
||||
if (!ear1_valid)
|
||||
{
|
||||
_ordered_border.insert(Radius_ptr_type(e1.first, p1));
|
||||
}
|
||||
if (!ear2_valid)
|
||||
{
|
||||
_ordered_border.insert(Radius_ptr_type(e2.first, p2));
|
||||
}
|
||||
}
|
||||
select_facet(c, edge_Efacet.second);
|
||||
return CONNECTING_CASE;
|
||||
}
|
||||
_ordered_border.insert(Radius_ptr_type(e1.first, p1));
|
||||
}
|
||||
}
|
||||
else// les deux oreilles ne se recollent pas sur la meme arete...
|
||||
{
|
||||
// on resoud la singularite.
|
||||
if (ear1_valid)
|
||||
{
|
||||
Validation_case res = validate(ear1, e1.first);
|
||||
if (!((res == EAR_CASE)||(res == FINAL_CASE)))
|
||||
std::cerr << "+++probleme de recollement : cas "
|
||||
<< res << std::endl;
|
||||
}
|
||||
if (ear2_valid)
|
||||
{
|
||||
Validation_case res = validate(ear2, e2.first);
|
||||
if (!((res == EAR_CASE)||(res == FINAL_CASE)))
|
||||
std::cerr << "+++probleme de recollement : cas "
|
||||
<< res << std::endl;
|
||||
}
|
||||
// on met a jour la PQ s'il y a lieu... mais surtout pas
|
||||
// avant la resolution de la singularite
|
||||
if (!ear1_valid)
|
||||
{
|
||||
_ordered_border.insert(Radius_ptr_type(e1.first, p1));
|
||||
}
|
||||
if (!ear2_valid)
|
||||
{
|
||||
_ordered_border.insert(Radius_ptr_type(e2.first, p2));
|
||||
}
|
||||
}
|
||||
select_facet(c, edge_Efacet.second);
|
||||
return CONNECTING_CASE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2047,7 +2047,7 @@ namespace CGAL {
|
|||
{
|
||||
new_candidate = compute_value(mem_Ifacet);
|
||||
if ((new_candidate != mem_e_it))
|
||||
// &&(new_candidate.first < NOT_VALID_CANDIDATE))
|
||||
// &&(new_candidate.first < NOT_VALID_CANDIDATE))
|
||||
{
|
||||
IO_edge_type* pnew =
|
||||
set_again_border_elt(key_tmp.first, key_tmp.second,
|
||||
|
|
@ -2369,7 +2369,7 @@ namespace CGAL {
|
|||
{
|
||||
std::list<Vertex_handle> L_v_tmp;
|
||||
Vertex_handle vprev_it(v_it), done(vprev_it), vh_it;
|
||||
// Vertex_handle vsucc_it;
|
||||
// Vertex_handle vsucc_it;
|
||||
int v_count(0);
|
||||
// collect all vertices on the border
|
||||
do
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace CGAL {
|
|||
{
|
||||
#ifdef AFSR_FACET_NUMBER
|
||||
for(int i = 0; i < 4; i++){
|
||||
_facet_number[i] = -1;
|
||||
_facet_number[i] = -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ namespace CGAL {
|
|||
{
|
||||
#ifdef FACET_NUMBER
|
||||
for(int i = 0; i < 4; i++){
|
||||
_facet_number[i] = -1;
|
||||
_facet_number[i] = -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ namespace CGAL {
|
|||
{
|
||||
#ifdef AFSR_FACET_NUMBER
|
||||
for(int i = 0; i < 4; i++){
|
||||
_facet_number[i] = -1;
|
||||
_facet_number[i] = -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -116,9 +116,9 @@ namespace CGAL {
|
|||
delete[] _smallest_radius_facet_tab;
|
||||
#ifdef AFSR_LAZY
|
||||
if (_circumcenter != nullptr)
|
||||
delete _circumcenter;
|
||||
delete _circumcenter;
|
||||
if (_squared_radius != nullptr)
|
||||
delete _squared_radius;
|
||||
delete _squared_radius;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -128,15 +128,15 @@ namespace CGAL {
|
|||
inline void clear()
|
||||
{
|
||||
if (_smallest_radius_facet_tab != nullptr)
|
||||
delete[] _smallest_radius_facet_tab;
|
||||
delete[] _smallest_radius_facet_tab;
|
||||
_smallest_radius_facet_tab = nullptr;
|
||||
selected_facet = 0;
|
||||
#ifdef AFSR_LAZY
|
||||
if (_circumcenter != nullptr)
|
||||
delete _circumcenter;
|
||||
delete _circumcenter;
|
||||
_circumcenter = nullptr;
|
||||
if (_squared_radius != nullptr)
|
||||
delete _squared_radius;
|
||||
delete _squared_radius;
|
||||
_squared_radius = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -145,18 +145,18 @@ namespace CGAL {
|
|||
inline coord_type smallest_radius(const int& i)
|
||||
{
|
||||
if (_smallest_radius_facet_tab == nullptr)
|
||||
return -1;
|
||||
return -1;
|
||||
return _smallest_radius_facet_tab[i];
|
||||
}
|
||||
|
||||
inline void set_smallest_radius(const int& i, const coord_type& c)
|
||||
{
|
||||
if (_smallest_radius_facet_tab == nullptr)
|
||||
{
|
||||
_smallest_radius_facet_tab = new coord_type[4];
|
||||
for(int i = 0; i < 4; i++)
|
||||
_smallest_radius_facet_tab[i] = -1;
|
||||
}
|
||||
{
|
||||
_smallest_radius_facet_tab = new coord_type[4];
|
||||
for(int i = 0; i < 4; i++)
|
||||
_smallest_radius_facet_tab[i] = -1;
|
||||
}
|
||||
_smallest_radius_facet_tab[i] = c;
|
||||
}
|
||||
|
||||
|
|
@ -164,10 +164,10 @@ namespace CGAL {
|
|||
inline bool alloc_smallest_radius_tab(coord_type* ptr)
|
||||
{
|
||||
if (_smallest_radius_facet_tab==nullptr)
|
||||
{
|
||||
_smallest_radius_facet_tab = ptr;
|
||||
return true;
|
||||
}
|
||||
{
|
||||
_smallest_radius_facet_tab = ptr;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,11 +173,11 @@ namespace CGAL {
|
|||
{
|
||||
if (m_incident_border == nullptr) return nullptr; //vh is interior
|
||||
if (m_incident_border->first->first != nullptr)
|
||||
if (m_incident_border->first->second.second == i)
|
||||
return m_incident_border->first;
|
||||
if (m_incident_border->first->second.second == i)
|
||||
return m_incident_border->first;
|
||||
if (m_incident_border->second->first != nullptr)
|
||||
if (m_incident_border->second->second.second == i)
|
||||
return m_incident_border->second;
|
||||
if (m_incident_border->second->second.second == i)
|
||||
return m_incident_border->second;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ namespace CGAL {
|
|||
{
|
||||
if (m_incident_border == nullptr) return false;
|
||||
return ((m_incident_border->first->first == v)||
|
||||
(m_incident_border->second->first == v));
|
||||
(m_incident_border->second->first == v));
|
||||
}
|
||||
|
||||
inline Next_border_elt* border_elt(Vertex_handle v) const
|
||||
|
|
@ -216,13 +216,13 @@ namespace CGAL {
|
|||
inline void set_next_border_elt(const Next_border_elt& elt)
|
||||
{
|
||||
if (m_incident_border->first->first == nullptr)
|
||||
*m_incident_border->first = elt;
|
||||
*m_incident_border->first = elt;
|
||||
else
|
||||
{
|
||||
if (m_incident_border->second->first != nullptr)
|
||||
std::cerr << "+++probleme de MAJ du bord <Vertex_base>" << std::endl;
|
||||
*m_incident_border->second = elt;
|
||||
}
|
||||
{
|
||||
if (m_incident_border->second->first != nullptr)
|
||||
std::cerr << "+++probleme de MAJ du bord <Vertex_base>" << std::endl;
|
||||
*m_incident_border->second = elt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -257,9 +257,9 @@ namespace CGAL {
|
|||
inline void inc_mark()
|
||||
{
|
||||
if (m_mark==-1)
|
||||
m_mark=1;
|
||||
m_mark=1;
|
||||
else
|
||||
m_mark++;
|
||||
m_mark++;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ if ( CGAL_FOUND )
|
|||
endforeach()
|
||||
|
||||
else()
|
||||
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
namespace CGAL {
|
||||
/*!
|
||||
|
||||
\mainpage User Manual
|
||||
\mainpage User Manual
|
||||
\anchor Chapter_Algebraic_Foundations
|
||||
|
||||
\cgalAutoToc
|
||||
|
|
@ -9,25 +9,25 @@ namespace CGAL {
|
|||
|
||||
\section Algebraic_foundationsIntroduction Introduction
|
||||
|
||||
\cgal is targeting towards exact computation with non-linear objects,
|
||||
in particular objects defined on algebraic curves and surfaces.
|
||||
As a consequence types representing polynomials, algebraic extensions and
|
||||
finite fields play a more important role in related implementations.
|
||||
This package has been introduced to stay abreast of these changes.
|
||||
\cgal is targeting towards exact computation with non-linear objects,
|
||||
in particular objects defined on algebraic curves and surfaces.
|
||||
As a consequence types representing polynomials, algebraic extensions and
|
||||
finite fields play a more important role in related implementations.
|
||||
This package has been introduced to stay abreast of these changes.
|
||||
Since in particular polynomials must be supported by the introduced framework
|
||||
the package avoids the term <I>number type</I>. Instead the package distinguishes
|
||||
between the <I>algebraic structure</I> of a type and whether a type is embeddable on
|
||||
the real axis, or <I>real embeddable</I> for short.
|
||||
Moreover, the package introduces the notion of <I>interoperable</I> types which
|
||||
allows an explicit handling of mixed operations.
|
||||
the package avoids the term <I>number type</I>. Instead the package distinguishes
|
||||
between the <I>algebraic structure</I> of a type and whether a type is embeddable on
|
||||
the real axis, or <I>real embeddable</I> for short.
|
||||
Moreover, the package introduces the notion of <I>interoperable</I> types which
|
||||
allows an explicit handling of mixed operations.
|
||||
|
||||
\section Algebraic_foundationsAlgebraic Algebraic Structures
|
||||
|
||||
The algebraic structure concepts introduced within this section are
|
||||
motivated by their well known counterparts in traditional algebra,
|
||||
but we also had to pay tribute to existing types and their restrictions.
|
||||
The algebraic structure concepts introduced within this section are
|
||||
motivated by their well known counterparts in traditional algebra,
|
||||
but we also had to pay tribute to existing types and their restrictions.
|
||||
To keep the interface minimal,
|
||||
it was not desirable to cover all known algebraic structures,
|
||||
it was not desirable to cover all known algebraic structures,
|
||||
e.g., we did not introduce concepts for such basic structures as <I>groups</I> or
|
||||
exceptional structures as <I>skew fields</I>.
|
||||
|
||||
|
|
@ -35,95 +35,95 @@ exceptional structures as <I>skew fields</I>.
|
|||
Concept Hierarchy of Algebraic Structures
|
||||
\cgalFigureEnd
|
||||
|
||||
\cgalFigureRef{figConceptHierarchyOfAlgebraicStructures} shows the refinement
|
||||
relationship of the algebraic structure concepts.
|
||||
`IntegralDomain`, `UniqueFactorizationDomain`, `EuclideanRing` and
|
||||
\cgalFigureRef{figConceptHierarchyOfAlgebraicStructures} shows the refinement
|
||||
relationship of the algebraic structure concepts.
|
||||
`IntegralDomain`, `UniqueFactorizationDomain`, `EuclideanRing` and
|
||||
`Field` correspond to the algebraic structures with the
|
||||
same name. `FieldWithSqrt`, `FieldWithKthRoot` and
|
||||
`FieldWithRootOf` are fields that in addition are closed under
|
||||
the operations 'sqrt', 'k-th root' and 'real root of a polynomial',
|
||||
same name. `FieldWithSqrt`, `FieldWithKthRoot` and
|
||||
`FieldWithRootOf` are fields that in addition are closed under
|
||||
the operations 'sqrt', 'k-th root' and 'real root of a polynomial',
|
||||
respectively. The concept `IntegralDomainWithoutDivision` also
|
||||
corresponds to integral domains in the algebraic sense, the
|
||||
distinction results from the fact that some implementations of
|
||||
integral domains lack the (algebraically always well defined) integral
|
||||
integral domains lack the (algebraically always well defined) integral
|
||||
division.
|
||||
Note that `Field` refines `IntegralDomain`. This is because
|
||||
most ring-theoretic notions like greatest common divisors become trivial for
|
||||
`Field`s. Hence we see `Field` as a refinement of
|
||||
`IntegralDomain` and not as a
|
||||
refinement of one of the more advanced ring concepts.
|
||||
If an algorithm wants to rely on gcd or remainder computation, it is trying
|
||||
Note that `Field` refines `IntegralDomain`. This is because
|
||||
most ring-theoretic notions like greatest common divisors become trivial for
|
||||
`Field`s. Hence we see `Field` as a refinement of
|
||||
`IntegralDomain` and not as a
|
||||
refinement of one of the more advanced ring concepts.
|
||||
If an algorithm wants to rely on gcd or remainder computation, it is trying
|
||||
to do things it should not do with a `Field` in the first place.
|
||||
|
||||
The main properties of an algebraic structure are collected in the class
|
||||
`Algebraic_structure_traits`.
|
||||
In particular the (most refined) concept each concrete model `AS`
|
||||
fulfills is encoded in the tag
|
||||
The main properties of an algebraic structure are collected in the class
|
||||
`Algebraic_structure_traits`.
|
||||
In particular the (most refined) concept each concrete model `AS`
|
||||
fulfills is encoded in the tag
|
||||
\link AlgebraicStructureTraits::Algebraic_category `Algebraic_structure_traits<AS>::Algebraic_category` \endlink .
|
||||
An algebraic structure is at least `Assignable`,
|
||||
`CopyConstructible`, `DefaultConstructible` and
|
||||
An algebraic structure is at least `Assignable`,
|
||||
`CopyConstructible`, `DefaultConstructible` and
|
||||
`EqualityComparable`. Moreover, we require that it is
|
||||
constructible from `int`.
|
||||
For ease of use and since their semantic is sufficiently standard to presume
|
||||
For ease of use and since their semantic is sufficiently standard to presume
|
||||
their existence, the usual arithmetic and comparison operators are required
|
||||
to be realized via \cpp operator overloading.
|
||||
The division operator is reserved for division in fields.
|
||||
All other unary (e.g., sqrt) and binary functions
|
||||
to be realized via \cpp operator overloading.
|
||||
The division operator is reserved for division in fields.
|
||||
All other unary (e.g., sqrt) and binary functions
|
||||
(e.g., gcd, div) must be models of the well known \stl-concepts
|
||||
`AdaptableUnaryFunction` or `AdaptableBinaryFunction`
|
||||
concept and local to the traits class
|
||||
(e.g., \link AlgebraicStructureTraits::Sqrt `Algebraic_structure_traits<AS>::Sqrt()(x)` \endlink).
|
||||
This design allows us to profit from all parts in the
|
||||
\stl and its programming style and avoids the name-lookup and
|
||||
two-pass template compilation problems experienced with the old design
|
||||
using overloaded functions. However, for ease of use and backward
|
||||
compatibility all functionality is also
|
||||
accessible through global functions defined within namespace `CGAL`,
|
||||
concept and local to the traits class
|
||||
(e.g., \link AlgebraicStructureTraits::Sqrt `Algebraic_structure_traits<AS>::Sqrt()(x)` \endlink).
|
||||
This design allows us to profit from all parts in the
|
||||
\stl and its programming style and avoids the name-lookup and
|
||||
two-pass template compilation problems experienced with the old design
|
||||
using overloaded functions. However, for ease of use and backward
|
||||
compatibility all functionality is also
|
||||
accessible through global functions defined within namespace `CGAL`,
|
||||
e.g., \link sqrt `CGAL::sqrt(x)` \endlink. This is realized via function templates using
|
||||
the according functor of the traits class. For an overview see
|
||||
the according functor of the traits class. For an overview see
|
||||
Section \ref PkgAlgebraicFoundationsRef in the reference manual.
|
||||
|
||||
\subsection Algebraic_foundationsTagsinAlgebraicStructure Tags in Algebraic Structure Traits
|
||||
|
||||
\subsection Algebraic_foundationsAlgebraicCategory Algebraic Category
|
||||
|
||||
For a type `AS`, `Algebraic_structure_traits<AS>`
|
||||
provides several tags. The most important tag is the `Algebraic_category`
|
||||
tag, which indicates the most refined algebraic concept the type `AS`
|
||||
fulfills. The tag is one of;
|
||||
`Integral_domain_without_division_tag`, `Integral_domain_tag`,
|
||||
`Field_tag`, `Field_with_sqrt_tag`, `Field_with_kth_root_tag`,
|
||||
`Field_with_root_of_tag`, `Unique_factorization_domain_tag`,
|
||||
`Euclidean_ring_tag`, or even `Null_tag`
|
||||
in case the type is not a model of an algebraic structure concept.
|
||||
The tags are derived from each other such that they reflect the
|
||||
hierarchy of the algebraic structure concept, e.g.,
|
||||
`Field_with_sqrt_tag` is derived from `Field_tag`.
|
||||
For a type `AS`, `Algebraic_structure_traits<AS>`
|
||||
provides several tags. The most important tag is the `Algebraic_category`
|
||||
tag, which indicates the most refined algebraic concept the type `AS`
|
||||
fulfills. The tag is one of;
|
||||
`Integral_domain_without_division_tag`, `Integral_domain_tag`,
|
||||
`Field_tag`, `Field_with_sqrt_tag`, `Field_with_kth_root_tag`,
|
||||
`Field_with_root_of_tag`, `Unique_factorization_domain_tag`,
|
||||
`Euclidean_ring_tag`, or even `Null_tag`
|
||||
in case the type is not a model of an algebraic structure concept.
|
||||
The tags are derived from each other such that they reflect the
|
||||
hierarchy of the algebraic structure concept, e.g.,
|
||||
`Field_with_sqrt_tag` is derived from `Field_tag`.
|
||||
|
||||
\subsection Algebraic_foundationsExactandNumericalSensitive Exact and Numerical Sensitive
|
||||
|
||||
Moreover, `Algebraic_structure_traits<AS>` provides the tags `Is_exact`
|
||||
and `Is_numerical_sensitive`, which are both `Boolean_tag`s.
|
||||
Moreover, `Algebraic_structure_traits<AS>` provides the tags `Is_exact`
|
||||
and `Is_numerical_sensitive`, which are both `Boolean_tag`s.
|
||||
|
||||
An algebraic structure is considered <I>exact</I>,
|
||||
if all operations required by its concept are computed such that a comparison
|
||||
if all operations required by its concept are computed such that a comparison
|
||||
of two algebraic expressions is always correct.
|
||||
|
||||
An algebraic structure is considered as <I>numerically sensitive</I>,
|
||||
if the performance of the type is sensitive to the condition number of an
|
||||
if the performance of the type is sensitive to the condition number of an
|
||||
algorithm.
|
||||
Note that there is really a difference among these two notions,
|
||||
e.g., the fundamental type `int` is not numerical sensitive but
|
||||
considered inexact due to overflow.
|
||||
Conversely, types as `leda_real` or `CORE::Expr` are exact but sensitive
|
||||
to numerical issues due to the internal use of multi precision floating point
|
||||
Note that there is really a difference among these two notions,
|
||||
e.g., the fundamental type `int` is not numerical sensitive but
|
||||
considered inexact due to overflow.
|
||||
Conversely, types as `leda_real` or `CORE::Expr` are exact but sensitive
|
||||
to numerical issues due to the internal use of multi precision floating point
|
||||
arithmetic. We expect that `Is_numerical_sensitive` is used for dispatching
|
||||
of algorithms, while `Is_exact` is useful to enable assertions that can be
|
||||
of algorithms, while `Is_exact` is useful to enable assertions that can be
|
||||
check for exact types only.
|
||||
|
||||
Tags are very useful to dispatch between alternative implementations.
|
||||
The following example illustrates a dispatch for `Field`s using overloaded
|
||||
functions. The example only needs two overloads since the algebraic
|
||||
Tags are very useful to dispatch between alternative implementations.
|
||||
The following example illustrates a dispatch for `Field`s using overloaded
|
||||
functions. The example only needs two overloads since the algebraic
|
||||
category tags reflect the algebraic structure hierarchy.
|
||||
|
||||
\cgalExample{Algebraic_foundations/algebraic_structure_dispatch.cpp}
|
||||
|
|
@ -132,35 +132,35 @@ category tags reflect the algebraic structure hierarchy.
|
|||
|
||||
\anchor secRealEmbeddable
|
||||
|
||||
Most number types represent some subset of the real numbers. From those types
|
||||
we expect functionality to compute the sign, absolute value or double
|
||||
approximations. In particular we can expect an order on such a type that
|
||||
reflects the order along the real axis.
|
||||
Most number types represent some subset of the real numbers. From those types
|
||||
we expect functionality to compute the sign, absolute value or double
|
||||
approximations. In particular we can expect an order on such a type that
|
||||
reflects the order along the real axis.
|
||||
All these properties are gathered in the concept `::RealEmbeddable`.
|
||||
The concept is orthogonal to the algebraic structure concepts,
|
||||
i.e., it is possible
|
||||
that a type is a model of `RealEmbeddable` only,
|
||||
The concept is orthogonal to the algebraic structure concepts,
|
||||
i.e., it is possible
|
||||
that a type is a model of `RealEmbeddable` only,
|
||||
since the type may just represent values on the real axis
|
||||
but does not provide any arithmetic operations.
|
||||
|
||||
As for algebraic structures this concept is also traits class oriented.
|
||||
The main functionality related to `RealEmbeddable` is gathered in
|
||||
the class `Real_embeddable_traits`. In particular, it provides the boolean
|
||||
tag `Is_real_embeddable` indicating whether a type is a model of
|
||||
`RealEmbeddable`. The comparison operators are required to be realized via
|
||||
\cpp operator overloading.
|
||||
All unary functions (e.g. <I>sign</I>, <I>to_double</I>) and
|
||||
binary functions (e.g. <I>compare</I> ) are models of the \stl-concepts
|
||||
`AdaptableUnaryFunction` and `AdaptableBinaryFunction` and are local
|
||||
The main functionality related to `RealEmbeddable` is gathered in
|
||||
the class `Real_embeddable_traits`. In particular, it provides the boolean
|
||||
tag `Is_real_embeddable` indicating whether a type is a model of
|
||||
`RealEmbeddable`. The comparison operators are required to be realized via
|
||||
\cpp operator overloading.
|
||||
All unary functions (e.g. <I>sign</I>, <I>to_double</I>) and
|
||||
binary functions (e.g. <I>compare</I> ) are models of the \stl-concepts
|
||||
`AdaptableUnaryFunction` and `AdaptableBinaryFunction` and are local
|
||||
to `Real_embeddable_traits`.
|
||||
|
||||
In case a type is a model of `IntegralDomainWithoutDivision` and
|
||||
`RealEmbeddable` the number represented by an object of this type is
|
||||
In case a type is a model of `IntegralDomainWithoutDivision` and
|
||||
`RealEmbeddable` the number represented by an object of this type is
|
||||
the same for arithmetic and comparison.
|
||||
It follows that the ring represented by this type is a superset of the integers
|
||||
and a subset of the real numbers and hence has characteristic zero.
|
||||
|
||||
In case the type is a model of `Field` and `RealEmbeddable` it is a
|
||||
In case the type is a model of `Field` and `RealEmbeddable` it is a
|
||||
superset of the rational numbers.
|
||||
|
||||
\section Algebraic_foundationsRealN Real Number Types
|
||||
|
|
@ -181,51 +181,51 @@ hierarchy of \cgalFigureRef{figConceptHierarchyOfAlgebraicStructures}.
|
|||
|
||||
\section Algebraic_foundationsInteroperability Interoperability
|
||||
|
||||
This section introduces two concepts for interoperability of types,
|
||||
namely `ImplicitInteroperable` and `ExplicitInteroperable`. While
|
||||
`ExplicitInteroperable` is the base concept, we start with
|
||||
This section introduces two concepts for interoperability of types,
|
||||
namely `ImplicitInteroperable` and `ExplicitInteroperable`. While
|
||||
`ExplicitInteroperable` is the base concept, we start with
|
||||
`ImplicitInteroperable` since it is the more intuitive one.
|
||||
|
||||
In general mixed operations are provided by overloaded operators and
|
||||
functions or just via implicit constructor calls.
|
||||
This level of interoperability is reflected by the concept
|
||||
`ImplicitInteroperable`. However, within template code the result type,
|
||||
functions or just via implicit constructor calls.
|
||||
This level of interoperability is reflected by the concept
|
||||
`ImplicitInteroperable`. However, within template code the result type,
|
||||
or so called coercion type, of a mixed arithmetic operation may be unclear.
|
||||
Therefore, the package introduces `Coercion_traits`
|
||||
giving access to the coercion type via \link Coercion_traits::Type `Coercion_traits<A,B>::Type` \endlink
|
||||
for two interoperable types `A` and `B`.
|
||||
|
||||
Some trivial example are `int` and `double` with coercion type double
|
||||
Some trivial example are `int` and `double` with coercion type double
|
||||
or `Gmpz` and `Gmpq` with coercion type `Gmpq`.
|
||||
However, the coercion type is not necessarily one of the input types,
|
||||
e.g. the coercion type of a polynomial
|
||||
with integer coefficients that is multiplied by a rational type
|
||||
e.g. the coercion type of a polynomial
|
||||
with integer coefficients that is multiplied by a rational type
|
||||
is supposed to be a polynomial with rational coefficients.
|
||||
|
||||
`Coercion_traits` is also
|
||||
required to provide a functor \link Coercion_traits::Cast `Coercion_traits<A,B>::Cast()` \endlink, that
|
||||
required to provide a functor \link Coercion_traits::Cast `Coercion_traits<A,B>::Cast()` \endlink, that
|
||||
converts from an input type into the coercion type. This is in fact the core
|
||||
of the more basic concept `ExplicitInteroperable`.
|
||||
`ExplicitInteroperable` has been introduced to cover more complex cases
|
||||
for which it is hard or impossible to guarantee implicit interoperability.
|
||||
Note that this functor can be useful for `ImplicitInteroperable` types
|
||||
of the more basic concept `ExplicitInteroperable`.
|
||||
`ExplicitInteroperable` has been introduced to cover more complex cases
|
||||
for which it is hard or impossible to guarantee implicit interoperability.
|
||||
Note that this functor can be useful for `ImplicitInteroperable` types
|
||||
as well, since it can be used to void redundant type conversions.
|
||||
|
||||
In case two types `A` and `B` are `ExplicitInteroperable` with
|
||||
coercion type `C` they are valid argument types for all binary functors
|
||||
In case two types `A` and `B` are `ExplicitInteroperable` with
|
||||
coercion type `C` they are valid argument types for all binary functors
|
||||
provided by `Algebraic_structure_traits` and `Real_embeddable_traits` of
|
||||
`C`. This is also true for the according global functions.
|
||||
|
||||
\subsection Algebraic_foundationsExamples Examples
|
||||
|
||||
The following example illustrates how two write code for
|
||||
The following example illustrates how two write code for
|
||||
`ExplicitInteroperable` types.
|
||||
|
||||
\cgalExample{Algebraic_foundations/interoperable.cpp}
|
||||
|
||||
The following example illustrates a dispatch for `ImplicitInteroperable` and
|
||||
`ExplicitInteroperable` types.
|
||||
The binary function (that just multiplies its two arguments) is supposed to
|
||||
The following example illustrates a dispatch for `ImplicitInteroperable` and
|
||||
`ExplicitInteroperable` types.
|
||||
The binary function (that just multiplies its two arguments) is supposed to
|
||||
take two `ExplicitInteroperable` arguments. For `ImplicitInteroperable`
|
||||
types a variant that avoids the explicit cast is selected.
|
||||
|
||||
|
|
@ -233,21 +233,21 @@ types a variant that avoids the explicit cast is selected.
|
|||
|
||||
\section Algebraic_foundationsFractions Fractions
|
||||
|
||||
Beyond the need for performing algebraic operations on objects as a
|
||||
whole, there are also number types which one would like to decompose into
|
||||
numerator and denominator. This does not only hold for rational numbers
|
||||
as `Quotient`, `Gmpq`, `mpq_class` or `leda_rational`, but
|
||||
also for compound objects as `Sqrt_extension` or `Polynomial`
|
||||
which may decompose into a (scalar)
|
||||
denominator and a compound numerator with a simpler coefficient type
|
||||
(e.g. integer instead of rational). Often operations can be performed faster on
|
||||
these denominator-free multiples. In case a type is a `Fraction`
|
||||
the relevant functionality as well as the numerator and denominator
|
||||
type are provided by `Fraction_traits`. In particular
|
||||
Beyond the need for performing algebraic operations on objects as a
|
||||
whole, there are also number types which one would like to decompose into
|
||||
numerator and denominator. This does not only hold for rational numbers
|
||||
as `Quotient`, `Gmpq`, `mpq_class` or `leda_rational`, but
|
||||
also for compound objects as `Sqrt_extension` or `Polynomial`
|
||||
which may decompose into a (scalar)
|
||||
denominator and a compound numerator with a simpler coefficient type
|
||||
(e.g. integer instead of rational). Often operations can be performed faster on
|
||||
these denominator-free multiples. In case a type is a `Fraction`
|
||||
the relevant functionality as well as the numerator and denominator
|
||||
type are provided by `Fraction_traits`. In particular
|
||||
`Fraction_traits` provides a tag \link FractionTraits::Is_fraction `Is_fraction` \endlink that can be
|
||||
used for dispatching.
|
||||
|
||||
A related class is `Rational_traits` which has been kept for backward
|
||||
A related class is `Rational_traits` which has been kept for backward
|
||||
compatibility reasons. However, we recommend to use `Fraction_traits` since
|
||||
it is more general and offers dispatching functionality.
|
||||
|
||||
|
|
@ -256,25 +256,25 @@ it is more general and offers dispatching functionality.
|
|||
The following example show a simple use of `Fraction_traits`:
|
||||
\cgalExample{Algebraic_foundations/fraction_traits.cpp}
|
||||
|
||||
The following example illustrates the integralization of a vector,
|
||||
i.e., the coefficient vector of a polynomial. Note that for minimizing
|
||||
coefficient growth \link FractionTraits::Common_factor `Fraction_traits<Type>::Common_factor` \endlink is used to
|
||||
The following example illustrates the integralization of a vector,
|
||||
i.e., the coefficient vector of a polynomial. Note that for minimizing
|
||||
coefficient growth \link FractionTraits::Common_factor `Fraction_traits<Type>::Common_factor` \endlink is used to
|
||||
compute the <i>least</i> common multiple of the denominators.
|
||||
|
||||
\cgalExample{Algebraic_foundations/integralize.cpp}
|
||||
|
||||
\section Algebraic_foundationsDesign Design and Implementation History
|
||||
|
||||
The package is part of \cgal since release 3.3. Of course the package is based
|
||||
on the former Number type support of CGAL. This goes back to Stefan Schirra and Andreas Fabri. But on the other hand the package is to a large extend influenced
|
||||
by the experience with the number type support in <span class="textsc">Exacus</span> \cgalCite{beh-eeeafcs-05},
|
||||
which in the main goes back to
|
||||
Lutz Kettner, Susan Hert, Arno Eigenwillig and Michael Hemmer.
|
||||
However, the package abstracts from the pure support for
|
||||
number types that are embedded on the real axis which allows the support of
|
||||
polynomials, finite fields, and algebraic extensions as well. See also related
|
||||
The package is part of \cgal since release 3.3. Of course the package is based
|
||||
on the former Number type support of CGAL. This goes back to Stefan Schirra and Andreas Fabri. But on the other hand the package is to a large extend influenced
|
||||
by the experience with the number type support in <span class="textsc">Exacus</span> \cgalCite{beh-eeeafcs-05},
|
||||
which in the main goes back to
|
||||
Lutz Kettner, Susan Hert, Arno Eigenwillig and Michael Hemmer.
|
||||
However, the package abstracts from the pure support for
|
||||
number types that are embedded on the real axis which allows the support of
|
||||
polynomials, finite fields, and algebraic extensions as well. See also related
|
||||
subsequent chapters.
|
||||
|
||||
*/
|
||||
*/
|
||||
} /* namespace CGAL */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
An instance of `Algebraic_structure_traits` is a model of `AlgebraicStructureTraits`, where <span class="textsc">T</span> is the associated type.
|
||||
An instance of `Algebraic_structure_traits` is a model of `AlgebraicStructureTraits`, where <span class="textsc">T</span> is the associated type.
|
||||
|
||||
\cgalModels `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -19,13 +19,13 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
Tag indicating that a type is a model of the
|
||||
`EuclideanRing` concept.
|
||||
Tag indicating that a type is a model of the
|
||||
`EuclideanRing` concept.
|
||||
|
||||
\cgalModels `DefaultConstructible`
|
||||
|
||||
\sa `EuclideanRing`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `EuclideanRing`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -36,12 +36,12 @@ struct Euclidean_ring_tag : public Unique_factorization_domain_tag {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
Tag indicating that a type is a model of the `Field` concept.
|
||||
Tag indicating that a type is a model of the `Field` concept.
|
||||
|
||||
\cgalModels `DefaultConstructible`
|
||||
|
||||
\sa `Field`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `Field`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -52,12 +52,12 @@ struct Field_tag : public Integral_domain_tag {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
Tag indicating that a type is a model of the `FieldWithKthRoot` concept.
|
||||
Tag indicating that a type is a model of the `FieldWithKthRoot` concept.
|
||||
|
||||
\cgalModels `DefaultConstructible`
|
||||
|
||||
\sa `FieldWithKthRoot`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `FieldWithKthRoot`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -68,12 +68,12 @@ struct Field_with_kth_root_tag : public Field_with_sqrt_tag {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
Tag indicating that a type is a model of the `FieldWithRootOf` concept.
|
||||
Tag indicating that a type is a model of the `FieldWithRootOf` concept.
|
||||
|
||||
\cgalModels `DefaultConstructible`
|
||||
|
||||
\sa `FieldWithRootOf`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `FieldWithRootOf`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -84,12 +84,12 @@ struct Field_with_root_of_tag : public Field_with_kth_root_tag {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
Tag indicating that a type is a model of the `FieldWithSqrt` concept.
|
||||
Tag indicating that a type is a model of the `FieldWithSqrt` concept.
|
||||
|
||||
\cgalModels `DefaultConstructible`
|
||||
|
||||
\sa `FieldWithSqrt`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `FieldWithSqrt`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -100,12 +100,12 @@ struct Field_with_sqrt_tag : public Field_tag {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
Tag indicating that a type is a model of the `IntegralDomain` concept.
|
||||
Tag indicating that a type is a model of the `IntegralDomain` concept.
|
||||
|
||||
\cgalModels `DefaultConstructible`
|
||||
|
||||
\sa `IntegralDomain`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `IntegralDomain`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -116,11 +116,11 @@ struct Integral_domain_tag : public Integral_domain_without_division_tag {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
|
||||
\cgalModels `DefaultConstructible`
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -131,12 +131,12 @@ struct Integral_domain_without_division_tag {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept.
|
||||
Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept.
|
||||
|
||||
\cgalModels `DefaultConstructible`
|
||||
|
||||
\sa `UniqueFactorizationDomain`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `UniqueFactorizationDomain`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -4,46 +4,46 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
An instance of `Coercion_traits` reflects the type coercion of the types
|
||||
<span class="textsc">A</span> and <span class="textsc">B</span>, it is symmetric in the two template arguments.
|
||||
An instance of `Coercion_traits` reflects the type coercion of the types
|
||||
<span class="textsc">A</span> and <span class="textsc">B</span>, it is symmetric in the two template arguments.
|
||||
|
||||
\sa `ExplicitInteroperable`
|
||||
\sa `ImplicitInteroperable`
|
||||
\sa `ExplicitInteroperable`
|
||||
\sa `ImplicitInteroperable`
|
||||
|
||||
*/
|
||||
template< typename A, typename B >
|
||||
struct Coercion_traits {
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Tag indicating whether the two types A and B are a model of `ExplicitInteroperable`
|
||||
Tag indicating whether the two types A and B are a model of `ExplicitInteroperable`
|
||||
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
*/
|
||||
typedef unspecified_type Are_explicit_interoperable;
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
*/
|
||||
typedef unspecified_type Are_explicit_interoperable;
|
||||
|
||||
/*!
|
||||
Tag indicating whether the two types A and B are a model of `ImplicitInteroperable`
|
||||
Tag indicating whether the two types A and B are a model of `ImplicitInteroperable`
|
||||
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
*/
|
||||
typedef unspecified_type Are_implicit_interoperable;
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
*/
|
||||
typedef unspecified_type Are_implicit_interoperable;
|
||||
|
||||
/*!
|
||||
The coercion type of `A` and `B`.
|
||||
The coercion type of `A` and `B`.
|
||||
|
||||
In case A and B are not `ExplicitInteroperable` this is undefined.
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
In case A and B are not `ExplicitInteroperable` this is undefined.
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
|
||||
/*!
|
||||
A model of the `AdaptableFunctor` concept, providing the conversion of `A` or `B` to `Type`.
|
||||
A model of the `AdaptableFunctor` concept, providing the conversion of `A` or `B` to `Type`.
|
||||
|
||||
In case A and B are not `ExplicitInteroperable` this is undefined.
|
||||
*/
|
||||
typedef unspecified_type Cast;
|
||||
In case A and B are not `ExplicitInteroperable` this is undefined.
|
||||
*/
|
||||
typedef unspecified_type Cast;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
An instance of `Fraction_traits` is a model of `FractionTraits`,
|
||||
where `T` is the associated type.
|
||||
An instance of `Fraction_traits` is a model of `FractionTraits`,
|
||||
where `T` is the associated type.
|
||||
|
||||
\cgalModels `FractionTraits`
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
An instance of `Real_embeddable_traits` is a model of `RealEmbeddableTraits`, where <span class="textsc">T</span> is the associated type.
|
||||
An instance of `Real_embeddable_traits` is a model of `RealEmbeddableTraits`, where <span class="textsc">T</span> is the associated type.
|
||||
|
||||
\cgalModels `RealEmbeddableTraits`
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The template function `abs()` returns the absolute value of a number.
|
||||
The template function `abs()` returns the absolute value of a number.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::Abs`
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::Abs`
|
||||
|
||||
*/
|
||||
template <class NT> NT abs(const NT& x);
|
||||
|
|
@ -21,21 +21,21 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The template function `compare()` compares the first argument with respect to
|
||||
the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger then \f$ y\f$.
|
||||
The template function `compare()` compares the first argument with respect to
|
||||
the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger then \f$ y\f$.
|
||||
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
`compare` is performed with the semantic of the type determined via
|
||||
`Coercion_traits`.
|
||||
The function is defined if this type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
`compare` is performed with the semantic of the type determined via
|
||||
`Coercion_traits`.
|
||||
The function is defined if this type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
|
||||
The `result_type` is convertible to `CGAL::Comparison_result`.
|
||||
The `result_type` is convertible to `CGAL::Comparison_result`.
|
||||
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::Compare`
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::Compare`
|
||||
*/
|
||||
template <class NT1, class NT2>
|
||||
template <class NT1, class NT2>
|
||||
result_type compare(const NT &x, const NT &y);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -45,28 +45,28 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `div()` computes the integral quotient of division
|
||||
with remainder.
|
||||
The function `div()` computes the integral quotient of division
|
||||
with remainder.
|
||||
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
|
||||
The actual `div` is performed with the semantic of that type.
|
||||
The actual `div` is performed with the semantic of that type.
|
||||
|
||||
The function is defined if `result_type`
|
||||
is a model of the `EuclideanRing` concept.
|
||||
The function is defined if `result_type`
|
||||
is a model of the `EuclideanRing` concept.
|
||||
|
||||
\sa `EuclideanRing`
|
||||
\sa `AlgebraicStructureTraits_::Div`
|
||||
\sa `EuclideanRing`
|
||||
\sa `AlgebraicStructureTraits_::Div`
|
||||
\sa `CGAL::mod()`
|
||||
\sa `CGAL::div_mod()`
|
||||
|
||||
*/
|
||||
template< class NT1, class NT2>
|
||||
result_type
|
||||
template< class NT1, class NT2>
|
||||
result_type
|
||||
div(const NT1& x, const NT2& y);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -76,32 +76,32 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$
|
||||
and \f$ r\f$ minimal with respect to the Euclidean Norm of the
|
||||
computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$
|
||||
and \f$ r\f$ minimal with respect to the Euclidean Norm of the
|
||||
`result_type`.
|
||||
|
||||
The function `div_mod()` computes the integral quotient and remainder of
|
||||
division with remainder.
|
||||
The function `div_mod()` computes the integral quotient and remainder of
|
||||
division with remainder.
|
||||
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
|
||||
The actual `div_mod` is performed with the semantic of that type.
|
||||
The actual `div_mod` is performed with the semantic of that type.
|
||||
|
||||
The function is defined if `result_type`
|
||||
is a model of the `EuclideanRing` concept.
|
||||
The function is defined if `result_type`
|
||||
is a model of the `EuclideanRing` concept.
|
||||
|
||||
\sa `EuclideanRing`
|
||||
\sa `EuclideanRing`
|
||||
\sa `AlgebraicStructureTraits_::DivMod`
|
||||
\sa `CGAL::mod()`
|
||||
\sa `CGAL::div()`
|
||||
|
||||
*/
|
||||
template <class NT1, class NT2>
|
||||
void
|
||||
template <class NT1, class NT2>
|
||||
void
|
||||
div_mod(const NT1& x, const NT2& y, result_type& q, result_type& r);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -111,24 +111,24 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `gcd()` computes the greatest common divisor of two values.
|
||||
The function `gcd()` computes the greatest common divisor of two values.
|
||||
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
|
||||
The actual `gcd` is performed with the semantic of that type.
|
||||
The actual `gcd` is performed with the semantic of that type.
|
||||
|
||||
The function is defined if `result_type`
|
||||
is a model of the `UniqueFactorizationDomain` concept.
|
||||
The function is defined if `result_type`
|
||||
is a model of the `UniqueFactorizationDomain` concept.
|
||||
|
||||
\sa `UniqueFactorizationDomain`
|
||||
\sa `AlgebraicStructureTraits_::Gcd`
|
||||
\sa `UniqueFactorizationDomain`
|
||||
\sa `AlgebraicStructureTraits_::Gcd`
|
||||
|
||||
*/
|
||||
template <class NT1, class NT2> result_type
|
||||
template <class NT1, class NT2> result_type
|
||||
gcd(const NT1& x, const NT2& y);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -138,28 +138,28 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `integral_division()` (a.k.a.\ exact division or division without remainder)
|
||||
maps ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$
|
||||
exists (i.e.\ if \f$ x\f$ is divisible by \f$ y\f$). Otherwise the effect of invoking
|
||||
this operation is undefined. Since the ring represented is an integral domain,
|
||||
\f$ z\f$ is uniquely defined if it exists.
|
||||
The function `integral_division()` (a.k.a.\ exact division or division without remainder)
|
||||
maps ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$
|
||||
exists (i.e.\ if \f$ x\f$ is divisible by \f$ y\f$). Otherwise the effect of invoking
|
||||
this operation is undefined. Since the ring represented is an integral domain,
|
||||
\f$ z\f$ is uniquely defined if it exists.
|
||||
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
|
||||
The actual `integral_division` is performed with the semantic of that type.
|
||||
The actual `integral_division` is performed with the semantic of that type.
|
||||
|
||||
The function is defined if `result_type`
|
||||
is a model of the `IntegralDomain` concept.
|
||||
The function is defined if `result_type`
|
||||
is a model of the `IntegralDomain` concept.
|
||||
|
||||
\sa `IntegralDomain`
|
||||
\sa `AlgebraicStructureTraits_::IntegralDivision`
|
||||
\sa `IntegralDomain`
|
||||
\sa `AlgebraicStructureTraits_::IntegralDivision`
|
||||
|
||||
*/
|
||||
template <class NT1, class NT2> result_type
|
||||
template <class NT1, class NT2> result_type
|
||||
integral_division(const NT1& x, const NT2& y);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -169,15 +169,15 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `inverse()` returns the inverse element with respect to multiplication.
|
||||
The function `inverse()` returns the inverse element with respect to multiplication.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `Field` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `Field` concept.
|
||||
|
||||
\pre \f$ x \neq0\f$.
|
||||
|
||||
\sa `Field`
|
||||
\sa `AlgebraicStructureTraits_::Inverse`
|
||||
\sa `Field`
|
||||
\sa `AlgebraicStructureTraits_::Inverse`
|
||||
|
||||
*/
|
||||
template <class NT> NT inverse(const NT& x);
|
||||
|
|
@ -189,14 +189,14 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The template function `is_negative()` determines if a value is negative or not.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
The template function `is_negative()` determines if a value is negative or not.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
|
||||
The `result_type` is convertible to `bool`.
|
||||
The `result_type` is convertible to `bool`.
|
||||
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::IsNegative`
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::IsNegative`
|
||||
|
||||
*/
|
||||
result_type is_negative(const NT& x);
|
||||
|
|
@ -208,15 +208,15 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `is_one()` determines if a value is equal to 1 or not.
|
||||
The function `is_one()` determines if a value is equal to 1 or not.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
|
||||
The `result_type` is convertible to `bool`.
|
||||
The `result_type` is convertible to `bool`.
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::IsOne`
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::IsOne`
|
||||
|
||||
*/
|
||||
template <class NT> result_type is_one(const NT& x);
|
||||
|
|
@ -228,14 +228,14 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The template function `is_positive()` determines if a value is positive or not.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
The template function `is_positive()` determines if a value is positive or not.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
|
||||
The `result_type` is convertible to `bool`.
|
||||
The `result_type` is convertible to `bool`.
|
||||
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::IsPositive`
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::IsPositive`
|
||||
|
||||
*/
|
||||
result_type is_positive(const NT& x);
|
||||
|
|
@ -247,18 +247,18 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
An ring element \f$ x\f$ is said to be a square iff there exists a ring element
|
||||
\f$ y\f$ such
|
||||
that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`,
|
||||
\f$ y\f$ is uniquely defined up to multiplication by units.
|
||||
An ring element \f$ x\f$ is said to be a square iff there exists a ring element
|
||||
\f$ y\f$ such
|
||||
that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`,
|
||||
\f$ y\f$ is uniquely defined up to multiplication by units.
|
||||
|
||||
The function `is_square()` is available if
|
||||
`Algebraic_structure_traits::Is_square` is not the `CGAL::Null_functor`.
|
||||
The function `is_square()` is available if
|
||||
`Algebraic_structure_traits::Is_square` is not the `CGAL::Null_functor`.
|
||||
|
||||
The `result_type` is convertible to `bool`.
|
||||
The `result_type` is convertible to `bool`.
|
||||
|
||||
\sa `UniqueFactorizationDomain`
|
||||
\sa `AlgebraicStructureTraits_::IsSquare`
|
||||
\sa `UniqueFactorizationDomain`
|
||||
\sa `AlgebraicStructureTraits_::IsSquare`
|
||||
|
||||
*/
|
||||
template <class NT> result_type is_square(const NT& x);
|
||||
|
|
@ -266,18 +266,18 @@ template <class NT> result_type is_square(const NT& x);
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
An ring element \f$ x\f$ is said to be a square iff there exists a ring element
|
||||
\f$ y\f$ such
|
||||
that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`,
|
||||
\f$ y\f$ is uniquely defined up to multiplication by units.
|
||||
An ring element \f$ x\f$ is said to be a square iff there exists a ring element
|
||||
\f$ y\f$ such
|
||||
that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`,
|
||||
\f$ y\f$ is uniquely defined up to multiplication by units.
|
||||
|
||||
The function `is_square()` is available if
|
||||
`Algebraic_structure_traits::Is_square` is not the `CGAL::Null_functor`.
|
||||
The function `is_square()` is available if
|
||||
`Algebraic_structure_traits::Is_square` is not the `CGAL::Null_functor`.
|
||||
|
||||
The `result_type` is convertible to `bool`.
|
||||
|
||||
\sa `UniqueFactorizationDomain`
|
||||
\sa `AlgebraicStructureTraits_::IsSquare`
|
||||
\sa `UniqueFactorizationDomain`
|
||||
\sa `AlgebraicStructureTraits_::IsSquare`
|
||||
|
||||
*/
|
||||
template <class NT> result_type is_square(const NT& x, NT& y);
|
||||
|
|
@ -289,18 +289,18 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `is_zero()` determines if a value is equal to 0 or not.
|
||||
The function `is_zero()` determines if a value is equal to 0 or not.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` or of
|
||||
the `IntegralDomainWithoutDivision` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` or of
|
||||
the `IntegralDomainWithoutDivision` concept.
|
||||
|
||||
The `result_type` is convertible to `bool`.
|
||||
The `result_type` is convertible to `bool`.
|
||||
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::IsZero`
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::IsZero`
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::IsZero`
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::IsZero`
|
||||
*/
|
||||
template <class NT> result_type is_zero(const NT& x);
|
||||
|
||||
|
|
@ -311,13 +311,13 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `kth_root()` returns the k-th root of a value.
|
||||
The function `kth_root()` returns the k-th root of a value.
|
||||
|
||||
The function is defined if the second argument type
|
||||
is a model of the `FieldWithKthRoot` concept.
|
||||
The function is defined if the second argument type
|
||||
is a model of the `FieldWithKthRoot` concept.
|
||||
|
||||
\sa `FieldWithKthRoot`
|
||||
\sa `AlgebraicStructureTraits_::KthRoot`
|
||||
\sa `FieldWithKthRoot`
|
||||
\sa `AlgebraicStructureTraits_::KthRoot`
|
||||
|
||||
*/
|
||||
template <class NT> NT kth_root(int k, const NT& x);
|
||||
|
|
@ -329,27 +329,27 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `mod()` computes the remainder of division with remainder.
|
||||
The function `mod()` computes the remainder of division with remainder.
|
||||
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
the `result_type` is determined via `Coercion_traits`.
|
||||
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
Thus, the `result_type` is well defined if `NT1` and `NT2`
|
||||
are a model of `ExplicitInteroperable`.
|
||||
|
||||
The actual `mod` is performed with the semantic of that type.
|
||||
The actual `mod` is performed with the semantic of that type.
|
||||
|
||||
The function is defined if `result_type`
|
||||
is a model of the `EuclideanRing` concept.
|
||||
The function is defined if `result_type`
|
||||
is a model of the `EuclideanRing` concept.
|
||||
|
||||
\sa `EuclideanRing`
|
||||
\sa `AlgebraicStructureTraits_::DivMod`
|
||||
\sa `EuclideanRing`
|
||||
\sa `AlgebraicStructureTraits_::DivMod`
|
||||
\sa `CGAL::div_mod()`
|
||||
\sa `CGAL::div()`
|
||||
|
||||
*/
|
||||
template< class NT1, class NT2>
|
||||
result_type
|
||||
template< class NT1, class NT2>
|
||||
result_type
|
||||
mod(const NT1& x, const NT2& y);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -363,19 +363,19 @@ returns the k-th real root of the univariate polynomial, which is
|
|||
defined by the iterator range, where begin refers to the constant
|
||||
term.
|
||||
|
||||
The function `root_of()` computes a real root of a square-free univariate
|
||||
polynomial.
|
||||
The function `root_of()` computes a real root of a square-free univariate
|
||||
polynomial.
|
||||
|
||||
The function is defined if the value type, `NT`,
|
||||
of the iterator range is a model of the `FieldWithRootOf` concept.
|
||||
The function is defined if the value type, `NT`,
|
||||
of the iterator range is a model of the `FieldWithRootOf` concept.
|
||||
|
||||
\pre The polynomial is square-free.
|
||||
|
||||
\sa `FieldWithRootOf`
|
||||
\sa `AlgebraicStructureTraits_::RootOf`
|
||||
\sa `FieldWithRootOf`
|
||||
\sa `AlgebraicStructureTraits_::RootOf`
|
||||
|
||||
*/
|
||||
template <class InputIterator> NT
|
||||
template <class InputIterator> NT
|
||||
root_of(int k, InputIterator begin, InputIterator end);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -385,15 +385,15 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The template function `sign()` returns the sign of its argument.
|
||||
The template function `sign()` returns the sign of its argument.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
|
||||
The `result_type` is convertible to `CGAL::Sign`.
|
||||
The `result_type` is convertible to `CGAL::Sign`.
|
||||
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::Sgn`
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::Sgn`
|
||||
|
||||
*/
|
||||
template <class NT> result_type sign(const NT& x);
|
||||
|
|
@ -405,13 +405,13 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `simplify()` may simplify a given object.
|
||||
The function `simplify()` may simplify a given object.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::Simplify`
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::Simplify`
|
||||
|
||||
*/
|
||||
template <class NT> void simplify(const NT& x);
|
||||
|
|
@ -423,13 +423,13 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `sqrt()` returns the square root of a value.
|
||||
The function `sqrt()` returns the square root of a value.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `FieldWithSqrt` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `FieldWithSqrt` concept.
|
||||
|
||||
\sa `FieldWithSqrt`
|
||||
\sa `AlgebraicStructureTraits_::Sqrt`
|
||||
\sa `FieldWithSqrt`
|
||||
\sa `AlgebraicStructureTraits_::Sqrt`
|
||||
|
||||
*/
|
||||
template <class NT> NT sqrt(const NT& x);
|
||||
|
|
@ -441,13 +441,13 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `square()` returns the square of a number.
|
||||
The function `square()` returns the square of a number.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::Square`
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::Square`
|
||||
|
||||
*/
|
||||
template <class NT> NT square(const NT& x);
|
||||
|
|
@ -466,13 +466,13 @@ number type (such as an instance of `CGAL::Lazy_exact_nt`), the double approxima
|
|||
returned might be affected by an exact computation internally triggered
|
||||
(that might have improved the double approximation).
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
|
||||
Remark: In order to control the quality of approximation one has to resort to methods that are specific to NT. There are no general guarantees whatsoever.
|
||||
Remark: In order to control the quality of approximation one has to resort to methods that are specific to NT. There are no general guarantees whatsoever.
|
||||
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::ToDouble`
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::ToDouble`
|
||||
|
||||
*/
|
||||
template <class NT> double to_double(const NT& x);
|
||||
|
|
@ -484,17 +484,17 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The template function `to_interval()` computes for a given real embeddable
|
||||
number \f$ x\f$ a double interval containing \f$ x\f$.
|
||||
This interval is represented by a `std::pair<double,double>`.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
The template function `to_interval()` computes for a given real embeddable
|
||||
number \f$ x\f$ a double interval containing \f$ x\f$.
|
||||
This interval is represented by a `std::pair<double,double>`.
|
||||
The function is defined if the argument type
|
||||
is a model of the `RealEmbeddable` concept.
|
||||
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::ToInterval`
|
||||
\sa `RealEmbeddable`
|
||||
\sa `RealEmbeddableTraits_::ToInterval`
|
||||
|
||||
*/
|
||||
template <class NT>
|
||||
template <class NT>
|
||||
std::pair<double,double> to_interval(const NT& x);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -504,14 +504,14 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The function `unit_part()` computes the unit part of a given ring
|
||||
element.
|
||||
The function `unit_part()` computes the unit part of a given ring
|
||||
element.
|
||||
|
||||
The function is defined if the argument type
|
||||
is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
The function is defined if the argument type
|
||||
is a model of the `IntegralDomainWithoutDivision` concept.
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::UnitPart`
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `AlgebraicStructureTraits_::UnitPart`
|
||||
|
||||
*/
|
||||
template <class NT> NT unit_part(const NT& x);
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction` computes the integral quotient of division
|
||||
with remainder.
|
||||
`AdaptableBinaryFunction` computes the integral quotient of division
|
||||
with remainder.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `AlgebraicStructureTraits_::Mod`
|
||||
|
|
@ -19,40 +19,40 @@ with remainder.
|
|||
class Div {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
|
||||
/*!
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type operator()(NT1 x, NT2 y);
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type operator()(NT1 x, NT2 y);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,191 +5,191 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableFunctor` computes both integral quotient and remainder
|
||||
of division with remainder. The quotient \f$ q\f$ and remainder \f$ r\f$ are computed
|
||||
such that \f$ x = q*y + r\f$ and \f$ |r| < |y|\f$ with respect to the proper integer norm of
|
||||
the represented ring.
|
||||
\cgalFootnote{For integers this norm is the absolute value.
|
||||
For univariate polynomials this norm is the degree.}
|
||||
In particular, \f$ r\f$ is chosen to be \f$ 0\f$ if possible.
|
||||
Moreover, we require \f$ q\f$ to be minimized with respect to the proper integer norm.
|
||||
`AdaptableFunctor` computes both integral quotient and remainder
|
||||
of division with remainder. The quotient \f$ q\f$ and remainder \f$ r\f$ are computed
|
||||
such that \f$ x = q*y + r\f$ and \f$ |r| < |y|\f$ with respect to the proper integer norm of
|
||||
the represented ring.
|
||||
\cgalFootnote{For integers this norm is the absolute value.
|
||||
For univariate polynomials this norm is the degree.}
|
||||
In particular, \f$ r\f$ is chosen to be \f$ 0\f$ if possible.
|
||||
Moreover, we require \f$ q\f$ to be minimized with respect to the proper integer norm.
|
||||
|
||||
Note that the last condition is needed to ensure a unique computation of the
|
||||
pair \f$ (q,r)\f$. However, an other option is to require minimality for \f$ |r|\f$,
|
||||
with the advantage that
|
||||
a <I>mod(x,y)</I> operation would return the unique representative of the
|
||||
residue class of \f$ x\f$ with respect to \f$ y\f$, e.g. \f$ mod(2,3)\f$ should return \f$ -1\f$.
|
||||
But this conflicts with nearly all current implementation
|
||||
of integer types. From there, we decided to stay conform with common
|
||||
implementations and require \f$ q\f$ to be computed as \f$ x/y\f$ rounded towards zero.
|
||||
Note that the last condition is needed to ensure a unique computation of the
|
||||
pair \f$ (q,r)\f$. However, an other option is to require minimality for \f$ |r|\f$,
|
||||
with the advantage that
|
||||
a <I>mod(x,y)</I> operation would return the unique representative of the
|
||||
residue class of \f$ x\f$ with respect to \f$ y\f$, e.g. \f$ mod(2,3)\f$ should return \f$ -1\f$.
|
||||
But this conflicts with nearly all current implementation
|
||||
of integer types. From there, we decided to stay conform with common
|
||||
implementations and require \f$ q\f$ to be computed as \f$ x/y\f$ rounded towards zero.
|
||||
|
||||
The following table illustrates the behavior for integers:
|
||||
The following table illustrates the behavior for integers:
|
||||
|
||||
<TABLE CELLSPACING=5 >
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
<TABLE CELLSPACING=5 >
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
x
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
y
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
q
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
r
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
2
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
2
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-2
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-2
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
</TABLE>
|
||||
<TABLE CELLSPACING=5 >
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
<TABLE CELLSPACING=5 >
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
x
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
y
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
q
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
r
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
2
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
2
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-2
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-2
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
</TABLE>
|
||||
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
<TABLE CELLSPACING=5 >
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
x
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
y
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
q
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
r
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
2
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
2
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-2
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-2
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
</TABLE>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
<TABLE CELLSPACING=5 >
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
x
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
y
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
q
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
r
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
2
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
2
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-1
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-2
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-2
|
||||
<TR>
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
-3
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
1
|
||||
<TD ALIGN=CENTER NOWRAP>
|
||||
0
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=4><HR>
|
||||
</TABLE>
|
||||
|
||||
</TABLE>
|
||||
</TABLE>
|
||||
|
||||
\cgalRefines `AdaptableFunctor`
|
||||
\cgalRefines `AdaptableFunctor`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `AlgebraicStructureTraits_::Mod`
|
||||
|
|
@ -200,56 +200,56 @@ r
|
|||
class DivMod {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is void.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is void.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type&`.
|
||||
*/
|
||||
typedef unspecified_type third_argument_type;
|
||||
Is `AlgebraicStructureTraits::Type&`.
|
||||
*/
|
||||
typedef unspecified_type third_argument_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type&`.
|
||||
*/
|
||||
typedef unspecified_type fourth_argument_type;
|
||||
Is `AlgebraicStructureTraits::Type&`.
|
||||
*/
|
||||
typedef unspecified_type fourth_argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$
|
||||
and \f$ r\f$ minimal with respect to the Euclidean Norm on
|
||||
`Type`.
|
||||
*/
|
||||
result_type operator()( first_argument_type x,
|
||||
second_argument_type y,
|
||||
third_argument_type q,
|
||||
fourth_argument_type r);
|
||||
computes the quotient \f$ q\f$ and remainder \f$ r\f$, such that \f$ x = q*y + r\f$
|
||||
and \f$ r\f$ minimal with respect to the Euclidean Norm on
|
||||
`Type`.
|
||||
*/
|
||||
result_type operator()( first_argument_type x,
|
||||
second_argument_type y,
|
||||
third_argument_type q,
|
||||
fourth_argument_type r);
|
||||
|
||||
/*!
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type
|
||||
operator()(NT1 x, NT2 y, third_argument_type q, fourth_argument_type r);
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type
|
||||
operator()(NT1 x, NT2 y, third_argument_type q, fourth_argument_type r);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,18 +5,18 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction`,
|
||||
returns true if the first argument divides the second argument.
|
||||
`AdaptableBinaryFunction`,
|
||||
returns true if the first argument divides the second argument.
|
||||
|
||||
Integral division (a.k.a. exact division or division without remainder) maps
|
||||
ring elements \f$ (n,d)\f$ to ring element \f$ c\f$ such that \f$ n = dc\f$ if such a \f$ c\f$
|
||||
exists. In this case it is said that \f$ d\f$ divides \f$ n\f$.
|
||||
Integral division (a.k.a. exact division or division without remainder) maps
|
||||
ring elements \f$ (n,d)\f$ to ring element \f$ c\f$ such that \f$ n = dc\f$ if such a \f$ c\f$
|
||||
exists. In this case it is said that \f$ d\f$ divides \f$ n\f$.
|
||||
|
||||
This functor is required to provide two operators. The first operator takes two
|
||||
arguments and returns true if the first argument divides the second argument.
|
||||
The second operator returns \f$ c\f$ via the additional third argument.
|
||||
This functor is required to provide two operators. The first operator takes two
|
||||
arguments and returns true if the first argument divides the second argument.
|
||||
The second operator returns \f$ c\f$ via the additional third argument.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `AlgebraicStructureTraits_::IntegralDivision`
|
||||
|
|
@ -26,46 +26,46 @@ The second operator returns \f$ c\f$ via the additional third argument.
|
|||
class Divides {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Boolean`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Boolean`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Computes whether \f$ d\f$ divides \f$ n\f$.
|
||||
*/
|
||||
result_type operator()(first_argument_type d,
|
||||
second_argument_type n);
|
||||
Computes whether \f$ d\f$ divides \f$ n\f$.
|
||||
*/
|
||||
result_type operator()(first_argument_type d,
|
||||
second_argument_type n);
|
||||
|
||||
/*!
|
||||
|
||||
Computes whether \f$ d\f$ divides \f$ n\f$.
|
||||
Moreover it computes \f$ c\f$ if \f$ d\f$ divides \f$ n\f$,
|
||||
otherwise the value of \f$ c\f$ is undefined.
|
||||
Computes whether \f$ d\f$ divides \f$ n\f$.
|
||||
Moreover it computes \f$ c\f$ if \f$ d\f$ divides \f$ n\f$,
|
||||
otherwise the value of \f$ c\f$ is undefined.
|
||||
|
||||
*/
|
||||
result_type operator()(
|
||||
first_argument_type d,
|
||||
second_argument_type n,
|
||||
AlgebraicStructureTraits::Type& c);
|
||||
*/
|
||||
result_type operator()(
|
||||
first_argument_type d,
|
||||
second_argument_type n,
|
||||
AlgebraicStructureTraits::Type& c);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,19 +5,19 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction` providing the gcd.
|
||||
`AdaptableBinaryFunction` providing the gcd.
|
||||
|
||||
The greatest common divisor (\f$ gcd\f$) of ring elements \f$ x\f$ and \f$ y\f$ is the unique
|
||||
ring element \f$ d\f$ (up to a unit) with the property that any common divisor of
|
||||
\f$ x\f$ and \f$ y\f$ also divides \f$ d\f$. (In other words: \f$ d\f$ is the greatest lower bound
|
||||
of \f$ x\f$ and \f$ y\f$ in the partial order of divisibility.) We demand the \f$ gcd\f$ to be
|
||||
unit-normal (i.e.\ have unit part 1).
|
||||
The greatest common divisor (\f$ gcd\f$) of ring elements \f$ x\f$ and \f$ y\f$ is the unique
|
||||
ring element \f$ d\f$ (up to a unit) with the property that any common divisor of
|
||||
\f$ x\f$ and \f$ y\f$ also divides \f$ d\f$. (In other words: \f$ d\f$ is the greatest lower bound
|
||||
of \f$ x\f$ and \f$ y\f$ in the partial order of divisibility.) We demand the \f$ gcd\f$ to be
|
||||
unit-normal (i.e.\ have unit part 1).
|
||||
|
||||
\f$ gcd(0,0)\f$ is defined as \f$ 0\f$, since \f$ 0\f$ is the greatest element with respect
|
||||
to the partial order of divisibility. This is because an element \f$ a \in R\f$ is said to divide \f$ b \in R\f$, iff \f$ \exists r \in R\f$ such that \f$ a \cdot r = b\f$.
|
||||
Thus, \f$ 0\f$ is divided by every element of the Ring, in particular by itself.
|
||||
\f$ gcd(0,0)\f$ is defined as \f$ 0\f$, since \f$ 0\f$ is the greatest element with respect
|
||||
to the partial order of divisibility. This is because an element \f$ a \in R\f$ is said to divide \f$ b \in R\f$, iff \f$ \exists r \in R\f$ such that \f$ a \cdot r = b\f$.
|
||||
Thus, \f$ 0\f$ is divided by every element of the Ring, in particular by itself.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -26,40 +26,40 @@ Thus, \f$ 0\f$ is divided by every element of the Ring, in particular by itself.
|
|||
class Gcd {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns \f$ gcd(x,y)\f$.
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
returns \f$ gcd(x,y)\f$.
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
|
||||
/*!
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type operator()(NT1 x, NT2 y);
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type operator()(NT1 x, NT2 y);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction` providing an integral division.
|
||||
`AdaptableBinaryFunction` providing an integral division.
|
||||
|
||||
Integral division (a.k.a. exact division or division without remainder) maps
|
||||
ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$
|
||||
exists (i.e.\ if \f$ x\f$ is divisible by \f$ y\f$). Otherwise the effect of invoking
|
||||
this operation is undefined. Since the ring represented is an integral domain,
|
||||
\f$ z\f$ is uniquely defined if it exists.
|
||||
Integral division (a.k.a. exact division or division without remainder) maps
|
||||
ring elements \f$ (x,y)\f$ to ring element \f$ z\f$ such that \f$ x = yz\f$ if such a \f$ z\f$
|
||||
exists (i.e.\ if \f$ x\f$ is divisible by \f$ y\f$). Otherwise the effect of invoking
|
||||
this operation is undefined. Since the ring represented is an integral domain,
|
||||
\f$ z\f$ is uniquely defined if it exists.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `AlgebraicStructureTraits_::Divides`
|
||||
|
|
@ -23,40 +23,40 @@ this operation is undefined. Since the ring represented is an integral domain,
|
|||
class IntegralDivision {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns \f$ x/y\f$, this is an integral division.
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
returns \f$ x/y\f$, this is an integral division.
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
|
||||
/*!
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type operator()(NT1 x, NT2 y);
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type operator()(NT1 x, NT2 y);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction` providing the inverse element with
|
||||
respect to multiplication of a `Field`.
|
||||
`AdaptableUnaryFunction` providing the inverse element with
|
||||
respect to multiplication of a `Field`.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -17,30 +17,30 @@ respect to multiplication of a `Field`.
|
|||
class Inverse {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the inverse element of \f$ x\f$ with respect to multiplication.
|
||||
\pre \f$ x \neq0\f$.
|
||||
returns the inverse element of \f$ x\f$ with respect to multiplication.
|
||||
\pre \f$ x \neq0\f$.
|
||||
|
||||
*/
|
||||
result_type operator()(argument_type x) const;
|
||||
*/
|
||||
result_type operator()(argument_type x) const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction`,
|
||||
returns true in case the argument is the one of the ring.
|
||||
`AdaptableUnaryFunction`,
|
||||
returns true in case the argument is the one of the ring.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -17,29 +17,29 @@ returns true in case the argument is the one of the ring.
|
|||
class IsOne {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Boolean`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Boolean`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
returns true in case \f$ x\f$ is the one of the ring.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
returns true in case \f$ x\f$ is the one of the ring.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction` that computes whether the first argument is a square.
|
||||
If the first argument is a square the second argument, which is taken by reference, contains the square root.
|
||||
Otherwise, the content of the second argument is undefined.
|
||||
`AdaptableBinaryFunction` that computes whether the first argument is a square.
|
||||
If the first argument is a square the second argument, which is taken by reference, contains the square root.
|
||||
Otherwise, the content of the second argument is undefined.
|
||||
|
||||
A ring element \f$ x\f$ is said to be a square iff there exists a ring element \f$ y\f$ such
|
||||
that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`,
|
||||
\f$ y\f$ is uniquely defined up to multiplication by units.
|
||||
A ring element \f$ x\f$ is said to be a square iff there exists a ring element \f$ y\f$ such
|
||||
that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`,
|
||||
\f$ y\f$ is uniquely defined up to multiplication by units.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -22,42 +22,42 @@ that \f$ x= y*y\f$. In case the ring is a `UniqueFactorizationDomain`,
|
|||
class IsSquare {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Boolean`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Boolean`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type&`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
Is `AlgebraicStructureTraits::Type&`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns <TT>true</TT> in case \f$ x\f$ is a square, i.e.\ \f$ x = y*y\f$.
|
||||
\post \f$ unit\_part(y) == 1\f$.
|
||||
returns <TT>true</TT> in case \f$ x\f$ is a square, i.e.\ \f$ x = y*y\f$.
|
||||
\post \f$ unit\_part(y) == 1\f$.
|
||||
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
|
||||
/*!
|
||||
returns <TT>true</TT> in case \f$ x\f$ is a square.
|
||||
returns <TT>true</TT> in case \f$ x\f$ is a square.
|
||||
|
||||
*/
|
||||
result_type operator()(first_argument_type x);
|
||||
*/
|
||||
result_type operator()(first_argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction`, returns true in case the argument is the zero element of the ring.
|
||||
`AdaptableUnaryFunction`, returns true in case the argument is the zero element of the ring.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `RealEmbeddableTraits_::IsZero`
|
||||
|
|
@ -17,29 +17,29 @@ namespace AlgebraicStructureTraits_{
|
|||
class IsZero {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Boolean`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Boolean`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
returns true in case \f$ x\f$ is the zero element of the ring.
|
||||
*/
|
||||
result_type operator()(argument_type x) const;
|
||||
returns true in case \f$ x\f$ is the zero element of the ring.
|
||||
*/
|
||||
result_type operator()(argument_type x) const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction` providing the k-th root.
|
||||
`AdaptableBinaryFunction` providing the k-th root.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `FieldWithRootOf`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
|
@ -17,35 +17,35 @@ namespace AlgebraicStructureTraits_{
|
|||
class KthRoot {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is int.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
Is int.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the \f$ k\f$-th root of \f$ x\f$.
|
||||
\pre \f$ k \geq1\f$
|
||||
returns the \f$ k\f$-th root of \f$ x\f$.
|
||||
\pre \f$ k \geq1\f$
|
||||
|
||||
*/
|
||||
result_type operator()(int k, second_argument_type x);
|
||||
*/
|
||||
result_type operator()(int k, second_argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction` computes the remainder of division with remainder.
|
||||
`AdaptableBinaryFunction` computes the remainder of division with remainder.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `AlgebraicStructureTraits_::Div`
|
||||
|
|
@ -18,40 +18,40 @@ namespace AlgebraicStructureTraits_ {
|
|||
class Mod {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
|
||||
/*!
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type operator()(NT1 x, NT2 y);
|
||||
This operator is defined if `NT1` and `NT2` are `ExplicitInteroperable`
|
||||
with coercion type `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2> result_type operator()(NT1 x, NT2 y);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableFunctor` computes a real root of a square-free univariate
|
||||
polynomial.
|
||||
`AdaptableFunctor` computes a real root of a square-free univariate
|
||||
polynomial.
|
||||
|
||||
\cgalRefines `AdaptableFunctor`
|
||||
\cgalRefines `AdaptableFunctor`
|
||||
|
||||
\sa `FieldWithRootOf`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
|
@ -18,28 +18,28 @@ polynomial.
|
|||
class RootOf {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the k-th real root of the univariate polynomial,
|
||||
which is defined by the iterator range,
|
||||
where begin refers to the constant term.
|
||||
\pre The polynomial is square-free.
|
||||
\pre The value type of the InputIterator is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template<class InputIterator>
|
||||
result_type operator() (int k, InputIterator begin, InputIterator end);
|
||||
returns the k-th real root of the univariate polynomial,
|
||||
which is defined by the iterator range,
|
||||
where begin refers to the constant term.
|
||||
\pre The polynomial is square-free.
|
||||
\pre The value type of the InputIterator is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
template<class InputIterator>
|
||||
result_type operator() (int k, InputIterator begin, InputIterator end);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
This `AdaptableUnaryFunction` may simplify a given object.
|
||||
This `AdaptableUnaryFunction` may simplify a given object.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -16,28 +16,28 @@ This `AdaptableUnaryFunction` may simplify a given object.
|
|||
class Simplify {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is void.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is void.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
may simplify \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
may simplify \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction` providing the square root.
|
||||
`AdaptableUnaryFunction` providing the square root.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -16,28 +16,28 @@ namespace AlgebraicStructureTraits_{
|
|||
class Sqrt {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns \f$ \sqrt{x}\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x) const;
|
||||
returns \f$ \sqrt{x}\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x) const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction`, computing the square of the argument.
|
||||
`AdaptableUnaryFunction`, computing the square of the argument.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -16,28 +16,28 @@ namespace AlgebraicStructureTraits_{
|
|||
class Square {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the square of \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
returns the square of \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,23 +5,23 @@ namespace AlgebraicStructureTraits_{
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
This `AdaptableUnaryFunction` computes the unit part of a given ring
|
||||
element.
|
||||
This `AdaptableUnaryFunction` computes the unit part of a given ring
|
||||
element.
|
||||
|
||||
The mathematical definition of unit part is as follows: Two ring elements \f$ a\f$
|
||||
and \f$ b\f$ are said to be associate if there exists an invertible ring element
|
||||
(i.e.\ a unit) \f$ u\f$ such that \f$ a = ub\f$. This defines an equivalence relation.
|
||||
We can distinguish exactly one element of every equivalence class as being
|
||||
unit normal. Then each element of a ring possesses a factorization into a unit
|
||||
(called its unit part) and a unit-normal ring element
|
||||
(called its unit normal associate).
|
||||
The mathematical definition of unit part is as follows: Two ring elements \f$ a\f$
|
||||
and \f$ b\f$ are said to be associate if there exists an invertible ring element
|
||||
(i.e.\ a unit) \f$ u\f$ such that \f$ a = ub\f$. This defines an equivalence relation.
|
||||
We can distinguish exactly one element of every equivalence class as being
|
||||
unit normal. Then each element of a ring possesses a factorization into a unit
|
||||
(called its unit part) and a unit-normal ring element
|
||||
(called its unit normal associate).
|
||||
|
||||
For the integers, the non-negative numbers are by convention unit normal,
|
||||
hence the unit-part of a non-zero integer is its sign. For a `Field`, every
|
||||
non-zero element is a unit and is its own unit part, its unit normal
|
||||
associate being one. The unit part of zero is, by convention, one.
|
||||
For the integers, the non-negative numbers are by convention unit normal,
|
||||
hence the unit-part of a non-zero integer is its sign. For a `Field`, every
|
||||
non-zero element is a unit and is its own unit part, its unit normal
|
||||
associate being one. The unit part of zero is, by convention, one.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `AlgebraicStructureTraits`
|
||||
|
||||
|
|
@ -31,28 +31,28 @@ associate being one. The unit part of zero is, by convention, one.
|
|||
class UnitPart {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `AlgebraicStructureTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns the unit part of \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
returns the unit part of \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of `AlgebraicStructureTraits` reflects the algebraic structure
|
||||
of an associated type `Type`.
|
||||
A model of `AlgebraicStructureTraits` reflects the algebraic structure
|
||||
of an associated type `Type`.
|
||||
|
||||
Depending on the concepts that `Type` fulfills,
|
||||
it contains various functors and descriptive tags.
|
||||
Moreover it gives access to the several possible
|
||||
algebraic operations within that structure.
|
||||
Depending on the concepts that `Type` fulfills,
|
||||
it contains various functors and descriptive tags.
|
||||
Moreover it gives access to the several possible
|
||||
algebraic operations within that structure.
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomain`
|
||||
|
|
@ -35,267 +35,267 @@ algebraic operations within that structure.
|
|||
class AlgebraicStructureTraits {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// A model of `AlgebraicStructureTraits` is supposed to provide:
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
The associated type.
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
The associated type.
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
|
||||
/*!
|
||||
Tag indicating the algebraic structure of the associated type.
|
||||
Tag indicating the algebraic structure of the associated type.
|
||||
|
||||
<TABLE CELLSPACING=5 >
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=2><HR>
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
Tag is:
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`Type` is model of:
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=2><HR>
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Null_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
no algebraic concept
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Integral_domain_without_division_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`IntegralDomainWithoutDivision`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Integral_domain_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`IntegralDomain`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Unique_factorization_domain_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`UniqueFactorizationDomain`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Euclidean_ring_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`EuclideanRing`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Field_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`Field`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Field_with_sqrt_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`FieldWithSqrt`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Field_with_kth_root_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`FieldWithKthRoot`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Field_with_root_of_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`FieldWithRootOf`
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=2><HR>
|
||||
</TABLE>
|
||||
<TABLE CELLSPACING=5 >
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=2><HR>
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
Tag is:
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`Type` is model of:
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=2><HR>
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Null_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
no algebraic concept
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Integral_domain_without_division_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`IntegralDomainWithoutDivision`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Integral_domain_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`IntegralDomain`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Unique_factorization_domain_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`UniqueFactorizationDomain`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Euclidean_ring_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`EuclideanRing`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Field_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`Field`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Field_with_sqrt_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`FieldWithSqrt`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Field_with_kth_root_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`FieldWithKthRoot`
|
||||
<TR>
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`CGAL::Field_with_root_of_tag`
|
||||
<TD ALIGN=LEFT NOWRAP>
|
||||
`FieldWithRootOf`
|
||||
<TR><TD ALIGN=LEFT NOWRAP COLSPAN=2><HR>
|
||||
</TABLE>
|
||||
|
||||
*/
|
||||
typedef unspecified_type Algebraic_category;
|
||||
*/
|
||||
typedef unspecified_type Algebraic_category;
|
||||
|
||||
/*!
|
||||
Tag indicating whether `Type` is exact.
|
||||
Tag indicating whether `Type` is exact.
|
||||
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
|
||||
An algebraic structure is considered exact, if all operations
|
||||
required by its concept are computed such that a comparison
|
||||
of two algebraic expressions is always correct.
|
||||
The exactness covers only those operations that are required by
|
||||
the algebraic structure concept.
|
||||
An algebraic structure is considered exact, if all operations
|
||||
required by its concept are computed such that a comparison
|
||||
of two algebraic expressions is always correct.
|
||||
The exactness covers only those operations that are required by
|
||||
the algebraic structure concept.
|
||||
|
||||
e.g. an exact `Field` may have a `Sqrt` functor that
|
||||
is not exact.
|
||||
e.g. an exact `Field` may have a `Sqrt` functor that
|
||||
is not exact.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Is_exact;
|
||||
*/
|
||||
typedef unspecified_type Is_exact;
|
||||
|
||||
/*!
|
||||
Tag indicating whether `Type` is numerical sensitive.
|
||||
Tag indicating whether `Type` is numerical sensitive.
|
||||
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
|
||||
An algebraic structure is considered as numerically sensitive,
|
||||
if the performance of the type is sensitive to the condition
|
||||
number of an algorithm.
|
||||
An algebraic structure is considered as numerically sensitive,
|
||||
if the performance of the type is sensitive to the condition
|
||||
number of an algorithm.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Is_numerical_sensitive;
|
||||
*/
|
||||
typedef unspecified_type Is_numerical_sensitive;
|
||||
|
||||
/*!
|
||||
This type specifies the return type of the predicates provided
|
||||
by this traits. The type must be convertible to `bool` and
|
||||
typically the type indeed maps to `bool`. However, there are also
|
||||
cases such as interval arithmetic, in which it is `Uncertain<bool>`
|
||||
or some similar type.
|
||||
This type specifies the return type of the predicates provided
|
||||
by this traits. The type must be convertible to `bool` and
|
||||
typically the type indeed maps to `bool`. However, there are also
|
||||
cases such as interval arithmetic, in which it is `Uncertain<bool>`
|
||||
or some similar type.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Boolean;
|
||||
*/
|
||||
typedef unspecified_type Boolean;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Functors
|
||||
/// \name Functors
|
||||
/// In case a functor is not provided, it is set to `CGAL::Null_functor`.
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::IsZero`.
|
||||
A model of `AlgebraicStructureTraits_::IsZero`.
|
||||
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
In case `Type` is also model of `RealEmbeddable` this is a
|
||||
model of `RealEmbeddableTraits_::IsZero`.
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
In case `Type` is also model of `RealEmbeddable` this is a
|
||||
model of `RealEmbeddableTraits_::IsZero`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Is_zero;
|
||||
*/
|
||||
typedef unspecified_type Is_zero;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::IsOne`.
|
||||
A model of `AlgebraicStructureTraits_::IsOne`.
|
||||
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Is_one;
|
||||
*/
|
||||
typedef unspecified_type Is_one;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::Square`.
|
||||
A model of `AlgebraicStructureTraits_::Square`.
|
||||
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Square;
|
||||
*/
|
||||
typedef unspecified_type Square;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::Simplify`.
|
||||
A model of `AlgebraicStructureTraits_::Simplify`.
|
||||
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Simplify;
|
||||
*/
|
||||
typedef unspecified_type Simplify;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::UnitPart`.
|
||||
A model of `AlgebraicStructureTraits_::UnitPart`.
|
||||
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Unit_part;
|
||||
*/
|
||||
typedef unspecified_type Unit_part;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::IntegralDivision`.
|
||||
A model of `AlgebraicStructureTraits_::IntegralDivision`.
|
||||
|
||||
Required by the concept `IntegralDomain`.
|
||||
Required by the concept `IntegralDomain`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Integral_division;
|
||||
*/
|
||||
typedef unspecified_type Integral_division;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::Divides`.
|
||||
A model of `AlgebraicStructureTraits_::Divides`.
|
||||
|
||||
Required by the concept `IntegralDomain`.
|
||||
Required by the concept `IntegralDomain`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Divides;
|
||||
*/
|
||||
typedef unspecified_type Divides;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::IsSquare`.
|
||||
A model of `AlgebraicStructureTraits_::IsSquare`.
|
||||
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
Required by the concept `IntegralDomainWithoutDivision`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Is_square;
|
||||
*/
|
||||
typedef unspecified_type Is_square;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::Gcd`.
|
||||
A model of `AlgebraicStructureTraits_::Gcd`.
|
||||
|
||||
Required by the concept `UniqueFactorizationDomain`.
|
||||
Required by the concept `UniqueFactorizationDomain`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Gcd;
|
||||
*/
|
||||
typedef unspecified_type Gcd;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::Mod`.
|
||||
A model of `AlgebraicStructureTraits_::Mod`.
|
||||
|
||||
Required by the concept `EuclideanRing`.
|
||||
Required by the concept `EuclideanRing`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Mod;
|
||||
*/
|
||||
typedef unspecified_type Mod;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::Div`.
|
||||
A model of `AlgebraicStructureTraits_::Div`.
|
||||
|
||||
Required by the concept `EuclideanRing`.
|
||||
Required by the concept `EuclideanRing`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Div;
|
||||
*/
|
||||
typedef unspecified_type Div;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::DivMod`.
|
||||
A model of `AlgebraicStructureTraits_::DivMod`.
|
||||
|
||||
Required by the concept `EuclideanRing`.
|
||||
Required by the concept `EuclideanRing`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Div_mod;
|
||||
*/
|
||||
typedef unspecified_type Div_mod;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::Inverse`.
|
||||
A model of `AlgebraicStructureTraits_::Inverse`.
|
||||
|
||||
Required by the concept `Field`.
|
||||
Required by the concept `Field`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Inverse;
|
||||
*/
|
||||
typedef unspecified_type Inverse;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::Sqrt`.
|
||||
A model of `AlgebraicStructureTraits_::Sqrt`.
|
||||
|
||||
Required by the concept `FieldWithSqrt`.
|
||||
Required by the concept `FieldWithSqrt`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Sqrt;
|
||||
*/
|
||||
typedef unspecified_type Sqrt;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::KthRoot`.
|
||||
A model of `AlgebraicStructureTraits_::KthRoot`.
|
||||
|
||||
Required by the concept `FieldWithKthRoot`.
|
||||
Required by the concept `FieldWithKthRoot`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Kth_root;
|
||||
*/
|
||||
typedef unspecified_type Kth_root;
|
||||
|
||||
/*!
|
||||
|
||||
A model of `AlgebraicStructureTraits_::RootOf`.
|
||||
A model of `AlgebraicStructureTraits_::RootOf`.
|
||||
|
||||
Required by the concept `FieldWithRootOf`.
|
||||
Required by the concept `FieldWithRootOf`.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Root_of;
|
||||
*/
|
||||
typedef unspecified_type Root_of;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,29 +3,29 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of `EuclideanRing` represents an euclidean ring (or Euclidean domain).
|
||||
It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders
|
||||
such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to
|
||||
\f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$.
|
||||
In particular, \f$ r\f$ is chosen to be \f$ 0\f$ if possible.
|
||||
A model of `EuclideanRing` represents an euclidean ring (or Euclidean domain).
|
||||
It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders
|
||||
such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to
|
||||
\f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$.
|
||||
In particular, \f$ r\f$ is chosen to be \f$ 0\f$ if possible.
|
||||
|
||||
Moreover, `CGAL::Algebraic_structure_traits< EuclideanRing >` is a model of
|
||||
`AlgebraicStructureTraits` providing:
|
||||
Moreover, `CGAL::Algebraic_structure_traits< EuclideanRing >` is a model of
|
||||
`AlgebraicStructureTraits` providing:
|
||||
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< EuclideanRing >::Algebraic_category` \endlink derived from `CGAL::Unique_factorization_domain_tag`
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< EuclideanRing >::Algebraic_category` \endlink derived from `CGAL::Unique_factorization_domain_tag`
|
||||
- \link AlgebraicStructureTraits::Mod `CGAL::Algebraic_structure_traits< EuclideanRing >::Mod` \endlink which is a model of `AlgebraicStructureTraits_::Mod`
|
||||
- \link AlgebraicStructureTraits::Div `CGAL::Algebraic_structure_traits< EuclideanRing >::Div` \endlink which is a model of `AlgebraicStructureTraits_::Div`
|
||||
- \link AlgebraicStructureTraits::Div `CGAL::Algebraic_structure_traits< EuclideanRing >::Div` \endlink which is a model of `AlgebraicStructureTraits_::Div`
|
||||
- \link AlgebraicStructureTraits::Div_mod `CGAL::Algebraic_structure_traits< EuclideanRing >::Div_mod` \endlink which is a model of `AlgebraicStructureTraits_::DivMod`
|
||||
|
||||
<p></p> <!-- Work around for a doxygen bug -->
|
||||
<p></p> <!-- Work around for a doxygen bug -->
|
||||
|
||||
\cgalHeading{Remarks}
|
||||
|
||||
The most prominent example of a Euclidean ring are the integers.
|
||||
Whenever both \f$ x\f$ and \f$ y\f$ are positive, then it is conventional to choose
|
||||
the smallest positive remainder \f$ r\f$.
|
||||
The most prominent example of a Euclidean ring are the integers.
|
||||
Whenever both \f$ x\f$ and \f$ y\f$ are positive, then it is conventional to choose
|
||||
the smallest positive remainder \f$ r\f$.
|
||||
|
||||
\cgalRefines `UniqueFactorizationDomain`
|
||||
\cgalRefines `UniqueFactorizationDomain`
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomain`
|
||||
|
|
|
|||
|
|
@ -3,23 +3,23 @@
|
|||
\ingroup PkgAlgebraicFoundationsInteroperabilityConcepts
|
||||
\cgalConcept
|
||||
|
||||
Two types `A` and `B` are a model of the `ExplicitInteroperable`
|
||||
concept, if it is possible to derive a superior type for `A` and `B`,
|
||||
such that both types are embeddable into this type.
|
||||
This type is \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits<A,B>::Type`\endlink.
|
||||
Two types `A` and `B` are a model of the `ExplicitInteroperable`
|
||||
concept, if it is possible to derive a superior type for `A` and `B`,
|
||||
such that both types are embeddable into this type.
|
||||
This type is \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits<A,B>::Type`\endlink.
|
||||
|
||||
In this case
|
||||
In this case
|
||||
\link CGAL::Coercion_traits::Are_explicit_interoperable `CGAL::Coercion_traits<A,B>::Are_explicit_interoperable`\endlink
|
||||
is `Tag_true`.
|
||||
is `Tag_true`.
|
||||
|
||||
`A` and `B` are valid argument types for all binary functors in
|
||||
`CGAL::Algebraic_structure_traits<Type>` and `CGAL::Real_embeddable_traits<Type>`.
|
||||
This is also the case for the respective global functions.
|
||||
`A` and `B` are valid argument types for all binary functors in
|
||||
`CGAL::Algebraic_structure_traits<Type>` and `CGAL::Real_embeddable_traits<Type>`.
|
||||
This is also the case for the respective global functions.
|
||||
|
||||
\sa `CGAL::Coercion_traits<A,B>`
|
||||
\sa `ImplicitInteroperable`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `RealEmbeddableTraits`
|
||||
\sa `CGAL::Coercion_traits<A,B>`
|
||||
\sa `ImplicitInteroperable`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -3,20 +3,20 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of `Field` is an `IntegralDomain` in which every non-zero element
|
||||
has a multiplicative inverse.
|
||||
Thus, one can divide by any non-zero element.
|
||||
Hence division is defined for any divisor != 0.
|
||||
For a Field, we require this division operation to be available through
|
||||
operators / and /=.
|
||||
A model of `Field` is an `IntegralDomain` in which every non-zero element
|
||||
has a multiplicative inverse.
|
||||
Thus, one can divide by any non-zero element.
|
||||
Hence division is defined for any divisor != 0.
|
||||
For a Field, we require this division operation to be available through
|
||||
operators / and /=.
|
||||
|
||||
Moreover, `CGAL::Algebraic_structure_traits< Field >` is a model of
|
||||
`AlgebraicStructureTraits` providing:
|
||||
Moreover, `CGAL::Algebraic_structure_traits< Field >` is a model of
|
||||
`AlgebraicStructureTraits` providing:
|
||||
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< Field >::Algebraic_category` \endlink derived from `CGAL::Field_tag`
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< Field >::Algebraic_category` \endlink derived from `CGAL::Field_tag`
|
||||
- \link AlgebraicStructureTraits::Inverse `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Inverse` \endlink which is a model of `AlgebraicStructureTraits_::Inverse`
|
||||
|
||||
\cgalRefines `IntegralDomain`
|
||||
\cgalRefines `IntegralDomain`
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomain`
|
||||
|
|
@ -33,19 +33,19 @@ Moreover, `CGAL::Algebraic_structure_traits< Field >` is a model of
|
|||
class Field {
|
||||
public:
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
Field operator/(const Field &a, const Field &b);
|
||||
*/
|
||||
Field operator/(const Field &a, const Field &b);
|
||||
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
Field operator/=(const Field &b);
|
||||
*/
|
||||
Field operator/=(const Field &b);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,27 +2,27 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `FieldNumberType` combines the requirements of the concepts
|
||||
`Field` and `RealEmbeddable`.
|
||||
A model of `FieldNumberType` can be used as a template parameter
|
||||
for Cartesian kernels.
|
||||
The concept `FieldNumberType` combines the requirements of the concepts
|
||||
`Field` and `RealEmbeddable`.
|
||||
A model of `FieldNumberType` can be used as a template parameter
|
||||
for Cartesian kernels.
|
||||
|
||||
\cgalRefines `Field`
|
||||
\cgalRefines `RealEmbeddable`
|
||||
\cgalRefines `Field`
|
||||
\cgalRefines `RealEmbeddable`
|
||||
|
||||
\cgalHasModel float
|
||||
\cgalHasModel double
|
||||
\cgalHasModel `CGAL::Gmpq`
|
||||
\cgalHasModel `CGAL::Interval_nt`
|
||||
\cgalHasModel float
|
||||
\cgalHasModel double
|
||||
\cgalHasModel `CGAL::Gmpq`
|
||||
\cgalHasModel `CGAL::Interval_nt`
|
||||
\cgalHasModel \ref CGAL::Interval_nt_advanced
|
||||
\cgalHasModel `CGAL::Lazy_exact_nt<FieldNumberType>`
|
||||
\cgalHasModel `CGAL::Quotient<RingNumberType>`
|
||||
\cgalHasModel `leda_rational`
|
||||
\cgalHasModel `leda_bigfloat`
|
||||
\cgalHasModel `leda_real`
|
||||
\cgalHasModel `CGAL::Lazy_exact_nt<FieldNumberType>`
|
||||
\cgalHasModel `CGAL::Quotient<RingNumberType>`
|
||||
\cgalHasModel `leda_rational`
|
||||
\cgalHasModel `leda_bigfloat`
|
||||
\cgalHasModel `leda_real`
|
||||
|
||||
\sa `RingNumberType`
|
||||
\sa `Kernel`
|
||||
\sa `RingNumberType`
|
||||
\sa `Kernel`
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of `FieldWithKthRoot` is a `FieldWithSqrt` that has operations to take k-th roots.
|
||||
A model of `FieldWithKthRoot` is a `FieldWithSqrt` that has operations to take k-th roots.
|
||||
|
||||
Moreover, `CGAL::Algebraic_structure_traits< FieldWithKthRoot >` is a model of `AlgebraicStructureTraits` providing:
|
||||
Moreover, `CGAL::Algebraic_structure_traits< FieldWithKthRoot >` is a model of `AlgebraicStructureTraits` providing:
|
||||
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithKthRoot >::Algebraic_category` \endlink derived from `CGAL::Field_with_kth_root_tag`
|
||||
- \link AlgebraicStructureTraits::Kth_root `CGAL::Algebraic_structure_traits< FieldWithKthRoot >::Kth_root` \endlink which is a model of `AlgebraicStructureTraits_::KthRoot`
|
||||
|
||||
\cgalRefines `FieldWithSqrt`
|
||||
\cgalRefines `FieldWithSqrt`
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomain`
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of `FieldWithRootOf` is a `FieldWithKthRoot` with the possibility to
|
||||
construct it as the root of a univariate polynomial.
|
||||
A model of `FieldWithRootOf` is a `FieldWithKthRoot` with the possibility to
|
||||
construct it as the root of a univariate polynomial.
|
||||
|
||||
Moreover, `CGAL::Algebraic_structure_traits< FieldWithRootOf >` is a model of `AlgebraicStructureTraits` providing:
|
||||
Moreover, `CGAL::Algebraic_structure_traits< FieldWithRootOf >` is a model of `AlgebraicStructureTraits` providing:
|
||||
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithRootOf >::Algebraic_category` \endlink derived from `CGAL::Field_with_kth_root_tag`
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithRootOf >::Algebraic_category` \endlink derived from `CGAL::Field_with_kth_root_tag`
|
||||
- \link AlgebraicStructureTraits::Root_of `CGAL::Algebraic_structure_traits< FieldWithRootOf >::Root_of` \endlink which is a model of `AlgebraicStructureTraits_::RootOf`
|
||||
|
||||
\cgalRefines `FieldWithKthRoot`
|
||||
\cgalRefines `FieldWithKthRoot`
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomain`
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of `FieldWithSqrt` is a `Field` that has operations to take square roots.
|
||||
A model of `FieldWithSqrt` is a `Field` that has operations to take square roots.
|
||||
|
||||
Moreover, `CGAL::Algebraic_structure_traits< FieldWithSqrt >` is a model of `AlgebraicStructureTraits` providing:
|
||||
Moreover, `CGAL::Algebraic_structure_traits< FieldWithSqrt >` is a model of `AlgebraicStructureTraits` providing:
|
||||
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Algebraic_category` \endlink derived from `CGAL::Field_with_sqrt_tag`
|
||||
- \link AlgebraicStructureTraits::Sqrt `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Sqrt` \endlink which is a model of `AlgebraicStructureTraits_::Sqrt`
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Algebraic_category` \endlink derived from `CGAL::Field_with_sqrt_tag`
|
||||
- \link AlgebraicStructureTraits::Sqrt `CGAL::Algebraic_structure_traits< FieldWithSqrt >::Sqrt` \endlink which is a model of `AlgebraicStructureTraits_::Sqrt`
|
||||
|
||||
\cgalRefines `Field`
|
||||
\cgalRefines `Field`
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomain`
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
\ingroup PkgAlgebraicFoundationsFractionsConcepts
|
||||
\cgalConcept
|
||||
|
||||
A type is considered as a `Fraction`, if there is a reasonable way to
|
||||
decompose it into a numerator and denominator. In this case the relevant
|
||||
functionality for decomposing and re-composing as well as the numerator and
|
||||
denominator type are provided by `CGAL::Fraction_traits`.
|
||||
A type is considered as a `Fraction`, if there is a reasonable way to
|
||||
decompose it into a numerator and denominator. In this case the relevant
|
||||
functionality for decomposing and re-composing as well as the numerator and
|
||||
denominator type are provided by `CGAL::Fraction_traits`.
|
||||
|
||||
\sa `FractionTraits`
|
||||
\sa `CGAL::Fraction_traits<T>`
|
||||
\sa `CGAL::Fraction_traits<T>`
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -3,53 +3,53 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of `FractionTraits` is associated with a type `Type`.
|
||||
A model of `FractionTraits` is associated with a type `Type`.
|
||||
|
||||
In case the associated type is a `Fraction`, a model of `FractionTraits` provides the relevant functionality for decomposing and re-composing as well
|
||||
as the numerator and denominator type.
|
||||
In case the associated type is a `Fraction`, a model of `FractionTraits` provides the relevant functionality for decomposing and re-composing as well
|
||||
as the numerator and denominator type.
|
||||
|
||||
\cgalHasModel `CGAL::Fraction_traits<T>`
|
||||
|
||||
\sa `FractionTraits_::Decompose`
|
||||
\sa `FractionTraits_::Compose`
|
||||
\sa `FractionTraits_::CommonFactor`
|
||||
\sa `FractionTraits_::Decompose`
|
||||
\sa `FractionTraits_::Compose`
|
||||
\sa `FractionTraits_::CommonFactor`
|
||||
|
||||
*/
|
||||
class FractionTraits {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
The associated type
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
The associated type
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
|
||||
/*!
|
||||
|
||||
Tag indicating whether the associated type is a fraction and can be
|
||||
decomposed into a numerator and denominator.
|
||||
Tag indicating whether the associated type is a fraction and can be
|
||||
decomposed into a numerator and denominator.
|
||||
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
*/
|
||||
typedef unspecified_type Is_fraction;
|
||||
This is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
||||
*/
|
||||
typedef unspecified_type Is_fraction;
|
||||
|
||||
/*!
|
||||
The type to represent the numerator.
|
||||
This is undefined in case the associated type is not a fraction.
|
||||
*/
|
||||
typedef unspecified_type Numerator_type ;
|
||||
The type to represent the numerator.
|
||||
This is undefined in case the associated type is not a fraction.
|
||||
*/
|
||||
typedef unspecified_type Numerator_type ;
|
||||
|
||||
/*!
|
||||
The (simpler) type to represent the denominator.
|
||||
This is undefined in case the associated type is not a fraction.
|
||||
*/
|
||||
typedef unspecified_type Denominator_type;
|
||||
The (simpler) type to represent the denominator.
|
||||
This is undefined in case the associated type is not a fraction.
|
||||
*/
|
||||
typedef unspecified_type Denominator_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Functors
|
||||
/// \name Functors
|
||||
/// In case `Type` is not a `Fraction` all functors are `Null_functor`.
|
||||
/// @{
|
||||
|
||||
|
|
@ -81,27 +81,27 @@ namespace FractionTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
Functor decomposing a `Fraction` into its numerator and denominator.
|
||||
Functor decomposing a `Fraction` into its numerator and denominator.
|
||||
|
||||
\sa `Fraction`
|
||||
\sa `FractionTraits`
|
||||
\sa `FractionTraits_::Compose`
|
||||
\sa `FractionTraits_::CommonFactor`
|
||||
\sa `Fraction`
|
||||
\sa `FractionTraits`
|
||||
\sa `FractionTraits_::Compose`
|
||||
\sa `FractionTraits_::CommonFactor`
|
||||
|
||||
*/
|
||||
|
||||
class Decompose {
|
||||
public:
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
decompose \f$ f\f$ into numerator \f$ n\f$ and denominator \f$ d\f$.
|
||||
*/
|
||||
void operator()( FractionTraits::Type f,
|
||||
FractionTraits::Numerator_type & n,
|
||||
FractionTraits::Denominator_type & d);
|
||||
decompose \f$ f\f$ into numerator \f$ n\f$ and denominator \f$ d\f$.
|
||||
*/
|
||||
void operator()( FractionTraits::Type f,
|
||||
FractionTraits::Numerator_type & n,
|
||||
FractionTraits::Denominator_type & d);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -111,47 +111,47 @@ FractionTraits::Denominator_type & d);
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction`, returns the fraction of its arguments.
|
||||
`AdaptableBinaryFunction`, returns the fraction of its arguments.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `Fraction`
|
||||
\sa `FractionTraits`
|
||||
\sa `FractionTraits_::Decompose`
|
||||
\sa `FractionTraits_::CommonFactor`
|
||||
\sa `Fraction`
|
||||
\sa `FractionTraits`
|
||||
\sa `FractionTraits_::Decompose`
|
||||
\sa `FractionTraits_::CommonFactor`
|
||||
|
||||
*/
|
||||
|
||||
class Compose {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
typedef FractionTraits::Type result_type;
|
||||
*/
|
||||
typedef FractionTraits::Type result_type;
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
typedef FractionTraits::Numerator_type first_argument_type;
|
||||
*/
|
||||
typedef FractionTraits::Numerator_type first_argument_type;
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
typedef FractionTraits::Denominator_type second_argument_type;
|
||||
*/
|
||||
typedef FractionTraits::Denominator_type second_argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
return the fraction \f$ n/d\f$.
|
||||
*/
|
||||
result_type operator()(first_argument_type n, second_argument_type d);
|
||||
return the fraction \f$ n/d\f$.
|
||||
*/
|
||||
result_type operator()(first_argument_type n, second_argument_type d);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -162,54 +162,54 @@ result_type operator()(first_argument_type n, second_argument_type d);
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction`, finds great common factor of denominators.
|
||||
`AdaptableBinaryFunction`, finds great common factor of denominators.
|
||||
|
||||
This can be considered as a relaxed version of `AlgebraicStructureTraits_::Gcd`,
|
||||
this is needed because it is not guaranteed that `FractionTraits::Denominator_type` is a model of
|
||||
`UniqueFactorizationDomain`.
|
||||
This can be considered as a relaxed version of `AlgebraicStructureTraits_::Gcd`,
|
||||
this is needed because it is not guaranteed that `FractionTraits::Denominator_type` is a model of
|
||||
`UniqueFactorizationDomain`.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `Fraction`
|
||||
\sa `FractionTraits`
|
||||
\sa `FractionTraits_::Decompose`
|
||||
\sa `FractionTraits_::Compose`
|
||||
\sa `AlgebraicStructureTraits_::Gcd`
|
||||
\sa `Fraction`
|
||||
\sa `FractionTraits`
|
||||
\sa `FractionTraits_::Decompose`
|
||||
\sa `FractionTraits_::Compose`
|
||||
\sa `AlgebraicStructureTraits_::Gcd`
|
||||
|
||||
*/
|
||||
|
||||
class CommonFactor {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
typedef FractionTraits::Denominator_type result_type;
|
||||
*/
|
||||
typedef FractionTraits::Denominator_type result_type;
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
typedef FractionTraits::Denominator_type first_argument_type;
|
||||
*/
|
||||
typedef FractionTraits::Denominator_type first_argument_type;
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
typedef FractionTraits::Denominator_type second_argument_type;
|
||||
*/
|
||||
typedef FractionTraits::Denominator_type second_argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
return a great common factor of \f$ d1\f$ and \f$ d2\f$.
|
||||
return a great common factor of \f$ d1\f$ and \f$ d2\f$.
|
||||
|
||||
Note: <TT>operator()(0,0) = 0</TT>
|
||||
*/
|
||||
result_type operator()(first_argument_type d1, second_argument_type d2);
|
||||
Note: <TT>operator()(0,0) = 0</TT>
|
||||
*/
|
||||
result_type operator()(first_argument_type d1, second_argument_type d2);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,26 +3,26 @@
|
|||
\ingroup PkgAlgebraicFoundationsConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of the concept `FromDoubleConstructible` is required
|
||||
to be constructible from the type `double`.
|
||||
A model of the concept `FromDoubleConstructible` is required
|
||||
to be constructible from the type `double`.
|
||||
|
||||
In case the type is a model of `RealEmbeddable` too, for any double d
|
||||
the identity: `d == CGAL::to_double(T(d))`, is guaranteed.
|
||||
In case the type is a model of `RealEmbeddable` too, for any double d
|
||||
the identity: `d == CGAL::to_double(T(d))`, is guaranteed.
|
||||
|
||||
*/
|
||||
|
||||
class FromDoubleConstructible {
|
||||
public:
|
||||
|
||||
/// \name Creation
|
||||
/// \name Creation
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
conversion constructor from double.
|
||||
conversion constructor from double.
|
||||
|
||||
*/
|
||||
FromDoubleConstructible(const double& d);
|
||||
*/
|
||||
FromDoubleConstructible(const double& d);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,25 +3,25 @@
|
|||
\ingroup PkgAlgebraicFoundationsConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of the concept `FromIntConstructible` is required
|
||||
to be constructible from int.
|
||||
A model of the concept `FromIntConstructible` is required
|
||||
to be constructible from int.
|
||||
|
||||
\cgalHasModel int
|
||||
\cgalHasModel long
|
||||
\cgalHasModel double
|
||||
\cgalHasModel int
|
||||
\cgalHasModel long
|
||||
\cgalHasModel double
|
||||
|
||||
*/
|
||||
|
||||
class FromIntConstructible {
|
||||
public:
|
||||
|
||||
/// \name Creation
|
||||
/// \name Creation
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
FromIntConstructible(int& i);
|
||||
*/
|
||||
FromIntConstructible(int& i);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,25 +3,25 @@
|
|||
\ingroup PkgAlgebraicFoundationsInteroperabilityConcepts
|
||||
\cgalConcept
|
||||
|
||||
Two types `A` and `B` are a model of the concept
|
||||
`ImplicitInteroperable`, if there is a superior type, such that
|
||||
binary arithmetic operations involving `A` and `B` result in
|
||||
this type. This type is \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits<A,B>::Type`\endlink.
|
||||
Two types `A` and `B` are a model of the concept
|
||||
`ImplicitInteroperable`, if there is a superior type, such that
|
||||
binary arithmetic operations involving `A` and `B` result in
|
||||
this type. This type is \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits<A,B>::Type`\endlink.
|
||||
In case types are `RealEmbeddable` this also implies that mixed compare operators are available.
|
||||
|
||||
The type \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits<A,B>::Type`\endlink is required to be
|
||||
implicit constructible from `A` and `B`.
|
||||
The type \link CGAL::Coercion_traits::Type `CGAL::Coercion_traits<A,B>::Type`\endlink is required to be
|
||||
implicit constructible from `A` and `B`.
|
||||
|
||||
In this case
|
||||
In this case
|
||||
\link CGAL::Coercion_traits::Are_implicit_interoperable `CGAL::Coercion_traits<A,B>::Are_implicit_interoperable`\endlink
|
||||
is `CGAL::Tag_true`.
|
||||
is `CGAL::Tag_true`.
|
||||
|
||||
\cgalRefines `ExplicitInteroperable`
|
||||
\cgalRefines `ExplicitInteroperable`
|
||||
|
||||
\sa `CGAL::Coercion_traits<A,B>`
|
||||
\sa `ExplicitInteroperable`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `RealEmbeddableTraits`
|
||||
\sa `CGAL::Coercion_traits<A,B>`
|
||||
\sa `ExplicitInteroperable`
|
||||
\sa `AlgebraicStructureTraits`
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -3,20 +3,20 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`IntegralDomain` refines `IntegralDomainWithoutDivision` by
|
||||
providing an integral division.
|
||||
`IntegralDomain` refines `IntegralDomainWithoutDivision` by
|
||||
providing an integral division.
|
||||
|
||||
<B>Note:</B> The concept does not require the operator / for this operation.
|
||||
We intend to reserve the operator syntax for use with a `Field`.
|
||||
<B>Note:</B> The concept does not require the operator / for this operation.
|
||||
We intend to reserve the operator syntax for use with a `Field`.
|
||||
|
||||
Moreover, `CGAL::Algebraic_structure_traits< IntegralDomain >` is a model of
|
||||
`AlgebraicStructureTraits` providing:
|
||||
Moreover, `CGAL::Algebraic_structure_traits< IntegralDomain >` is a model of
|
||||
`AlgebraicStructureTraits` providing:
|
||||
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< IntegralDomain >::Algebraic_category` \endlink derived from `CGAL::Integral_domain_tag`
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< IntegralDomain >::Algebraic_category` \endlink derived from `CGAL::Integral_domain_tag`
|
||||
- \link AlgebraicStructureTraits::Integral_division `CGAL::Algebraic_structure_traits< IntegralDomain >::Integral_division` \endlink which is a model of `AlgebraicStructureTraits_::IntegralDivision`
|
||||
- \link AlgebraicStructureTraits::Divides `CGAL::Algebraic_structure_traits< IntegralDomain >::Divides` \endlink which is a model of `AlgebraicStructureTraits_::Divides`
|
||||
|
||||
\cgalRefines `IntegralDomainWithoutDivision`
|
||||
\cgalRefines `IntegralDomainWithoutDivision`
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomain`
|
||||
|
|
|
|||
|
|
@ -3,37 +3,37 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
This is the most basic concept for algebraic structures considered within \cgal.
|
||||
This is the most basic concept for algebraic structures considered within \cgal.
|
||||
|
||||
A model `IntegralDomainWithoutDivision` represents an integral domain,
|
||||
i.e.\ commutative ring with 0, 1, +, * and unity free of zero divisors.
|
||||
A model `IntegralDomainWithoutDivision` represents an integral domain,
|
||||
i.e.\ commutative ring with 0, 1, +, * and unity free of zero divisors.
|
||||
|
||||
<B>Note:</B> A model is not required to offer the always well defined integral division.
|
||||
<B>Note:</B> A model is not required to offer the always well defined integral division.
|
||||
|
||||
It refines `Assignable`, `CopyConstructible`, `DefaultConstructible`
|
||||
and `FromIntConstructible`.
|
||||
It refines `Assignable`, `CopyConstructible`, `DefaultConstructible`
|
||||
and `FromIntConstructible`.
|
||||
|
||||
It refines `EqualityComparable`, where equality is defined w.r.t.\ the ring element being represented.
|
||||
It refines `EqualityComparable`, where equality is defined w.r.t.\ the ring element being represented.
|
||||
|
||||
The operators unary and binary plus +, unary and binary minus -,
|
||||
multiplication * and their compound forms +=, -=, *= are required and
|
||||
implement the respective ring operations.
|
||||
The operators unary and binary plus +, unary and binary minus -,
|
||||
multiplication * and their compound forms +=, -=, *= are required and
|
||||
implement the respective ring operations.
|
||||
|
||||
Moreover, `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >` is a model of
|
||||
`AlgebraicStructureTraits` providing:
|
||||
Moreover, `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >` is a model of
|
||||
`AlgebraicStructureTraits` providing:
|
||||
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Algebraic_category` \endlink derived from `CGAL::Integral_domain_without_division_tag`
|
||||
- \link AlgebraicStructureTraits::Algebraic_category `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Algebraic_category` \endlink derived from `CGAL::Integral_domain_without_division_tag`
|
||||
- \link AlgebraicStructureTraits::Is_zero `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Is_zero` \endlink which is a model of `AlgebraicStructureTraits_::IsZero`
|
||||
- \link AlgebraicStructureTraits::Is_one `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Is_one` \endlink which is a model of `AlgebraicStructureTraits_::IsOne`
|
||||
- \link AlgebraicStructureTraits::Square `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Square` \endlink which is a model of `AlgebraicStructureTraits_::Square`
|
||||
- \link AlgebraicStructureTraits::Simplify `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Simplify` \endlink which is a model of `AlgebraicStructureTraits_::Simplify`
|
||||
- \link AlgebraicStructureTraits::Unit_part `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Unit_part` \endlink which is a model of `AlgebraicStructureTraits_::UnitPart`
|
||||
|
||||
\cgalRefines `Assignable`
|
||||
\cgalRefines `CopyConstructible`
|
||||
\cgalRefines `DefaultConstructible`
|
||||
\cgalRefines `EqualityComparable`
|
||||
\cgalRefines `FromIntConstructible`
|
||||
\cgalRefines `Assignable`
|
||||
\cgalRefines `CopyConstructible`
|
||||
\cgalRefines `DefaultConstructible`
|
||||
\cgalRefines `EqualityComparable`
|
||||
\cgalRefines `FromIntConstructible`
|
||||
|
||||
\sa `IntegralDomainWithoutDivision`
|
||||
\sa `IntegralDomain`
|
||||
|
|
@ -50,72 +50,72 @@ Moreover, `CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >` is
|
|||
class IntegralDomainWithoutDivision {
|
||||
public:
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
unary plus
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator+(const IntegralDomainWithoutDivision &a);
|
||||
unary plus
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator+(const IntegralDomainWithoutDivision &a);
|
||||
|
||||
/*!
|
||||
unary minus
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator-(const IntegralDomainWithoutDivision &a);
|
||||
unary minus
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator-(const IntegralDomainWithoutDivision &a);
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator+(const IntegralDomainWithoutDivision &a,
|
||||
const IntegralDomainWithoutDivision &b);
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator+(const IntegralDomainWithoutDivision &a,
|
||||
const IntegralDomainWithoutDivision &b);
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator-(const IntegralDomainWithoutDivision &a,
|
||||
const IntegralDomainWithoutDivision &b);
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator-(const IntegralDomainWithoutDivision &a,
|
||||
const IntegralDomainWithoutDivision &b);
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator*(const IntegralDomainWithoutDivision &a,
|
||||
const IntegralDomainWithoutDivision &b);
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator*(const IntegralDomainWithoutDivision &a,
|
||||
const IntegralDomainWithoutDivision &b);
|
||||
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator+=(const IntegralDomainWithoutDivision &b);
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator+=(const IntegralDomainWithoutDivision &b);
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator-=(const IntegralDomainWithoutDivision &b);
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator-=(const IntegralDomainWithoutDivision &b);
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator*=(const IntegralDomainWithoutDivision &b);
|
||||
*/
|
||||
IntegralDomainWithoutDivision
|
||||
operator*=(const IntegralDomainWithoutDivision &b);
|
||||
|
||||
/*!
|
||||
The `result_type` is convertible to `bool`.
|
||||
*/
|
||||
result_type
|
||||
operator==(const IntegralDomainWithoutDivision &a, const IntegralDomainWithoutDivision &b);
|
||||
The `result_type` is convertible to `bool`.
|
||||
*/
|
||||
result_type
|
||||
operator==(const IntegralDomainWithoutDivision &a, const IntegralDomainWithoutDivision &b);
|
||||
|
||||
/*!
|
||||
The `result_type` is convertible to `bool`.
|
||||
*/
|
||||
result_type
|
||||
operator!=(const IntegralDomainWithoutDivision &a, const IntegralDomainWithoutDivision &b);
|
||||
The `result_type` is convertible to `bool`.
|
||||
*/
|
||||
result_type
|
||||
operator!=(const IntegralDomainWithoutDivision &a, const IntegralDomainWithoutDivision &b);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,18 +3,18 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of this concepts represents numbers that are embeddable on the real
|
||||
axis. The type obeys the algebraic structure and compares two values according
|
||||
to the total order of the real numbers.
|
||||
A model of this concepts represents numbers that are embeddable on the real
|
||||
axis. The type obeys the algebraic structure and compares two values according
|
||||
to the total order of the real numbers.
|
||||
|
||||
Moreover, `CGAL::Real_embeddable_traits< RealEmbeddable >` is a model of
|
||||
`RealEmbeddableTraits`
|
||||
Moreover, `CGAL::Real_embeddable_traits< RealEmbeddable >` is a model of
|
||||
`RealEmbeddableTraits`
|
||||
|
||||
with:
|
||||
with:
|
||||
|
||||
- \link RealEmbeddableTraits::Is_real_embeddable `CGAL::Real_embeddable_traits< RealEmbeddable >::Is_real_embeddable` \endlink set to `Tag_true`
|
||||
- \link RealEmbeddableTraits::Is_real_embeddable `CGAL::Real_embeddable_traits< RealEmbeddable >::Is_real_embeddable` \endlink set to `Tag_true`
|
||||
|
||||
and functors :
|
||||
and functors :
|
||||
|
||||
- \link RealEmbeddableTraits::Is_zero `CGAL::Real_embeddable_traits< RealEmbeddable >::Is_zero` \endlink which is a model of `RealEmbeddableTraits_::IsZero`
|
||||
|
||||
|
|
@ -32,14 +32,14 @@ and functors :
|
|||
|
||||
- \link RealEmbeddableTraits::To_interval `CGAL::Real_embeddable_traits< RealEmbeddable >::To_interval` \endlink which is a model of `RealEmbeddableTraits_::ToInterval`
|
||||
|
||||
Remark:
|
||||
Remark:
|
||||
|
||||
If a number type is a model of both `IntegralDomainWithoutDivision` and
|
||||
`RealEmbeddable`, it follows that the ring represented by such a number type
|
||||
is a sub-ring of the real numbers and hence has characteristic zero.
|
||||
If a number type is a model of both `IntegralDomainWithoutDivision` and
|
||||
`RealEmbeddable`, it follows that the ring represented by such a number type
|
||||
is a sub-ring of the real numbers and hence has characteristic zero.
|
||||
|
||||
\cgalRefines `EqualityComparable`
|
||||
\cgalRefines `LessThanComparable`
|
||||
\cgalRefines `LessThanComparable`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
|
|
@ -48,47 +48,47 @@ is a sub-ring of the real numbers and hence has characteristic zero.
|
|||
class RealEmbeddable {
|
||||
public:
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
bool operator==(const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
*/
|
||||
bool operator==(const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
bool operator!=(const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
*/
|
||||
bool operator!=(const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
bool operator< (const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
*/
|
||||
bool operator< (const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
bool operator<=(const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
*/
|
||||
bool operator<=(const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
|
||||
/*!
|
||||
|
||||
|
||||
*/
|
||||
bool operator> (const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
*/
|
||||
bool operator> (const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
|
||||
/*!
|
||||
|
||||
\relates RealEmbeddable
|
||||
*/
|
||||
bool operator>=(const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
\relates RealEmbeddable
|
||||
*/
|
||||
bool operator>=(const RealEmbeddable &a,
|
||||
const RealEmbeddable &b);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction` computes the absolute value of a number.
|
||||
`AdaptableUnaryFunction` computes the absolute value of a number.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
|
|
@ -16,28 +16,28 @@ namespace RealEmbeddableTraits_ {
|
|||
class Abs {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
computes the absolute value of \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
computes the absolute value of \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableBinaryFunction` compares two real embeddable numbers.
|
||||
`AdaptableBinaryFunction` compares two real embeddable numbers.
|
||||
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
\cgalRefines `AdaptableBinaryFunction`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
|
|
@ -16,43 +16,43 @@ namespace RealEmbeddableTraits_ {
|
|||
class Compare {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Type convertible to `CGAL::Comparison_result`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Type convertible to `CGAL::Comparison_result`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type first_argument_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type second_argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
compares \f$ x\f$ with respect to \f$ y\f$.
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
compares \f$ x\f$ with respect to \f$ y\f$.
|
||||
*/
|
||||
result_type operator()(first_argument_type x,
|
||||
second_argument_type y);
|
||||
|
||||
/*!
|
||||
|
||||
This operator is defined if `NT1` and `NT2` are
|
||||
`ExplicitInteroperable` with coercion type
|
||||
`RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2>
|
||||
result_type operator()(NT1 x, NT2 y);
|
||||
This operator is defined if `NT1` and `NT2` are
|
||||
`ExplicitInteroperable` with coercion type
|
||||
`RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
template <class NT1, class NT2>
|
||||
result_type operator()(NT1 x, NT2 y);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction`, returns true in case the argument is negative.
|
||||
`AdaptableUnaryFunction`, returns true in case the argument is negative.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
|
|
@ -16,28 +16,28 @@ namespace RealEmbeddableTraits_ {
|
|||
class IsNegative {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Type convertible to `bool`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Type convertible to `bool`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns true in case \f$ x\f$ is negative.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
returns true in case \f$ x\f$ is negative.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction`, returns true in case the argument is positive.
|
||||
`AdaptableUnaryFunction`, returns true in case the argument is positive.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
|
|
@ -16,28 +16,28 @@ namespace RealEmbeddableTraits_ {
|
|||
class IsPositive {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Type convertible to `bool`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Type convertible to `bool`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
returns true in case \f$ x\f$ is positive.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
returns true in case \f$ x\f$ is positive.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction`, returns true in case the argument is 0.
|
||||
`AdaptableUnaryFunction`, returns true in case the argument is 0.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
\sa `AlgebraicStructureTraits_::IsZero`
|
||||
|
|
@ -17,29 +17,29 @@ namespace RealEmbeddableTraits_ {
|
|||
class IsZero {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Type convertible to `bool`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Type convertible to `bool`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
returns true in case \f$ x\f$ is the zero element of the ring.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
returns true in case \f$ x\f$ is the zero element of the ring.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace RealEmbeddableTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
This `AdaptableUnaryFunction` computes the sign of a real embeddable number.
|
||||
This `AdaptableUnaryFunction` computes the sign of a real embeddable number.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
|
|
@ -16,28 +16,28 @@ This `AdaptableUnaryFunction` computes the sign of a real embeddable number.
|
|||
class Sgn {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Type convertible to `CGAL::Sign`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
Type convertible to `CGAL::Sign`.
|
||||
*/
|
||||
typedef unspecified_type result_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Computes the sign of \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
Computes the sign of \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ namespace RealEmbeddableTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction` computes a double approximation of a real
|
||||
embeddable number.
|
||||
`AdaptableUnaryFunction` computes a double approximation of a real
|
||||
embeddable number.
|
||||
|
||||
Remark: In order to control the quality of approximation one has to resort
|
||||
to methods that are specific to NT. There are no general guarantees whatsoever.
|
||||
Remark: In order to control the quality of approximation one has to resort
|
||||
to methods that are specific to NT. There are no general guarantees whatsoever.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
|
|
@ -20,28 +20,28 @@ to methods that are specific to NT. There are no general guarantees whatsoever.
|
|||
class ToDouble {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
The result type.
|
||||
*/
|
||||
The result type.
|
||||
*/
|
||||
typedef double result_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
computes a double approximation of a real embeddable number.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
computes a double approximation of a real embeddable number.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ namespace RealEmbeddableTraits_ {
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
`AdaptableUnaryFunction` computes for a given real embeddable
|
||||
number \f$ x\f$ a double interval containing \f$ x\f$.
|
||||
This interval is represented by `std::pair<double,double>`.
|
||||
`AdaptableUnaryFunction` computes for a given real embeddable
|
||||
number \f$ x\f$ a double interval containing \f$ x\f$.
|
||||
This interval is represented by `std::pair<double,double>`.
|
||||
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
\cgalRefines `AdaptableUnaryFunction`
|
||||
|
||||
\sa `RealEmbeddableTraits`
|
||||
|
||||
|
|
@ -18,28 +18,28 @@ This interval is represented by `std::pair<double,double>`.
|
|||
class ToInterval {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
The result type.
|
||||
*/
|
||||
*/
|
||||
typedef std::pair<double,double> result_type;
|
||||
|
||||
/*!
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
Is `RealEmbeddableTraits::Type`.
|
||||
*/
|
||||
typedef unspecified_type argument_type;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
computes a double interval containing \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
computes a double interval containing \f$ x\f$.
|
||||
*/
|
||||
result_type operator()(argument_type x);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\cgalConcept
|
||||
|
||||
A model of `RealEmbeddableTraits` is associated to a number type
|
||||
`Type` and reflects the properties of this type with respect
|
||||
to the concept `RealEmbeddable`.
|
||||
A model of `RealEmbeddableTraits` is associated to a number type
|
||||
`Type` and reflects the properties of this type with respect
|
||||
to the concept `RealEmbeddable`.
|
||||
|
||||
\cgalHasModel `CGAL::Real_embeddable_traits<T>`
|
||||
*/
|
||||
|
|
@ -13,55 +13,55 @@ to the concept `RealEmbeddable`.
|
|||
class RealEmbeddableTraits {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// \name Types
|
||||
/// A model of `RealEmbeddableTraits` is supposed to provide:
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
The associated number type.
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
The associated number type.
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
|
||||
/*!
|
||||
Tag indicating whether the associated type is real embeddable.
|
||||
Tag indicating whether the associated type is real embeddable.
|
||||
|
||||
This is either \link Tag_true `Tag_true`\endlink or \link Tag_false `Tag_false`\endlink.
|
||||
*/
|
||||
typedef unspecified_type Is_real_embeddable;
|
||||
This is either \link Tag_true `Tag_true`\endlink or \link Tag_false `Tag_false`\endlink.
|
||||
*/
|
||||
typedef unspecified_type Is_real_embeddable;
|
||||
|
||||
/*!
|
||||
This type specifies the return type of the predicates provided
|
||||
by this traits. The type must be convertible to `bool` and
|
||||
typically the type indeed maps to `bool`. However, there are also
|
||||
cases such as interval arithmetic, in which it is `Uncertain<bool>`
|
||||
or some similar type.
|
||||
This type specifies the return type of the predicates provided
|
||||
by this traits. The type must be convertible to `bool` and
|
||||
typically the type indeed maps to `bool`. However, there are also
|
||||
cases such as interval arithmetic, in which it is `Uncertain<bool>`
|
||||
or some similar type.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Boolean;
|
||||
*/
|
||||
typedef unspecified_type Boolean;
|
||||
|
||||
/*!
|
||||
This type specifies the return type of the `Sgn` functor.
|
||||
The type must be convertible to `CGAL::Sign` and
|
||||
typically the type indeed maps to `CGAL::Sign`. However, there are also
|
||||
cases such as interval arithmetic, in which it is `Uncertain<CGAL::Sign>`
|
||||
or some similar type.
|
||||
This type specifies the return type of the `Sgn` functor.
|
||||
The type must be convertible to `CGAL::Sign` and
|
||||
typically the type indeed maps to `CGAL::Sign`. However, there are also
|
||||
cases such as interval arithmetic, in which it is `Uncertain<CGAL::Sign>`
|
||||
or some similar type.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Sign;
|
||||
*/
|
||||
typedef unspecified_type Sign;
|
||||
|
||||
/*!
|
||||
This type specifies the return type of the `Compare` functor.
|
||||
The type must be convertible to `CGAL::Comparison_result` and
|
||||
typically the type indeed maps to `CGAL::Comparison_result`. However, there are also
|
||||
cases such as interval arithmetic, in which it is `Uncertain<CGAL::Comparison_result>`
|
||||
or some similar type.
|
||||
This type specifies the return type of the `Compare` functor.
|
||||
The type must be convertible to `CGAL::Comparison_result` and
|
||||
typically the type indeed maps to `CGAL::Comparison_result`. However, there are also
|
||||
cases such as interval arithmetic, in which it is `Uncertain<CGAL::Comparison_result>`
|
||||
or some similar type.
|
||||
|
||||
*/
|
||||
typedef unspecified_type Comparison_result;
|
||||
*/
|
||||
typedef unspecified_type Comparison_result;
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
/// \name Functors
|
||||
/// \name Functors
|
||||
/// In case the associated type is `RealEmbeddable` all functors are
|
||||
/// provided. In case a functor is not provided, it is set to
|
||||
/// `CGAL::Null_functor`.
|
||||
|
|
@ -69,46 +69,46 @@ typedef unspecified_type Comparison_result;
|
|||
|
||||
/*!
|
||||
|
||||
A model of `RealEmbeddableTraits_::IsZero`
|
||||
In case `Type` is also model of `IntegralDomainWithoutDivision`
|
||||
this is a model of `AlgebraicStructureTraits_::IsZero`.
|
||||
*/
|
||||
typedef unspecified_type Is_zero;
|
||||
A model of `RealEmbeddableTraits_::IsZero`
|
||||
In case `Type` is also model of `IntegralDomainWithoutDivision`
|
||||
this is a model of `AlgebraicStructureTraits_::IsZero`.
|
||||
*/
|
||||
typedef unspecified_type Is_zero;
|
||||
|
||||
/*!
|
||||
A model of `RealEmbeddableTraits_::Abs`
|
||||
*/
|
||||
typedef unspecified_type Abs;
|
||||
A model of `RealEmbeddableTraits_::Abs`
|
||||
*/
|
||||
typedef unspecified_type Abs;
|
||||
|
||||
/*!
|
||||
A model of `RealEmbeddableTraits_::Sgn`
|
||||
*/
|
||||
typedef unspecified_type Sgn;
|
||||
A model of `RealEmbeddableTraits_::Sgn`
|
||||
*/
|
||||
typedef unspecified_type Sgn;
|
||||
|
||||
/*!
|
||||
A model of `RealEmbeddableTraits_::IsPositive`
|
||||
*/
|
||||
typedef unspecified_type Is_positive;
|
||||
A model of `RealEmbeddableTraits_::IsPositive`
|
||||
*/
|
||||
typedef unspecified_type Is_positive;
|
||||
|
||||
/*!
|
||||
A model of `RealEmbeddableTraits_::IsNegative`
|
||||
*/
|
||||
typedef unspecified_type Is_negative;
|
||||
A model of `RealEmbeddableTraits_::IsNegative`
|
||||
*/
|
||||
typedef unspecified_type Is_negative;
|
||||
|
||||
/*!
|
||||
A model of `RealEmbeddableTraits_::Compare`
|
||||
*/
|
||||
typedef unspecified_type Compare;
|
||||
A model of `RealEmbeddableTraits_::Compare`
|
||||
*/
|
||||
typedef unspecified_type Compare;
|
||||
|
||||
/*!
|
||||
A model of `RealEmbeddableTraits_::ToDouble`
|
||||
*/
|
||||
typedef unspecified_type To_double;
|
||||
A model of `RealEmbeddableTraits_::ToDouble`
|
||||
*/
|
||||
typedef unspecified_type To_double;
|
||||
|
||||
/*!
|
||||
A model of `RealEmbeddableTraits_::ToInterval`
|
||||
*/
|
||||
typedef unspecified_type To_interval;
|
||||
A model of `RealEmbeddableTraits_::ToInterval`
|
||||
*/
|
||||
typedef unspecified_type To_interval;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue