DiagonalMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
50 #include <blaze/math/Forward.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // DIAGONALMATRIX OPERATORS
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
85 template< typename MT, bool SO, bool DF >
86 inline void reset( DiagonalMatrix<MT,SO,DF>& m );
87 
88 template< typename MT, bool SO, bool DF >
89 inline void reset( DiagonalMatrix<MT,SO,DF>& m, size_t i );
90 
91 template< typename MT, bool SO, bool DF >
92 inline void clear( DiagonalMatrix<MT,SO,DF>& m );
93 
94 template< typename MT, bool SO, bool DF >
95 inline bool isDefault( const DiagonalMatrix<MT,SO,DF>& m );
96 
97 template< typename MT, bool SO, bool DF >
98 inline void swap( DiagonalMatrix<MT,SO,DF>& a, DiagonalMatrix<MT,SO,DF>& b ) /* throw() */;
100 //*************************************************************************************************
101 
102 
103 //*************************************************************************************************
110 template< typename MT // Type of the adapted matrix
111  , bool SO // Storage order of the adapted matrix
112  , bool DF > // Density flag
114 {
115  m.reset();
116 }
117 //*************************************************************************************************
118 
119 
120 //*************************************************************************************************
133 template< typename MT // Type of the adapted matrix
134  , bool SO // Storage order of the adapted matrix
135  , bool DF > // Density flag
136 inline void reset( DiagonalMatrix<MT,SO,DF>& m, size_t i )
137 {
138  m.reset( i );
139 }
140 //*************************************************************************************************
141 
142 
143 //*************************************************************************************************
150 template< typename MT // Type of the adapted matrix
151  , bool SO // Storage order of the adapted matrix
152  , bool DF > // Density flag
154 {
155  m.clear();
156 }
157 //*************************************************************************************************
158 
159 
160 //*************************************************************************************************
178 template< typename MT // Type of the adapted matrix
179  , bool SO // Storage order of the adapted matrix
180  , bool DF > // Density flag
181 inline bool isDefault( const DiagonalMatrix<MT,SO,DF>& m )
182 {
183  return isDefault( m.matrix_ );
184 }
185 //*************************************************************************************************
186 
187 
188 //*************************************************************************************************
197 template< typename MT // Type of the adapted matrix
198  , bool SO // Storage order of the adapted matrix
199  , bool DF > // Density flag
200 inline void swap( DiagonalMatrix<MT,SO,DF>& a, DiagonalMatrix<MT,SO,DF>& b ) /* throw() */
201 {
202  a.swap( b );
203 }
204 //*************************************************************************************************
205 
206 
207 //*************************************************************************************************
222 template< typename MT // Type of the adapted matrix
223  , bool SO // Storage order of the adapted matrix
224  , bool DF > // Density flag
225 inline MT& derestrict( DiagonalMatrix<MT,SO,DF>& m )
226 {
227  return m.matrix_;
228 }
230 //*************************************************************************************************
231 
232 
233 
234 
235 //=================================================================================================
236 //
237 // ROWS SPECIALIZATIONS
238 //
239 //=================================================================================================
240 
241 //*************************************************************************************************
243 template< typename MT, bool SO, bool DF >
244 struct Rows< DiagonalMatrix<MT,SO,DF> > : public Rows<MT>
245 {};
247 //*************************************************************************************************
248 
249 
250 
251 
252 //=================================================================================================
253 //
254 // COLUMNS SPECIALIZATIONS
255 //
256 //=================================================================================================
257 
258 //*************************************************************************************************
260 template< typename MT, bool SO, bool DF >
261 struct Columns< DiagonalMatrix<MT,SO,DF> > : public Columns<MT>
262 {};
264 //*************************************************************************************************
265 
266 
267 
268 
269 //=================================================================================================
270 //
271 // ISSQUARE SPECIALIZATIONS
272 //
273 //=================================================================================================
274 
275 //*************************************************************************************************
277 template< typename MT, bool SO, bool DF >
278 struct IsSquare< DiagonalMatrix<MT,SO,DF> > : public TrueType
279 {
280  enum { value = 1 };
281  typedef TrueType Type;
282 };
284 //*************************************************************************************************
285 
286 
287 
288 
289 //=================================================================================================
290 //
291 // ISSYMMETRIC SPECIALIZATIONS
292 //
293 //=================================================================================================
294 
295 //*************************************************************************************************
297 template< typename MT, bool SO, bool DF >
298 struct IsSymmetric< DiagonalMatrix<MT,SO,DF> > : public TrueType
299 {
300  enum { value = 1 };
301  typedef TrueType Type;
302 };
304 //*************************************************************************************************
305 
306 
307 
308 
309 //=================================================================================================
310 //
311 // ISLOWER SPECIALIZATIONS
312 //
313 //=================================================================================================
314 
315 //*************************************************************************************************
317 template< typename MT, bool SO, bool DF >
318 struct IsLower< DiagonalMatrix<MT,SO,DF> > : public TrueType
319 {
320  enum { value = 1 };
321  typedef TrueType Type;
322 };
324 //*************************************************************************************************
325 
326 
327 
328 
329 //=================================================================================================
330 //
331 // ISUPPER SPECIALIZATIONS
332 //
333 //=================================================================================================
334 
335 //*************************************************************************************************
337 template< typename MT, bool SO, bool DF >
338 struct IsUpper< DiagonalMatrix<MT,SO,DF> > : public TrueType
339 {
340  enum { value = 1 };
341  typedef TrueType Type;
342 };
344 //*************************************************************************************************
345 
346 
347 
348 
349 //=================================================================================================
350 //
351 // ISADAPTOR SPECIALIZATIONS
352 //
353 //=================================================================================================
354 
355 //*************************************************************************************************
357 template< typename MT, bool SO, bool DF >
358 struct IsAdaptor< DiagonalMatrix<MT,SO,DF> > : public TrueType
359 {
360  enum { value = 1 };
361  typedef TrueType Type;
362 };
364 //*************************************************************************************************
365 
366 
367 
368 
369 //=================================================================================================
370 //
371 // ISRESTRICTED SPECIALIZATIONS
372 //
373 //=================================================================================================
374 
375 //*************************************************************************************************
377 template< typename MT, bool SO, bool DF >
378 struct IsRestricted< DiagonalMatrix<MT,SO,DF> > : public TrueType
379 {
380  enum { value = 1 };
381  typedef TrueType Type;
382 };
384 //*************************************************************************************************
385 
386 
387 
388 
389 //=================================================================================================
390 //
391 // HASCONSTDATAACCESS SPECIALIZATIONS
392 //
393 //=================================================================================================
394 
395 //*************************************************************************************************
397 template< typename MT, bool SO >
398 struct HasConstDataAccess< DiagonalMatrix<MT,SO,true> > : public TrueType
399 {
400  enum { value = 1 };
401  typedef TrueType Type;
402 };
404 //*************************************************************************************************
405 
406 
407 
408 
409 //=================================================================================================
410 //
411 // ISRESIZABLE SPECIALIZATIONS
412 //
413 //=================================================================================================
414 
415 //*************************************************************************************************
417 template< typename MT, bool SO, bool DF >
418 struct IsResizable< DiagonalMatrix<MT,SO,DF> > : public IsResizable<MT>::Type
419 {
420  enum { value = IsResizable<MT>::value };
421  typedef typename IsResizable<MT>::Type Type;
422 };
424 //*************************************************************************************************
425 
426 
427 
428 
429 //=================================================================================================
430 //
431 // REMOVEADAPTOR SPECIALIZATIONS
432 //
433 //=================================================================================================
434 
435 //*************************************************************************************************
437 template< typename MT, bool SO, bool DF >
438 struct RemoveAdaptor< DiagonalMatrix<MT,SO,DF> >
439 {
440  typedef MT Type;
441 };
443 //*************************************************************************************************
444 
445 
446 
447 
448 //=================================================================================================
449 //
450 // DERESTRICTTRAIT SPECIALIZATIONS
451 //
452 //=================================================================================================
453 
454 //*************************************************************************************************
456 template< typename MT, bool SO, bool DF >
457 struct DerestrictTrait< DiagonalMatrix<MT,SO,DF> >
458 {
459  typedef MT& Type;
460 };
462 //*************************************************************************************************
463 
464 
465 
466 
467 //=================================================================================================
468 //
469 // ADDTRAIT SPECIALIZATIONS
470 //
471 //=================================================================================================
472 
473 //*************************************************************************************************
475 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
476 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
477 {
478  typedef typename AddTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
479 };
480 
481 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
482 struct AddTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
483 {
484  typedef typename AddTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
485 };
486 
487 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
488 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
489 {
490  typedef typename AddTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
491 };
492 
493 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
494 struct AddTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
495 {
496  typedef typename AddTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
497 };
498 
499 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
500 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
501 {
502  typedef typename AddTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
503 };
504 
505 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
506 struct AddTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
507 {
508  typedef typename AddTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
509 };
510 
511 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
512 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
513 {
514  typedef typename AddTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
515 };
516 
517 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
518 struct AddTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
519 {
520  typedef typename AddTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
521 };
522 
523 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
524 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
525 {
526  typedef typename AddTrait<MT1,MT2>::Type Type;
527 };
528 
529 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
530 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
531 {
532  typedef typename AddTrait<MT1,MT2>::Type Type;
533 };
534 
535 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
536 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
537 {
538  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
539 };
540 
541 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
542 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
543 {
544  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
545 };
546 
547 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
548 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
549 {
550  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
551 };
552 
553 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
554 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
555 {
556  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
557 };
558 
559 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
560 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
561 {
562  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
563 };
564 
565 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
566 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
567 {
568  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
569 };
570 
571 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
572 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
573 {
574  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
575 };
576 
577 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
578 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
579 {
580  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
581 };
582 
583 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
584 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
585 {
586  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
587 };
588 
589 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
590 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
591 {
592  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
593 };
594 
595 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
596 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
597 {
598  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
599 };
600 
601 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
602 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
603 {
604  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
605 };
606 
607 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
608 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
609 {
610  typedef DiagonalMatrix< typename AddTrait<MT1,MT2>::Type > Type;
611 };
613 //*************************************************************************************************
614 
615 
616 
617 
618 //=================================================================================================
619 //
620 // SUBTRAIT SPECIALIZATIONS
621 //
622 //=================================================================================================
623 
624 //*************************************************************************************************
626 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
627 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
628 {
629  typedef typename SubTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
630 };
631 
632 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
633 struct SubTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
634 {
635  typedef typename SubTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
636 };
637 
638 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
639 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
640 {
641  typedef typename SubTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
642 };
643 
644 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
645 struct SubTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
646 {
647  typedef typename SubTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
648 };
649 
650 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
651 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
652 {
653  typedef typename SubTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
654 };
655 
656 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
657 struct SubTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
658 {
659  typedef typename SubTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
660 };
661 
662 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
663 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
664 {
665  typedef typename SubTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
666 };
667 
668 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
669 struct SubTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
670 {
671  typedef typename SubTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
672 };
673 
674 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
675 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
676 {
677  typedef typename SubTrait<MT1,MT2>::Type Type;
678 };
679 
680 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
681 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
682 {
683  typedef typename SubTrait<MT1,MT2>::Type Type;
684 };
685 
686 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
687 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
688 {
689  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
690 };
691 
692 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
693 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
694 {
695  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
696 };
697 
698 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
699 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
700 {
701  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
702 };
703 
704 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
705 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
706 {
707  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
708 };
709 
710 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
711 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
712 {
713  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
714 };
715 
716 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
717 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
718 {
719  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
720 };
721 
722 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
723 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
724 {
725  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
726 };
727 
728 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
729 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
730 {
731  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
732 };
733 
734 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
735 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
736 {
737  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
738 };
739 
740 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
741 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
742 {
743  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
744 };
745 
746 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
747 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
748 {
749  typedef DiagonalMatrix< typename SubTrait<MT1,MT2>::Type > Type;
750 };
752 //*************************************************************************************************
753 
754 
755 
756 
757 //=================================================================================================
758 //
759 // MULTTRAIT SPECIALIZATIONS
760 //
761 //=================================================================================================
762 
763 //*************************************************************************************************
765 template< typename MT, bool SO, bool DF, typename T >
766 struct MultTrait< DiagonalMatrix<MT,SO,DF>, T >
767 {
768  typedef DiagonalMatrix< typename MultTrait<MT,T>::Type > Type;
770 };
771 
772 template< typename T, typename MT, bool SO, bool DF >
773 struct MultTrait< T, DiagonalMatrix<MT,SO,DF> >
774 {
775  typedef DiagonalMatrix< typename MultTrait<T,MT>::Type > Type;
777 };
778 
779 template< typename MT, bool SO, bool DF, typename T, size_t N >
780 struct MultTrait< DiagonalMatrix<MT,SO,DF>, StaticVector<T,N,false> >
781 {
782  typedef typename MultTrait< MT, StaticVector<T,N,false> >::Type Type;
783 };
784 
785 template< typename T, size_t N, typename MT, bool SO, bool DF >
786 struct MultTrait< StaticVector<T,N,true>, DiagonalMatrix<MT,SO,DF> >
787 {
788  typedef typename MultTrait< StaticVector<T,N,true>, MT >::Type Type;
789 };
790 
791 template< typename MT, bool SO, bool DF, typename T, size_t N >
792 struct MultTrait< DiagonalMatrix<MT,SO,DF>, HybridVector<T,N,false> >
793 {
794  typedef typename MultTrait< MT, HybridVector<T,N,false> >::Type Type;
795 };
796 
797 template< typename T, size_t N, typename MT, bool SO, bool DF >
798 struct MultTrait< HybridVector<T,N,true>, DiagonalMatrix<MT,SO,DF> >
799 {
800  typedef typename MultTrait< HybridVector<T,N,true>, MT >::Type Type;
801 };
802 
803 template< typename MT, bool SO, bool DF, typename T >
804 struct MultTrait< DiagonalMatrix<MT,SO,DF>, DynamicVector<T,false> >
805 {
806  typedef typename MultTrait< MT, DynamicVector<T,false> >::Type Type;
807 };
808 
809 template< typename T, typename MT, bool SO, bool DF >
810 struct MultTrait< DynamicVector<T,true>, DiagonalMatrix<MT,SO,DF> >
811 {
812  typedef typename MultTrait< DynamicVector<T,true>, MT >::Type Type;
813 };
814 
815 template< typename MT, bool SO, bool DF, typename T >
816 struct MultTrait< DiagonalMatrix<MT,SO,DF>, CompressedVector<T,false> >
817 {
818  typedef typename MultTrait< MT, CompressedVector<T,false> >::Type Type;
819 };
820 
821 template< typename T, typename MT, bool SO, bool DF >
822 struct MultTrait< CompressedVector<T,true>, DiagonalMatrix<MT,SO,DF> >
823 {
824  typedef typename MultTrait< CompressedVector<T,true>, MT >::Type Type;
825 };
826 
827 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
828 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
829 {
830  typedef typename MultTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
831 };
832 
833 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
834 struct MultTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
835 {
836  typedef typename MultTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
837 };
838 
839 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
840 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
841 {
842  typedef typename MultTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
843 };
844 
845 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
846 struct MultTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
847 {
848  typedef typename MultTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
849 };
850 
851 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
852 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
853 {
854  typedef typename MultTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
855 };
856 
857 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
858 struct MultTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
859 {
860  typedef typename MultTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
861 };
862 
863 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
864 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
865 {
866  typedef typename MultTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
867 };
868 
869 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
870 struct MultTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
871 {
872  typedef typename MultTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
873 };
874 
875 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
876 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
877 {
878  typedef typename MultTrait<MT1,MT2>::Type Type;
879 };
880 
881 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
882 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
883 {
884  typedef typename MultTrait<MT1,MT2>::Type Type;
885 };
886 
887 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
888 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
889 {
890  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
891 };
892 
893 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
894 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
895 {
896  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
897 };
898 
899 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
900 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
901 {
902  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
903 };
904 
905 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
906 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
907 {
908  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
909 };
910 
911 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
912 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
913 {
914  typedef StrictlyLowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
915 };
916 
917 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
918 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
919 {
920  typedef StrictlyLowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
921 };
922 
923 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
924 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
925 {
926  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
927 };
928 
929 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
930 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
931 {
932  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
933 };
934 
935 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
936 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
937 {
938  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
939 };
940 
941 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
942 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
943 {
944  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
945 };
946 
947 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
948 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
949 {
950  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
951 };
952 
953 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
954 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
955 {
956  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
957 };
958 
959 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
960 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
961 {
962  typedef DiagonalMatrix< typename MultTrait<MT1,MT2>::Type > Type;
963 };
965 //*************************************************************************************************
966 
967 
968 
969 
970 //=================================================================================================
971 //
972 // DIVTRAIT SPECIALIZATIONS
973 //
974 //=================================================================================================
975 
976 //*************************************************************************************************
978 template< typename MT, bool SO, bool DF, typename T >
979 struct DivTrait< DiagonalMatrix<MT,SO,DF>, T >
980 {
981  typedef DiagonalMatrix< typename DivTrait<MT,T>::Type > Type;
983 };
985 //*************************************************************************************************
986 
987 
988 
989 
990 //=================================================================================================
991 //
992 // MATHTRAIT SPECIALIZATIONS
993 //
994 //=================================================================================================
995 
996 //*************************************************************************************************
998 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
999 struct MathTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1000 {
1001  typedef DiagonalMatrix< typename MathTrait<MT1,MT2>::HighType > HighType;
1002  typedef DiagonalMatrix< typename MathTrait<MT1,MT2>::LowType > LowType;
1003 };
1005 //*************************************************************************************************
1006 
1007 
1008 
1009 
1010 //=================================================================================================
1011 //
1012 // SUBMATRIXTRAIT SPECIALIZATIONS
1013 //
1014 //=================================================================================================
1015 
1016 //*************************************************************************************************
1018 template< typename MT, bool SO, bool DF >
1019 struct SubmatrixTrait< DiagonalMatrix<MT,SO,DF> >
1020 {
1021  typedef typename SubmatrixTrait<MT>::Type Type;
1022 };
1024 //*************************************************************************************************
1025 
1026 
1027 
1028 
1029 //=================================================================================================
1030 //
1031 // ROWTRAIT SPECIALIZATIONS
1032 //
1033 //=================================================================================================
1034 
1035 //*************************************************************************************************
1037 template< typename MT, bool SO, bool DF >
1038 struct RowTrait< DiagonalMatrix<MT,SO,DF> >
1039 {
1040  typedef typename RowTrait<MT>::Type Type;
1041 };
1043 //*************************************************************************************************
1044 
1045 
1046 
1047 
1048 //=================================================================================================
1049 //
1050 // COLUMNTRAIT SPECIALIZATIONS
1051 //
1052 //=================================================================================================
1053 
1054 //*************************************************************************************************
1056 template< typename MT, bool SO, bool DF >
1057 struct ColumnTrait< DiagonalMatrix<MT,SO,DF> >
1058 {
1059  typedef typename ColumnTrait<MT>::Type Type;
1060 };
1062 //*************************************************************************************************
1063 
1064 } // namespace blaze
1065 
1066 #endif
Constraint on the data type.
Header file for the Rows type trait.
Header file for the subtraction trait.
Header file for the row trait.
Header file for the implementation of the base template of the DiagonalMatrix.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
Header file for the implementation of the base template of the UpperMatrix.
Header file for the IsSquare type trait.
Header file for the multiplication trait.
Header file for the IsSymmetric type trait.
Header file for the implementation of the base template of the LowerMatrix.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for all forward declarations of the math module.
Header file for the Columns type trait.
Header file for the IsLower type trait.
Header file for the RemoveAdaptor type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
Header file for the IsAdaptor type trait.
Header file for the implementation of the base template of the StrictlyUpperMatrix.
Header file for the DerestrictTrait class template.
Header file for the HasConstDataAccess type trait.
DiagonalMatrix specialization for sparse matrices.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
Header file for the column trait.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:200
Header file for the mathematical trait.
DiagonalMatrix specialization for dense matrices.
Matrix adapter for diagonal matrices.
Definition: BaseTemplate.h:525
Header file for the IsUpper type trait.
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the implementation of the base template of the StrictlyLowerMatrix.