37 #ifndef GMM_REAL_PART_H 38 #define GMM_REAL_PART_H 45 struct linalg_real_part {};
46 struct linalg_imag_part {};
47 template <
typename R,
typename PART>
struct which_part {};
49 template <
typename C>
typename number_traits<C>::magnitude_type
50 real_or_imag_part(C x, linalg_real_part) {
return gmm::real(x); }
51 template <
typename C>
typename number_traits<C>::magnitude_type
52 real_or_imag_part(C x, linalg_imag_part) {
return gmm::imag(x); }
53 template <
typename T,
typename C,
typename OP> C
54 complex_from(T x, C y, OP op, linalg_real_part) {
return std::complex<T>(op(std::real(y), x), std::imag(y)); }
55 template <
typename T,
typename C,
typename OP> C
56 complex_from(T x, C y, OP op,linalg_imag_part) {
return std::complex<T>(std::real(y), op(std::imag(y), x)); }
58 template<
typename T>
struct project2nd {
59 T operator()(T , T b)
const {
return b; }
62 template<
typename T,
typename R,
typename PART>
class ref_elt_vector<T, which_part<R, PART> > {
68 operator T()
const {
return real_or_imag_part(std::complex<T>(r), PART()); }
69 ref_elt_vector(R r_) : r(r_) {}
70 inline ref_elt_vector &operator =(T v)
71 { r = complex_from(v, std::complex<T>(r), gmm::project2nd<T>(), PART());
return *
this; }
72 inline bool operator ==(T v)
const {
return (r == v); }
73 inline bool operator !=(T v)
const {
return (r != v); }
74 inline ref_elt_vector &operator +=(T v)
75 { r = complex_from(v, std::complex<T>(r), std::plus<T>(), PART());
return *
this; }
76 inline ref_elt_vector &operator -=(T v)
77 { r = complex_from(v, std::complex<T>(r), std::minus<T>(), PART());
return *
this; }
78 inline ref_elt_vector &operator /=(T v)
79 { r = complex_from(v, std::complex<T>(r), std::divides<T>(), PART());
return *
this; }
80 inline ref_elt_vector &operator *=(T v)
81 { r = complex_from(v, std::complex<T>(r), std::multiplies<T>(), PART());
return *
this; }
82 inline ref_elt_vector &operator =(
const ref_elt_vector &re)
83 { *
this = T(re);
return *
this; }
88 T operator *(T v) {
return T(*
this)* v; }
89 T operator /(T v) {
return T(*
this)/ v; }
92 template<
typename reference>
struct ref_or_value_type {
93 template <
typename T,
typename W>
94 static W r(
const T &x, linalg_real_part, W) {
97 template <
typename T,
typename W>
98 static W r(
const T &x, linalg_imag_part, W) {
103 template<
typename U,
typename R,
typename PART>
104 struct ref_or_value_type<ref_elt_vector<U, which_part<R, PART> > > {
105 template<
typename T ,
typename W>
106 static const T &r(
const T &x, linalg_real_part, W)
108 template<
typename T,
typename W>
109 static const T &r(
const T &x, linalg_imag_part, W) {
112 template<
typename T ,
typename W>
113 static T &r(T &x, linalg_real_part, W)
115 template<
typename T,
typename W>
116 static T &r(T &x, linalg_imag_part, W) {
126 template <
typename IT,
typename MIT,
typename PART>
127 struct part_vector_iterator {
128 typedef typename std::iterator_traits<IT>::value_type vtype;
129 typedef typename gmm::number_traits<vtype>::magnitude_type value_type;
130 typedef value_type *pointer;
131 typedef ref_elt_vector<value_type, which_part<typename std::iterator_traits<IT>::reference, PART> > reference;
132 typedef typename std::iterator_traits<IT>::difference_type difference_type;
133 typedef typename std::iterator_traits<IT>::iterator_category
138 part_vector_iterator(
void) {}
139 explicit part_vector_iterator(
const IT &i) : it(i) {}
140 part_vector_iterator(
const part_vector_iterator<MIT, MIT, PART> &i) : it(i.it) {}
143 size_type index(
void)
const {
return it.index(); }
144 part_vector_iterator operator ++(
int)
145 { part_vector_iterator tmp = *
this; ++it;
return tmp; }
146 part_vector_iterator operator --(
int)
147 { part_vector_iterator tmp = *
this; --it;
return tmp; }
148 part_vector_iterator &operator ++() { ++it;
return *
this; }
149 part_vector_iterator &operator --() { --it;
return *
this; }
150 part_vector_iterator &operator +=(difference_type i)
151 { it += i;
return *
this; }
152 part_vector_iterator &operator -=(difference_type i)
153 { it -= i;
return *
this; }
154 part_vector_iterator
operator +(difference_type i)
const 155 { part_vector_iterator itb = *
this;
return (itb += i); }
156 part_vector_iterator
operator -(difference_type i)
const 157 { part_vector_iterator itb = *
this;
return (itb -= i); }
158 difference_type
operator -(
const part_vector_iterator &i)
const 159 {
return difference_type(it - i.it); }
161 reference operator *()
const {
return reference(*it); }
162 reference operator [](
size_type ii)
const {
return reference(it[ii]); }
164 bool operator ==(
const part_vector_iterator &i)
const 165 {
return (i.it == it); }
166 bool operator !=(
const part_vector_iterator &i)
const 167 {
return (i.it != it); }
168 bool operator < (
const part_vector_iterator &i)
const 169 {
return (it < i.it); }
173 template <
typename PT,
typename PART>
struct part_vector {
174 typedef part_vector<PT, PART> this_type;
175 typedef typename std::iterator_traits<PT>::value_type V;
177 typedef typename select_ref<typename linalg_traits<V>::const_iterator,
178 typename linalg_traits<V>::iterator, PT>::ref_type iterator;
179 typedef typename linalg_traits<this_type>::reference reference;
180 typedef typename linalg_traits<this_type>::value_type value_type;
181 typedef typename linalg_traits<this_type>::porigin_type porigin_type;
183 iterator begin_, end_;
187 size_type size(
void)
const {
return size_; }
189 reference operator[](
size_type i)
const {
190 return reference(ref_or_value_type<reference>::r(
191 linalg_traits<V>::access(origin, begin_, end_, i),
192 PART(), value_type()));
196 : begin_(vect_begin(v)), end_(vect_end(v)),
197 origin(linalg_origin(v)), size_(
gmm::vect_size(v)) {}
198 part_vector(
const V &v)
199 : begin_(vect_begin(const_cast<V &>(v))),
200 end_(vect_end(const_cast<V &>(v))),
201 origin(linalg_origin(const_cast<V &>(v))), size_(
gmm::vect_size(v)) {}
203 part_vector(
const part_vector<CPT, PART> &cr)
204 : begin_(cr.begin_),end_(cr.end_),origin(cr.origin), size_(cr.size_) {}
207 template <
typename IT,
typename MIT,
typename ORG,
typename PT,
208 typename PART>
inline 209 void set_to_begin(part_vector_iterator<IT, MIT, PART> &it,
210 ORG o, part_vector<PT, PART> *, linalg_modifiable) {
211 typedef part_vector<PT, PART> VECT;
212 typedef typename linalg_traits<VECT>::V_reference ref_t;
213 set_to_begin(it.it, o,
typename linalg_traits<VECT>::pV(), ref_t());
215 template <
typename IT,
typename MIT,
typename ORG,
typename PT,
216 typename PART>
inline 217 void set_to_begin(part_vector_iterator<IT, MIT, PART> &it,
218 ORG o,
const part_vector<PT, PART> *, linalg_modifiable) {
219 typedef part_vector<PT, PART> VECT;
220 typedef typename linalg_traits<VECT>::V_reference ref_t;
221 set_to_begin(it.it, o,
typename linalg_traits<VECT>::pV(), ref_t());
223 template <
typename IT,
typename MIT,
typename ORG,
typename PT,
224 typename PART>
inline 225 void set_to_end(part_vector_iterator<IT, MIT, PART> &it,
226 ORG o, part_vector<PT, PART> *, linalg_modifiable) {
227 typedef part_vector<PT, PART> VECT;
228 typedef typename linalg_traits<VECT>::V_reference ref_t;
229 set_to_end(it.it, o,
typename linalg_traits<VECT>::pV(), ref_t());
231 template <
typename IT,
typename MIT,
typename ORG,
232 typename PT,
typename PART>
inline 233 void set_to_end(part_vector_iterator<IT, MIT, PART> &it,
234 ORG o,
const part_vector<PT, PART> *,
236 typedef part_vector<PT, PART> VECT;
237 typedef typename linalg_traits<VECT>::V_reference ref_t;
238 set_to_end(it.it, o,
typename linalg_traits<VECT>::pV(), ref_t());
241 template <
typename PT,
typename PART> std::ostream &
operator <<
242 (std::ostream &o,
const part_vector<PT, PART>& m)
243 { gmm::write(o,m);
return o; }
251 template <
typename PT,
typename PART>
struct part_row_ref {
253 typedef part_row_ref<PT, PART> this_type;
254 typedef typename std::iterator_traits<PT>::value_type M;
256 typedef typename std::iterator_traits<PT>::reference ref_M;
257 typedef typename select_ref<typename linalg_traits<this_type>
258 ::const_row_iterator,
typename linalg_traits<this_type>
259 ::row_iterator, PT>::ref_type iterator;
260 typedef typename linalg_traits<this_type>::value_type value_type;
261 typedef typename linalg_traits<this_type>::reference reference;
262 typedef typename linalg_traits<this_type>::porigin_type porigin_type;
264 iterator begin_, end_;
268 part_row_ref(ref_M m)
269 : begin_(mat_row_begin(m)), end_(mat_row_end(m)),
270 origin(linalg_origin(m)), nr(mat_nrows(m)), nc(mat_ncols(m)) {}
272 part_row_ref(
const part_row_ref<CPT, PART> &cr) :
273 begin_(cr.begin_),end_(cr.end_), origin(cr.origin),nr(cr.nr),nc(cr.nc) {}
276 return reference(ref_or_value_type<reference>::r(
277 linalg_traits<M>::access(begin_+i, j),
278 PART(), value_type()));
282 template<
typename PT,
typename PART> std::ostream &
operator <<
283 (std::ostream &o,
const part_row_ref<PT, PART>& m)
284 { gmm::write(o,m);
return o; }
286 template <
typename PT,
typename PART>
struct part_col_ref {
288 typedef part_col_ref<PT, PART> this_type;
289 typedef typename std::iterator_traits<PT>::value_type M;
291 typedef typename std::iterator_traits<PT>::reference ref_M;
292 typedef typename select_ref<typename linalg_traits<this_type>
293 ::const_col_iterator,
typename linalg_traits<this_type>
294 ::col_iterator, PT>::ref_type iterator;
295 typedef typename linalg_traits<this_type>::value_type value_type;
296 typedef typename linalg_traits<this_type>::reference reference;
297 typedef typename linalg_traits<this_type>::porigin_type porigin_type;
299 iterator begin_, end_;
303 part_col_ref(ref_M m)
304 : begin_(mat_col_begin(m)), end_(mat_col_end(m)),
305 origin(linalg_origin(m)), nr(mat_nrows(m)), nc(mat_ncols(m)) {}
307 part_col_ref(
const part_col_ref<CPT, PART> &cr) :
308 begin_(cr.begin_),end_(cr.end_), origin(cr.origin),nr(cr.nr),nc(cr.nc) {}
311 return reference(ref_or_value_type<reference>::r(
312 linalg_traits<M>::access(begin_+j, i),
313 PART(), value_type()));
319 template<
typename PT,
typename PART> std::ostream &
operator <<
320 (std::ostream &o,
const part_col_ref<PT, PART>& m)
321 { gmm::write(o,m);
return o; }
328 template <
typename TYPE,
typename PART,
typename PT>
329 struct part_return_ {
330 typedef abstract_null_type return_type;
332 template <
typename PT,
typename PART>
333 struct part_return_<row_major, PART, PT> {
334 typedef typename std::iterator_traits<PT>::value_type L;
335 typedef typename select_return<part_row_ref<const L *, PART>,
336 part_row_ref< L *, PART>, PT>::return_type return_type;
338 template <
typename PT,
typename PART>
339 struct part_return_<col_major, PART, PT> {
340 typedef typename std::iterator_traits<PT>::value_type L;
341 typedef typename select_return<part_col_ref<const L *, PART>,
342 part_col_ref<L *, PART>, PT>::return_type return_type;
345 template <
typename PT,
typename PART,
typename LT>
struct part_return__{
346 typedef abstract_null_type return_type;
349 template <
typename PT,
typename PART>
350 struct part_return__<PT, PART, abstract_matrix> {
351 typedef typename std::iterator_traits<PT>::value_type L;
352 typedef typename part_return_<
typename principal_orientation_type<
353 typename linalg_traits<L>::sub_orientation>::potype, PART,
354 PT>::return_type return_type;
357 template <
typename PT,
typename PART>
358 struct part_return__<PT, PART, abstract_vector> {
359 typedef typename std::iterator_traits<PT>::value_type L;
360 typedef typename select_return<part_vector<const L *, PART>,
361 part_vector<L *, PART>, PT>::return_type return_type;
364 template <
typename PT,
typename PART>
struct part_return {
365 typedef typename std::iterator_traits<PT>::value_type L;
366 typedef typename part_return__<PT, PART,
367 typename linalg_traits<L>::linalg_type>::return_type return_type;
370 template <
typename L>
inline 371 typename part_return<const L *, linalg_real_part>::return_type
372 real_part(
const L &l) {
373 return typename part_return<const L *, linalg_real_part>::return_type
374 (linalg_cast(const_cast<L &>(l)));
377 template <
typename L>
inline 378 typename part_return<L *, linalg_real_part>::return_type
380 return typename part_return<L *, linalg_real_part>::return_type(linalg_cast(l));
383 template <
typename L>
inline 384 typename part_return<const L *, linalg_imag_part>::return_type
385 imag_part(
const L &l) {
386 return typename part_return<const L *, linalg_imag_part>::return_type
387 (linalg_cast(const_cast<L &>(l)));
390 template <
typename L>
inline 391 typename part_return<L *, linalg_imag_part>::return_type
393 return typename part_return<L *, linalg_imag_part>::return_type(linalg_cast(l));
397 template <
typename PT,
typename PART>
398 struct linalg_traits<part_vector<PT, PART> > {
399 typedef part_vector<PT, PART> this_type;
400 typedef this_type * pthis_type;
402 typedef typename std::iterator_traits<PT>::value_type V;
403 typedef typename linalg_traits<V>::index_sorted index_sorted;
404 typedef typename linalg_traits<V>::is_reference V_reference;
405 typedef typename linalg_traits<V>::origin_type origin_type;
406 typedef typename select_ref<
const origin_type *, origin_type *,
407 PT>::ref_type porigin_type;
408 typedef typename which_reference<PT>::is_reference is_reference;
409 typedef abstract_vector linalg_type;
410 typedef typename linalg_traits<V>::value_type vtype;
411 typedef typename number_traits<vtype>::magnitude_type value_type;
412 typedef typename select_ref<value_type, ref_elt_vector<value_type,
413 which_part<typename linalg_traits<V>::reference,
414 PART> >, PT>::ref_type reference;
415 typedef typename select_ref<typename linalg_traits<V>::const_iterator,
416 typename linalg_traits<V>::iterator, PT>::ref_type pre_iterator;
417 typedef typename select_ref<abstract_null_type,
418 part_vector_iterator<pre_iterator, pre_iterator, PART>,
419 PT>::ref_type iterator;
420 typedef part_vector_iterator<typename linalg_traits<V>::const_iterator,
421 pre_iterator, PART> const_iterator;
422 typedef typename linalg_traits<V>::storage_type storage_type;
423 static size_type size(
const this_type &v) {
return v.size(); }
424 static iterator begin(this_type &v) {
425 iterator it; it.it = v.begin_;
426 if (!is_const_reference(is_reference()) && is_sparse(storage_type()))
427 set_to_begin(it, v.origin, pthis_type(), is_reference());
430 static const_iterator begin(
const this_type &v) {
431 const_iterator it(v.begin_);
432 if (!is_const_reference(is_reference()) && is_sparse(storage_type()))
433 { set_to_begin(it, v.origin, pthis_type(), is_reference()); }
436 static iterator end(this_type &v) {
438 if (!is_const_reference(is_reference()) && is_sparse(storage_type()))
439 set_to_end(it, v.origin, pthis_type(), is_reference());
442 static const_iterator end(
const this_type &v) {
443 const_iterator it(v.end_);
444 if (!is_const_reference(is_reference()) && is_sparse(storage_type()))
445 set_to_end(it, v.origin, pthis_type(), is_reference());
448 static origin_type* origin(this_type &v) {
return v.origin; }
449 static const origin_type* origin(
const this_type &v) {
return v.origin; }
451 static void clear(origin_type* o,
const iterator &begin_,
452 const iterator &end_, abstract_sparse) {
453 std::deque<size_type> ind;
454 iterator it = begin_;
455 for (; it != end_; ++it) ind.push_front(it.index());
456 for (; !(ind.empty()); ind.pop_back())
457 access(o, begin_, end_, ind.back()) = value_type(0);
459 static void clear(origin_type* o,
const iterator &begin_,
460 const iterator &end_, abstract_skyline) {
461 clear(o, begin_, end_, abstract_sparse());
463 static void clear(origin_type* o,
const iterator &begin_,
464 const iterator &end_, abstract_dense) {
465 for (iterator it = begin_; it != end_; ++it) *it = value_type(0);
468 static void clear(origin_type* o,
const iterator &begin_,
469 const iterator &end_)
470 {
clear(o, begin_, end_, storage_type()); }
471 static void do_clear(this_type &v) {
clear(v.origin, begin(v), end(v)); }
472 static value_type access(
const origin_type *o,
const const_iterator &it,
473 const const_iterator &ite,
size_type i) {
474 return real_or_imag_part(linalg_traits<V>::access(o, it.it, ite.it,i),
477 static reference access(origin_type *o,
const iterator &it,
479 {
return reference(linalg_traits<V>::access(o, it.it, ite.it,i)); }
482 template <
typename PT,
typename PART>
483 struct linalg_traits<part_row_ref<PT, PART> > {
484 typedef part_row_ref<PT, PART> this_type;
485 typedef typename std::iterator_traits<PT>::value_type M;
486 typedef typename linalg_traits<M>::origin_type origin_type;
487 typedef typename select_ref<
const origin_type *, origin_type *,
488 PT>::ref_type porigin_type;
489 typedef typename which_reference<PT>::is_reference is_reference;
490 typedef abstract_matrix linalg_type;
491 typedef typename linalg_traits<M>::value_type vtype;
492 typedef typename number_traits<vtype>::magnitude_type value_type;
493 typedef typename linalg_traits<M>::storage_type storage_type;
494 typedef abstract_null_type sub_col_type;
495 typedef abstract_null_type const_sub_col_type;
496 typedef abstract_null_type col_iterator;
497 typedef abstract_null_type const_col_iterator;
498 typedef typename org_type<typename linalg_traits<M>::const_sub_row_type>::t
499 pre_const_sub_row_type;
500 typedef typename org_type<typename linalg_traits<M>::sub_row_type>::t pre_sub_row_type;
501 typedef part_vector<const pre_const_sub_row_type *, PART>
503 typedef typename select_ref<abstract_null_type,
504 part_vector<pre_sub_row_type *, PART>, PT>::ref_type sub_row_type;
505 typedef typename linalg_traits<M>::const_row_iterator const_row_iterator;
506 typedef typename select_ref<abstract_null_type,
typename 507 linalg_traits<M>::row_iterator, PT>::ref_type row_iterator;
508 typedef typename select_ref<
509 typename linalg_traits<const_sub_row_type>::reference,
510 typename linalg_traits<sub_row_type>::reference,
511 PT>::ref_type reference;
512 typedef row_major sub_orientation;
513 typedef typename linalg_traits<M>::index_sorted index_sorted;
514 static size_type ncols(
const this_type &v) {
return v.nc; }
515 static size_type nrows(
const this_type &v) {
return v.nr; }
516 static const_sub_row_type row(
const const_row_iterator &it)
517 {
return const_sub_row_type(linalg_traits<M>::row(it)); }
518 static sub_row_type row(
const row_iterator &it)
519 {
return sub_row_type(linalg_traits<M>::row(it)); }
520 static row_iterator row_begin(this_type &m) {
return m.begin_; }
521 static row_iterator row_end(this_type &m) {
return m.end_; }
522 static const_row_iterator row_begin(
const this_type &m)
524 static const_row_iterator row_end(
const this_type &m) {
return m.end_; }
525 static origin_type* origin(this_type &v) {
return v.origin; }
526 static const origin_type* origin(
const this_type &v) {
return v.origin; }
527 static void do_clear(this_type &v);
528 static value_type access(
const const_row_iterator &itrow,
size_type i)
529 {
return real_or_imag_part(linalg_traits<M>::access(itrow, i), PART()); }
530 static reference access(
const row_iterator &itrow,
size_type i) {
531 return reference(ref_or_value_type<reference>::r(
532 linalg_traits<M>::access(itrow, i),
533 PART(), value_type()));
537 template <
typename PT,
typename PART>
538 struct linalg_traits<part_col_ref<PT, PART> > {
539 typedef part_col_ref<PT, PART> this_type;
540 typedef typename std::iterator_traits<PT>::value_type M;
541 typedef typename linalg_traits<M>::origin_type origin_type;
542 typedef typename select_ref<
const origin_type *, origin_type *,
543 PT>::ref_type porigin_type;
544 typedef typename which_reference<PT>::is_reference is_reference;
545 typedef abstract_matrix linalg_type;
546 typedef typename linalg_traits<M>::value_type vtype;
547 typedef typename number_traits<vtype>::magnitude_type value_type;
548 typedef typename linalg_traits<M>::storage_type storage_type;
549 typedef abstract_null_type sub_row_type;
550 typedef abstract_null_type const_sub_row_type;
551 typedef abstract_null_type row_iterator;
552 typedef abstract_null_type const_row_iterator;
553 typedef typename org_type<typename linalg_traits<M>::const_sub_col_type>::t
554 pre_const_sub_col_type;
555 typedef typename org_type<typename linalg_traits<M>::sub_col_type>::t pre_sub_col_type;
556 typedef part_vector<const pre_const_sub_col_type *, PART>
558 typedef typename select_ref<abstract_null_type,
559 part_vector<pre_sub_col_type *, PART>, PT>::ref_type sub_col_type;
560 typedef typename linalg_traits<M>::const_col_iterator const_col_iterator;
561 typedef typename select_ref<abstract_null_type,
typename 562 linalg_traits<M>::col_iterator, PT>::ref_type col_iterator;
563 typedef typename select_ref<
564 typename linalg_traits<const_sub_col_type>::reference,
565 typename linalg_traits<sub_col_type>::reference,
566 PT>::ref_type reference;
567 typedef col_major sub_orientation;
568 typedef typename linalg_traits<M>::index_sorted index_sorted;
569 static size_type nrows(
const this_type &v) {
return v.nr; }
570 static size_type ncols(
const this_type &v) {
return v.nc; }
571 static const_sub_col_type col(
const const_col_iterator &it)
572 {
return const_sub_col_type(linalg_traits<M>::col(it)); }
573 static sub_col_type col(
const col_iterator &it)
574 {
return sub_col_type(linalg_traits<M>::col(it)); }
575 static col_iterator col_begin(this_type &m) {
return m.begin_; }
576 static col_iterator col_end(this_type &m) {
return m.end_; }
577 static const_col_iterator col_begin(
const this_type &m)
579 static const_col_iterator col_end(
const this_type &m) {
return m.end_; }
580 static origin_type* origin(this_type &v) {
return v.origin; }
581 static const origin_type* origin(
const this_type &v) {
return v.origin; }
582 static void do_clear(this_type &v);
583 static value_type access(
const const_col_iterator &itcol,
size_type i)
584 {
return real_or_imag_part(linalg_traits<M>::access(itcol, i), PART()); }
585 static reference access(
const col_iterator &itcol,
size_type i) {
586 return reference(ref_or_value_type<reference>::r(
587 linalg_traits<M>::access(itcol, i),
588 PART(), value_type()));
592 template <
typename PT,
typename PART>
593 void linalg_traits<part_col_ref<PT, PART> >::do_clear(this_type &v) {
594 col_iterator it = mat_col_begin(v), ite = mat_col_end(v);
595 for (; it != ite; ++it)
clear(col(it));
598 template <
typename PT,
typename PART>
599 void linalg_traits<part_row_ref<PT, PART> >::do_clear(this_type &v) {
600 row_iterator it = mat_row_begin(v), ite = mat_row_end(v);
601 for (; it != ite; ++it)
clear(row(it));
605 #endif // GMM_REAL_PART_H rational_fraction< T > operator+(const polynomial< T > &P, const rational_fraction< T > &Q)
Add Q to P.
rational_fraction< T > operator-(const polynomial< T > &P, const rational_fraction< T > &Q)
Subtract Q from P.
size_t size_type
used as the common size type in the library
Declaration of the vector types (gmm::rsvector, gmm::wsvector, gmm::slvector ,..) ...
void clear(L &l)
clear (fill with zeros) a vector or matrix.
Basic definitions and tools of GMM.