Merge branch 'wip' of github.com:KLayout/klayout into wip

This commit is contained in:
Matthias Koefferlein 2023-10-19 21:25:07 +02:00
commit 1cf34b0ee9
10 changed files with 323 additions and 501 deletions

View File

@ -22,6 +22,7 @@
#include "dbPoint.h"
#include "dbVector.h"
// ----------------------------------------------------------------
// Implementation of the custom extractors
@ -55,6 +56,15 @@ namespace {
}
namespace db
{
// instantiations
template class point<Coord>;
template class point<DCoord>;
}
namespace tl
{

View File

@ -47,7 +47,7 @@ class ArrayRepository;
*/
template <class C>
class DB_PUBLIC_TEMPLATE point
class DB_PUBLIC point
{
public:
typedef C coord_type;
@ -131,27 +131,48 @@ public:
/**
* @brief Add to operation
*/
point<C> &operator+= (const vector<C> &v);
point<C> &operator+= (const vector<C> &v)
{
m_x += v.x ();
m_y += v.y ();
return *this;
}
/**
* @brief method version of operator+ (mainly for automation purposes)
*/
point<C> add (const vector<C> &v) const;
point<C> add (const vector<C> &v) const
{
point<C> r (*this);
r += v;
return r;
}
/**
* @brief Subtract from operation
*/
point<C> &operator-= (const vector<C> &v);
point<C> &operator-= (const vector<C> &v)
{
m_x -= v.x ();
m_y -= v.y ();
return *this;
}
/**
* @brief method version of operator- (mainly for automation purposes)
*/
point<C> subtract (const vector<C> &v) const;
point<C> subtract (const vector<C> &v) const
{
return *this - v;
}
/**
* @brief method version of operator- (mainly for automation purposes)
*/
vector<C> subtract (const point<C> &p) const;
vector<C> subtract (const point<C> &p) const
{
return *this - p;
}
/**
* @brief "less" comparison operator
@ -159,17 +180,26 @@ public:
* This operator is provided to establish a sorting
* order
*/
bool operator< (const point<C> &p) const;
bool operator< (const point<C> &p) const
{
return m_y < p.m_y || (m_y == p.m_y && m_x < p.m_x);
}
/**
* @brief Equality test operator
*/
bool operator== (const point<C> &p) const;
bool operator== (const point<C> &p) const
{
return m_x == p.m_x && m_y == p.m_y;
}
/**
* @brief Inequality test operator
*/
bool operator!= (const point<C> &p) const;
bool operator!= (const point<C> &p) const
{
return !operator== (p);
}
/**
* @brief Const transform
@ -181,7 +211,10 @@ public:
* @return The transformed point
*/
template <class Tr>
point<typename Tr::target_coord_type> transformed (const Tr &t) const;
point<typename Tr::target_coord_type> transformed (const Tr &t) const
{
return t (*this);
}
/**
* @brief In-place transformation
@ -193,27 +226,43 @@ public:
* @return The transformed point
*/
template <class Tr>
point &transform (const Tr &t);
point &transform (const Tr &t)
{
*this = t (*this);
return *this;
}
/**
* @brief Accessor to the x coordinate
*/
C x () const;
C x () const
{
return m_x;
}
/**
* @brief Accessor to the y coordinate
*/
C y () const;
C y () const
{
return m_y;
}
/**
* @brief Write accessor to the x coordinate
*/
void set_x (C _x);
void set_x (C _x)
{
m_x = _x;
}
/**
* @brief Write accessor to the y coordinate
*/
void set_y (C _y);
void set_y (C _y)
{
m_y = _y;
}
/**
* @brief Scaling self by some factor
@ -221,12 +270,22 @@ public:
* Scaling involves rounding which in our case is simply handled
* with the coord_traits scheme.
*/
point<C> &operator*= (double s);
point<C> &operator*= (double s)
{
m_x = coord_traits::rounded (m_x * s);
m_y = coord_traits::rounded (m_y * s);
return *this;
}
/**
* @brief Scaling self by some integer factor
*/
point<C> &operator*= (long s);
point<C> &operator*= (long s)
{
m_x = coord_traits::rounded (m_x * s);
m_y = coord_traits::rounded (m_y * s);
return *this;
}
/**
* @brief Division by some divisor.
@ -235,62 +294,114 @@ public:
* with the coord_traits scheme.
*/
point<C> &operator/= (double s);
point<C> &operator/= (double s)
{
double mult = 1.0 / static_cast<double>(s);
*this *= mult;
return *this;
}
/**
* @brief Dividing self by some integer divisor
*/
point<C> &operator/= (long s);
point<C> &operator/= (long s)
{
double mult = 1.0 / static_cast<double>(s);
*this *= mult;
return *this;
}
/**
* @brief The euclidian distance to another point
*
* @param d The other to compute the distance to.
*/
distance_type distance (const point<C> &p) const;
distance_type distance (const point<C> &p) const
{
double ddx (p.x ());
double ddy (p.y ());
ddx -= double (x ());
ddy -= double (y ());
return coord_traits::rounded_distance (sqrt (ddx * ddx + ddy * ddy));
}
/**
* @brief The euclidian distance of the point to (0,0)
*/
distance_type distance () const;
distance_type distance () const
{
double ddx (x ());
double ddy (y ());
return coord_traits::rounded_distance (sqrt (ddx * ddx + ddy * ddy));
}
/**
* @brief The euclidian distance to another point as double value
*
* @param d The other to compute the distance to.
*/
double double_distance (const point<C> &p) const;
double double_distance (const point<C> &p) const
{
double ddx (p.x ());
double ddy (p.y ());
ddx -= double (x ());
ddy -= double (y ());
return sqrt (ddx * ddx + ddy * ddy);
}
/**
* @brief The euclidian distance of the point to (0,0) as double value
*/
double double_distance () const;
double double_distance () const
{
double ddx (x ());
double ddy (y ());
return sqrt (ddx * ddx + ddy * ddy);
}
/**
* @brief The square euclidian distance to another point
*
* @param d The other to compute the distance to.
*/
area_type sq_distance (const point<C> &p) const;
area_type sq_distance (const point<C> &p) const
{
return coord_traits::sq_length (p.x (), p.y (), x (), y ());
}
/**
* @brief The square euclidian distance to point (0,0)
*
* @param d The other to compute the distance to.
*/
area_type sq_distance () const;
area_type sq_distance () const
{
return coord_traits::sq_length (0, 0, x (), y ());
}
/**
* @brief The square of the euclidian distance to another point as double value
*
* @param d The other to compute the distance to.
*/
double sq_double_distance (const point<C> &p) const;
double sq_double_distance (const point<C> &p) const
{
double ddx (p.x ());
double ddy (p.y ());
ddx -= double (x ());
ddy -= double (y ());
return ddx * ddx + ddy * ddy;
}
/**
* @brief The square of the euclidian distance of the point to (0,0) as double value
*/
double sq_double_distance () const;
double sq_double_distance () const
{
double ddx (x ());
double ddy (y ());
return ddx * ddx + ddy * ddy;
}
/**
* @brief String conversion
@ -313,7 +424,10 @@ public:
/**
* @brief Fuzzy comparison of points
*/
bool equal (const point<C> &p) const;
bool equal (const point<C> &p) const
{
return coord_traits::equal (x (), p.x ()) && coord_traits::equal (y (), p.y ());
}
/**
* @brief Fuzzy comparison of points for inequality
@ -326,7 +440,16 @@ public:
/**
* @brief Fuzzy "less" comparison of points
*/
bool less (const point<C> &p) const;
bool less (const point<C> &p) const
{
if (! coord_traits::equal (y (), p.y ())) {
return y () < p.y ();
}
if (! coord_traits::equal (x (), p.x ())) {
return x () < p.x ();
}
return false;
}
/**
* @brief The (dummy) translation operator
@ -350,131 +473,6 @@ private:
C m_x, m_y;
};
template <class C>
inline point<C> &
point<C>::operator+= (const vector<C> &v)
{
m_x += v.x ();
m_y += v.y ();
return *this;
}
template <class C>
inline point<C>
point<C>::add (const vector<C> &v) const
{
point<C> r (*this);
r += v;
return r;
}
template <class C>
inline point<C> &
point<C>::operator-= (const vector<C> &v)
{
m_x -= v.x ();
m_y -= v.y ();
return *this;
}
template <class C>
inline point<C>
point<C>::subtract (const vector<C> &v) const
{
return *this - v;
}
template <class C>
inline vector<C>
point<C>::subtract (const point<C> &p) const
{
return *this - p;
}
template <class C>
inline bool
point<C>::operator< (const point<C> &p) const
{
return m_y < p.m_y || (m_y == p.m_y && m_x < p.m_x);
}
template <class C>
inline bool
point<C>::less (const point<C> &p) const
{
if (! coord_traits::equal (y (), p.y ())) {
return y () < p.y ();
}
if (! coord_traits::equal (x (), p.x ())) {
return x () < p.x ();
}
return false;
}
template <class C>
inline bool
point<C>::operator== (const point<C> &p) const
{
return m_x == p.m_x && m_y == p.m_y;
}
template <class C>
inline bool
point<C>::equal (const point<C> &p) const
{
return coord_traits::equal (x (), p.x ()) && coord_traits::equal (y (), p.y ());
}
template <class C>
inline bool
point<C>::operator!= (const point<C> &p) const
{
return !operator== (p);
}
template <class C> template <class Tr>
inline point<typename Tr::target_coord_type>
point<C>::transformed (const Tr &t) const
{
return t (*this);
}
template <class C> template <class Tr>
inline point<C> &
point<C>::transform (const Tr &t)
{
*this = t (*this);
return *this;
}
template <class C>
inline C
point<C>::x () const
{
return m_x;
}
template <class C>
inline C
point<C>::y () const
{
return m_y;
}
template <class C>
inline void
point<C>::set_x (C _x)
{
m_x = _x;
}
template <class C>
inline void
point<C>::set_y (C _y)
{
m_y = _y;
}
template <class C>
inline point<double>
operator* (const db::point<C> &p, double s)
@ -518,116 +516,6 @@ operator/ (const db::point<C> &p, Number s)
return point<C> (p.x () * mult, p.y () * mult);
}
template <class C>
inline point<C> &
point<C>::operator/= (double s)
{
double mult = 1.0 / static_cast<double>(s);
*this *= mult;
return *this;
}
template <class C>
inline point<C> &
point<C>::operator/= (long s)
{
double mult = 1.0 / static_cast<double>(s);
*this *= mult;
return *this;
}
template <class C>
inline point<C> &
point<C>::operator*= (double s)
{
m_x = coord_traits::rounded (m_x * s);
m_y = coord_traits::rounded (m_y * s);
return *this;
}
template <class C>
inline point<C> &
point<C>::operator*= (long s)
{
m_x = coord_traits::rounded (m_x * s);
m_y = coord_traits::rounded (m_y * s);
return *this;
}
template <class C>
inline typename point<C>::distance_type
point<C>::distance (const point<C> &p) const
{
double ddx (p.x ());
double ddy (p.y ());
ddx -= double (x ());
ddy -= double (y ());
return coord_traits::rounded_distance (sqrt (ddx * ddx + ddy * ddy));
}
template <class C>
inline typename point<C>::distance_type
point<C>::distance () const
{
double ddx (x ());
double ddy (y ());
return coord_traits::rounded_distance (sqrt (ddx * ddx + ddy * ddy));
}
template <class C>
inline double
point<C>::double_distance (const point<C> &p) const
{
double ddx (p.x ());
double ddy (p.y ());
ddx -= double (x ());
ddy -= double (y ());
return sqrt (ddx * ddx + ddy * ddy);
}
template <class C>
inline double
point<C>::double_distance () const
{
double ddx (x ());
double ddy (y ());
return sqrt (ddx * ddx + ddy * ddy);
}
template <class C>
inline typename point<C>::area_type
point<C>::sq_distance (const point<C> &p) const
{
return coord_traits::sq_length (p.x (), p.y (), x (), y ());
}
template <class C>
inline typename point<C>::area_type
point<C>::sq_distance () const
{
return coord_traits::sq_length (0, 0, x (), y ());
}
template <class C>
inline double
point<C>::sq_double_distance (const point<C> &p) const
{
double ddx (p.x ());
double ddy (p.y ());
ddx -= double (x ());
ddy -= double (y ());
return ddx * ddx + ddy * ddy;
}
template <class C>
inline double
point <C>::sq_double_distance () const
{
double ddx (x ());
double ddy (y ());
return ddx * ddx + ddy * ddy;
}
/**
* @brief The binary + operator (addition point and vector)
*

View File

@ -32,6 +32,11 @@
#include "tlObjectCollection.h"
#include "tlList.h"
#include <vector>
#include <string>
#include <list>
#include <algorithm>
namespace db
{

View File

@ -29,6 +29,9 @@
#include "tlTimer.h"
#include <set>
#include <memory>
#include <vector>
#include <map>
namespace db
{
@ -1085,7 +1088,7 @@ Triangles::fill_concave_corners (const std::vector<db::TriangleEdge *> &edges)
}
if (not any_connected) {
if (! any_connected) {
break;
}
@ -1315,7 +1318,7 @@ Triangles::join_edges (std::vector<db::TriangleEdge *> &edges)
void
Triangles::constrain (const std::vector<std::vector<db::Vertex *> > &contours)
{
assert (! m_is_constrained);
tl_assert (! m_is_constrained);
std::vector<std::pair<db::DEdge, std::vector<db::TriangleEdge *> > > resolved_edges;

View File

@ -33,6 +33,11 @@
#include "tlObjectCollection.h"
#include "tlStableVector.h"
#include <limits>
#include <list>
#include <vector>
#include <algorithm>
namespace db
{

View File

@ -22,6 +22,7 @@
#include "dbVector.h"
#include "dbPoint.h"
// ----------------------------------------------------------------
// Implementation of the custom extractors
@ -55,6 +56,15 @@ namespace {
}
namespace db
{
// instantiations
template class vector<Coord>;
template class vector<DCoord>;
}
namespace tl
{

View File

@ -45,7 +45,7 @@ template <class C> class point;
*/
template <class C>
class DB_PUBLIC_TEMPLATE vector
class DB_PUBLIC vector
{
public:
typedef C coord_type;
@ -171,22 +171,42 @@ public:
/**
* @brief Add to operation
*/
vector<C> &operator+= (const vector<C> &p);
vector<C> &operator+= (const vector<C> &p)
{
m_x += p.x ();
m_y += p.y ();
return *this;
}
/**
* @brief method version of operator+ (mainly for automation purposes)
*/
vector<C> add (const vector<C> &p) const;
vector<C> add (const vector<C> &p) const
{
vector<C> r (*this);
r += p;
return r;
}
/**
* @brief Subtract from operation
*/
vector<C> &operator-= (const vector<C> &p);
vector<C> &operator-= (const vector<C> &p)
{
m_x -= p.x ();
m_y -= p.y ();
return *this;
}
/**
* @brief method version of operator- (mainly for automation purposes)
*/
vector<C> subtract (const vector<C> &p) const;
vector<C> subtract (const vector<C> &p) const
{
vector<C> r (*this);
r -= p;
return r;
}
/**
* @brief "less" comparison operator
@ -194,17 +214,26 @@ public:
* This operator is provided to establish a sorting
* order
*/
bool operator< (const vector<C> &p) const;
bool operator< (const vector<C> &p) const
{
return m_y < p.m_y || (m_y == p.m_y && m_x < p.m_x);
}
/**
* @brief Equality test operator
*/
bool operator== (const vector<C> &p) const;
bool operator== (const vector<C> &p) const
{
return m_x == p.m_x && m_y == p.m_y;
}
/**
* @brief Inequality test operator
*/
bool operator!= (const vector<C> &p) const;
bool operator!= (const vector<C> &p) const
{
return !operator== (p);
}
/**
* @brief Const transform
@ -217,7 +246,10 @@ public:
* @return The transformed vector
*/
template <class Tr>
vector<typename Tr::target_coord_type> transformed (const Tr &t) const;
vector<typename Tr::target_coord_type> transformed (const Tr &t) const
{
return t (vector<typename Tr::target_coord_type> (*this));
}
/**
* @brief In-place transformation
@ -229,32 +261,51 @@ public:
* @return The transformed vector
*/
template <class Tr>
vector &transform (const Tr &t);
vector &transform (const Tr &t)
{
*this = vector<C> (t (*this));
return *this;
}
/**
* @brief Accessor to the x coordinate
*/
C x () const;
C x () const
{
return m_x;
}
/**
* @brief Accessor to the y coordinate
*/
C y () const;
C y () const
{
return m_y;
}
/**
* @brief Write accessor to the x coordinate
*/
void set_x (C _x);
void set_x (C _x)
{
m_x = _x;
}
/**
* @brief Write accessor to the y coordinate
*/
void set_y (C _y);
void set_y (C _y)
{
m_y = _y;
}
/**
* @brief Fuzzy comparison of vectors
*/
bool equal (const vector<C> &p) const;
bool equal (const vector<C> &p) const
{
return coord_traits::equal (x (), p.x ()) && coord_traits::equal (y (), p.y ());
}
/**
* @brief Fuzzy comparison of vectors for inequality
@ -267,31 +318,56 @@ public:
/**
* @brief Fuzzy "less" comparison of vectors
*/
bool less (const vector<C> &p) const;
bool less (const vector<C> &p) const
{
if (! coord_traits::equal (y (), p.y ())) {
return y () < p.y ();
}
if (! coord_traits::equal (x (), p.x ())) {
return x () < p.x ();
}
return false;
}
/**
* @brief Scaling by some factor
*
* To avoid round effects, the result vector is of double coordinate type.
*/
vector<double> operator* (double s) const;
vector<double> operator* (double s) const
{
return vector<double> (m_x * s, m_y * s);
}
/**
* @brief Scaling by some factor
*/
vector<C> operator* (long s) const;
vector<C> operator* (long s) const
{
return vector<C> (m_x * s, m_y * s);
}
/**
* @brief Scaling self by some factor
*
* Scaling by a double value in general involves rounding when the coordinate type is integer.
*/
vector<C> operator*= (double s);
vector<C> operator*= (double s)
{
m_x = coord_traits::rounded (m_x * s);
m_y = coord_traits::rounded (m_y * s);
return *this;
}
/**
* @brief Scaling self by some integer factor
*/
vector<C> operator*= (long s);
vector<C> operator*= (long s)
{
m_x *= s;
m_y *= s;
return *this;
}
/**
* @brief Division by some divisor.
@ -300,32 +376,60 @@ public:
* with the coord_traits scheme.
*/
vector<C> &operator/= (double s);
vector<C> &operator/= (double s)
{
double mult = 1.0 / static_cast<double>(s);
*this *= mult;
return *this;
}
/**
* @brief Dividing self by some integer divisor
*/
vector<C> &operator/= (long s);
vector<C> &operator/= (long s)
{
double mult = 1.0 / static_cast<double>(s);
*this *= mult;
return *this;
}
/**
* @brief The euclidian length
*/
distance_type length () const;
distance_type length () const
{
double ddx (x ());
double ddy (y ());
return coord_traits::rounded_distance (sqrt (ddx * ddx + ddy * ddy));
}
/**
* @brief The euclidian length of the vector
*/
double double_length () const;
double double_length () const
{
double ddx (x ());
double ddy (y ());
return sqrt (ddx * ddx + ddy * ddy);
}
/**
* @brief The square euclidian length of the vector
*/
area_type sq_length () const;
area_type sq_length () const
{
return coord_traits::sq_length (0, 0, x (), y ());
}
/**
* @brief The square of the euclidian length of the vector
*/
double sq_double_length () const;
double sq_double_length () const
{
double ddx (x ());
double ddy (y ());
return ddx * ddx + ddy * ddy;
}
/**
* @brief String conversion
@ -349,140 +453,6 @@ private:
C m_x, m_y;
};
template <class C>
inline vector<C> &
vector<C>::operator+= (const vector<C> &p)
{
m_x += p.x ();
m_y += p.y ();
return *this;
}
template <class C>
inline vector<C>
vector<C>::add (const vector<C> &p) const
{
vector<C> r (*this);
r += p;
return r;
}
template <class C>
inline vector<C> &
vector<C>::operator-= (const vector<C> &p)
{
m_x -= p.x ();
m_y -= p.y ();
return *this;
}
template <class C>
inline vector<C>
vector<C>::subtract (const vector<C> &p) const
{
vector<C> r (*this);
r -= p;
return r;
}
template <class C>
inline bool
vector<C>::operator< (const vector<C> &p) const
{
return m_y < p.m_y || (m_y == p.m_y && m_x < p.m_x);
}
template <class C>
inline bool
vector<C>::less (const vector<C> &p) const
{
if (! coord_traits::equal (y (), p.y ())) {
return y () < p.y ();
}
if (! coord_traits::equal (x (), p.x ())) {
return x () < p.x ();
}
return false;
}
template <class C>
inline bool
vector<C>::operator== (const vector<C> &p) const
{
return m_x == p.m_x && m_y == p.m_y;
}
template <class C>
inline bool
vector<C>::equal (const vector<C> &p) const
{
return coord_traits::equal (x (), p.x ()) && coord_traits::equal (y (), p.y ());
}
template <class C>
inline bool
vector<C>::operator!= (const vector<C> &p) const
{
return !operator== (p);
}
template <class C> template <class Tr>
inline vector<typename Tr::target_coord_type>
vector<C>::transformed (const Tr &t) const
{
return t (vector<typename Tr::target_coord_type> (*this));
}
template <class C> template <class Tr>
inline vector<C> &
vector<C>::transform (const Tr &t)
{
*this = vector<C> (t (*this));
return *this;
}
template <class C>
inline C
vector<C>::x () const
{
return m_x;
}
template <class C>
inline C
vector<C>::y () const
{
return m_y;
}
template <class C>
inline void
vector<C>::set_x (C _x)
{
m_x = _x;
}
template <class C>
inline void
vector<C>::set_y (C _y)
{
m_y = _y;
}
template <class C>
inline vector<double>
vector<C>::operator* (double s) const
{
return vector<double> (m_x * s, m_y * s);
}
template <class C>
inline vector<C>
vector<C>::operator* (long s) const
{
return vector<C> (m_x * s, m_y * s);
}
template <class C, typename Number>
inline vector<C>
operator/ (const db::vector<C> &p, Number s)
@ -491,76 +461,6 @@ operator/ (const db::vector<C> &p, Number s)
return vector<C> (p.x () * mult, p.y () * mult);
}
template <class C>
inline vector<C> &
vector<C>::operator/= (double s)
{
double mult = 1.0 / static_cast<double>(s);
*this *= mult;
return *this;
}
template <class C>
inline vector<C> &
vector<C>::operator/= (long s)
{
double mult = 1.0 / static_cast<double>(s);
*this *= mult;
return *this;
}
template <class C>
inline vector<C>
vector<C>::operator*= (double s)
{
m_x = coord_traits::rounded (m_x * s);
m_y = coord_traits::rounded (m_y * s);
return *this;
}
template <class C>
inline vector<C>
vector<C>::operator*= (long s)
{
m_x *= s;
m_y *= s;
return *this;
}
template <class C>
inline typename vector<C>::distance_type
vector<C>::length () const
{
double ddx (x ());
double ddy (y ());
return coord_traits::rounded_distance (sqrt (ddx * ddx + ddy * ddy));
}
template <class C>
inline double
vector<C>::double_length () const
{
double ddx (x ());
double ddy (y ());
return sqrt (ddx * ddx + ddy * ddy);
}
template <class C>
inline typename vector<C>::area_type
vector<C>::sq_length () const
{
return coord_traits::sq_length (0, 0, x (), y ());
}
template <class C>
inline double
vector<C>::sq_double_length () const
{
double ddx (x ());
double ddy (y ());
return ddx * ddx + ddy * ddy;
}
/**
* @brief The binary + operator (addition of vectors)
*

View File

@ -482,7 +482,7 @@ TEST(4)
el.layer_properties_dirty = false;
EXPECT_EQ (g.get_layer_maybe (db::LayerProperties (42, 17)), -1);
EXPECT_EQ (el.layer_properties_dirty, false);
// always true: EXPECT_EQ (g.get_layer (db::LayerProperties (42, 17)) >= 0, true);
g.get_layer (db::LayerProperties (42, 17));
EXPECT_EQ (el.layer_properties_dirty, true); // new layer got inserted
}

View File

@ -25,6 +25,7 @@
#include "tlUnitTest.h"
#include <list>
#include <memory>
class TestableTriangleEdge
: public db::TriangleEdge

View File

@ -142,9 +142,9 @@ TEST(6)
EXPECT_EQ (db::vprod_with_sign (db::Vector (1000000000, 0), db::Vector (1000000000, -1)).second, -1);
EXPECT_EQ (db::sprod_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, 0)), 0);
EXPECT_EQ (db::sprod_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, 1e-7)), 0);
EXPECT_EQ (db::sprod_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, 1e-11)), 0);
EXPECT_EQ (db::sprod_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, 0.0001)), 1);
EXPECT_EQ (db::sprod_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, -1e-7)), 0);
EXPECT_EQ (db::sprod_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, -1e-11)), 0);
EXPECT_EQ (db::sprod_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, -0.0001)), -1);
EXPECT_EQ (db::sprod_sign (db::DVector (100000.0000, 0), db::DVector (0, 100000.0000)), 0);
EXPECT_EQ (db::sprod_sign (db::DVector (100000.0000, 0), db::DVector (0.0001, 100000.0000)), 1);
@ -157,9 +157,9 @@ TEST(6)
EXPECT_EQ (db::vprod_sign (db::DVector (100000.0000, 0), db::DVector (100000.0000, -0.0001)), -1);
EXPECT_EQ (db::sprod_with_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, 0)).second, 0);
EXPECT_EQ (db::sprod_with_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, 1e-7)).second, 0);
EXPECT_EQ (db::sprod_with_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, 1e-11)).second, 0);
EXPECT_EQ (db::sprod_with_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, 0.0001)).second, 1);
EXPECT_EQ (db::sprod_with_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, -1e-7)).second, 0);
EXPECT_EQ (db::sprod_with_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, -1e-11)).second, 0);
EXPECT_EQ (db::sprod_with_sign (db::DVector (0, 100000.0000), db::DVector (100000.0000, -0.0001)).second, -1);
EXPECT_EQ (db::sprod_with_sign (db::DVector (100000.0000, 0), db::DVector (0, 100000.0000)).second, 0);
EXPECT_EQ (db::sprod_with_sign (db::DVector (100000.0000, 0), db::DVector (0.0001, 100000.0000)).second, 1);