mirror of https://github.com/CGAL/cgal
rm std::vector specific constructors from Exponent_vector
This commit is contained in:
parent
e71be8b1f6
commit
95180e4fdd
|
|
@ -49,13 +49,26 @@ to the last/outermost variable of a multivariate polynomial.
|
||||||
\ccConstructor{Exponent_vector(const Exponent_vector & ev_);}
|
\ccConstructor{Exponent_vector(const Exponent_vector & ev_);}
|
||||||
{The copy constructor
|
{The copy constructor
|
||||||
}\ccGlue
|
}\ccGlue
|
||||||
|
% OLD CONSTRUCTORS
|
||||||
|
%\ccConstructor{Exponent_vector(size_type n);}
|
||||||
|
% {Creates a vector with \ccc{n} elements.
|
||||||
|
% }\ccGlue
|
||||||
|
%\ccConstructor{Exponent_vector(size_type n, int i);}
|
||||||
|
% {Creates a vector with \ccc{n} copies of \ccc{i}.
|
||||||
|
% }\ccGlue
|
||||||
|
|
||||||
\ccConstructor{Exponent_vector(size_type n);}
|
%\ccConstructor{Exponent_vector(int e1);}
|
||||||
{Creates a vector with \ccc{n} elements.
|
% {Creates a vector containing the given element.
|
||||||
}\ccGlue
|
% }\ccGlue
|
||||||
\ccConstructor{Exponent_vector(size_type n, int i);}
|
%\ccConstructor{Exponent_vector(int e1, int e2);}
|
||||||
{Creates a vector with \ccc{n} copies of \ccc{i}.
|
% {Creates a vector containing the given elements.
|
||||||
}\ccGlue
|
% }\ccGlue
|
||||||
|
%\ccConstructor{Exponent_vector(int e1, int e2, int e3);}
|
||||||
|
% {Creates a vector containing the given elements.
|
||||||
|
% }\ccGlue
|
||||||
|
%\ccConstructor{Exponent_vector(int e1, int e2, int e3, int e4);}
|
||||||
|
% {Creates a vector containing the given elements.
|
||||||
|
% }\ccGlue
|
||||||
|
|
||||||
\ccConstructor{
|
\ccConstructor{
|
||||||
template < class InputIterator >
|
template < class InputIterator >
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ int main(){
|
||||||
<< lcoeff(F) << std::endl;
|
<< lcoeff(F) << std::endl;
|
||||||
|
|
||||||
PT_2::Get_innermost_coefficient get_icoeff;
|
PT_2::Get_innermost_coefficient get_icoeff;
|
||||||
CGAL:: Exponent_vector ev(2,0); ev[0]=1; ev[1]=4;
|
CGAL:: Exponent_vector ev; ev.push_back(1); ev.push_back(4);
|
||||||
std::cout << "Innermost coefficient of monomial x^1y^4: "
|
std::cout << "Innermost coefficient of monomial x^1y^4: "
|
||||||
<< get_icoeff(F,ev) << std::endl;
|
<< get_icoeff(F,ev) << std::endl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ int main(){
|
||||||
// construction from an iterator range over monomials
|
// construction from an iterator range over monomials
|
||||||
|
|
||||||
std::list<std::pair<CGAL::Exponent_vector, Integer> > innermost_coeffs;
|
std::list<std::pair<CGAL::Exponent_vector, Integer> > innermost_coeffs;
|
||||||
CGAL::Exponent_vector ev(2,0); // = [0,0] sequence
|
CGAL::Exponent_vector ev(std::vector<int>(2,0)); // = [0,0] sequence
|
||||||
innermost_coeffs.push_back(std::make_pair(ev,-2));
|
innermost_coeffs.push_back(std::make_pair(ev,-2));
|
||||||
ev[0]=3;
|
ev[0]=3;
|
||||||
ev[1]=5;
|
ev[1]=5;
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,29 @@ class Exponent_vector :
|
||||||
typedef std::vector<int> Base;
|
typedef std::vector<int> Base;
|
||||||
public:
|
public:
|
||||||
Exponent_vector(): Base(){};
|
Exponent_vector(): Base(){};
|
||||||
Exponent_vector(Base::size_type i): Base(i){};
|
|
||||||
Exponent_vector(Base::size_type i, Base::value_type x): Base(i,x){};
|
// OLD CONSTRUCTORS
|
||||||
Exponent_vector(int i, int x): Base(i,x){};
|
// Exponent_vector(Base::size_type i): Base(i){};
|
||||||
Exponent_vector(const Exponent_vector& x): Base ( x ){};
|
// Exponent_vector(Base::size_type i, Base::value_type x): Base(i,x){};
|
||||||
|
// Exponent_vector(int i, int x): Base(i,x){};
|
||||||
|
// NEW CONSTRUCTORS
|
||||||
|
|
||||||
|
/*
|
||||||
|
Exponent_vector(int e0):Base(1){
|
||||||
|
*this[0]=e0;
|
||||||
|
};
|
||||||
|
Exponent_vector(int e0, int e1):Base(2){
|
||||||
|
*this[0]=e0; *this[1]=e1;
|
||||||
|
};
|
||||||
|
Exponent_vector(int e0, int e1, int e2):Base(3){
|
||||||
|
*this[0]=e0; *this[1]=e1; *this[2]=e2;
|
||||||
|
};
|
||||||
|
Exponent_vector(int e0, int e1, int e2, int e3):Base(4){
|
||||||
|
*this[0]=e0; *this[1]=e1; *this[2]=e2; *this[3]=e3;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
Exponent_vector(const Base& v): Base ( v ){};
|
||||||
|
Exponent_vector(const Exponent_vector& v): Base ( v ){};
|
||||||
|
|
||||||
template <class InputIterator>
|
template <class InputIterator>
|
||||||
Exponent_vector(InputIterator begin , InputIterator end)
|
Exponent_vector(InputIterator begin , InputIterator end)
|
||||||
|
|
|
||||||
|
|
@ -1458,7 +1458,7 @@ struct Construct_coefficient_const_iterator_range
|
||||||
template <class OutputIterator>
|
template <class OutputIterator>
|
||||||
void operator()( const Polynomial_d& p, OutputIterator oit ) const {
|
void operator()( const Polynomial_d& p, OutputIterator oit ) const {
|
||||||
if(CGAL::is_zero(p)){
|
if(CGAL::is_zero(p)){
|
||||||
*oit= make_pair(Exponent_vector(d,0), Innermost_coefficient_type(0));
|
*oit= make_pair(Exponent_vector(std::vector<int>(d,0)), Innermost_coefficient_type(0));
|
||||||
oit++;
|
oit++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,13 @@ int main() {
|
||||||
assert(!(ev1<ev2));
|
assert(!(ev1<ev2));
|
||||||
assert(!(ev1>ev2));
|
assert(!(ev1>ev2));
|
||||||
|
|
||||||
ev1 = CGAL::Exponent_vector(3);
|
ev1.push_back(1);
|
||||||
ev2 = CGAL::Exponent_vector(3);
|
ev1.push_back(0);
|
||||||
|
ev1.push_back(0);
|
||||||
|
|
||||||
ev1[0]=1;
|
ev2.push_back(0);
|
||||||
ev2[1]=1;
|
ev2.push_back(1);
|
||||||
|
ev2.push_back(0);
|
||||||
|
|
||||||
assert(!(ev2 == ev1)) ;
|
assert(!(ev2 == ev1)) ;
|
||||||
assert( (ev2 != ev1)) ;
|
assert( (ev2 != ev1)) ;
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,9 @@ generate_sparse_random_polynomial(int max_degree = 10){
|
||||||
|
|
||||||
Polynomial_d result;
|
Polynomial_d result;
|
||||||
for(int i = 0; i < number_of_coeffs; i++){
|
for(int i = 0; i < number_of_coeffs; i++){
|
||||||
CGAL::Exponent_vector exps(PT::d);
|
CGAL::Exponent_vector exps;
|
||||||
for(int j = 0; j < PT::d; j++){
|
for(int j = 0; j < PT::d; j++){
|
||||||
exps[j]=my_rnd.get_int(0,max_degree);
|
exps.push_back(my_rnd.get_int(0,max_degree));
|
||||||
}
|
}
|
||||||
ICoeff c = ICoeff(my_rnd.get_int(-range,range));
|
ICoeff c = ICoeff(my_rnd.get_int(-range,range));
|
||||||
Monom_rep monom_rep;
|
Monom_rep monom_rep;
|
||||||
|
|
@ -121,9 +121,9 @@ void test_construct_polynomial(const Polynomial_traits_d&){
|
||||||
assert(construct(monom_list.begin(),monom_list.end()) == construct(0));
|
assert(construct(monom_list.begin(),monom_list.end()) == construct(0));
|
||||||
CGAL::Random rnd(7);
|
CGAL::Random rnd(7);
|
||||||
for(int j = 0; j < 2; j++){
|
for(int j = 0; j < 2; j++){
|
||||||
CGAL::Exponent_vector exps(d);
|
CGAL::Exponent_vector exps;
|
||||||
for(int i = 0; i < d; i++){
|
for(int i = 0; i < d; i++){
|
||||||
exps[i]=j+i*5;
|
exps.push_back(j+i*5);
|
||||||
}
|
}
|
||||||
monom_list.push_back(Monom(exps,ICoeff(j+1)));
|
monom_list.push_back(Monom(exps,ICoeff(j+1)));
|
||||||
};
|
};
|
||||||
|
|
@ -1777,7 +1777,7 @@ int main(){
|
||||||
#ifdef CGAL_USE_CORE
|
#ifdef CGAL_USE_CORE
|
||||||
{
|
{
|
||||||
typedef CGAL::CORE_arithmetic_kernel AT;
|
typedef CGAL::CORE_arithmetic_kernel AT;
|
||||||
//test_AT<AT>();
|
test_AT<AT>();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@ generate_sparse_random_polynomial(CGAL::Random random, int max_degree = 6){
|
||||||
|
|
||||||
Polynomial_d result;
|
Polynomial_d result;
|
||||||
for(int i = 0; i < number_of_coeffs; i++){
|
for(int i = 0; i < number_of_coeffs; i++){
|
||||||
CGAL::Exponent_vector exps(PT::d);
|
CGAL::Exponent_vector exps;
|
||||||
for(int j = 0; j < PT::d; j++){
|
for(int j = 0; j < PT::d; j++){
|
||||||
exps[j]=random.get_int(0,max_degree);
|
exps.push_back(random.get_int(0,max_degree));
|
||||||
}
|
}
|
||||||
IC c = IC(random.get_int(-range,range));
|
IC c = IC(random.get_int(-range,range));
|
||||||
Monom_rep monom_rep;
|
Monom_rep monom_rep;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue