realroot_doc 0.1.1
Seq< C, R > Struct Template Reference

Sequence of terms with reference counter. More...

#include <Seq.hpp>

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<class C, class R = std::vector<C>>
struct mmx::Seq< C, R >

Sequence of terms with reference counter.

It allows to use it as output of other functions. The container @ should have the following signatures:

  typename R::size_type;
  typename R::iterator;
  typename R::const_iterator;
  typename R::reverse_iterator;
  typename R::const_reverse_iterator;

        C begin();
        C end();
  
        C rbegin();
        C rend();

        C& operator[] (size_type);
  const C& operator[] (size_type) const;
Examples:

polynomial_mv_sparse_test.cpp, solver_mv_bernstein_binary_test.cpp, solver_mv_fatarcs_test.cpp, solver_mv_monomial_test.cpp, solver_uv_bernstein_binary_test.cpp, solver_uv_inewton_test.cpp, and solver_uv_test.cpp.

Definition at line 58 of file Seq.hpp.


Member Typedef Documentation

typedef R::const_iterator const_iterator

Definition at line 68 of file Seq.hpp.

typedef R::const_reverse_iterator const_reverse_iterator

Definition at line 70 of file Seq.hpp.

typedef R::iterator iterator

Definition at line 67 of file Seq.hpp.

typedef R::reverse_iterator reverse_iterator

Definition at line 69 of file Seq.hpp.

typedef Seq<C,R> self_t

Definition at line 71 of file Seq.hpp.

typedef R::size_type size_type

Definition at line 64 of file Seq.hpp.

typedef C value_t

Definition at line 66 of file Seq.hpp.

typedef C value_type

Definition at line 65 of file Seq.hpp.


Constructor & Destructor Documentation

Seq ( ) [inline]

Definition at line 73 of file Seq.hpp.

: data() {}
Seq ( const R &  r) [inline]

Definition at line 74 of file Seq.hpp.

:data(r){}
Seq ( size_type  s) [inline]

Definition at line 75 of file Seq.hpp.

{rep().resize(s);}
Seq ( size_type  s,
value_type t 
) [inline]

Definition at line 76 of file Seq.hpp.

{rep()=R(t,t+s);}
Seq ( iterator  b,
iterator  e 
) [inline]

Definition at line 77 of file Seq.hpp.

{rep()=R(b,e);}
Seq ( size_type  m,
const char *  str 
)
Seq ( char *  str)

Definition at line 347 of file Seq.hpp.

References mmx::assign(), BLIST, ELIST, Seq< C, R >::push_back(), Seq< C, R >::rep(), mmx::shift(), synaps_input, synaps_inputlim, mmx::synaps_inputptr, yylex(), and yylval.

                      : data()
{
  rep().resize(0);
  synaps_input = s;
  synaps_inputptr = synaps_input;
  synaps_inputlim = s + strlen(s);
  C term;
  bool shift = true;
  int Ask;

  for (;;) {
    Ask = yylex();
    if (shift && Ask == BLIST) {
      shift = false ;
    }
    else if (Ask == ELIST) {
      break;
    }
    else {
      let::assign(term,yylval);
      this->push_back(term);
    }
  }
}
Seq ( const self_t r) [inline]

Definition at line 82 of file Seq.hpp.

: data(r.data) {}
Seq ( const Seq< X, S > &  P) [inline]

Definition at line 84 of file Seq.hpp.

{using namespace let;   assign(*this,P);}
~Seq ( ) [inline]

Definition at line 184 of file Seq.hpp.

{}

Member Function Documentation

const_iterator begin ( ) const [inline]

Definition at line 88 of file Seq.hpp.

{return rep().begin();}
self_t& clear ( ) [inline]

Definition at line 116 of file Seq.hpp.

Referenced by box_rep< C >::max_eval().

                    { rep().clear();
                                        return *this; }
bool empty ( ) const [inline]

Definition at line 164 of file Seq.hpp.

{return (rep().size()==0);}
const_iterator end ( ) const [inline]

Definition at line 89 of file Seq.hpp.

{return rep().end();}
self_t& erase ( size_type  i) [inline]

Definition at line 111 of file Seq.hpp.

Referenced by solver_mv_monomial< FT, POL >::solve_system().

                                { 
    //if (i>size_type(-1) && i< this->size() )
      rep().erase(rep().begin()+i);
    return *this; }
const value_type& front ( ) const [inline]

Definition at line 108 of file Seq.hpp.

{ assert(this->size()>0); return rep()[0];}
C max ( ) [inline]

Definition at line 143 of file Seq.hpp.

           {
    return *std::max_element( this->rep().begin(), this->rep().end());
  }
C max ( Compare  comp) [inline]

Definition at line 158 of file Seq.hpp.

                       {
   return *std::max_element( this->rep().begin(), this->rep().end(),comp);
  }
bool member ( const C &  x) [inline]

Definition at line 128 of file Seq.hpp.

                           {
                        for (size_type i=0;i< this->size();++i)
                                        if ( this->rep()[i]== x) 
                                                        return true;
      return false;
                        }
C min ( ) [inline]

Definition at line 139 of file Seq.hpp.

          {
    return *std::min_element( this->rep().begin(), this->rep().end());
  }
C min ( Compare  comp) [inline]

Definition at line 153 of file Seq.hpp.

                      {
  return *std::min_element( this->rep().begin(), this->rep().end(),comp);
  }
self_t operator, ( const self_t x) const

Concatenate two sequences.

Seq< C, R > operator, ( const C &  x) const

Concatenate an element at the end of the sequence.

Definition at line 222 of file Seq.hpp.

References Seq< C, R >::push_back(), and Seq< C, R >::rep().

{
  self_t r(rep());
  r.push_back(x);
  return r;
}
self_t operator<< ( const self_t s) [inline]

Definition at line 177 of file Seq.hpp.

  {
    for(const_iterator it=s.begin(); it!=s.end();++it) 
      this->push_back(*it);
    return *this;
  }
self_t& operator= ( const self_t V) [inline]

Definition at line 97 of file Seq.hpp.

{data=V.data; return *this;}
self_t& operator= ( const Seq< X, S > &  V) [inline]

Definition at line 99 of file Seq.hpp.

                                           {
      using namespace let;
     assign(*this,V); 
      return *this;}
value_type& operator[] ( size_type  i) [inline]

Definition at line 105 of file Seq.hpp.

{return rep()[i];}
const value_type& operator[] ( size_type  i) const [inline]

Definition at line 106 of file Seq.hpp.

{return rep()[i];}
self_t& push_back ( const C &  x) [inline]
const_reverse_iterator rbegin ( ) const [inline]

Definition at line 92 of file Seq.hpp.

{return rep().rbegin();}
reverse_iterator rbegin ( ) [inline]

Definition at line 90 of file Seq.hpp.

{return rep().rbegin();}
reverse_iterator rend ( ) [inline]

Definition at line 91 of file Seq.hpp.

{return rep().rend();}
const_reverse_iterator rend ( ) const [inline]

Definition at line 93 of file Seq.hpp.

{return rep().rbegin();}
const R& rep ( ) const [inline]

Definition at line 62 of file Seq.hpp.

{return (*data);}
void resize ( size_type  i) [inline]

Definition at line 165 of file Seq.hpp.

Referenced by mmx::CF_solve(), subresultant< PREM >::sequence(), and box_rep< POL >::subdiv_center().

{ rep().resize(i); }
void reverse ( ) [inline]

Reverse list.

Definition at line 168 of file Seq.hpp.

Referenced by Seq< Interval< C > >::reverse(), and Seq< Interval< C > >::reversed().

{ std::reverse (rep().begin( ), rep().end( ) );  }
self_t reversed ( ) const [inline]

Definition at line 169 of file Seq.hpp.

{ self_t s(*this); s.reverse(); return s; }
size_type search ( const C &  x) [inline]

Definition at line 119 of file Seq.hpp.

                                {
                        for (size_type i=0;i< this->size();++i) {
                                        if ( this->rep()[i]== x) 
                                                        return i;
                        }
      //std::cout<<"Seq: "<<x<<" not found"<<std::endl;
                        return (size_type(-1) );  
  }
size_type size ( void  ) const [inline]

Definition at line 162 of file Seq.hpp.

Referenced by solver_cffirst< Real, POL >::all_roots_isolate(), solver_cffirst< Real, POL >::all_roots_separate(), solver_mv_monomial< FT, POL >::approximate(), solver_mv_fatarcs< C >::box_gen(), cell_mv_bernstein< C >::cell_mv_bernstein(), mmx::CF_solve(), solver_mv_monomial< FT, POL >::check_root(), mmx::sparse::coefficients(), homography_mv< C >::colapse(), box_rep< POL >::contract_box(), domain< coeff_t >::delta(), Seq< Interval< C > >::empty(), box_rep< POL >::eval(), mmx::realroot::eval_poly_matrix(), extpts(), Seq< Interval< C > >::front(), mmx::hash(), box_rep< POL >::is_root(), subresultant< PREM >::is_zero_seq(), solver_mv_monomial< FT, POL >::isolate(), mmx::realroot::jacobian(), box_rep< POL >::l_bound(), Seq< Interval< C > >::member(), cell_mv_bernstein< C >::nbeq(), box_rep< POL >::nbpol(), cell_mv_bernstein< C >::nbvar(), arc_rep< C >::offset(), box_rep< POL >::point(), mmx::polynomial_bernstein_coefficients(), mmx::polynomial_dual_coefficients(), mmx::polynomial_sparse_coefficients(), mmx::polynomial_sturm_sequence(), mmx::polynomial_tensor_coefficients(), mmx::realroot::precondition(), box_rep< POL >::restrict(), subresultant< PREM >::resultant(), box_rep< POL >::reverse_and_shift_box(), box_rep< POL >::reverse_box(), Seq< Interval< C > >::search(), seq2b(), subresultant< PREM >::sequence(), box_rep< POL >::shift_box(), mmx::realroot::signof(), homography_mv< C >::size(), cell_mv_bernstein< C >::size(), continued_fraction_subdivision< K >::solve(), solver_mv_monomial< FT, POL >::solve_system(), subresultant< PREM >::subres_gcd(), mmx::realroot::topological_degree_2d(), box_rep< POL >::update_data(), box_rep< POL >::volume(), and box_rep< POL >::width().

{return rep().size();}
void sort ( Compare  comp) [inline]

Definition at line 148 of file Seq.hpp.

                          {
   std::sort( this->rep().begin(), this->rep().end(),comp);
  }
void sort ( ) [inline]

Definition at line 135 of file Seq.hpp.

Referenced by Seq< Interval< C > >::sort().

                {
        std::sort( this->rep().begin(), this->rep().end() );
    }

Member Data Documentation

Definition at line 60 of file Seq.hpp.

Referenced by Seq< Interval< C > >::operator=(), and Seq< Interval< C > >::rep().


The documentation for this struct was generated from the following file: