mirror of https://github.com/CGAL/cgal
fixes warnings
This commit is contained in:
parent
f2f821b956
commit
c672ed6fc1
|
|
@ -111,11 +111,11 @@ std::ostream& Hyperbolic_fundamental_domain_2<Traits>::to_stream(std::ostream& s
|
||||||
|
|
||||||
s << std::to_string(n) << std::endl;
|
s << std::to_string(n) << std::endl;
|
||||||
|
|
||||||
for (int k=0; k<n; k++){
|
for (std::size_t k=0; k<n; ++k){
|
||||||
s << paired_side(k) << std::endl;
|
s << paired_side(k) << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int k=0; k<n; k++){
|
for (std::size_t k=0; k<n; ++k){
|
||||||
s << vertex(k) << std::endl;
|
s << vertex(k) << std::endl;
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
|
|
@ -132,12 +132,12 @@ std::istream& Hyperbolic_fundamental_domain_2<Traits>::from_stream(std::istream&
|
||||||
_vertices.reserve(size);
|
_vertices.reserve(size);
|
||||||
_pairings.reserve(size);
|
_pairings.reserve(size);
|
||||||
|
|
||||||
for (int k=0; k<size; k++){
|
for (std::size_t k=0; k<size; ++k){
|
||||||
s >> line;
|
s >> line;
|
||||||
_pairings.push_back(std::stoi(line));
|
_pairings.push_back(std::stoi(line));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int k=0; k<size; k++){
|
for (std::size_t k=0; k<size; ++k){
|
||||||
Point p;
|
Point p;
|
||||||
s >> p;
|
s >> p;
|
||||||
_vertices.push_back(p);
|
_vertices.push_back(p);
|
||||||
|
|
@ -165,10 +165,10 @@ bool Hyperbolic_fundamental_domain_2<Traits>::is_valid()const{
|
||||||
|
|
||||||
// Check that the _pairings vector encodes a perfect matching of the set {0,1,\dots,n-1}
|
// Check that the _pairings vector encodes a perfect matching of the set {0,1,\dots,n-1}
|
||||||
std::vector<bool> already_paired(n);
|
std::vector<bool> already_paired(n);
|
||||||
for (int k=0; k<n; k++){
|
for (std::size_t k=0; k<n; ++k){
|
||||||
already_paired[k] = false;
|
already_paired[k] = false;
|
||||||
}
|
}
|
||||||
for (int k=0; k<n; k++){
|
for (std::size_t k=0; k<n; ++k){
|
||||||
std::size_t paired_side = _pairings[k];
|
std::size_t paired_side = _pairings[k];
|
||||||
if ((paired_side<0) || (paired_side>=n)){
|
if ((paired_side<0) || (paired_side>=n)){
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -180,7 +180,7 @@ bool Hyperbolic_fundamental_domain_2<Traits>::is_valid()const{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the vertices all lie within the open unit disk
|
// Check that the vertices all lie within the open unit disk
|
||||||
for (int k=0; k<n; k++){
|
for (std::size_t k=0; k<n; ++k){
|
||||||
if (norm(Complex_number(_vertices[k].x(),_vertices[k].y())) >= typename Traits::FT(1)){
|
if (norm(Complex_number(_vertices[k].x(),_vertices[k].y())) >= typename Traits::FT(1)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ Hyperbolic_fundamental_domain_2<Traits> Hyperbolic_fundamental_domain_factory_2<
|
||||||
vertices.push_back(_Point(-exact_z3.real(), -exact_z3.imag()));
|
vertices.push_back(_Point(-exact_z3.real(), -exact_z3.imag()));
|
||||||
|
|
||||||
std::vector<int> pairings;
|
std::vector<int> pairings;
|
||||||
for (int k=0; k<8; k++){
|
for (int k=0; k<8; ++k){
|
||||||
pairings.push_back((k+4)%8);
|
pairings.push_back((k+4)%8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,6 @@ public:
|
||||||
// Triangulation_on_hyperbolic_surface_2(Combinatorial_map_with_cross_ratios& cmap);
|
// Triangulation_on_hyperbolic_surface_2(Combinatorial_map_with_cross_ratios& cmap);
|
||||||
Triangulation_on_hyperbolic_surface_2(Combinatorial_map_with_cross_ratios& cmap, Anchor& anchor);
|
Triangulation_on_hyperbolic_surface_2(Combinatorial_map_with_cross_ratios& cmap, Anchor& anchor);
|
||||||
|
|
||||||
//Triangulation_on_hyperbolic_surface_2& operator=(Triangulation_on_hyperbolic_surface_2&& other);
|
|
||||||
Triangulation_on_hyperbolic_surface_2& operator=(Triangulation_on_hyperbolic_surface_2 other);
|
|
||||||
|
|
||||||
Combinatorial_map_with_cross_ratios& combinatorial_map();
|
Combinatorial_map_with_cross_ratios& combinatorial_map();
|
||||||
bool has_anchor() const;
|
bool has_anchor() const;
|
||||||
|
|
@ -162,7 +160,7 @@ Triangulation_on_hyperbolic_surface_2<Traits,Attributes>::Triangulation_on_hyper
|
||||||
|
|
||||||
// Make the triangles
|
// Make the triangles
|
||||||
std::vector<Dart_descriptor> dart_of_triangle(size-2);
|
std::vector<Dart_descriptor> dart_of_triangle(size-2);
|
||||||
for (int k=0; k<size-2; k++){
|
for (int k=0; k<size-2; ++k){
|
||||||
dart_of_triangle[k] = _combinatorial_map.make_combinatorial_polygon(3);
|
dart_of_triangle[k] = _combinatorial_map.make_combinatorial_polygon(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,7 +168,7 @@ Triangulation_on_hyperbolic_surface_2<Traits,Attributes>::Triangulation_on_hyper
|
||||||
Dart_descriptor dart_1, dart_2;
|
Dart_descriptor dart_1, dart_2;
|
||||||
Point p0,p1,p2,p3;
|
Point p0,p1,p2,p3;
|
||||||
|
|
||||||
for (int k=1; k<size-2; k++){
|
for (int k=1; k<size-2; ++k){
|
||||||
dart_1 = dart_of_triangle[k];
|
dart_1 = dart_of_triangle[k];
|
||||||
dart_2 = cw(dart_of_triangle[k-1]);
|
dart_2 = cw(dart_of_triangle[k-1]);
|
||||||
|
|
||||||
|
|
@ -240,20 +238,6 @@ template<class Traits, class Attributes>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
template<class Traits, class Attributes>
|
|
||||||
Triangulation_on_hyperbolic_surface_2<Traits, Attributes>& Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::operator=(Triangulation_on_hyperbolic_surface_2<Traits, Attributes> other){
|
|
||||||
CGAL_precondition(other->is_valid());
|
|
||||||
if (other.has_anchor()){
|
|
||||||
copy_from(other.combinatorial_map(), other.anchor());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
copy_from(other.combinatorial_map());
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
template<class Traits, class Attributes>
|
template<class Traits, class Attributes>
|
||||||
typename Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::Combinatorial_map_with_cross_ratios& Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::combinatorial_map(){
|
typename Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::Combinatorial_map_with_cross_ratios& Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::combinatorial_map(){
|
||||||
return _combinatorial_map;
|
return _combinatorial_map;
|
||||||
|
|
@ -502,7 +486,7 @@ bool Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::is_valid() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the combinatorial map has no 1,2-boundary
|
// Check that the combinatorial map has no 1,2-boundary
|
||||||
for (int k=1; k<3; k++){
|
for (int k=1; k<3; ++k){
|
||||||
if ( !_combinatorial_map.is_without_boundary(k) ){
|
if ( !_combinatorial_map.is_without_boundary(k) ){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -517,7 +501,7 @@ bool Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::is_valid() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the three vertices of the anchor lie within the open unit disk
|
// Check that the three vertices of the anchor lie within the open unit disk
|
||||||
for (int k=0; k<3; k++){
|
for (int k=0; k<3; ++k){
|
||||||
// if (_anchor.vertices[k].get_z() >= Number(1)){
|
// if (_anchor.vertices[k].get_z() >= Number(1)){
|
||||||
if ( norm(Complex_number(_anchor.vertices[k].x(),_anchor.vertices[k].y())) >= Number(1)){
|
if ( norm(Complex_number(_anchor.vertices[k].x(),_anchor.vertices[k].y())) >= Number(1)){
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -598,7 +582,7 @@ void Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::from_stream(std:
|
||||||
// Load the triangles
|
// Load the triangles
|
||||||
std::vector<Dart_descriptor> darts_by_id (nb_darts);
|
std::vector<Dart_descriptor> darts_by_id (nb_darts);
|
||||||
int index1, index2, index3;
|
int index1, index2, index3;
|
||||||
for (int k=0; k<nb_darts/3; k++){
|
for (int k=0; k<nb_darts/3; ++k){
|
||||||
Dart_descriptor triangle_dart = _combinatorial_map.make_combinatorial_polygon(3);
|
Dart_descriptor triangle_dart = _combinatorial_map.make_combinatorial_polygon(3);
|
||||||
|
|
||||||
s >> line;
|
s >> line;
|
||||||
|
|
@ -616,7 +600,7 @@ void Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::from_stream(std:
|
||||||
// Load the edges
|
// Load the edges
|
||||||
Dart_descriptor dart_1, dart_2;
|
Dart_descriptor dart_1, dart_2;
|
||||||
Complex_number cross_ratio;
|
Complex_number cross_ratio;
|
||||||
for (int k=0; k<nb_darts/2; k++){
|
for (int k=0; k<nb_darts/2; ++k){
|
||||||
s >> line;
|
s >> line;
|
||||||
index1 = std::stoi(line);
|
index1 = std::stoi(line);
|
||||||
s >> line;
|
s >> line;
|
||||||
|
|
@ -735,7 +719,7 @@ void Triangulation_on_hyperbolic_surface_2<Traits, Attributes>::copy_from(Combin
|
||||||
|
|
||||||
// Set the anchor
|
// Set the anchor
|
||||||
_anchor.dart = darts_table[anchor.dart];
|
_anchor.dart = darts_table[anchor.dart];
|
||||||
for (int k=0; k<3; k++){
|
for (int k=0; k<3; ++k){
|
||||||
_anchor.vertices[k] = anchor.vertices[k];
|
_anchor.vertices[k] = anchor.vertices[k];
|
||||||
}
|
}
|
||||||
_has_anchor = true;
|
_has_anchor = true;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ std::istream& operator>>(std::istream& s, Hyperbolic_fundamental_domain_2<Traits
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
template<class Traits>
|
template<class Traits>
|
||||||
std::ostream& operator<<(std::ostream& s, const Hyperbolic_isometry_2<Traits>& isometry){
|
std::ostream& operator<<(std::ostream& s, const Hyperbolic_isometry_2<Traits>& isometry){
|
||||||
for (int k=0; k<4; k++){
|
for (int k=0; k<4; ++k){
|
||||||
s << isometry.get_coefficient(k);
|
s << isometry.get_coefficient(k);
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,13 @@ int main() {
|
||||||
vertices.push_back(z7);
|
vertices.push_back(z7);
|
||||||
|
|
||||||
std::vector<int> pairings;
|
std::vector<int> pairings;
|
||||||
for (int k=0; k<8; k++){
|
for (std::size_t k=0; k<8; ++k){
|
||||||
pairings.push_back((k+4)%8);
|
pairings.push_back((k+4)%8);
|
||||||
}
|
}
|
||||||
|
|
||||||
Domain domain = Domain(vertices, pairings);
|
Domain domain = Domain(vertices, pairings);
|
||||||
assert( domain.size()==8 );
|
assert( domain.size()==8 );
|
||||||
for (int k=0; k<8; k++){
|
for (std::size_t k=0; k<8; ++k){
|
||||||
assert( domain.vertex(k)==vertices[k] );
|
assert( domain.vertex(k)==vertices[k] );
|
||||||
assert( domain.paired_side(k)==(k+4)%8 );
|
assert( domain.paired_side(k)==(k+4)%8 );
|
||||||
assert( domain.side_pairing(k).evaluate(domain.vertex((k+4)%8))==domain.vertex((k+1)%8) );
|
assert( domain.side_pairing(k).evaluate(domain.vertex((k+4)%8))==domain.vertex((k+1)%8) );
|
||||||
|
|
@ -55,7 +55,7 @@ int main() {
|
||||||
|
|
||||||
Domain domain_prime = Domain(vertices, pairings);
|
Domain domain_prime = Domain(vertices, pairings);
|
||||||
assert( domain_prime.size()==8 );
|
assert( domain_prime.size()==8 );
|
||||||
for (int k=0; k<8; k++){
|
for (std::size_t k=0; k<8; ++k){
|
||||||
assert( domain_prime.vertex(k)==vertices[k]);
|
assert( domain_prime.vertex(k)==vertices[k]);
|
||||||
assert( domain_prime.paired_side(k)==(k+4)%8 );
|
assert( domain_prime.paired_side(k)==(k+4)%8 );
|
||||||
|
|
||||||
|
|
@ -68,7 +68,7 @@ int main() {
|
||||||
buffer << domain;
|
buffer << domain;
|
||||||
buffer >> domain_ter;
|
buffer >> domain_ter;
|
||||||
assert( domain_ter.size()==8 );
|
assert( domain_ter.size()==8 );
|
||||||
for (int k=0; k<8; k++){
|
for (std::size_t k=0; k<8; ++k){
|
||||||
assert( domain_ter.vertex(k)==vertices[k]);
|
assert( domain_ter.vertex(k)==vertices[k]);
|
||||||
assert( domain_ter.paired_side(k)==(k+4)%8 );
|
assert( domain_ter.paired_side(k)==(k+4)%8 );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ int main() {
|
||||||
vertices.push_back(z7);
|
vertices.push_back(z7);
|
||||||
|
|
||||||
assert( domain.size()==8 );
|
assert( domain.size()==8 );
|
||||||
for (int k=0; k<8; k++){
|
for (std::size_t k=0; k<8; ++k){
|
||||||
assert( domain.vertex(k)==vertices[k]);
|
assert( domain.vertex(k)==vertices[k]);
|
||||||
assert( domain.paired_side(k)==(k+4)%8 );
|
assert( domain.paired_side(k)==(k+4)%8 );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ Domain build_domain(){
|
||||||
vertices.push_back( Point(FT("22088524601252853411192791001942853611410938513/24711029456888649611435724068315791591836010000"),FT("-9482675065452890527617859332378101016513362487/24711029456888649611435724068315791591836010000")) );
|
vertices.push_back( Point(FT("22088524601252853411192791001942853611410938513/24711029456888649611435724068315791591836010000"),FT("-9482675065452890527617859332378101016513362487/24711029456888649611435724068315791591836010000")) );
|
||||||
|
|
||||||
std::vector<int> pairings;
|
std::vector<int> pairings;
|
||||||
for (int k=0; k<8; k++){
|
for (int k=0; k<8; ++k){
|
||||||
pairings.push_back((k+4)%8);
|
pairings.push_back((k+4)%8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue