36 #ifndef GMM_REAL_PART_H
37 #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)
142 part_vector_iterator &
operator =
143 (
const part_vector_iterator<MIT, MIT, PART> &i) { it = i.it;
return *
this; }
145 size_type index(
void)
const {
return it.index(); }
146 part_vector_iterator operator ++(
int)
147 { part_vector_iterator tmp = *
this; ++it;
return tmp; }
148 part_vector_iterator operator --(
int)
149 { part_vector_iterator tmp = *
this; --it;
return tmp; }
150 part_vector_iterator &operator ++() { ++it;
return *
this; }
151 part_vector_iterator &operator --() { --it;
return *
this; }
152 part_vector_iterator &operator +=(difference_type i)
153 { it += i;
return *
this; }
154 part_vector_iterator &operator -=(difference_type i)
155 { it -= i;
return *
this; }
156 part_vector_iterator
operator +(difference_type i)
const
157 { part_vector_iterator itb = *
this;
return (itb += i); }
158 part_vector_iterator
operator -(difference_type i)
const
159 { part_vector_iterator itb = *
this;
return (itb -= i); }
160 difference_type
operator -(
const part_vector_iterator &i)
const
161 {
return difference_type(it - i.it); }
163 reference operator *()
const {
return reference(*it); }
164 reference operator [](
size_type ii)
const {
return reference(it[ii]); }
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 (i.it != it); }
170 bool operator < (
const part_vector_iterator &i)
const
171 {
return (it < i.it); }
172 bool operator > (
const part_vector_iterator &i)
const
173 {
return (it > i.it); }
174 bool operator >=(
const part_vector_iterator &i)
const
175 {
return (it >= i.it); }
179 template <
typename PT,
typename PART>
struct part_vector {
180 typedef part_vector<PT, PART> this_type;
181 typedef typename std::iterator_traits<PT>::value_type V;
183 typedef typename select_ref<typename linalg_traits<V>::const_iterator,
184 typename linalg_traits<V>::iterator, PT>::ref_type iterator;
185 typedef typename linalg_traits<this_type>::reference reference;
186 typedef typename linalg_traits<this_type>::value_type value_type;
187 typedef typename linalg_traits<this_type>::porigin_type porigin_type;
189 iterator begin_, end_;
193 size_type size(
void)
const {
return size_; }
195 reference operator[](
size_type i)
const {
196 return reference(ref_or_value_type<reference>::r(
197 linalg_traits<V>::access(origin, begin_, end_, i),
198 PART(), value_type()));
202 : begin_(vect_begin(v)), end_(vect_end(v)),
203 origin(linalg_origin(v)), size_(gmm::vect_size(v)) {}
204 part_vector(
const V &v)
205 : begin_(vect_begin(const_cast<V &>(v))),
206 end_(vect_end(const_cast<V &>(v))),
207 origin(linalg_origin(const_cast<V &>(v))), size_(gmm::vect_size(v)) {}
209 part_vector(
const part_vector<CPT, PART> &cr)
210 : begin_(cr.begin_),end_(cr.end_),origin(cr.origin), size_(cr.size_) {}
213 template <
typename IT,
typename MIT,
typename ORG,
typename PT,
214 typename PART>
inline
215 void set_to_begin(part_vector_iterator<IT, MIT, PART> &it,
216 ORG o, part_vector<PT, PART> *, linalg_modifiable) {
217 typedef part_vector<PT, PART> VECT;
218 typedef typename linalg_traits<VECT>::V_reference ref_t;
219 set_to_begin(it.it, o,
typename linalg_traits<VECT>::pV(), ref_t());
221 template <
typename IT,
typename MIT,
typename ORG,
typename PT,
222 typename PART>
inline
223 void set_to_begin(part_vector_iterator<IT, MIT, PART> &it,
224 ORG o,
const part_vector<PT, PART> *, linalg_modifiable) {
225 typedef part_vector<PT, PART> VECT;
226 typedef typename linalg_traits<VECT>::V_reference ref_t;
227 set_to_begin(it.it, o,
typename linalg_traits<VECT>::pV(), ref_t());
229 template <
typename IT,
typename MIT,
typename ORG,
typename PT,
230 typename PART>
inline
231 void set_to_end(part_vector_iterator<IT, MIT, PART> &it,
232 ORG o, part_vector<PT, PART> *, linalg_modifiable) {
233 typedef part_vector<PT, PART> VECT;
234 typedef typename linalg_traits<VECT>::V_reference ref_t;
235 set_to_end(it.it, o,
typename linalg_traits<VECT>::pV(), ref_t());
237 template <
typename IT,
typename MIT,
typename ORG,
238 typename PT,
typename PART>
inline
239 void set_to_end(part_vector_iterator<IT, MIT, PART> &it,
240 ORG o,
const part_vector<PT, PART> *,
242 typedef part_vector<PT, PART> VECT;
243 typedef typename linalg_traits<VECT>::V_reference ref_t;
244 set_to_end(it.it, o,
typename linalg_traits<VECT>::pV(), ref_t());
247 template <
typename PT,
typename PART> std::ostream &
operator <<
248 (std::ostream &o,
const part_vector<PT, PART>& m)
249 { gmm::write(o,m);
return o; }
257 template <
typename PT,
typename PART>
struct part_row_ref {
259 typedef part_row_ref<PT, PART> this_type;
260 typedef typename std::iterator_traits<PT>::value_type M;
262 typedef typename std::iterator_traits<PT>::reference ref_M;
263 typedef typename select_ref<typename linalg_traits<this_type>
264 ::const_row_iterator,
typename linalg_traits<this_type>
265 ::row_iterator, PT>::ref_type iterator;
266 typedef typename linalg_traits<this_type>::value_type value_type;
267 typedef typename linalg_traits<this_type>::reference reference;
268 typedef typename linalg_traits<this_type>::porigin_type porigin_type;
270 iterator begin_, end_;
274 part_row_ref(ref_M m)
275 : begin_(mat_row_begin(m)), end_(mat_row_end(m)),
276 origin(linalg_origin(m)), nr(mat_nrows(m)), nc(mat_ncols(m)) {}
278 part_row_ref(
const part_row_ref<CPT, PART> &cr) :
279 begin_(cr.begin_),end_(cr.end_), origin(cr.origin),nr(cr.nr),nc(cr.nc) {}
282 return reference(ref_or_value_type<reference>::r(
283 linalg_traits<M>::access(begin_+i, j),
284 PART(), value_type()));
288 template<
typename PT,
typename PART> std::ostream &
operator <<
289 (std::ostream &o,
const part_row_ref<PT, PART>& m)
290 { gmm::write(o,m);
return o; }
292 template <
typename PT,
typename PART>
struct part_col_ref {
294 typedef part_col_ref<PT, PART> this_type;
295 typedef typename std::iterator_traits<PT>::value_type M;
297 typedef typename std::iterator_traits<PT>::reference ref_M;
298 typedef typename select_ref<typename linalg_traits<this_type>
299 ::const_col_iterator,
typename linalg_traits<this_type>
300 ::col_iterator, PT>::ref_type iterator;
301 typedef typename linalg_traits<this_type>::value_type value_type;
302 typedef typename linalg_traits<this_type>::reference reference;
303 typedef typename linalg_traits<this_type>::porigin_type porigin_type;
305 iterator begin_, end_;
309 part_col_ref(ref_M m)
310 : begin_(mat_col_begin(m)), end_(mat_col_end(m)),
311 origin(linalg_origin(m)), nr(mat_nrows(m)), nc(mat_ncols(m)) {}
313 part_col_ref(
const part_col_ref<CPT, PART> &cr) :
314 begin_(cr.begin_),end_(cr.end_), origin(cr.origin),nr(cr.nr),nc(cr.nc) {}
317 return reference(ref_or_value_type<reference>::r(
318 linalg_traits<M>::access(begin_+j, i),
319 PART(), value_type()));
325 template<
typename PT,
typename PART> std::ostream &
operator <<
326 (std::ostream &o,
const part_col_ref<PT, PART>& m)
327 { gmm::write(o,m);
return o; }
334 template <
typename TYPE,
typename PART,
typename PT>
335 struct part_return_ {
336 typedef abstract_null_type return_type;
338 template <
typename PT,
typename PART>
339 struct part_return_<row_major, PART, PT> {
340 typedef typename std::iterator_traits<PT>::value_type L;
341 typedef typename select_return<part_row_ref<const L *, PART>,
342 part_row_ref< L *, PART>, PT>::return_type return_type;
344 template <
typename PT,
typename PART>
345 struct part_return_<col_major, PART, PT> {
346 typedef typename std::iterator_traits<PT>::value_type L;
347 typedef typename select_return<part_col_ref<const L *, PART>,
348 part_col_ref<L *, PART>, PT>::return_type return_type;
351 template <
typename PT,
typename PART,
typename LT>
struct part_return__{
352 typedef abstract_null_type return_type;
355 template <
typename PT,
typename PART>
356 struct part_return__<PT, PART, abstract_matrix> {
357 typedef typename std::iterator_traits<PT>::value_type L;
358 typedef typename part_return_<
typename principal_orientation_type<
359 typename linalg_traits<L>::sub_orientation>::potype, PART,
360 PT>::return_type return_type;
363 template <
typename PT,
typename PART>
364 struct part_return__<PT, PART, abstract_vector> {
365 typedef typename std::iterator_traits<PT>::value_type L;
366 typedef typename select_return<part_vector<const L *, PART>,
367 part_vector<L *, PART>, PT>::return_type return_type;
370 template <
typename PT,
typename PART>
struct part_return {
371 typedef typename std::iterator_traits<PT>::value_type L;
372 typedef typename part_return__<PT, PART,
373 typename linalg_traits<L>::linalg_type>::return_type return_type;
376 template <
typename L>
inline
377 typename part_return<const L *, linalg_real_part>::return_type
378 real_part(
const L &l) {
379 return typename part_return<const L *, linalg_real_part>::return_type
380 (linalg_cast(
const_cast<L &
>(l)));
383 template <
typename L>
inline
384 typename part_return<L *, linalg_real_part>::return_type
386 return typename part_return<L *, linalg_real_part>::return_type(linalg_cast(l));
389 template <
typename L>
inline
390 typename part_return<const L *, linalg_imag_part>::return_type
391 imag_part(
const L &l) {
392 return typename part_return<const L *, linalg_imag_part>::return_type
393 (linalg_cast(
const_cast<L &
>(l)));
396 template <
typename L>
inline
397 typename part_return<L *, linalg_imag_part>::return_type
399 return typename part_return<L *, linalg_imag_part>::return_type(linalg_cast(l));
403 template <
typename PT,
typename PART>
404 struct linalg_traits<part_vector<PT, PART> > {
405 typedef part_vector<PT, PART> this_type;
406 typedef this_type * pthis_type;
408 typedef typename std::iterator_traits<PT>::value_type V;
409 typedef typename linalg_traits<V>::index_sorted index_sorted;
410 typedef typename linalg_traits<V>::is_reference V_reference;
411 typedef typename linalg_traits<V>::origin_type origin_type;
412 typedef typename select_ref<
const origin_type *, origin_type *,
413 PT>::ref_type porigin_type;
414 typedef typename which_reference<PT>::is_reference is_reference;
415 typedef abstract_vector linalg_type;
416 typedef typename linalg_traits<V>::value_type vtype;
417 typedef typename number_traits<vtype>::magnitude_type value_type;
418 typedef typename select_ref<value_type, ref_elt_vector<value_type,
419 which_part<typename linalg_traits<V>::reference,
420 PART> >, PT>::ref_type reference;
421 typedef typename select_ref<typename linalg_traits<V>::const_iterator,
422 typename linalg_traits<V>::iterator, PT>::ref_type pre_iterator;
423 typedef typename select_ref<abstract_null_type,
424 part_vector_iterator<pre_iterator, pre_iterator, PART>,
425 PT>::ref_type iterator;
426 typedef part_vector_iterator<typename linalg_traits<V>::const_iterator,
427 pre_iterator, PART> const_iterator;
428 typedef typename linalg_traits<V>::storage_type storage_type;
429 static size_type size(
const this_type &v) {
return v.size(); }
430 static iterator begin(this_type &v) {
431 iterator it; it.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 const_iterator begin(
const this_type &v) {
437 const_iterator it(v.begin_);
438 if (!is_const_reference(is_reference()) && is_sparse(storage_type()))
439 { set_to_begin(it, v.origin, pthis_type(), is_reference()); }
442 static iterator end(this_type &v) {
444 if (!is_const_reference(is_reference()) && is_sparse(storage_type()))
445 set_to_end(it, v.origin, pthis_type(), is_reference());
448 static const_iterator end(
const this_type &v) {
449 const_iterator it(v.end_);
450 if (!is_const_reference(is_reference()) && is_sparse(storage_type()))
451 set_to_end(it, v.origin, pthis_type(), is_reference());
454 static origin_type* origin(this_type &v) {
return v.origin; }
455 static const origin_type* origin(
const this_type &v) {
return v.origin; }
457 static void clear(origin_type* o,
const iterator &begin_,
458 const iterator &end_, abstract_sparse) {
459 std::deque<size_type> ind;
460 iterator it = begin_;
461 for (; it != end_; ++it) ind.push_front(it.index());
462 for (; !(ind.empty()); ind.pop_back())
463 access(o, begin_, end_, ind.back()) = value_type(0);
465 static void clear(origin_type* o,
const iterator &begin_,
466 const iterator &end_, abstract_skyline) {
467 clear(o, begin_, end_, abstract_sparse());
469 static void clear(origin_type* o,
const iterator &begin_,
470 const iterator &end_, abstract_dense) {
471 for (iterator it = begin_; it != end_; ++it)
475 static void clear(origin_type* o,
const iterator &begin_,
476 const iterator &end_)
477 {
clear(o, begin_, end_, storage_type()); }
478 static void do_clear(this_type &v) {
clear(v.origin, begin(v), end(v)); }
479 static value_type access(
const origin_type *o,
const const_iterator &it,
480 const const_iterator &ite,
size_type i) {
481 return real_or_imag_part(linalg_traits<V>::access(o, it.it, ite.it,i),
484 static reference access(origin_type *o,
const iterator &it,
486 {
return reference(linalg_traits<V>::access(o, it.it, ite.it,i)); }
489 template <
typename PT,
typename PART>
490 struct linalg_traits<part_row_ref<PT, PART> > {
491 typedef part_row_ref<PT, PART> this_type;
492 typedef typename std::iterator_traits<PT>::value_type M;
493 typedef typename linalg_traits<M>::origin_type origin_type;
494 typedef typename select_ref<
const origin_type *, origin_type *,
495 PT>::ref_type porigin_type;
496 typedef typename which_reference<PT>::is_reference is_reference;
497 typedef abstract_matrix linalg_type;
498 typedef typename linalg_traits<M>::value_type vtype;
499 typedef typename number_traits<vtype>::magnitude_type value_type;
500 typedef typename linalg_traits<M>::storage_type storage_type;
501 typedef abstract_null_type sub_col_type;
502 typedef abstract_null_type const_sub_col_type;
503 typedef abstract_null_type col_iterator;
504 typedef abstract_null_type const_col_iterator;
505 typedef typename org_type<typename linalg_traits<M>::const_sub_row_type>::t
506 pre_const_sub_row_type;
507 typedef typename org_type<typename linalg_traits<M>::sub_row_type>::t pre_sub_row_type;
508 typedef part_vector<const pre_const_sub_row_type *, PART>
510 typedef typename select_ref<abstract_null_type,
511 part_vector<pre_sub_row_type *, PART>, PT>::ref_type sub_row_type;
512 typedef typename linalg_traits<M>::const_row_iterator const_row_iterator;
513 typedef typename select_ref<abstract_null_type,
typename
514 linalg_traits<M>::row_iterator, PT>::ref_type row_iterator;
515 typedef typename select_ref<
516 typename linalg_traits<const_sub_row_type>::reference,
517 typename linalg_traits<sub_row_type>::reference,
518 PT>::ref_type reference;
519 typedef row_major sub_orientation;
520 typedef typename linalg_traits<M>::index_sorted index_sorted;
521 static size_type ncols(
const this_type &v) {
return v.nc; }
522 static size_type nrows(
const this_type &v) {
return v.nr; }
523 static const_sub_row_type row(
const const_row_iterator &it)
524 {
return const_sub_row_type(linalg_traits<M>::row(it)); }
525 static sub_row_type row(
const row_iterator &it)
526 {
return sub_row_type(linalg_traits<M>::row(it)); }
527 static row_iterator row_begin(this_type &m) {
return m.begin_; }
528 static row_iterator row_end(this_type &m) {
return m.end_; }
529 static const_row_iterator row_begin(
const this_type &m)
531 static const_row_iterator row_end(
const this_type &m) {
return m.end_; }
532 static origin_type* origin(this_type &v) {
return v.origin; }
533 static const origin_type* origin(
const this_type &v) {
return v.origin; }
534 static void do_clear(this_type &v);
535 static value_type access(
const const_row_iterator &itrow,
size_type i)
536 {
return real_or_imag_part(linalg_traits<M>::access(itrow, i), PART()); }
537 static reference access(
const row_iterator &itrow,
size_type i) {
538 return reference(ref_or_value_type<reference>::r(
539 linalg_traits<M>::access(itrow, i),
540 PART(), value_type()));
544 template <
typename PT,
typename PART>
545 struct linalg_traits<part_col_ref<PT, PART> > {
546 typedef part_col_ref<PT, PART> this_type;
547 typedef typename std::iterator_traits<PT>::value_type M;
548 typedef typename linalg_traits<M>::origin_type origin_type;
549 typedef typename select_ref<
const origin_type *, origin_type *,
550 PT>::ref_type porigin_type;
551 typedef typename which_reference<PT>::is_reference is_reference;
552 typedef abstract_matrix linalg_type;
553 typedef typename linalg_traits<M>::value_type vtype;
554 typedef typename number_traits<vtype>::magnitude_type value_type;
555 typedef typename linalg_traits<M>::storage_type storage_type;
556 typedef abstract_null_type sub_row_type;
557 typedef abstract_null_type const_sub_row_type;
558 typedef abstract_null_type row_iterator;
559 typedef abstract_null_type const_row_iterator;
560 typedef typename org_type<typename linalg_traits<M>::const_sub_col_type>::t
561 pre_const_sub_col_type;
562 typedef typename org_type<typename linalg_traits<M>::sub_col_type>::t pre_sub_col_type;
563 typedef part_vector<const pre_const_sub_col_type *, PART>
565 typedef typename select_ref<abstract_null_type,
566 part_vector<pre_sub_col_type *, PART>, PT>::ref_type sub_col_type;
567 typedef typename linalg_traits<M>::const_col_iterator const_col_iterator;
568 typedef typename select_ref<abstract_null_type,
typename
569 linalg_traits<M>::col_iterator, PT>::ref_type col_iterator;
570 typedef typename select_ref<
571 typename linalg_traits<const_sub_col_type>::reference,
572 typename linalg_traits<sub_col_type>::reference,
573 PT>::ref_type reference;
574 typedef col_major sub_orientation;
575 typedef typename linalg_traits<M>::index_sorted index_sorted;
576 static size_type nrows(
const this_type &v) {
return v.nr; }
577 static size_type ncols(
const this_type &v) {
return v.nc; }
578 static const_sub_col_type col(
const const_col_iterator &it)
579 {
return const_sub_col_type(linalg_traits<M>::col(it)); }
580 static sub_col_type col(
const col_iterator &it)
581 {
return sub_col_type(linalg_traits<M>::col(it)); }
582 static col_iterator col_begin(this_type &m) {
return m.begin_; }
583 static col_iterator col_end(this_type &m) {
return m.end_; }
584 static const_col_iterator col_begin(
const this_type &m)
586 static const_col_iterator col_end(
const this_type &m) {
return m.end_; }
587 static origin_type* origin(this_type &v) {
return v.origin; }
588 static const origin_type* origin(
const this_type &v) {
return v.origin; }
589 static void do_clear(this_type &v);
590 static value_type access(
const const_col_iterator &itcol,
size_type i)
591 {
return real_or_imag_part(linalg_traits<M>::access(itcol, i), PART()); }
592 static reference access(
const col_iterator &itcol,
size_type i) {
593 return reference(ref_or_value_type<reference>::r(
594 linalg_traits<M>::access(itcol, i),
595 PART(), value_type()));
599 template <
typename PT,
typename PART>
600 void linalg_traits<part_col_ref<PT, PART> >::do_clear(this_type &v) {
601 col_iterator it = mat_col_begin(v), ite = mat_col_end(v);
602 for (; it != ite; ++it)
clear(col(it));
605 template <
typename PT,
typename PART>
606 void linalg_traits<part_row_ref<PT, PART> >::do_clear(this_type &v) {
607 row_iterator it = mat_row_begin(v), ite = mat_row_end(v);
608 for (; it != ite; ++it)
clear(row(it));
void clear(L &l)
clear (fill with zeros) a vector or matrix.
Basic definitions and tools of GMM.
Declaration of the vector types (gmm::rsvector, gmm::wsvector, gmm::slvector ,..)
rational_fraction< T > operator-(const polynomial< T > &P, const rational_fraction< T > &Q)
Subtract Q from P.
rational_fraction< T > operator+(const polynomial< T > &P, const rational_fraction< T > &Q)
Add Q to P.
size_t size_type
used as the common size type in the library