- Fixed <strstream> to <sstream>.

- Fixed a bug in stream input of Vector__.h. The copy_n solution
    together with the istream_iterator was reading one coordinate too much.
  - Cleaned up SIMPLE_INTERFACE stuff.
  - Cleaned up ostream output in Vector__.h and Matrix__.h.
  - Removed include/CGAL/Kernel_d/d_utils.h
  - Cleaned up old MSC specific code.
  - Removed DESIGN_ONE versions of the polyhedral surface design.
This commit is contained in:
Lutz Kettner 2003-05-09 13:30:08 +00:00
parent 0afc78529b
commit 03316dd365
32 changed files with 137 additions and 1181 deletions

View File

@ -1,5 +1,16 @@
Kernel_d Package: Release changes
----------------------------------------------------------------------
0.9.81 (9 May 2003)
- Fixed <strstream> to <sstream>.
- Fixed a bug in stream input of Vector__.h. The copy_n solution
together with the istream_iterator was reading one coordinate too much.
- Cleaned up SIMPLE_INTERFACE stuff.
- Cleaned up ostream output in Vector__.h and Matrix__.h.
- Removed include/CGAL/Kernel_d/d_utils.h
- Cleaned up old MSC specific code.
- Removed DESIGN_ONE versions of the polyhedral surface design.
0.9.80 (8 May 2003)
- no simple interface anymore in vector__

View File

@ -79,11 +79,7 @@ Let |j = C.index_of_vertex_in_opposite_facet(f,i)|. Then
#include <CGAL/basic.h>
#include <CGAL/Unique_hash_map.h>
#if ! defined(_MSC_VER) || defined(__INTEL_COMPILER)
#include <CGAL/Regular_complex_d.h>
#else
#include <CGAL/Regular_complex_d_MSC.h>
#endif
#include <list>
#include <vector>
@ -1052,21 +1048,11 @@ template <class R>
void Convex_hull_d<R>::
compute_equation_of_base_facet(Simplex_handle S)
{
#ifndef CGAL_SIMPLE_INTERFACE
typename R::Construct_hyperplane_d hyperplane_through_points =
kernel().construct_hyperplane_d_object();
S->set_hyperplane_of_base_facet( hyperplane_through_points(
S->points_begin()+1, S->points_begin()+1+current_dimension(),
center(), ON_NEGATIVE_SIDE)); // skip the first point !
#else
typename R::Construct_hyperplane_d hyperplane_through_points =
kernel().construct_hyperplane_d_object();
std::vector<Point_d> V(current_dimension());
for (int i=0; i<current_dimension(); ++i)
V[i] = point_of_simplex(S,i+1); // skip the first point !
S->set_hyperplane_of_base_facet(
hyperplane_through_points(V.begin(),V.end(),center(),ON_NEGATIVE_SIDE));
#endif
#ifdef CGAL_CHECK_EXPENSIVE
{ /* Let us check */

View File

@ -105,25 +105,14 @@ private:
include |<CGAL/Convex_hull_d_to_polyhedron_3.h>|
\setopdims{2cm}{3cm}}*/
#if defined(_MSC_VER) && defined(CGAL_USE_POLYHEDRON_DESIGN_ONE)
template <class R, class Tr, class HDS>
void
convex_hull_d_to_polyhedron_3(const Convex_hull_d<R>& C,
Polyhedron_3<Tr,HDS>& P)
#else // non-MSVC compilers or MSVC>1200 can handle this more general interface
template <class R, class Polyhedron_3>
void convex_hull_d_to_polyhedron_3(
const Convex_hull_d<R>& C, Polyhedron_3& P)
#endif
/*{\Mfunc converts the convex hull |C| to polyedral surface stored in
|P|.\\ \precond |dim == 3| and |dcur == 3|. }*/
{ typedef Convex_hull_d<R> ChullType;
#if defined(_MSC_VER) && defined(CGAL_USE_POLYHEDRON_DESIGN_ONE)
typedef typename Polyhedron_3<Tr, HDS>::HalfedgeDS HDS;
#else
typedef typename Polyhedron_3::HalfedgeDS HDS;
#endif
CGAL_assertion_msg(C.dimension()==3&&C.current_dimension()==3,
"convex_hull_d_to_polyhedron_3: only full manifold can be transformed.");
Build_polyhedron_from_chull<HDS,ChullType> get_surface(C);

View File

@ -39,10 +39,6 @@
CGAL_BEGIN_NAMESPACE
#if (defined(_MSC_VER) && ! defined(__INTEL_COMPILER) ) || defined(__BORLANDC__)
#define CGAL_SIMPLE_INTERFACE
#endif
template <class R_> struct Convex_hull_d_traits_3
{
typedef R_ R;
@ -64,11 +60,7 @@ template <class R_> struct Convex_hull_d_traits_3
struct Orientation_d {
template <class I>
Orientation operator()(I s, I e) {
#ifndef CGAL_SIMPLE_INTERFACE
std::vector<Point_d> A(s,e);
#else
std::vector<Point_d> A; while (s!=e) A.push_back(*s++);
#endif
CGAL_assertion(A.size()==4);
return orientation(A[0],A[1],A[2],A[3]);
}
@ -80,11 +72,7 @@ template <class R_> struct Convex_hull_d_traits_3
template <class I>
bool operator()(I s, I e)
{
#ifndef CGAL_SIMPLE_INTERFACE
std::vector<Point_d> A(s,e);
#else
std::vector<Point_d> A; while (s!=e) A.push_back(*s++);
#endif
int a = A.size();
if (a > 4)
return false;
@ -104,11 +92,7 @@ template <class R_> struct Convex_hull_d_traits_3
template <class I>
bool operator()(I s, I e, const Point_d& p)
{
#ifndef CGAL_SIMPLE_INTERFACE
std::vector<Point_d> A(s,e);
#else
std::vector<Point_d> A; while (s!=e) A.push_back(*s++);
#endif
int a = A.size();
CGAL_assertion( a <= 4 );
if (a == 4) {
@ -133,11 +117,7 @@ template <class R_> struct Convex_hull_d_traits_3
template <class I>
bool operator()(I s, I e, const Point_d& p)
{
#ifndef CGAL_SIMPLE_INTERFACE
std::vector<Point_d> A(s,e);
#else
std::vector<Point_d> A; while (s!=e) A.push_back(*s++);
#endif
int a = A.size();
Affinely_independent_d affinely_independent;
CGAL_assertion( affinely_independent(s,e) );
@ -197,11 +177,7 @@ template <class R_> struct Convex_hull_d_traits_3
Hyperplane_d operator()(I s, I e, const Point_d& p,
Oriented_side side)
{
#ifndef CGAL_SIMPLE_INTERFACE
std::vector<Point_d> A(s,e);
#else
std::vector<Point_d> A; while (s!=e) A.push_back(*s++);
#endif
int a = A.size(); CGAL_assertion( a <= 3 );
Hyperplane_d pl;
if (a == 3) {

View File

@ -24,11 +24,7 @@
#include <CGAL/basic.h>
#include <CGAL/Unique_hash_map.h>
#if ! defined(_MSC_VER) || defined(__INTEL_COMPILER)
#include <CGAL/Regular_complex_d.h>
#else
#include <CGAL/Regular_complex_d_MSC.h>
#endif
#include <CGAL/LEDA_basic.h>
#include <CGAL/IO/Window_stream.h>

View File

@ -75,8 +75,6 @@ Aff_transformationCd(const Matrix& M) : Base( Rep(M) )
CGAL_assertion(M(d-1,d-1)==FT(1));
}
#ifndef CGAL_SIMPLE_INTERFACE
template <typename Forward_iterator>
Aff_transformationCd(Scaling, Forward_iterator start, Forward_iterator end) :
Base( Rep(std::distance(start,end)-1) )
@ -86,18 +84,6 @@ diagonal matrix with entries |set [start,end)| on the diagonal
dimension $d+1$.}*/
{ int i=0; while (start != end) { ptr()->M_(i,i) = *start++;++i; } }
#else
#define FIXATCD(I) \
Aff_transformationCd(Scaling, I start, I end) : \
Base( Rep(end-start-1) ) \
{ int i=0; while (start != end) { ptr()->M_(i,i) = *start++;++i; } }
FIXATCD(int*)
FIXATCD(const int*)
FIXATCD(RT*)
FIXATCD(const RT*)
#undef FIXATCD
#endif
Aff_transformationCd(Translation, const VectorCd<RT,LA>& v) :
Base( Rep(v.dimension()) )

View File

@ -104,8 +104,6 @@ matrix $M$. \precond |M| is a square matrix of dimension $d + 1$. }*/
construction: initialization matrix is not quadratic.");
}
#ifndef CGAL_SIMPLE_INTERFACE
template <typename Forward_iterator>
Aff_transformationHd(Scaling, Forward_iterator start, Forward_iterator end) :
Base( Rep(std::distance(start,end)-1) )
@ -115,19 +113,6 @@ diagonal matrix with entries |set [start,end)| on the diagonal
dimension $d+1$.}*/
{ int i=0; while (start != end) { ptr()->M_(i,i) = *start++;++i; } }
#else
#define FIXATHD(I) \
Aff_transformationHd(Scaling, I start, I end) : \
Base( Rep(end-start-1) ) \
{ int i=0; while (start != end) { ptr()->M_(i,i) = *start++;++i; } }
FIXATHD(int*)
FIXATHD(const int*)
FIXATHD(RT*)
FIXATHD(const RT*)
#undef FIXATHD
#endif
Aff_transformationHd(Translation, const VectorHd<RT,LA>& v) :
Base( Rep(v.dimension()) )
/*{\Mcreate introduces the translation by vector $v$.}*/

View File

@ -57,22 +57,10 @@ class Aff_transformation_d : public pR::Aff_transformation_d_base
Aff_transformation_d(const Base& a) : Base(a) {}
Aff_transformation_d(const Self& a) : Base(a) {}
#ifndef CGAL_SIMPLE_INTERFACE
template <typename Forward_iterator>
Aff_transformation_d(Scaling tag,
Forward_iterator start, Forward_iterator end) : Base(tag,start,end) {}
#else
#define FIXATD(I) \
Aff_transformation_d(Scaling tag, I start, I end) : Base(tag,start,end) {}
FIXATD(int*)
FIXATD(const int*)
FIXATD(RT*)
FIXATD(const RT*)
#undef FIXATD
#endif // CGAL_SIMPLE_INTERFACE
Self operator*(const Self& a)
{ return Base::operator*(a); }
Self inverse() const { return Base::inverse(); }

View File

@ -62,22 +62,10 @@ DirectionCd(int d = 0) : Base( Tuple(d) ) {}
DirectionCd(const VectorCd<FT,LA>& v);
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
DirectionCd(int d, InputIterator first, InputIterator last) :
Base( Tuple(d,first,last) ) {}
#else
#define FIXDIRCD(I) \
DirectionCd(int d, I first, I last) : Base( Tuple(d,first,last) ) {}
FIXDIRCD(int*)
FIXDIRCD(const int*)
FIXDIRCD(RT*)
FIXDIRCD(const RT*)
#undef FIXDIRCD
#endif
DirectionCd(int d, Base_direction, int i) : Base( Tuple(d) )
{ if ( d==0 ) return;
CGAL_assertion_msg((0<=i&&i<d), "DirectionCd::base: index out of range.");

View File

@ -98,8 +98,6 @@ DirectionHd(const VectorHd<RT,LA>& v);
/*{\Mcreate introduces a variable |\Mvar| of type |DirectionHd<RT,LA>|
initialized to the direction of |v|.}*/
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
DirectionHd(int d, InputIterator first, InputIterator last) :
Base( Tuple(d+1,first,last,1) ) {}
@ -108,16 +106,6 @@ with representation tuple |set [first,last)|. \precond |d| is
nonnegative, |[first,last)| has |d| elements and the value type of
|InputIterator| is |RT|.}*/
#else
#define FIXDIRHD(I) \
DirectionHd(int d, I first, I last) : Base( Tuple(d+1,first,last,1) ) {}
FIXDIRHD(int*)
FIXDIRHD(const int*)
FIXDIRHD(RT*)
FIXDIRHD(const RT*)
#undef FIXDIRHD
#endif
DirectionHd(int d, Base_direction, int i) : Base( Tuple(d+1) )
/*{\Mcreate returns a variable |\Mvar| of type |\Mname| initialized
to the direction of the $i$-th base vector of dimension $d$.

View File

@ -42,23 +42,10 @@ class Direction_d : public pR::Direction_d_base
Direction_d(int a, int b, int c) : Base(a,b,c) {}
Direction_d(const RT& a, const RT& b, const RT& c) : Base(a,b,c) {}
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
Direction_d (int d, InputIterator first, InputIterator last)
: Base(d, first, last) {}
#else
#define FIXDIRD(I) \
Direction_d (int d, I first, I last) : Base(d, first, last) {}
FIXDIRD(int*)
FIXDIRD(const int*)
FIXDIRD(RT*)
FIXDIRD(const RT*)
#undef FIXDIRD
#endif
Direction_d(const Direction_d<R> &d) : Base(d) {}
Direction_d(const Vector_d<R> &v) : Base(v) {}
Direction_d(int d, Base_direction, int i) :

View File

@ -54,8 +54,6 @@ typedef typename Tuple::const_iterator Coefficient_const_iterator;
HyperplaneCd(int d = 0) : Base( Tuple(d+1) ) {}
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
HyperplaneCd(int d, InputIterator first, InputIterator last, const FT& D)
: Base( Tuple(d+1,first,last,D) ) {}
@ -64,18 +62,6 @@ template <class InputIterator>
HyperplaneCd(int d, InputIterator first, InputIterator last)
: Base( Tuple(d+1,first,last) ) {}
#else
#define FIXHYPCD(I)\
HyperplaneCd(int d, I first, I last) : Base( Tuple(d+1,first,last) ) {}\
HyperplaneCd(int d, I first, I last, const FT& D) \
: Base(Tuple(d+1,first,last,D)) {}
FIXHYPCD(int*)
FIXHYPCD(const int*)
FIXHYPCD(RT*)
FIXHYPCD(const RT*)
#undef FIXHYPCD
#endif
template <class ForwardIterator>
void
construct_from_points(ForwardIterator first, ForwardIterator last,
@ -122,8 +108,6 @@ construct_from_points(ForwardIterator first, ForwardIterator last,
invert_rep();
}
#ifndef CGAL_SIMPLE_INTERFACE
template <class ForwardIterator>
HyperplaneCd(ForwardIterator first, ForwardIterator last,
const PointCd<FT,LA>& o,
@ -131,35 +115,6 @@ HyperplaneCd(ForwardIterator first, ForwardIterator last,
: Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
#else
HyperplaneCd(const PointCd<FT,LA>* first, const PointCd<FT,LA>* last,
const PointCd<FT,LA>& o,
Oriented_side side = Oriented_side(0))
: Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
#if defined(_MSC_VER) && ! defined(__INTEL_COMPILER)
// necessary as for MSC we have the vector iterators implemented
// as class types and not as pointers
typedef typename std::vector<PointCd<FT,LA> >::iterator vecpntit;
typedef typename std::vector<PointCd<FT,LA> >::const_iterator vecpntcit;
HyperplaneCd(vecpntit first, vecpntit last,
const PointCd<FT,LA>& o,
Oriented_side side = Oriented_side(0))
: Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
HyperplaneCd(vecpntcit first, vecpntcit last,
const PointCd<FT,LA>& o,
Oriented_side side = Oriented_side(0))
: Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
#endif // MSC
#endif // CGAL_SIMPLE_INTERFACE
HyperplaneCd(const PointCd<FT,LA>& p, const DirectionCd<FT,LA>& dir)
: Base( Tuple(p.dimension()+1) )
{

View File

@ -97,8 +97,6 @@ HyperplaneHd(int d = 0) : Base( Tuple(d+1) ) {}
/*{\Mcreate introduces a variable |\Mvar| of type |\Mname|
initialized to some hyperplane in $d$ - dimensional space. }*/
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
HyperplaneHd(int d, InputIterator first, InputIterator last)
: Base( Tuple(d+1,first,last) ) {}
@ -115,18 +113,6 @@ initialized to the hyperplane with coefficients |set [first,last)| and
|D|. \precond |size [first,last) == d| and the value type of
InputIterator is |RT|.}*/
#else
#define FIXHYPHD(I)\
HyperplaneHd(int d, I first, I last) : Base( Tuple(d+1,first,last) ) {}\
HyperplaneHd(int d, I first, I last, const RT& D) \
: Base(Tuple(d+1,first,last,D)) {}
FIXHYPHD(int*)
FIXHYPHD(const int*)
FIXHYPHD(RT*)
FIXHYPHD(const RT*)
#undef FIXHYPHD
#endif
/* We want to construct a hyperplane that passes through a set |P =
set [first,last)| of points in $d$-dimensional space and has a
specified point $o$ on a specified side. We simply have to find a
@ -189,8 +175,6 @@ construct_from_points(ForwardIterator first, ForwardIterator last,
}
#ifndef CGAL_SIMPLE_INTERFACE
template <class ForwardIterator>
HyperplaneHd(ForwardIterator first, ForwardIterator last,
const PointHd<RT,LA>& o,
@ -203,36 +187,6 @@ exist. The value type of |ForwardIterator| is |PointHd<RT,LA>|. }*/
: Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
#else
HyperplaneHd(const PointHd<RT,LA>* first, const PointHd<RT,LA>* last,
const PointHd<RT,LA>& o,
Oriented_side side = Oriented_side(0)) :
Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
#if defined(_MSC_VER) && ! defined(__INTEL_COMPILER)
// necessary as for MSC we have the vector iterators implemented
// as class types and not as pointers
typedef typename std::vector<PointHd<RT,LA> >::iterator vecpntit;
typedef typename std::vector<PointHd<RT,LA> >::const_iterator vecpntcit;
HyperplaneHd(vecpntit first, vecpntit last,
const PointHd<RT,LA>& o,
Oriented_side side = Oriented_side(0)) :
Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
HyperplaneHd(vecpntcit first, vecpntcit last,
const PointHd<RT,LA>& o,
Oriented_side side = Oriented_side(0)) :
Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
#endif // MSC
#endif // CGAL_SIMPLE_INTERFACE
HyperplaneHd(const PointHd<RT,LA>& p, const DirectionHd<RT,LA>& dir)
/*{\Mcreate constructs the hyperplane with normal direction |dir|
that passes through $p$. The direction |dir| points into the positive

View File

@ -49,8 +49,6 @@ class Hyperplane_d : public pR::Hyperplane_d_base
Hyperplane_d(const Hyperplane_d<R> &h) : Base(h) {}
Hyperplane_d(const Base& p) : Base(p) {}
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
Hyperplane_d(int d, InputIterator first, InputIterator last)
: Base (d, first, last) {}
@ -65,33 +63,6 @@ class Hyperplane_d : public pR::Hyperplane_d_base
const Point_d<R>& o, Oriented_side side = Oriented_side(0)) :
Base(first,last,o,side) {}
#else
#define FIXHYPD(I) \
Hyperplane_d(int d, I first, I last) : Base (d,first,last) {} \
Hyperplane_d(int d, I first, I last, const RT& D) : Base (d,first,last,D) {}
#define FIXHYPDD(I) \
Hyperplane_d(I first, I last, const Point_d<R>& o, Oriented_side side = \
Oriented_side(0)) : Base(o.dimension()) \
{ construct_from_points(first,last,o,side); }
//Oriented_side(0)) : Base(first,last,o,side) {}
FIXHYPD(int*)
FIXHYPD(const int*)
FIXHYPD(RT*)
FIXHYPD(const RT*)
#undef FIXHYPD
#if defined(_MSC_VER) && ! defined(__INTEL_COMPILER)
FIXHYPDD(typename std::vector< Point_d<R> >::iterator)
FIXHYPDD(typename std::vector< Point_d<R> >::const_iterator)
#endif // MSC
FIXHYPDD(Point_d<R>*)
FIXHYPDD(const Point_d<R>*)
#undef FIXHYPDD
#endif
Vector_d<R> orthogonal_vector() const
{ return Base::orthogonal_vector(); }
Direction_d<R> orthogonal_direction() const

View File

@ -163,13 +163,10 @@ vector_pointer* v_; int dm_,dn_;
NT& elem(int i, int j) const { return v_[i]->v_[j]; }
#ifndef CGAL_SIMPLE_INTERFACE
typedef typename AL_::template rebind<vector_pointer>::other
allocator_type;
static allocator_type MM;
#endif
#ifndef CGAL_SIMPLE_INTERFACE
inline void allocate_mat_space(vector_pointer*& vi, int d)
{
/* We use this procedure to allocate memory. We use our allocator
@ -191,16 +188,6 @@ inline void deallocate_mat_space(vector_pointer*& vi, int d)
vi = (vector_pointer*)0;
}
#else
inline void allocate_mat_space(vector_pointer*& vi, int d)
{ vi = new vector_pointer[d]; }
inline void deallocate_mat_space(vector_pointer*& vi, int)
{ delete[] vi; vi = (vector_pointer*)0; }
#endif
inline void check_dimensions(const Matrix_<NT_,AL_>& mat) const
{
CGAL_assertion_msg((dm_ == mat.dm_ && dn_ == mat.dn_),
@ -254,8 +241,6 @@ void range_initialize(RAIterator first, RAIterator last,
v_ = (Vector**)0;
}
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
void range_initialize(InputIterator first, InputIterator last,
std::forward_iterator_tag)
@ -279,8 +264,6 @@ requirements.}*/
iterator_category;
range_initialize(first,last,iterator_category()); }
#endif
Matrix_(const std::vector< Vector >& A)
/*{\Mcreate creates an instance |\Mvar| of type |\Mname|. Let $A$ be
an array of $n$ column-vectors of common dimension $m$. |\Mvar| is
@ -322,14 +305,7 @@ Vector& row(int i) const
Vector column(int i) const
/*{\Mop returns the $i$-th column of |\Mvar| (an $n$ - vector).\\
\precond $0 \le i \le n - 1$. }*/
#ifndef CGAL_SIMPLE_INTERFACE
{ return Vector(column_begin(i),column_end(i)); }
#else
{ Vector result(row_dimension());
for (int j=0; j<row_dimension(); ++j)
result[j] = elem(j,i);
return result; }
#endif
Vector to_vector() const
{
@ -771,20 +747,41 @@ std::ostream& operator<<(std::ostream& os, const Matrix_<NT_,AL_>& M)
d2-times
x_d2-1,0 ... x_d2-1,d1-1 */
CGAL::print_d<NT_> prt(&os);
if (os.iword(CGAL::IO::mode)==CGAL::IO::PRETTY) os << "LA::Matrix(";
prt(M.row_dimension());
prt(M.column_dimension());
if (os.iword(CGAL::IO::mode)==CGAL::IO::PRETTY)
{ os << " [\n"; prt.reset(); }
for (register int i=0; i<M.row_dimension(); i++) {
std::for_each(M.row(i).begin(),M.row(i).end(),prt);
if (i != M.row_dimension() &&
os.iword(CGAL::IO::mode)==CGAL::IO::PRETTY)
{ prt.reset(); os << ",\n";}
}
if (os.iword(CGAL::IO::mode)==CGAL::IO::PRETTY) os << "])";
return os;
int d = M.row_dimension();
int k = M.column_dimension();
switch (os.iword(CGAL::IO::mode)) {
case CGAL::IO::BINARY:
CGAL::write( os, d);
CGAL::write( os, k);
for ( int i = 0; i < d; ++i) {
for ( register int j = 0; j < k; ++j) {
CGAL::write( os, M[i][j]);
}
}
break;
case CGAL::IO::ASCII:
os << d << ' ' << k;
for ( int i = 0; i < d; ++i) {
for ( register int j = 0; j < k; ++j) {
os << ' ' << M[i][j];
}
}
break;
case CGAL::IO::PRETTY:
os << "LA::Matrix((" << d << ", " << k << " [";
for ( int i = 0; i < d; ++i) {
for ( register int j = 0; j < k; ++j) {
if ( j != 0)
os << ',' << ' ';
os << M[i][j];
}
if ( i != d)
os << ",\n";
}
os << "])";
break;
}
return os;
}
template <class NT_, class AL_>
@ -816,10 +813,8 @@ std::istream& operator>>(std::istream& is, Matrix_<NT_,AL_>& M)
return is;
}
#ifndef CGAL_SIMPLE_INTERFACE
template <class NT_, class AL_>
typename Matrix_<NT_,AL_>::allocator_type Matrix_<NT_,AL_>::MM;
#endif
/*{\Ximplementation

View File

@ -67,8 +67,6 @@ friend class HyperplaneCd<FT,LA>;
PointCd(int d = 0) : Base( Tuple(d) ) {}
PointCd(int d, const Origin&) : Base( Tuple(d) ) {}
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
PointCd(int d, InputIterator first, InputIterator last)
: Base( Tuple(d,first,last) )
@ -86,26 +84,6 @@ PointCd (int d, InputIterator first, InputIterator last,
for (register int i=0; i<d; ++i) entry(i)/=D;
}
#else
#define FIXPNTCD(I) \
PointCd(int d, I first, I last) : Base( Tuple(d,first,last) ) \
{ if ( first == last ) return; \
CGAL_assertion_msg(FT(*first)!=FT(0), \
"PointCd::constructor: denominator must be nonzero."); \
for (register int i=0; i<d; ++i) entry(i)/=FT(*first); \
} \
PointCd (int d, I first, I last, const FT& D) : Base( Tuple(d,first,last) ) \
{ CGAL_assertion_msg(D!=FT(0),"PointCd::constructor: D must be nonzero."); \
for (register int i=0; i<d; ++i) entry(i)/=D; \
}
FIXPNTCD(int*)
FIXPNTCD(const int*)
FIXPNTCD(RT*)
FIXPNTCD(const RT*)
#undef FIXPNTCD
#endif
PointCd(int x, int y, int w = 1) : Base( Tuple((FT)x,(FT)y) )
{ CGAL_assertion_msg(w!=0,"PointCd::construction: w == 0.");
vector_rep()/=w; }

View File

@ -104,8 +104,6 @@ $d$-dimensional space, initialized to the origin.}*/
: Base( Tuple(d+1) )
{ entry(d) = 1; }
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
PointHd(int d, InputIterator first, InputIterator last)
/*{\Mcreate introduces a variable |\Mvar| of type |\Mname| in
@ -138,27 +136,6 @@ of |RT|, and the value type of |InputIterator| is |RT|. }*/
if (D < RT(0)) invert_rep();
}
#else
#define FIXPNTHD(I) \
PointHd(int d, I first, I last) : Base( Tuple(d+1,first,last) )\
{ RT D = entry(d);\
CGAL_assertion_msg(first!=last || D!=RT(0),\
"PointHd::constructor: denominator must be nonzero.");\
if ( D == RT(0) ) entry(d) = 1; if ( D < RT(0) ) invert_rep(); \
} \
PointHd (int d, I first, I last, const RT& D) : Base(Tuple(d+1,first,last,D))\
{ CGAL_assertion_msg(D!=RT(0),"PointHd::constructor: D must be nonzero.");\
if (D < RT(0)) invert_rep();\
}
FIXPNTHD(int*)
FIXPNTHD(const int*)
FIXPNTHD(RT*)
FIXPNTHD(const RT*)
#undef FIXPNTHD
#endif
PointHd(int x, int y, int w = 1) : Base( Tuple((RT)x,(RT)y,(RT)w) )
{ CGAL_assertion_msg((w != 0),"PointHd::construction: w == 0.");
if (w < 0) invert_rep();

View File

@ -31,9 +31,11 @@ class Point_d : public pR::Point_d_base
typedef typename pR::Point_d_base Base;
typedef Point_d<pR> Self;
typedef pR R;
private:
typedef typename R::RT RT;
typedef typename R::FT FT;
typedef typename R::LA LA;
public:
Point_d(int d=0) : Base(d) {}
Point_d(int d, const Origin &o) : Base(d,o) {}
@ -47,8 +49,6 @@ class Point_d : public pR::Point_d_base
Point_d(const RT& a, const RT& b, const RT& c, const RT& d) :
Base(a,b,c,d) {}
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
Point_d (int d, InputIterator first, InputIterator last)
: Base (d, first, last) {}
@ -56,18 +56,6 @@ class Point_d : public pR::Point_d_base
Point_d(int d, InputIterator first, InputIterator last, const RT& D)
: Base (d, first, last, D) {}
#else
#define FIXPNTD(I) \
Point_d (int d, I first, I last) : Base (d, first, last) {} \
Point_d(int d, I first, I last, const RT& D) : Base (d, first, last, D) {}
//FIXPNTD(int*)
FIXPNTD(const int*)
//FIXPNTD(RT*)
FIXPNTD(const RT*)
#undef FIXPNTD
#endif
Point_d(const Self &p) : Base(p) {}
Point_d(const Base& p) : Base(p) {}

View File

@ -24,10 +24,10 @@
#define CGAL_TUPLE_D_H
#ifndef NOCGALINCL
#include <strstream>
#include <CGAL/basic.h>
#include <CGAL/Handle_for.h>
#include <CGAL/Quotient.h>
#include <sstream>
#endif
CGAL_BEGIN_NAMESPACE
@ -137,8 +137,6 @@ public:
Tuple_d(const NT& a, const NT& b, const NT& c, const NT& d) : v(4)
{ v[0]=a; v[1]=b; v[2]=c; v[3]=d; }
#ifndef CGAL_SIMPLE_INTERFACE
template <typename I>
Tuple_d(int d, I& start, I end) : v(d)
{ int i(0);
@ -155,21 +153,6 @@ public:
v[d-1] = D;
}
#else // provide instantiated constructors:
#define FIXTUPLE(I) \
Tuple_d(int d, I& start, I end) : v(d) \
{ int i(0); while ( i < d && start != end ) v[i++] = *start++; } \
Tuple_d(int d, I start, I end, NT D) : v(d) \
{ int i(0); while ( i < d && start != end ) v[i++] = *start++; v[d-1] = D; }
//FIXTUPLE(int*)
FIXTUPLE(const int*)
//FIXTUPLE(NT*)
FIXTUPLE(const NT*)
#undef FIXTUPLE
#endif
int size() const { return v.dimension(); }
const_iterator begin() const { return v.begin(); }
const_iterator last() const { return v.end()-1; }
@ -310,11 +293,10 @@ void tuple_dim_check(ForwardIterator first, ForwardIterator last,
int d = first->dimension(); ++first;
for (; first!=last; ++first)
if (first->dimension() != d) {
std::ostrstream os;
std::ostringstream os;
os << "Tuple Dimension Error " <<
"File " << file << "Line " << line << "Operation " << op << '\0';
CGAL_assertion_msg(0,os.str());
os.freeze(0);
CGAL_assertion_msg(0,os.str().c_str());
}
}

View File

@ -67,8 +67,6 @@ friend class HyperplaneCd<FT,LA>;
VectorCd(int d = 0) : Base( Tuple(d) ) {}
VectorCd(int d, Null_vector) : Base( Tuple(d) ) {}
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
VectorCd(int d, InputIterator first, InputIterator last)
: Base( Tuple(d,first,last) )
@ -86,26 +84,6 @@ VectorCd(int d, InputIterator first, InputIterator last,
for (register int i=0; i<d; ++i) entry(i)/=D;
}
#else
#define FIXVECCD(I) \
VectorCd(int d, I first, I last) : Base( Tuple(d,first,last) ) \
{ if ( first == last ) return; \
CGAL_assertion_msg(*first!=FT(0), \
"VectorCd::constructor: denominator must be nonzero."); \
for (register int i=0; i<d; ++i) entry(i)/=*first; \
} \
VectorCd(int d, I first, I last, const FT& D):Base( Tuple(d,first,last) )\
{ CGAL_assertion_msg(D!=FT(0), "VectorCd::constructor: D must be nonzero.");\
for (register int i=0; i<d; ++i) entry(i)/=D;\
}
FIXVECCD(int*)
FIXVECCD(const int*)
FIXVECCD(RT*)
FIXVECCD(const RT*)
#undef FIXVECCD
#endif
VectorCd(int d, Base_vector, int i) : Base( Tuple(d) )
{ if ( d == 0 ) return;
CGAL_assertion_msg((0<=i&&i<d),"VectorCd::base: index out of range.");

View File

@ -108,8 +108,6 @@ $d$-dimensional space. There is a constant |CGAL::NULL_VECTOR| that
can be used for the second argument.}*/
{ if ( d > 0 ) entry(d) = 1; }
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
VectorHd(int d, InputIterator first, InputIterator last) :
Base( Tuple(d+1,first,last) )
@ -140,26 +138,6 @@ a $d$-tuple of |RT|, and the value type of |InputIterator| is |RT|. }*/
if (D < RT(0)) invert_rep();
}
#else
#define FIXVECHD(I) \
VectorHd(int d, I first, I last) : Base( Tuple(d+1,first,last) ) \
{ RT D = entry(d); \
CGAL_assertion_msg(first!=last || D!=RT(0),\
"VectorHd::constructor: denominator must be nonzero.");\
if ( D == RT(0) ) entry(d) = 1; if ( D < RT(0) ) invert_rep();\
} \
VectorHd(int d, I first, I last, const RT& D):Base(Tuple(d+1,first,last,D))\
{ CGAL_assertion_msg(D!=RT(0), "VectorHd::constructor: D must be nonzero.");\
if (D < RT(0)) invert_rep();\
}
FIXVECHD(int*)
FIXVECHD(const int*)
FIXVECHD(RT*)
FIXVECHD(const RT*)
#undef FIXVECHD
#endif
VectorHd(int d, Base_vector, int i) : Base( Tuple(d+1) )
/*{\Mcreate returns a variable |\Mvar| of type |\Mname| initialized
to the $i$-th base vector of dimension $d$. }*/

View File

@ -30,7 +30,6 @@
#include <CGAL/basic.h>
#include <CGAL/memory.h>
#include <CGAL/Kernel_d/d_utils.h>
#undef _DEBUG
#define _DEBUG 51
@ -48,15 +47,6 @@ namespace CGALLA {
template <class NT_, class AL_> class Vector_;
template <class NT_, class AL_> class Matrix_;
#define FIXIT(T) \
Vector_(T f, T l) \
{ int dist(0); T ff = f; while(ff++ != l) ++dist;\
d_ = dist;\
allocate_vec_space(v_,d_);\
iterator it = begin();\
while (f != l) { *it = NT(*f); ++it; ++f; }\
}
/*{\Msubst
<NT_,AL_>#
<NT,AL>#
@ -108,8 +98,6 @@ protected:
NT* v_; int d_;
static allocator_type MM;
#if ! defined( CGAL_SIMPLE_INTERFACE ) //&& ! defined(__BORLANDC__)
inline void allocate_vec_space(NT*& vi, int di)
{
/* We use this procedure to allocate memory. We first get an appropriate
@ -134,23 +122,6 @@ protected:
vi = (NT*)0;
}
#else
inline void allocate_vec_space(NT*& vi, int di)
{
vi = new NT[di];
NT* p = vi + di - 1;
while (p >= vi) { *p = NT(0); p--; }
}
inline void deallocate_vec_space(NT*& vi, int)
{
delete [] vi;
vi = (NT*)0;
}
#endif // CGAL_SIMPLE_INTERFACE
inline void
check_dimensions(const Vector_<NT_,AL_>& vec) const
{
@ -191,19 +162,6 @@ Vector_(int d, const NT& x)
}
}
#ifdef CGAL_SIMPLE_INTERFACE
FIXIT(NT*)
FIXIT(const NT*)
FIXIT(int*)
FIXIT(const int*)
//FIXIT(std::vector<NT>::interator)
//FIXIT(std::vector<NT>::const_interator)
//FIXIT(typename std::list<NT>::interator)
//FIXIT(std::list<NT>::const_interator)
#else
template <class Forward_iterator>
Vector_(Forward_iterator first, Forward_iterator last)
/*{\Mcreate creates an instance |\Mvar| of type |\Mname|;
@ -215,8 +173,6 @@ Vector_(Forward_iterator first, Forward_iterator last)
while (first != last) { *it = *first; ++it; ++first; }
}
#endif
Vector_(const Vector_<NT_,AL_>& p)
{ d_ = p.d_;
if (d_ > 0) allocate_vec_space(v_,d_);
@ -448,13 +404,29 @@ template <class NT_, class AL_>
std::ostream& operator<<(std::ostream& os, const Vector_<NT_,AL_>& v)
/*{\Xbinopfunc writes |\Mvar| componentwise to the output stream $O$.}*/
{ /* syntax: d x_0 x_1 ... x_d-1 */
CGAL::print_d<NT_> prt(&os);
if (os.iword(CGAL::IO::mode)==CGAL::IO::PRETTY) os << "LA::Vector(";
prt(v.dimension());
if (os.iword(CGAL::IO::mode)==CGAL::IO::PRETTY) { os << " ["; prt.reset(); }
std::for_each(v.begin(),v.end(),prt);
if (os.iword(CGAL::IO::mode)==CGAL::IO::PRETTY) os << "])";
return os;
int d = v.dimension();
switch (os.iword(CGAL::IO::mode)) {
case CGAL::IO::BINARY:
CGAL::write( os, d);
for ( int i = 0; i < d; ++i)
CGAL::write( os, v[i]);
break;
case CGAL::IO::ASCII:
os << d;
for ( int i = 0; i < d; ++i)
os << ' ' << v[i];
break;
case CGAL::IO::PRETTY:
os << "LA::Vector(" << d << " [";
for ( int i = 0; i < d; ++i) {
if ( i > 0)
os << ',' << ' ';
os << v[i];
}
os << "])";
break;
}
return os;
}
template <class NT_, class AL_>
@ -465,8 +437,11 @@ std::istream& operator>>(std::istream& is, Vector_<NT_,AL_>& v)
switch (is.iword(CGAL::IO::mode)) {
case CGAL::IO::ASCII :
case CGAL::IO::BINARY :
is >> d; v = Vector_<NT_,AL_>(d);
CGAL::copy_n(std::istream_iterator<NT_>(is),d,v.begin());
is >> d;
v = Vector_<NT_,AL_>(d);
for ( int i = 0; i < d; ++i) {
is >> v[i];
}
break;
default:
std::cerr<<"\nStream must be in ascii or binary mode"<<std::endl;

View File

@ -47,8 +47,6 @@ class Vector_d : public pR::Vector_d_base
Vector_d(int d, Base_vector, int i) :
Base(d,Base_vector(),i) {}
#ifndef CGAL_SIMPLE_INTERFACE
template <class InputIterator>
Vector_d (int d, InputIterator first, InputIterator last)
: Base (d, first, last) {}
@ -56,18 +54,6 @@ class Vector_d : public pR::Vector_d_base
Vector_d (int d, InputIterator first, InputIterator last, const RT& D)
: Base (d, first, last, D) {}
#else
#define FIXVECD(I) \
Vector_d (int d, I first, I last) : Base (d, first, last) {} \
Vector_d(int d, I first, I last, const RT& D) : Base (d, first, last, D) {}
FIXVECD(int*)
FIXVECD(const int*)
FIXVECD(RT*)
FIXVECD(const RT*)
#undef FIXVECD
#endif
Vector_d(const Self& v) : Base(v) {}
Vector_d(const Base& v) : Base(v) {}

View File

@ -1,69 +0,0 @@
// ======================================================================
//
// Copyright (c) 1999 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
// intended for general use.
//
// ----------------------------------------------------------------------
//
// release : $CGAL_Revision: CGAL-2.4-I-64 $
// release_date : $CGAL_Date: 2002/03/18 $
//
// file : include/CGAL/Kernel_d/d_utils.h
// package : Kernel_d (0.9.54)
// maintainer : Michael Seel <seel@mpi-sb.mpg.de>
// revision : $Revision$
// revision_date : $Date$
// author : Herve Broennimann
// coordinator : INRIA Sophia-Antipolis (Herve.Bronnimann@sophia.inria.fr)
//
// ======================================================================
#ifndef CGAL_CARTESIAN_D_UTILS_H
#define CGAL_CARTESIAN_D_UTILS_H
#include <CGAL/copy_n.h>
#include <iterator>
#include <algorithm>
#include <functional>
CGAL_BEGIN_NAMESPACE
// Small object utility for printing objects
// with separators depending on the ostream mode
template < class Object >
struct print_d
{
const char * _separator;
std::ostream*_os;
bool _print_sep;
print_d(std::ostream *os) : _os(os), _print_sep(false)
{
if (_os->iword(IO::mode)==IO::ASCII) _separator = " ";
else if (_os->iword(IO::mode)==IO::BINARY) _separator = "";
else _separator = ", ";
}
void reset()
{
_print_sep = false;
}
void operator()(const Object &x) {
if (_print_sep && _os->iword(IO::mode) != IO::BINARY)
(*_os) << _separator;
(*_os) << x;
_print_sep = true;
}
void operator()(const int &x) {
if (_print_sep && _os->iword(IO::mode) != IO::BINARY)
(*_os) << _separator;
(*_os) << x;
_print_sep = true;
}
};
CGAL_END_NAMESPACE
#endif // CGAL_CARTESIAN_D_UTILS_H

View File

@ -29,7 +29,7 @@
#include <iostream>
#include <string>
#include <strstream>
#include <sstream>
#undef TRACE
#undef TRACEN
@ -39,6 +39,10 @@
#undef ASSERT
static int debugthread=3141592;
namespace {
struct Avoid_warning_for_unused_debugthread { static int x; };
int Avoid_warning_for_unused_debugthread::x = debugthread;
}
#if _DEBUG>0
#define SETDTHREAD(l) debugthread=l
@ -110,9 +114,11 @@ void print(I s, I e, std::ostream& os = std::cerr)
template <class T>
std::string make_std_string(const T& t)
{ std::ostrstream os;
{ std::ostringstream os;
os << t;
std::string res(os.str()); os.freeze(0); return res; }
std::string res(os.str());
return res;
}
} // MSDEBUG

View File

@ -1,594 +0,0 @@
// ============================================================================
//
// Copyright (c) 1997-2000 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
// intended for general use.
//
// ----------------------------------------------------------------------------
//
// release : $CGAL_Revision$
// release_date : $CGAL_Date$
//
// file : include/CGAL/Regular_complex_d_MSC.h
// package : Kernel_d
// chapter : Basic
//
// revision : $Revision$
// revision_date : $Date$
//
// author(s) : Michael Seel <seel@mpi-sb.mpg.de>
// maintainer : Michael Seel <seel@mpi-sb.mpg.de>
// coordinator : Susan Hert <hert@mpi-sb.mpg.de>
//
// implementation: regular complex specialization for MSC
// ============================================================================
#ifndef CGAL_REGULAR_COMPLEX_D_MSC_H
#define CGAL_REGULAR_COMPLEX_D_MSC_H
#include <CGAL/basic.h>
#include <CGAL/Iterator_project.h>
#include <CGAL/In_place_list.h>
#include <vector>
#include <list>
#undef _DEBUG
#define _DEBUG 93
#include <CGAL/Kernel_d/debug.h>
CGAL_BEGIN_NAMESPACE
template <class R> class RC_simplex_d;
template <class R> class RC_vertex_d;
template <class R> class Regular_complex_d;
template <class R> class Convex_hull_d;
#define forall_rc_vertices(x,RC)\
for(x = (RC).vertices_begin(); x != (RC).vertices_end(); ++x)
#define forall_rc_simplices(x,RC)\
for(x = (RC).simplices_begin(); x != (RC).simplices_end(); ++x)
template <class Refs>
class RC_vertex_d : public
CGAL::In_place_list_base< RC_vertex_d<Refs> >
{ typedef RC_vertex_d<Refs> Self;
typedef typename Refs::Point_d Point_d;
typedef typename Refs::Simplex_iterator Simplex_handle;
typedef typename Refs::R R;
friend class Regular_complex_d<R>;
friend class Convex_hull_d<R>;
friend class RC_simplex_d<Refs>;
Simplex_handle s_;
int index_;
Point_d point_;
void set_simplex(Simplex_handle s) { s_=s; }
void set_index(int i) { index_=i; }
void set_point(const Point_d& p) { point_=p; }
public:
RC_vertex_d(Simplex_handle s, int i, const Point_d& p) :
s_(s), index_(i), point_(p) {}
RC_vertex_d(const Point_d& p) : point_(p) {}
RC_vertex_d() : s_(), index_(-42) {}
// beware that ass_point was initialized here by nil_point
~RC_vertex_d() {}
Simplex_handle simplex() const { return s_; }
int index() const { return index_; }
const Point_d& point() const { return point_; }
#ifdef CGAL_USE_LEDA
LEDA_MEMORY(RC_vertex_d)
#endif
};
template <class Refs>
class RC_simplex_d : public
CGAL::In_place_list_base< RC_simplex_d<Refs> >
{ typedef RC_simplex_d<Refs> Self;
typedef typename Refs::Point_d Point_d;
typedef typename Refs::Vertex_iterator Vertex_handle;
typedef typename Refs::Simplex_iterator Simplex_handle;
typedef typename Refs::R R;
friend class Regular_complex_d<R>;
friend class Convex_hull_d<R>;
protected:
std::vector<Vertex_handle> vertices; // array of vertices
std::vector<Simplex_handle> neighbors; // opposite simplices
std::vector<int> opposite_vertices;
// indices of opposite vertices
//------ only for convex hulls ------------------
typedef typename R::Hyperplane_d Hyperplane_d;
Hyperplane_d h_base; // hyperplane supporting base facet
bool visited_; // visited mark when traversing
//------ only for convex hulls ------------------
Vertex_handle vertex(int i) const { return vertices[i]; }
Simplex_handle neighbor(int i) const { return neighbors[i]; }
int opposite_vertex_index(int i) const { return opposite_vertices[i]; }
void set_vertex(int i, Vertex_handle v) { vertices[i] = v; }
void set_neighbor(int i, Simplex_handle s) { neighbors[i]=s; }
void set_opposite_vertex_index(int i, int index)
{ opposite_vertices[i]=index; }
//------ only for convex hulls ------------------
Hyperplane_d hyperplane_of_base_facet() const { return h_base; }
void set_hyperplane_of_base_facet(const Hyperplane_d& h) { h_base = h; }
bool& visited() { return visited_; }
//------ only for convex hulls ------------------
public:
typedef typename std::vector<Vertex_handle>::const_iterator
VIV_iterator;
struct Point_from_VIV_iterator {
typedef Vertex_handle argument_type;
typedef Point_d result_type;
result_type& operator()(argument_type& x) const
{ return x->point(); }
const result_type& operator()(const argument_type& x) const
{ return x->point(); }
};
typedef CGAL::Iterator_project<VIV_iterator,Point_from_VIV_iterator,
const Point_d&, const Point_d*> Point_const_iterator;
Point_const_iterator points_begin() const
{ return Point_const_iterator(vertices.begin()); }
Point_const_iterator points_end() const
{ return Point_const_iterator(vertices.end()); }
RC_simplex_d() {}
RC_simplex_d(int dmax) :
vertices(dmax+1), neighbors(dmax+1), opposite_vertices(dmax+1)
{ for (int i = 0; i <= dmax; i++) {
neighbors[i] = Simplex_handle();
vertices[i] = Vertex_handle();
opposite_vertices[i] = -1;
}
visited_ = false;
}
~RC_simplex_d() {}
void print(std::ostream& O=std::cout) const
{
O << "RC_simplex_d {" ;
for(int i=0;i < int(vertices.size());++i) {
Vertex_handle v = vertices[i];
if ( v != Vertex_handle() ) O << v->point();
else O << "(nil)";
}
O << "}";
}
#ifdef CGAL_USE_LEDA
LEDA_MEMORY(RC_simplex_d)
#endif
};
template <typename R>
std::ostream& operator<<(std::ostream& O, const RC_simplex_d<R>& s)
{ s.print(O); return O; }
template <class R_>
class Regular_complex_d_base
{
typedef Regular_complex_d_base<R_> Self;
public:
typedef R_ R;
typedef typename R::Point_d Point_d;
typedef RC_vertex_d<Self> Vertex;
typedef RC_simplex_d<Self> Simplex;
typedef CGAL::CGALi::In_place_list_iterator<Vertex> Vertex_iterator;
typedef CGAL::CGALi::In_place_list_const_iterator<Vertex>
Vertex_const_iterator;
typedef CGAL::CGALi::In_place_list_iterator<Simplex> Simplex_iterator;
typedef CGAL::CGALi::In_place_list_const_iterator<Simplex>
Simplex_const_iterator;
typedef CGAL::In_place_list<Vertex,false> Vertex_list;
typedef CGAL::In_place_list<Simplex,false> Simplex_list;
};
template <class R_>
class Regular_complex_d : public Regular_complex_d_base<R_>
{
typedef Regular_complex_d<R_> Self;
typedef Regular_complex_d_base<R_> Base;
public:
typedef R_ R;
typedef typename R::Point_d Point_d;
typedef typename Base::Vertex_iterator Vertex_iterator;
typedef typename Base::Vertex_const_iterator Vertex_const_iterator;
typedef typename Base::Vertex_iterator Vertex_handle;
typedef typename Base::Vertex_const_iterator Vertex_const_handle;
typedef typename Base::Vertex_list Vertex_list;
typedef typename Base::Simplex_iterator Simplex_iterator;
typedef typename Base::Simplex_const_iterator Simplex_const_iterator;
typedef typename Base::Simplex_iterator Simplex_handle;
typedef typename Base::Simplex_const_iterator Simplex_const_handle;
typedef typename Base::Simplex_list Simplex_list;
protected:
const R& Kernel_;
int dcur; // dimension of the current complex
int dmax; // dimension of ambient space
Vertex_list vertices_; // list of all vertices
Simplex_list simplices_; // list of all simplices
/* the default copy constructor and assignment operator for class
regl_complex work incorrectly; it is therefore good practice to
either implement them correctly or to make them inaccessible. We do
the latter. */
private:
Regular_complex_d(const Regular_complex_d<R>& );
Regular_complex_d& operator=(const Regular_complex_d<R>& );
void clean_dynamic_memory()
{ vertices_.destroy(); simplices_.destroy(); }
public:
/*{\Mcreation}*/
Regular_complex_d(int d = 2, const R& Kernel = R())
/*{\Mcreate creates an instance |\Mvar| of type |\Mtype|. The
dimension of the underlying space is $d$ and |\Mvar| is initialized to
the empty regular complex. Thus |dcur| equals $-1$. The traits class
|R| specifies the models of all types and the implementations of
all geometric primitives used by the regular complex class. The
|Kernel| parameter allows you to carry fixed geometric information
into the data type. For the default kernel traits |Homogeneous_d|
the default construction of |Kernel| is enough.
In the following we use further template parameters like the point
type |Point_d=R::Point_d|. At this point, it suffices to say that
|Point_d| represents points in $d$-space. The complete specification of
the traits class is to be found at the end of this manual page.}*/
: Kernel_(Kernel) { dmax = d; dcur = -1; }
~Regular_complex_d() { clean_dynamic_memory(); }
/* In the destructor for |Regular_complex_d|, we have to release the
storage which was allocated for the simplices and the vertices. */
/*{\Mtext The data type |\Mtype| offers neither copy constructor nor
assignment operator.}*/
/*{\Moperations 3 3}*/
/*{\Mtext \headerline{Access Operations}}*/
int dimension() const { return dmax; }
/*{\Mop returns the dimension of ambient space}*/
int current_dimension() const { return dcur; }
/*{\Mop returns the current dimension of the simplices in the
complex.}*/
Vertex_handle vertex(Simplex_handle s, int i) const
/*{\Mop returns the $i$-th vertex of $s$.\\
\precond $0 \leq i \leq |current_dimension|$. }*/
{ CGAL_assertion(0<=i&&i<=dcur);
return s->vertex(i); }
Vertex_const_handle vertex(Simplex_const_handle s, int i) const
{ CGAL_assertion(0<=i&&i<=dcur);
return s->vertex(i); }
Point_d associated_point(Vertex_handle v) const
/*{\Mop returns the point associated with vertex |v|.}*/
{ return v->point(); }
Point_d associated_point(Vertex_const_handle v) const
{ return v->point(); }
int index(Vertex_handle v) const
/*{\Mop returns the index of $v$ in |C.simplex(v)|.}*/
{ return v->index(); }
int index(Vertex_const_handle v) const
{ return v->index(); }
Simplex_handle simplex(Vertex_handle v) const
/*{\Mop returns a simplex of which $v$ is a vertex. Note that this
simplex is not unique. }*/
{ return v->simplex(); }
Simplex_const_handle simplex(Vertex_const_handle v) const
{ return v->simplex(); }
Point_d associated_point(Simplex_handle s, int i) const
/*{\Mop same as |C.associated_point(C.vertex(s,i))|.}*/
{ return associated_point(vertex(s,i)); }
Point_d associated_point(Simplex_const_handle s, int i) const
{ return associated_point(vertex(s,i)); }
Simplex_handle opposite_simplex(Simplex_handle s,int i) const
/*{\Mop returns the simplex opposite to the $i$-th vertex of $s$
(|Simplex_handle()| is there is no such simplex).\\
\precond $0 \leq i \leq |dcur|$. }*/
{ CGAL_assertion(0<=i&&i<=dcur);
return s->neighbor(i); }
Simplex_const_handle opposite_simplex(Simplex_const_handle s,int i) const
{ CGAL_assertion(0<=i&&i<=dcur);
return s->neighbor(i); }
int index_of_opposite_vertex(Simplex_handle s, int i) const
{ CGAL_assertion(0<=i&&i<=dcur);
return s->opposite_vertex_index(i); }
/*{\Mop returns the index of the vertex opposite to the $i$-th vertex
of $s$. \precond $0 \leq i \leq |dcur|$ and there is a
simplex opposite to the $i$-th vertex of $s$.}*/
int index_of_opposite_vertex(Simplex_const_handle s, int i) const
{ CGAL_assertion(0<=i&&i<=dcur);
return s->opposite_vertex_index(i); }
/*{\Mtext \headerline{Update Operations}
We give operations that allow to update a regular complex. They have
to be used with care as they may invalidate the data structure.}*/
void clear(int d = 0)
/*{\Mop reinitializes |\Mvar| to the empty complex in dimension |dim|.}*/
{ clean_dynamic_memory();
dmax = d; dcur = -1;
}
void set_current_dimension(int d) { dcur = d; }
/*{\Mop sets |dcur| to |d|. }*/
Simplex_handle new_simplex()
/*{\Mop adds a new simplex to |\Mvar| and returns it. The new simplex
has no vertices yet.}*/
//{ simplices_.push_back(* new Simplex(dcur) ); return --simplices_end(); }
{ simplices_.push_back(* new Simplex(dmax) ); return --simplices_end(); }
Vertex_handle new_vertex()
/*{\Mop adds a new vertex to |\Mvar| and returns it. The new vertex
has no associated simplex nor index yet. The associated point
is the point |Regular_complex_d::nil_point| which is a static
member of class |Regular_complex_d.|}*/
{ vertices_.push_back(* new Vertex(nil_point) ); return --vertices_end(); }
Vertex_handle new_vertex(const Point_d& p)
/*{\Mop adds a new vertex to |\Mvar| and returns it. The new vertex
has |p| as the associated point, but is has no associated
simplex nor index yet.}*/
{ vertices_.push_back(* new Vertex(p) ); return --vertices_end(); }
void associate_vertex_with_simplex(Simplex_handle s, int i, Vertex_handle v)
/*{\Mop sets the $i$-th vertex of |s| to |v| and records this fact in
$v$. The latter occurs only if $v$ is non-nil.}*/
{ s -> set_vertex(i,v);
if ( v != Vertex_handle() ) {
v -> set_simplex(s); v -> set_index(i);
}
}
void associate_point_with_vertex(Vertex_handle v, const Point_d& p)
/*{\Mop sets the point associated with $v$ to $p$.}*/
{ v -> set_point(p); }
void set_neighbor(Simplex_handle s, int i, Simplex_handle s1, int j)
/*{\Mop sets the neihbor opposite to vertex $i$ of |s| to |s1| and
records vertex $j$ of |s1| as the vertex opposite to $i$.}*/
{ s -> set_neighbor(i,s1);
s1 -> set_neighbor(j,s);
s -> set_opposite_vertex_index(i,j);
s1 -> set_opposite_vertex_index(j,i);
}
void check_topology() const;
/*{\Mop Partially checks whether |\Mvar| is an abstract simplicial
complex. This function terminates without error if each vertex is a
vertex of the simplex of which it claims to be a vertex, if the
vertices of all simplices are pairwise distinct, if the neighbor
relationship is symmetric, and if neighboring simplices share exactly
|dcur| vertices. It returns an error message if one of these
conditions is violated. Note that it is not checked whether simplices
that share |dcur| vertices are neighbors in the data structure.}*/
void check_topology_and_geometry() const;
/*{\Mop In addition to the above, this function checks whether all
vertices have an associated point different from
|Regular_complex_d::nil_point| and whether the points associated with the
vertices of any simplex are affinely independent. It returns an error
message otherwise. Note that it is not checked whether the
intersection of any two simplices is a facet of both.}*/
typedef size_t Size_type;
Size_type number_of_vertices() const { return _vertices.size();}
Size_type number_of_simplices() const { return _simplices.size();}
void print_statistics(std::ostream& os = std::cout) const
{
os << "Regular_complex_d - statistic" << std::endl;
os << "number of vertices = " << number_of_vertices() << std::endl;
os << "number of simplices = " << number_of_simplices() << std::endl;
}
/*{\Mtext \headerline{Lists and Iterators}
\setopdims{4.5cm}{3.5cm}}*/
/*{\Mtext The following operation pairs return iterator ranges in
the style of STL.}*/
Vertex_iterator vertices_begin() { return vertices_.begin(); }
/*{\Mop the first vertex of |\Mvar|.}*/
Vertex_iterator vertices_end() { return vertices_.end(); }
/*{\Mop the beyond vertex of |\Mvar|.}*/
Simplex_iterator simplices_begin() { return simplices_.begin(); }
/*{\Mop the first simplex of |\Mvar|.}*/
Simplex_iterator simplices_end() { return simplices_.end(); }
/*{\Mop the beyond simplex of |\Mvar|.}*/
Vertex_const_iterator vertices_begin() const { return vertices_.begin(); }
Vertex_const_iterator vertices_end() const { return vertices_.end(); }
Simplex_const_iterator simplices_begin() const { return simplices_.begin(); }
Simplex_const_iterator simplices_end() const { return simplices_.end(); }
std::list<Simplex_handle> all_simplices()
/*{\Mop returns the set of all maximal simplices in |\Mvar|.}*/
{ std::list<Simplex_handle> res; Simplex_iterator it;
forall_rc_simplices(it,*this) res.push_back(it);
return res; }
std::list<Simplex_const_handle> all_simplices() const
{ std::list<Simplex_const_handle> res; Simplex_const_iterator it;
forall_rc_simplices(it,*this) res.push_back(it);
return res; }
std::list<Vertex_handle> all_vertices()
/*{\Mop returns the set of all vertices in |\Mvar|.}*/
{ std::list<Vertex_handle> res; Vertex_iterator it;
forall_rc_vertices(it,*this) res.push_back(it);
return res; }
std::list<Vertex_const_handle> all_vertices() const
{ std::list<Vertex_const_handle> res; Vertex_const_iterator it;
forall_rc_vertices(it,*this) res.push_back(it);
return res; }
const R& kernel() const { return Kernel_; }
static Point_d nil_point;
}; // Regular_complex_d<R>
// init static member:
template <class R>
typename Regular_complex_d<R>::Point_d Regular_complex_d<R>::nil_point;
template <class R>
void Regular_complex_d<R>::check_topology() const
{
Simplex_const_handle s,t;
Vertex_const_handle v;
int i,j,k;
if (dcur == -1) {
if (!vertices_.empty() || !simplices_.empty() )
CGAL_assertion_msg(0,
"check_topology: dcur is -1 but there are vertices or simplices");
}
forall_rc_vertices(v,*this) {
if ( v != vertex(simplex(v),index(v)) )
CGAL_assertion_msg(0,
"check_topology: vertex-simplex relationship corrupted");
}
forall_rc_simplices(s,*this) {
for(i = 0; i <= dcur; i++) {
for (j = i + 1; j <= dcur; j++) {
if (vertex(s,i) == vertex(s,j))
CGAL_assertion_msg(0,
"check_topology: a simplex with two equal vertices");
}
}
}
forall_rc_simplices(s,*this) {
for(i = 0; i <= dcur; i++) {
if ((t = opposite_simplex(s,i)) != Simplex_const_handle()) {
int l = index_of_opposite_vertex(s,i);
if (s != opposite_simplex(t,l) ||
i != index_of_opposite_vertex(t,l))
CGAL_assertion_msg(0,
"check_topology: neighbor relation is not symmetric");
for (j = 0; j <= dcur; j++) {
if (j != i) {
// j must also occur as a vertex of t
for (k = 0; k <= dcur &&
( vertex(s,j) != vertex(t,k) || k == l); k++);
// forloop has no body
if (k > dcur)
CGAL_assertion_msg(0,
"check_topology: too few shared vertices.");
}
}
}
}
}
}
template <class R>
void Regular_complex_d<R>::check_topology_and_geometry() const
{
check_topology();
Vertex_const_handle v;
forall_rc_vertices(v,*this) {
if ( v == Vertex_const_handle() ||
associated_point(v).identical(Regular_complex_d<R>::nil_point) )
CGAL_assertion_msg(0,"check_topology_and_geometry: \
vertex with nil_point or no associated point.");
}
typename R::Affinely_independent_d affinely_independent =
kernel().affinely_independent_d_object();
Simplex_const_handle s;
forall_rc_simplices(s,*this) {
std::vector<Point_d> A(dcur + 1);
for (int i = 0; i <= dcur; i++)
A[i] = associated_point(s,i);
if ( !affinely_independent(A.begin(),A.end()) )
CGAL_assertion_msg(0,"check_topology_and_geometry: \
corners of some simplex are not affinely independent");
}
}
/*{\Mtext
\headerline{Iteration Statements}
{\bf forall\_rc\_simplices}($s,C$)
$\{$ ``the simplices of $C$ are successively assigned to $s$'' $\}$
{\bf forall\_rc\_vertices}($v,C$)
$\{$ ``the vertices of $C$ are successively assigned to $v$'' $\}$
}*/
/*{\Mimplementation Each simplex stores its vertices, the adjacent
simplices, and the opposite vertices in arrays. The space requirement
for a simplex is $3 * |dim| * 4$ Bytes for the contents of the arrays
plus the actual space for the points plus the constant space overhead
for the arrays (see the manual pages for arrays).
The class |Regular_complex_d| needs constant space plus space for a
list of simplices (which is about 12 bytes per simplex). The total
space requirement is therefore about $12(|dim| + 2)$ bytes times the
number of simplices. }*/
CGAL_END_NAMESPACE
#endif // CGAL_REGULAR_COMPLEX_D_MSC_H

View File

@ -81,7 +81,7 @@ int main(int argc, char* argv[])
v21 /= 13;
CGAL_TEST(v21 == v22);
if (IOTEST) CGAL_IO_TEST(v1,v2);
if (IOTEST) CGAL_IO_TEST(v1,v2,CGAL::IO::ASCII);
}
{
@ -169,7 +169,7 @@ int main(int argc, char* argv[])
CGAL_TEST(LA::verify_determinant(C, det, L, U, q, c));
CGAL_TEST(det == LA::determinant(C));
CGAL_TEST(CGAL_NTS sign(det) == LA::sign_of_determinant(C));
if (IOTEST) CGAL_IO_TEST(A,C);
if (IOTEST) CGAL_IO_TEST(A,C,CGAL::IO::ASCII);
/* a random linear solver task: */
Vector b(mat_dim),x(mat_dim),e;
NT denom;
@ -278,7 +278,7 @@ int main(int argc, char* argv[])
v21 /= 13;
CGAL_TEST(v21 == v22);
if (IOTEST) CGAL_IO_TEST(v1,v2);
if (IOTEST) CGAL_IO_TEST(v1,v2,CGAL::IO::ASCII);
}
{
@ -366,7 +366,8 @@ int main(int argc, char* argv[])
CGAL_TEST(LA::verify_determinant(C, det, L, U, q, c));
CGAL_TEST(det == LA::determinant(C));
CGAL_TEST(CGAL_NTS sign(det) == LA::sign_of_determinant(C));
if (IOTEST) CGAL_IO_TEST(A,C);
if (IOTEST) CGAL_IO_TEST(A,C,CGAL::IO::ASCII);
// add binary test later: if (IOTEST) CGAL_IO_TEST(A,C,CGAL::IO::BINARY);
/* a random linear solver task: */
Vector b(mat_dim),x(mat_dim),e;
NT denom;

View File

@ -116,7 +116,7 @@ int main()
CGAL_TEST(at1.dimension()==2);
CGAL_TEST(at1.matrix() == M1);
CGAL_IO_TEST(at4,at0);
CGAL_IO_TEST(at4,at0,CGAL::IO::ASCII);
Afftrafo at12 = at2 * at2.inverse();
Point p(1,1);
@ -284,7 +284,7 @@ int main()
CGAL_TEST(at1.dimension()==2);
CGAL_TEST(at1.matrix() == M1);
CGAL_IO_TEST(at4,at0);
CGAL_IO_TEST(at4,at0,CGAL::IO::ASCII);
Afftrafo at12 = at2 * at2.inverse();
Point p(1,1);

View File

@ -64,7 +64,8 @@ int main()
v5 = DT.insert(p5);
Simplex_handle ds2 = DT.simplex(v5);
int di2 = DT.index(v5);
CGAL_TEST(DT.is_simplex_of_nearest(ds2) && !DT.is_simplex_of_furthest(ds2));
CGAL_TEST(DT.is_simplex_of_nearest(ds2)
&& ! DT.is_simplex_of_furthest(ds2));
CGAL_TEST(DT.point_of_simplex(ds2,di2) == DT.associated_point(v5));
CGAL_TEST(DT.opposite_simplex(ds2,1)!=Simplex_handle());
CGAL_TEST(DT.opposite_simplex(DT.opposite_simplex(ds2,1),
@ -151,7 +152,8 @@ int main()
v5 = DT.insert(p5);
Simplex_handle ds2 = DT.simplex(v5);
int di2 = DT.index(v5);
CGAL_TEST(DT.is_simplex_of_nearest(ds2) && !DT.is_simplex_of_furthest(ds2));
CGAL_TEST(DT.is_simplex_of_nearest(ds2)
&& ! DT.is_simplex_of_furthest(ds2));
CGAL_TEST(DT.point_of_simplex(ds2,di2) == DT.associated_point(v5));
CGAL_TEST(DT.opposite_simplex(ds2,1)!=Simplex_handle());
CGAL_TEST(DT.opposite_simplex(DT.opposite_simplex(ds2,1),

View File

@ -3,7 +3,7 @@
#include <CGAL/basic.h>
#include <iostream>
#include <strstream>
#include <sstream>
#include <vector>
#define CGAL_TEST_START int cgal_test_res=0
@ -12,13 +12,26 @@
std::cerr<<"ERROR: ("<<__LINE__ <<") test "<<#b<<" failed."<<std::endl; } \
else
#define CGAL_IO_TEST(datao,datai) { \
std::ostrstream OS; OS<<datao<<'\n'<<'\0'; \
std::istrstream IS(OS.str()); OS.freeze(0); IS>>datai; \
if (datao != datai) { ++cgal_test_res; \
std::cerr<<"ERROR in IO of "<<#datao<<" "<<#datai<<" : "\
<<OS.str()<<" failed."<<std::endl;\
OS.freeze(0); }}
#define CGAL_IO_TEST(datao,datai,iomode) { \
std::stringstream S; \
CGAL::set_mode(S,iomode); \
S << datao; \
if ( iomode != CGAL::IO::BINARY) \
S << '\n'; \
S << datao; \
S >> datai; \
if (datao != datai) { \
++cgal_test_res; \
std::cerr << "ERROR in 1.IO " << #iomode << " of " << #datao << " "\
<< #datai << " : " << S.str() << " failed." <<std::endl; \
} \
S >> datai; \
if (datao != datai) { \
++cgal_test_res; \
std::cerr << "ERROR in 2.IO " << #iomode << " of " << #datao << " "\
<< #datai << " : " << S.str() << " failed." <<std::endl; \
} \
}
#define CGAL_TEST_END return cgal_test_res

View File

@ -76,7 +76,7 @@ int main()
CGAL_TEST(p0 != p1 && p0 != p2); // op!=
CGAL_TEST(p0 == CGAL::ORIGIN);
if (DOIO) CGAL_IO_TEST(p1,p4); p4 = p1;
if (DOIO) CGAL_IO_TEST(p1,p4,CGAL::IO::ASCII); p4 = p1;
CGAL_TEST(p4.dimension()==p1.dimension()); // dimension()
CGAL_TEST(p4.dimension()!=Point(3).dimension()); // dimension()
@ -256,7 +256,7 @@ int main()
CGAL_TEST((a1==a6 && a3==a2));
CGAL_TEST((a0!=a1 && a0!=a4));
if (DOIO) CGAL_IO_TEST(a1,a6); a6 = a1;
if (DOIO) CGAL_IO_TEST(a1,a6,CGAL::IO::ASCII); a6 = a1;
CGAL_TEST(a2.dimension()==a3.dimension());
CGAL_TEST(a3.dimension()!=a4.dimension());
@ -345,7 +345,7 @@ int main()
CGAL_TEST(d2==Direction(2,2,0));
CGAL_TEST(d31!=d32 && d2!=d1)
if (DOIO) CGAL_IO_TEST(d1,d5); d5=d1;
if (DOIO) CGAL_IO_TEST(d1,d5,CGAL::IO::ASCII); d5=d1;
CGAL_TEST(d2.dimension()==d1.dimension());
CGAL_TEST(d31.dimension()!=d32.dimension());
CGAL_TEST(d1.dx()==d1.delta(0));
@ -411,7 +411,7 @@ int main()
CGAL_TEST(!h5.has_on(p1));
CGAL_TEST(h3.has_on_positive_side(o));
if (DOIO) CGAL_IO_TEST(h0,h8); h8=h0;
if (DOIO) CGAL_IO_TEST(h0,h8,CGAL::IO::ASCII); h8=h0;
Hyperplane::Coefficient_const_iterator it; int i;
for (i=0,it=h5.coefficients_begin();
@ -469,7 +469,7 @@ int main()
std::vector< Point > B = make_vector(p+v,q+v,r+v,s+v);
CGAL_TEST( (S1+v) == Sphere(3,B.begin(),B.end()) );
CGAL_TEST( CGAL::weak_equality(S1.opposite(),S1) );
if (DOIO) CGAL_IO_TEST(S1,S3); S3 = S1;
if (DOIO) CGAL_IO_TEST(S1,S3,CGAL::IO::ASCII); S3 = S1;
}
{
@ -502,7 +502,7 @@ int main()
CGAL_TEST(CGAL::weak_equality(s1,s1.opposite()));
CGAL_TEST(CGAL::parallel(s6,s6+v));
CGAL_TEST(CGAL::common_endpoint(s1,s2,p3)&&p3==p1);
if (DOIO) CGAL_IO_TEST(s1,s6); s6 = s1;
if (DOIO) CGAL_IO_TEST(s1,s6,CGAL::IO::ASCII); s6 = s1;
}
{
@ -525,7 +525,7 @@ int main()
CGAL_TEST(r1+Vector(1,-1) == r7);
CGAL_TEST(r1.has_on(Point(10,0))&&!r1.has_on(Point(-10,0)));
CGAL_TEST(CGAL::parallel(r1,(r2+Vector(0,1)).opposite()));
if (DOIO) CGAL_IO_TEST(r1,r4); r4 = r1;
if (DOIO) CGAL_IO_TEST(r1,r4,CGAL::IO::ASCII); r4 = r1;
}
{
@ -546,7 +546,7 @@ int main()
CGAL_TEST(l1.has_on(Point(3,0))&&!l1.has_on(p2));
CGAL_TEST(CGAL::weak_equality(l1,l1.opposite())&&l1!=l1.opposite());
CGAL_TEST(CGAL::parallel(l2,Line(p2,dir)));
if (DOIO) CGAL_IO_TEST(l1,l5); l5 = l1;
if (DOIO) CGAL_IO_TEST(l1,l5,CGAL::IO::ASCII); l5 = l1;
}
@ -581,7 +581,7 @@ int main()
CGAL_TEST(p0 != p1 && p0 != p2); // op!=
CGAL_TEST(p0 == CGAL::ORIGIN);
if (DOIO) CGAL_IO_TEST(p1,p4); p4 = p1;
if (DOIO) CGAL_IO_TEST(p1,p4,CGAL::IO::ASCII); p4 = p1;
CGAL_TEST(p4.dimension()==p1.dimension()); // dimension()
CGAL_TEST(p4.dimension()!=Point(3).dimension()); // dimension()
@ -761,7 +761,7 @@ int main()
CGAL_TEST((a1==a6 && a3==a2));
CGAL_TEST((a0!=a1 && a0!=a4));
if (DOIO) CGAL_IO_TEST(a1,a6); a6 = a1;
if (DOIO) CGAL_IO_TEST(a1,a6,CGAL::IO::ASCII); a6 = a1;
CGAL_TEST(a2.dimension()==a3.dimension());
CGAL_TEST(a3.dimension()!=a4.dimension());
@ -850,7 +850,7 @@ int main()
CGAL_TEST(d2==Direction(2,2,0));
CGAL_TEST(d31!=d32 && d2!=d1)
if (DOIO) CGAL_IO_TEST(d1,d5); d5=d1;
if (DOIO) CGAL_IO_TEST(d1,d5,CGAL::IO::ASCII); d5=d1;
CGAL_TEST(d2.dimension()==d1.dimension());
CGAL_TEST(d31.dimension()!=d32.dimension());
CGAL_TEST(d1.dx()==d1.delta(0));
@ -916,7 +916,7 @@ int main()
CGAL_TEST(!h5.has_on(p1));
CGAL_TEST(h3.has_on_positive_side(o));
if (DOIO) CGAL_IO_TEST(h0,h8); h8=h0;
if (DOIO) CGAL_IO_TEST(h0,h8,CGAL::IO::ASCII); h8=h0;
Hyperplane::Coefficient_const_iterator it; int i;
for (i=0,it=h5.coefficients_begin();
@ -974,7 +974,7 @@ int main()
std::vector< Point > B = make_vector(p+v,q+v,r+v,s+v);
CGAL_TEST( (S1+v) == Sphere(3,B.begin(),B.end()) );
CGAL_TEST( CGAL::weak_equality(S1.opposite(),S1) );
if (DOIO) CGAL_IO_TEST(S1,S3); S3 = S1;
if (DOIO) CGAL_IO_TEST(S1,S3,CGAL::IO::ASCII); S3 = S1;
}
{
@ -1007,7 +1007,7 @@ int main()
CGAL_TEST(CGAL::weak_equality(s1,s1.opposite()));
CGAL_TEST(CGAL::parallel(s6,s6+v));
CGAL_TEST(CGAL::common_endpoint(s1,s2,p3)&&p3==p1);
if (DOIO) CGAL_IO_TEST(s1,s6); s6 = s1;
if (DOIO) CGAL_IO_TEST(s1,s6,CGAL::IO::ASCII); s6 = s1;
}
{
@ -1030,7 +1030,7 @@ int main()
CGAL_TEST(r1+Vector(1,-1) == r7);
CGAL_TEST(r1.has_on(Point(10,0))&&!r1.has_on(Point(-10,0)));
CGAL_TEST(CGAL::parallel(r1,(r2+Vector(0,1)).opposite()));
if (DOIO) CGAL_IO_TEST(r1,r4); r4 = r1;
if (DOIO) CGAL_IO_TEST(r1,r4,CGAL::IO::ASCII); r4 = r1;
}
{
@ -1051,7 +1051,7 @@ int main()
CGAL_TEST(l1.has_on(Point(3,0))&&!l1.has_on(p2));
CGAL_TEST(CGAL::weak_equality(l1,l1.opposite())&&l1!=l1.opposite());
CGAL_TEST(CGAL::parallel(l2,Line(p2,dir)));
if (DOIO) CGAL_IO_TEST(l1,l5); l5 = l1;
if (DOIO) CGAL_IO_TEST(l1,l5,CGAL::IO::ASCII); l5 = l1;
}

View File

@ -1 +1 @@
0.9.80 ( 8 May 2003)
0.9.81 ( 8 May 2003)