HermitianMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
50 #include <blaze/math/Forward.h>
51 #include <blaze/math/Functions.h>
74 #include <blaze/util/Assert.h>
75 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/Exception.h>
77 #include <blaze/util/mpl/If.h>
80 #include <blaze/util/Unused.h>
82 
83 
84 namespace blaze {
85 
86 //=================================================================================================
87 //
88 // HERMITIANMATRIX OPERATORS
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
95 template< typename MT, bool SO, bool DF >
96 inline void reset( HermitianMatrix<MT,SO,DF>& m );
97 
98 template< typename MT, bool SO, bool DF >
99 inline void reset( HermitianMatrix<MT,SO,DF>& m, size_t i );
100 
101 template< typename MT, bool SO, bool DF >
102 inline void clear( HermitianMatrix<MT,SO,DF>& m );
103 
104 template< typename MT, bool SO, bool DF >
105 inline bool isDefault( const HermitianMatrix<MT,SO,DF>& m );
106 
107 template< typename MT, bool SO, bool DF >
108 inline bool isIntact( const HermitianMatrix<MT,SO,DF>& m );
109 
110 template< typename MT, bool SO, bool DF >
111 inline void swap( HermitianMatrix<MT,SO,DF>& a, HermitianMatrix<MT,SO,DF>& b ) /* throw() */;
113 //*************************************************************************************************
114 
115 
116 //*************************************************************************************************
123 template< typename MT // Type of the adapted matrix
124  , bool SO // Storage order of the adapted matrix
125  , bool DF > // Density flag
127 {
128  m.reset();
129 }
130 //*************************************************************************************************
131 
132 
133 //*************************************************************************************************
146 template< typename MT // Type of the adapted matrix
147  , bool SO // Storage order of the adapted matrix
148  , bool DF > // Density flag
149 inline void reset( HermitianMatrix<MT,SO,DF>& m, size_t i )
150 {
151  m.reset( i );
152 }
153 //*************************************************************************************************
154 
155 
156 //*************************************************************************************************
163 template< typename MT // Type of the adapted matrix
164  , bool SO // Storage order of the adapted matrix
165  , bool DF > // Density flag
167 {
168  m.clear();
169 }
170 //*************************************************************************************************
171 
172 
173 //*************************************************************************************************
191 template< typename MT // Type of the adapted matrix
192  , bool SO // Storage order of the adapted matrix
193  , bool DF > // Density flag
194 inline bool isDefault( const HermitianMatrix<MT,SO,DF>& m )
195 {
196  return isDefault( m.matrix_ );
197 }
198 //*************************************************************************************************
199 
200 
201 //*************************************************************************************************
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 bool isIntact( const HermitianMatrix<MT,SO,DF>& m )
226 {
227  return m.isIntact();
228 }
229 //*************************************************************************************************
230 
231 
232 //*************************************************************************************************
241 template< typename MT // Type of the adapted matrix
242  , bool SO // Storage order of the adapted matrix
243  , bool DF > // Density flag
244 inline void swap( HermitianMatrix<MT,SO,DF>& a, HermitianMatrix<MT,SO,DF>& b ) /* throw() */
245 {
246  a.swap( b );
247 }
248 //*************************************************************************************************
249 
250 
251 //*************************************************************************************************
267 template< typename MT // Type of the dense matrix
268  , bool SO > // Storage order of the dense matrix
269 inline void invert2x2( HermitianMatrix<MT,SO,true>& m )
270 {
272 
273  BLAZE_INTERNAL_ASSERT( m.rows() == 2UL, "Invalid number of rows detected" );
274  BLAZE_INTERNAL_ASSERT( m.columns() == 2UL, "Invalid number of columns detected" );
275 
276  typedef typename MT::ElementType ET;
277 
278  const MT& A( m.matrix_ );
279  MT& B( m.matrix_ );
280 
281  const ET det( A(0,0)*A(1,1) - A(0,1)*A(1,0) );
282 
283  if( isDefault( det ) ) {
284  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
285  }
286 
287  const ET idet( ET(1) / det );
288  const ET a11( A(0,0) * idet );
289 
290  B(0,0) = A(1,1) * idet;
291  B(1,0) = -A(1,0) * idet;
292  B(0,1) = conj( B(1,0) );
293  B(1,1) = a11;
294 
295  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
296 }
298 //*************************************************************************************************
299 
300 
301 //*************************************************************************************************
317 template< typename MT // Type of the dense matrix
318  , bool SO > // Storage order of the dense matrix
319 inline void invert3x3( HermitianMatrix<MT,SO,true>& m )
320 {
322 
323  BLAZE_INTERNAL_ASSERT( m.rows() == 3UL, "Invalid number of rows detected" );
324  BLAZE_INTERNAL_ASSERT( m.columns() == 3UL, "Invalid number of columns detected" );
325 
326  typedef typename MT::ElementType ET;
327 
328  const StaticMatrix<ET,3UL,3UL,SO> A( m.matrix_ );
329  MT& B( m.matrix_ );
330 
331  B(0,0) = A(1,1)*A(2,2) - A(1,2)*A(2,1);
332  B(1,0) = A(1,2)*A(2,0) - A(1,0)*A(2,2);
333  B(2,0) = A(1,0)*A(2,1) - A(1,1)*A(2,0);
334 
335  const ET det( A(0,0)*B(0,0) + A(0,1)*B(1,0) + A(0,2)*B(2,0) );
336 
337  if( isDefault( det ) ) {
338  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
339  }
340 
341  B(0,1) = conj( B(1,0) );
342  B(1,1) = A(0,0)*A(2,2) - A(0,2)*A(2,0);
343  B(2,1) = A(0,1)*A(2,0) - A(0,0)*A(2,1);
344  B(0,2) = conj( B(2,0) );
345  B(1,2) = conj( B(2,1) );
346  B(2,2) = A(0,0)*A(1,1) - A(0,1)*A(1,0);
347 
348  m /= det;
349 
350  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
351 }
353 //*************************************************************************************************
354 
355 
356 //*************************************************************************************************
372 template< typename MT // Type of the dense matrix
373  , bool SO > // Storage order of the dense matrix
374 inline void invert4x4( HermitianMatrix<MT,SO,true>& m )
375 {
377 
378  BLAZE_INTERNAL_ASSERT( m.rows() == 4UL, "Invalid number of rows detected" );
379  BLAZE_INTERNAL_ASSERT( m.columns() == 4UL, "Invalid number of columns detected" );
380 
381  typedef typename MT::ElementType ET;
382 
383  const StaticMatrix<ET,4UL,4UL,SO> A( m.matrix_ );
384  MT& B( m.matrix_ );
385 
386  ET tmp1( A(2,2)*A(3,3) - A(2,3)*A(3,2) );
387  ET tmp2( A(2,1)*A(3,3) - A(2,3)*A(3,1) );
388  ET tmp3( A(2,1)*A(3,2) - A(2,2)*A(3,1) );
389 
390  B(0,0) = A(1,1)*tmp1 - A(1,2)*tmp2 + A(1,3)*tmp3;
391  B(0,1) = A(0,2)*tmp2 - A(0,1)*tmp1 - A(0,3)*tmp3;
392 
393  ET tmp4( A(2,0)*A(3,3) - A(2,3)*A(3,0) );
394  ET tmp5( A(2,0)*A(3,2) - A(2,2)*A(3,0) );
395 
396  B(1,1) = A(0,0)*tmp1 - A(0,2)*tmp4 + A(0,3)*tmp5;
397 
398  tmp1 = A(2,0)*A(3,1) - A(2,1)*A(3,0);
399 
400  B(2,0) = A(1,0)*tmp2 - A(1,1)*tmp4 + A(1,3)*tmp1;
401  B(2,1) = A(0,1)*tmp4 - A(0,0)*tmp2 - A(0,3)*tmp1;
402  B(3,0) = A(1,1)*tmp5 - A(1,0)*tmp3 - A(1,2)*tmp1;
403  B(3,1) = A(0,0)*tmp3 - A(0,1)*tmp5 + A(0,2)*tmp1;
404 
405  tmp1 = A(0,1)*A(1,3) - A(0,3)*A(1,1);
406  tmp2 = A(0,1)*A(1,2) - A(0,2)*A(1,1);
407  tmp3 = A(0,0)*A(1,3) - A(0,3)*A(1,0);
408  tmp4 = A(0,0)*A(1,2) - A(0,2)*A(1,0);
409  tmp5 = A(0,0)*A(1,1) - A(0,1)*A(1,0);
410 
411  B(2,2) = A(3,0)*tmp1 - A(3,1)*tmp3 + A(3,3)*tmp5;
412  B(2,3) = A(2,1)*tmp3 - A(2,0)*tmp1 - A(2,3)*tmp5;
413  B(3,3) = A(2,0)*tmp2 - A(2,1)*tmp4 + A(2,2)*tmp5;
414 
415  B(0,2) = conj( B(2,0) );
416  B(0,3) = conj( B(3,0) );
417  B(1,0) = conj( B(0,1) );
418  B(1,2) = conj( B(2,1) );
419  B(1,3) = conj( B(3,1) );
420  B(3,2) = conj( B(2,3) );
421 
422  const ET det( A(0,0)*B(0,0) + A(0,1)*B(1,0) + A(0,2)*B(2,0) + A(0,3)*B(3,0) );
423 
424  if( isDefault( det ) ) {
425  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
426  }
427 
428  B /= det;
429 
430  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
431 }
433 //*************************************************************************************************
434 
435 
436 //*************************************************************************************************
452 template< typename MT // Type of the dense matrix
453  , bool SO > // Storage order of the dense matrix
454 inline void invert5x5( HermitianMatrix<MT,SO,true>& m )
455 {
457 
458  BLAZE_INTERNAL_ASSERT( m.rows() == 5UL, "Invalid number of rows detected" );
459  BLAZE_INTERNAL_ASSERT( m.columns() == 5UL, "Invalid number of columns detected" );
460 
461  typedef typename MT::ElementType ET;
462 
463  const StaticMatrix<ET,5UL,5UL,SO> A( m.matrix_ );
464  MT& B( m.matrix_ );
465 
466  ET tmp1 ( A(3,3)*A(4,4) - A(3,4)*A(4,3) );
467  ET tmp2 ( A(3,2)*A(4,4) - A(3,4)*A(4,2) );
468  ET tmp3 ( A(3,2)*A(4,3) - A(3,3)*A(4,2) );
469  ET tmp4 ( A(3,1)*A(4,4) - A(3,4)*A(4,1) );
470  ET tmp5 ( A(3,1)*A(4,3) - A(3,3)*A(4,1) );
471  ET tmp6 ( A(3,1)*A(4,2) - A(3,2)*A(4,1) );
472  ET tmp7 ( A(3,0)*A(4,4) - A(3,4)*A(4,0) );
473  ET tmp8 ( A(3,0)*A(4,3) - A(3,3)*A(4,0) );
474  ET tmp9 ( A(3,0)*A(4,2) - A(3,2)*A(4,0) );
475  ET tmp10( A(3,0)*A(4,1) - A(3,1)*A(4,0) );
476 
477  ET tmp11( A(2,2)*tmp1 - A(2,3)*tmp2 + A(2,4)*tmp3 );
478  ET tmp12( A(2,1)*tmp1 - A(2,3)*tmp4 + A(2,4)*tmp5 );
479  ET tmp13( A(2,1)*tmp2 - A(2,2)*tmp4 + A(2,4)*tmp6 );
480  ET tmp14( A(2,1)*tmp3 - A(2,2)*tmp5 + A(2,3)*tmp6 );
481  ET tmp15( A(2,0)*tmp1 - A(2,3)*tmp7 + A(2,4)*tmp8 );
482  ET tmp16( A(2,0)*tmp2 - A(2,2)*tmp7 + A(2,4)*tmp9 );
483  ET tmp17( A(2,0)*tmp3 - A(2,2)*tmp8 + A(2,3)*tmp9 );
484 
485  B(0,0) = A(1,1)*tmp11 - A(1,2)*tmp12 + A(1,3)*tmp13 - A(1,4)*tmp14;
486  B(0,1) = - A(0,1)*tmp11 + A(0,2)*tmp12 - A(0,3)*tmp13 + A(0,4)*tmp14;
487  B(1,1) = A(0,0)*tmp11 - A(0,2)*tmp15 + A(0,3)*tmp16 - A(0,4)*tmp17;
488 
489  ET tmp18( A(2,0)*tmp4 - A(2,1)*tmp7 + A(2,4)*tmp10 );
490  ET tmp19( A(2,0)*tmp5 - A(2,1)*tmp8 + A(2,3)*tmp10 );
491  ET tmp20( A(2,0)*tmp6 - A(2,1)*tmp9 + A(2,2)*tmp10 );
492 
493  B(2,0) = A(1,0)*tmp12 - A(1,1)*tmp15 + A(1,3)*tmp18 - A(1,4)*tmp19;
494  B(2,1) = - A(0,0)*tmp12 + A(0,1)*tmp15 - A(0,3)*tmp18 + A(0,4)*tmp19;
495  B(3,0) = - A(1,0)*tmp13 + A(1,1)*tmp16 - A(1,2)*tmp18 + A(1,4)*tmp20;
496  B(3,1) = A(0,0)*tmp13 - A(0,1)*tmp16 + A(0,2)*tmp18 - A(0,4)*tmp20;
497  B(4,0) = A(1,0)*tmp14 - A(1,1)*tmp17 + A(1,2)*tmp19 - A(1,3)*tmp20;
498  B(4,1) = - A(0,0)*tmp14 + A(0,1)*tmp17 - A(0,2)*tmp19 + A(0,3)*tmp20;
499 
500  tmp11 = A(1,1)*tmp1 - A(1,3)*tmp4 + A(1,4)*tmp5;
501  tmp12 = A(1,0)*tmp1 - A(1,3)*tmp7 + A(1,4)*tmp8;
502  tmp13 = A(1,0)*tmp4 - A(1,1)*tmp7 + A(1,4)*tmp10;
503  tmp14 = A(1,0)*tmp5 - A(1,1)*tmp8 + A(1,3)*tmp10;
504 
505  B(2,2) = A(0,0)*tmp11 - A(0,1)*tmp12 + A(0,3)*tmp13 - A(0,4)*tmp14;
506 
507  tmp1 = A(0,2)*A(1,3) - A(0,3)*A(1,2);
508  tmp2 = A(0,1)*A(1,3) - A(0,3)*A(1,1);
509  tmp3 = A(0,1)*A(1,2) - A(0,2)*A(1,1);
510  tmp4 = A(0,0)*A(1,3) - A(0,3)*A(1,0);
511  tmp5 = A(0,0)*A(1,2) - A(0,2)*A(1,0);
512  tmp6 = A(0,0)*A(1,1) - A(0,1)*A(1,0);
513  tmp7 = A(0,2)*A(1,4) - A(0,4)*A(1,2);
514  tmp8 = A(0,1)*A(1,4) - A(0,4)*A(1,1);
515  tmp9 = A(0,0)*A(1,4) - A(0,4)*A(1,0);
516  tmp10 = A(0,3)*A(1,4) - A(0,4)*A(1,3);
517 
518  tmp11 = A(2,1)*tmp10 - A(2,3)*tmp8 + A(2,4)*tmp2;
519  tmp12 = A(2,1)*tmp7 - A(2,2)*tmp8 + A(2,4)*tmp3;
520  tmp13 = A(2,1)*tmp1 - A(2,2)*tmp2 + A(2,3)*tmp3;
521  tmp14 = A(2,0)*tmp10 - A(2,3)*tmp9 + A(2,4)*tmp4;
522  tmp15 = A(2,0)*tmp7 - A(2,2)*tmp9 + A(2,4)*tmp5;
523  tmp16 = A(2,0)*tmp1 - A(2,2)*tmp4 + A(2,3)*tmp5;
524  tmp17 = A(2,0)*tmp8 - A(2,1)*tmp9 + A(2,4)*tmp6;
525  tmp18 = A(2,0)*tmp2 - A(2,1)*tmp4 + A(2,3)*tmp6;
526  tmp19 = A(2,0)*tmp3 - A(2,1)*tmp5 + A(2,2)*tmp6;
527 
528  B(2,3) = A(4,0)*tmp11 - A(4,1)*tmp14 + A(4,3)*tmp17 - A(4,4)*tmp18;
529  B(2,4) = - A(3,0)*tmp11 + A(3,1)*tmp14 - A(3,3)*tmp17 + A(3,4)*tmp18;
530  B(3,3) = - A(4,0)*tmp12 + A(4,1)*tmp15 - A(4,2)*tmp17 + A(4,4)*tmp19;
531  B(3,4) = A(3,0)*tmp12 - A(3,1)*tmp15 + A(3,2)*tmp17 - A(3,4)*tmp19;
532  B(4,4) = - A(3,0)*tmp13 + A(3,1)*tmp16 - A(3,2)*tmp18 + A(3,3)*tmp19;
533 
534  B(0,2) = conj( B(2,0) );
535  B(0,3) = conj( B(3,0) );
536  B(0,4) = conj( B(4,0) );
537  B(1,0) = conj( B(0,1) );
538  B(1,2) = conj( B(2,1) );
539  B(1,3) = conj( B(3,1) );
540  B(1,4) = conj( B(4,1) );
541  B(3,2) = conj( B(2,3) );
542  B(4,2) = conj( B(2,4) );
543  B(4,3) = conj( B(3,4) );
544 
545  const ET det( A(0,0)*B(0,0) + A(0,1)*B(1,0) + A(0,2)*B(2,0) + A(0,3)*B(3,0) + A(0,4)*B(4,0) );
546 
547  if( isDefault( det ) ) {
548  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
549  }
550 
551  B /= det;
552 
553  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
554 }
556 //*************************************************************************************************
557 
558 
559 //*************************************************************************************************
575 template< typename MT // Type of the dense matrix
576  , bool SO > // Storage order of the dense matrix
577 inline void invert6x6( HermitianMatrix<MT,SO,true>& m )
578 {
580 
581  BLAZE_INTERNAL_ASSERT( m.rows() == 6UL, "Invalid number of rows detected" );
582  BLAZE_INTERNAL_ASSERT( m.columns() == 6UL, "Invalid number of columns detected" );
583 
584  typedef typename MT::ElementType ET;
585 
586  const StaticMatrix<ET,6UL,6UL,SO> A( m.matrix_ );
587  MT& B( m.matrix_ );
588 
589  ET tmp1 ( A(4,4)*A(5,5) - A(4,5)*A(5,4) );
590  ET tmp2 ( A(4,3)*A(5,5) - A(4,5)*A(5,3) );
591  ET tmp3 ( A(4,3)*A(5,4) - A(4,4)*A(5,3) );
592  ET tmp4 ( A(4,2)*A(5,5) - A(4,5)*A(5,2) );
593  ET tmp5 ( A(4,2)*A(5,4) - A(4,4)*A(5,2) );
594  ET tmp6 ( A(4,2)*A(5,3) - A(4,3)*A(5,2) );
595  ET tmp7 ( A(4,1)*A(5,5) - A(4,5)*A(5,1) );
596  ET tmp8 ( A(4,1)*A(5,4) - A(4,4)*A(5,1) );
597  ET tmp9 ( A(4,1)*A(5,3) - A(4,3)*A(5,1) );
598  ET tmp10( A(4,1)*A(5,2) - A(4,2)*A(5,1) );
599  ET tmp11( A(4,0)*A(5,5) - A(4,5)*A(5,0) );
600  ET tmp12( A(4,0)*A(5,4) - A(4,4)*A(5,0) );
601  ET tmp13( A(4,0)*A(5,3) - A(4,3)*A(5,0) );
602  ET tmp14( A(4,0)*A(5,2) - A(4,2)*A(5,0) );
603  ET tmp15( A(4,0)*A(5,1) - A(4,1)*A(5,0) );
604 
605  ET tmp16( A(3,3)*tmp1 - A(3,4)*tmp2 + A(3,5)*tmp3 );
606  ET tmp17( A(3,2)*tmp1 - A(3,4)*tmp4 + A(3,5)*tmp5 );
607  ET tmp18( A(3,2)*tmp2 - A(3,3)*tmp4 + A(3,5)*tmp6 );
608  ET tmp19( A(3,2)*tmp3 - A(3,3)*tmp5 + A(3,4)*tmp6 );
609  ET tmp20( A(3,1)*tmp1 - A(3,4)*tmp7 + A(3,5)*tmp8 );
610  ET tmp21( A(3,1)*tmp2 - A(3,3)*tmp7 + A(3,5)*tmp9 );
611  ET tmp22( A(3,1)*tmp3 - A(3,3)*tmp8 + A(3,4)*tmp9 );
612  ET tmp23( A(3,1)*tmp4 - A(3,2)*tmp7 + A(3,5)*tmp10 );
613  ET tmp24( A(3,1)*tmp5 - A(3,2)*tmp8 + A(3,4)*tmp10 );
614  ET tmp25( A(3,1)*tmp6 - A(3,2)*tmp9 + A(3,3)*tmp10 );
615  ET tmp26( A(3,0)*tmp1 - A(3,4)*tmp11 + A(3,5)*tmp12 );
616  ET tmp27( A(3,0)*tmp2 - A(3,3)*tmp11 + A(3,5)*tmp13 );
617  ET tmp28( A(3,0)*tmp3 - A(3,3)*tmp12 + A(3,4)*tmp13 );
618  ET tmp29( A(3,0)*tmp4 - A(3,2)*tmp11 + A(3,5)*tmp14 );
619  ET tmp30( A(3,0)*tmp5 - A(3,2)*tmp12 + A(3,4)*tmp14 );
620  ET tmp31( A(3,0)*tmp6 - A(3,2)*tmp13 + A(3,3)*tmp14 );
621  ET tmp32( A(3,0)*tmp7 - A(3,1)*tmp11 + A(3,5)*tmp15 );
622  ET tmp33( A(3,0)*tmp8 - A(3,1)*tmp12 + A(3,4)*tmp15 );
623  ET tmp34( A(3,0)*tmp9 - A(3,1)*tmp13 + A(3,3)*tmp15 );
624  ET tmp35( A(3,0)*tmp10 - A(3,1)*tmp14 + A(3,2)*tmp15 );
625 
626  ET tmp36( A(2,2)*tmp16 - A(2,3)*tmp17 + A(2,4)*tmp18 - A(2,5)*tmp19 );
627  ET tmp37( A(2,1)*tmp16 - A(2,3)*tmp20 + A(2,4)*tmp21 - A(2,5)*tmp22 );
628  ET tmp38( A(2,1)*tmp17 - A(2,2)*tmp20 + A(2,4)*tmp23 - A(2,5)*tmp24 );
629  ET tmp39( A(2,1)*tmp18 - A(2,2)*tmp21 + A(2,3)*tmp23 - A(2,5)*tmp25 );
630  ET tmp40( A(2,1)*tmp19 - A(2,2)*tmp22 + A(2,3)*tmp24 - A(2,4)*tmp25 );
631  ET tmp41( A(2,0)*tmp16 - A(2,3)*tmp26 + A(2,4)*tmp27 - A(2,5)*tmp28 );
632  ET tmp42( A(2,0)*tmp17 - A(2,2)*tmp26 + A(2,4)*tmp29 - A(2,5)*tmp30 );
633  ET tmp43( A(2,0)*tmp18 - A(2,2)*tmp27 + A(2,3)*tmp29 - A(2,5)*tmp31 );
634  ET tmp44( A(2,0)*tmp19 - A(2,2)*tmp28 + A(2,3)*tmp30 - A(2,4)*tmp31 );
635 
636  B(0,0) = A(1,1)*tmp36 - A(1,2)*tmp37 + A(1,3)*tmp38 - A(1,4)*tmp39 + A(1,5)*tmp40;
637  B(0,1) = - A(0,1)*tmp36 + A(0,2)*tmp37 - A(0,3)*tmp38 + A(0,4)*tmp39 - A(0,5)*tmp40;
638  B(1,1) = A(0,0)*tmp36 - A(0,2)*tmp41 + A(0,3)*tmp42 - A(0,4)*tmp43 + A(0,5)*tmp44;
639 
640  ET tmp45( A(2,0)*tmp20 - A(2,1)*tmp26 + A(2,4)*tmp32 - A(2,5)*tmp33 );
641  ET tmp46( A(2,0)*tmp21 - A(2,1)*tmp27 + A(2,3)*tmp32 - A(2,5)*tmp34 );
642  ET tmp47( A(2,0)*tmp22 - A(2,1)*tmp28 + A(2,3)*tmp33 - A(2,4)*tmp34 );
643  ET tmp48( A(2,0)*tmp23 - A(2,1)*tmp29 + A(2,2)*tmp32 - A(2,5)*tmp35 );
644  ET tmp49( A(2,0)*tmp24 - A(2,1)*tmp30 + A(2,2)*tmp33 - A(2,4)*tmp35 );
645 
646  B(2,0) = A(1,0)*tmp37 - A(1,1)*tmp41 + A(1,3)*tmp45 - A(1,4)*tmp46 + A(1,5)*tmp47;
647  B(2,1) = - A(0,0)*tmp37 + A(0,1)*tmp41 - A(0,3)*tmp45 + A(0,4)*tmp46 - A(0,5)*tmp47;
648  B(3,0) = - A(1,0)*tmp38 + A(1,1)*tmp42 - A(1,2)*tmp45 + A(1,4)*tmp48 - A(1,5)*tmp49;
649  B(3,1) = A(0,0)*tmp38 - A(0,1)*tmp42 + A(0,2)*tmp45 - A(0,4)*tmp48 + A(0,5)*tmp49;
650 
651  ET tmp50( A(2,0)*tmp25 - A(2,1)*tmp31 + A(2,2)*tmp34 - A(2,3)*tmp35 );
652 
653  B(4,0) = A(1,0)*tmp39 - A(1,1)*tmp43 + A(1,2)*tmp46 - A(1,3)*tmp48 + A(1,5)*tmp50;
654  B(4,1) = - A(0,0)*tmp39 + A(0,1)*tmp43 - A(0,2)*tmp46 + A(0,3)*tmp48 - A(0,5)*tmp50;
655  B(5,0) = - A(1,0)*tmp40 + A(1,1)*tmp44 - A(1,2)*tmp47 + A(1,3)*tmp49 - A(1,4)*tmp50;
656  B(5,1) = A(0,0)*tmp40 - A(0,1)*tmp44 + A(0,2)*tmp47 - A(0,3)*tmp49 + A(0,4)*tmp50;
657 
658  tmp36 = A(1,1)*tmp16 - A(1,3)*tmp20 + A(1,4)*tmp21 - A(1,5)*tmp22;
659  tmp37 = A(1,1)*tmp17 - A(1,2)*tmp20 + A(1,4)*tmp23 - A(1,5)*tmp24;
660  tmp38 = A(1,0)*tmp16 - A(1,3)*tmp26 + A(1,4)*tmp27 - A(1,5)*tmp28;
661  tmp39 = A(1,0)*tmp17 - A(1,2)*tmp26 + A(1,4)*tmp29 - A(1,5)*tmp30;
662  tmp40 = A(1,0)*tmp20 - A(1,1)*tmp26 + A(1,4)*tmp32 - A(1,5)*tmp33;
663  tmp41 = A(1,0)*tmp21 - A(1,1)*tmp27 + A(1,3)*tmp32 - A(1,5)*tmp34;
664  tmp42 = A(1,0)*tmp22 - A(1,1)*tmp28 + A(1,3)*tmp33 - A(1,4)*tmp34;
665  tmp43 = A(1,0)*tmp23 - A(1,1)*tmp29 + A(1,2)*tmp32 - A(1,5)*tmp35;
666  tmp44 = A(1,0)*tmp24 - A(1,1)*tmp30 + A(1,2)*tmp33 - A(1,4)*tmp35;
667 
668  B(2,2) = A(0,0)*tmp36 - A(0,1)*tmp38 + A(0,3)*tmp40 - A(0,4)*tmp41 + A(0,5)*tmp42;
669  B(3,2) = - A(0,0)*tmp37 + A(0,1)*tmp39 - A(0,2)*tmp40 + A(0,4)*tmp43 - A(0,5)*tmp44;
670 
671  tmp1 = A(0,3)*A(1,4) - A(0,4)*A(1,3);
672  tmp2 = A(0,2)*A(1,4) - A(0,4)*A(1,2);
673  tmp3 = A(0,2)*A(1,3) - A(0,3)*A(1,2);
674  tmp4 = A(0,1)*A(1,4) - A(0,4)*A(1,1);
675  tmp5 = A(0,1)*A(1,3) - A(0,3)*A(1,1);
676  tmp6 = A(0,1)*A(1,2) - A(0,2)*A(1,1);
677  tmp7 = A(0,0)*A(1,4) - A(0,4)*A(1,0);
678  tmp8 = A(0,0)*A(1,3) - A(0,3)*A(1,0);
679  tmp9 = A(0,0)*A(1,2) - A(0,2)*A(1,0);
680  tmp10 = A(0,0)*A(1,1) - A(0,1)*A(1,0);
681  tmp11 = A(0,3)*A(1,5) - A(0,5)*A(1,3);
682  tmp12 = A(0,2)*A(1,5) - A(0,5)*A(1,2);
683  tmp13 = A(0,1)*A(1,5) - A(0,5)*A(1,1);
684  tmp14 = A(0,0)*A(1,5) - A(0,5)*A(1,0);
685  tmp15 = A(0,4)*A(1,5) - A(0,5)*A(1,4);
686 
687  tmp16 = A(2,3)*tmp15 - A(2,4)*tmp11 + A(2,5)*tmp1;
688  tmp17 = A(2,2)*tmp15 - A(2,4)*tmp12 + A(2,5)*tmp2;
689  tmp18 = A(2,2)*tmp11 - A(2,3)*tmp12 + A(2,5)*tmp3;
690  tmp19 = A(2,2)*tmp1 - A(2,3)*tmp2 + A(2,4)*tmp3;
691  tmp20 = A(2,1)*tmp15 - A(2,4)*tmp13 + A(2,5)*tmp4;
692  tmp21 = A(2,1)*tmp11 - A(2,3)*tmp13 + A(2,5)*tmp5;
693  tmp22 = A(2,1)*tmp1 - A(2,3)*tmp4 + A(2,4)*tmp5;
694  tmp23 = A(2,1)*tmp12 - A(2,2)*tmp13 + A(2,5)*tmp6;
695  tmp24 = A(2,1)*tmp2 - A(2,2)*tmp4 + A(2,4)*tmp6;
696  tmp25 = A(2,1)*tmp3 - A(2,2)*tmp5 + A(2,3)*tmp6;
697  tmp26 = A(2,0)*tmp15 - A(2,4)*tmp14 + A(2,5)*tmp7;
698  tmp27 = A(2,0)*tmp11 - A(2,3)*tmp14 + A(2,5)*tmp8;
699  tmp28 = A(2,0)*tmp1 - A(2,3)*tmp7 + A(2,4)*tmp8;
700  tmp29 = A(2,0)*tmp12 - A(2,2)*tmp14 + A(2,5)*tmp9;
701  tmp30 = A(2,0)*tmp2 - A(2,2)*tmp7 + A(2,4)*tmp9;
702  tmp31 = A(2,0)*tmp3 - A(2,2)*tmp8 + A(2,3)*tmp9;
703  tmp32 = A(2,0)*tmp13 - A(2,1)*tmp14 + A(2,5)*tmp10;
704  tmp33 = A(2,0)*tmp4 - A(2,1)*tmp7 + A(2,4)*tmp10;
705  tmp34 = A(2,0)*tmp5 - A(2,1)*tmp8 + A(2,3)*tmp10;
706  tmp35 = A(2,0)*tmp6 - A(2,1)*tmp9 + A(2,2)*tmp10;
707 
708  tmp36 = A(3,1)*tmp16 - A(3,3)*tmp20 + A(3,4)*tmp21 - A(3,5)*tmp22;
709  tmp37 = A(3,1)*tmp17 - A(3,2)*tmp20 + A(3,4)*tmp23 - A(3,5)*tmp24;
710  tmp38 = A(3,0)*tmp16 - A(3,3)*tmp26 + A(3,4)*tmp27 - A(3,5)*tmp28;
711  tmp39 = A(3,0)*tmp17 - A(3,2)*tmp26 + A(3,4)*tmp29 - A(3,5)*tmp30;
712  tmp40 = A(3,0)*tmp20 - A(3,1)*tmp26 + A(3,4)*tmp32 - A(3,5)*tmp33;
713  tmp41 = A(3,0)*tmp21 - A(3,1)*tmp27 + A(3,3)*tmp32 - A(3,5)*tmp34;
714  tmp42 = A(3,0)*tmp22 - A(3,1)*tmp28 + A(3,3)*tmp33 - A(3,4)*tmp34;
715  tmp43 = A(3,0)*tmp23 - A(3,1)*tmp29 + A(3,2)*tmp32 - A(3,5)*tmp35;
716  tmp44 = A(3,0)*tmp24 - A(3,1)*tmp30 + A(3,2)*tmp33 - A(3,4)*tmp35;
717 
718  B(2,4) = - A(5,0)*tmp36 + A(5,1)*tmp38 - A(5,3)*tmp40 + A(5,4)*tmp41 - A(5,5)*tmp42;
719  B(2,5) = A(4,0)*tmp36 - A(4,1)*tmp38 + A(4,3)*tmp40 - A(4,4)*tmp41 + A(4,5)*tmp42;
720  B(3,4) = A(5,0)*tmp37 - A(5,1)*tmp39 + A(5,2)*tmp40 - A(5,4)*tmp43 + A(5,5)*tmp44;
721  B(3,5) = - A(4,0)*tmp37 + A(4,1)*tmp39 - A(4,2)*tmp40 + A(4,4)*tmp43 - A(4,5)*tmp44;
722 
723  tmp36 = A(3,1)*tmp18 - A(3,2)*tmp21 + A(3,3)*tmp23 - A(3,5)*tmp25;
724  tmp37 = A(3,1)*tmp19 - A(3,2)*tmp22 + A(3,3)*tmp24 - A(3,4)*tmp25;
725  tmp38 = A(3,0)*tmp18 - A(3,2)*tmp27 + A(3,3)*tmp29 - A(3,5)*tmp31;
726  tmp39 = A(3,0)*tmp19 - A(3,2)*tmp28 + A(3,3)*tmp30 - A(3,4)*tmp31;
727  tmp40 = A(3,0)*tmp25 - A(3,1)*tmp31 + A(3,2)*tmp34 - A(3,3)*tmp35;
728 
729  B(4,4) = - A(5,0)*tmp36 + A(5,1)*tmp38 - A(5,2)*tmp41 + A(5,3)*tmp43 - A(5,5)*tmp40;
730  B(4,5) = A(4,0)*tmp36 - A(4,1)*tmp38 + A(4,2)*tmp41 - A(4,3)*tmp43 + A(4,5)*tmp40;
731  B(5,5) = - A(4,0)*tmp37 + A(4,1)*tmp39 - A(4,2)*tmp42 + A(4,3)*tmp44 - A(4,4)*tmp40;
732 
733  tmp36 = A(4,1)*tmp17 - A(4,2)*tmp20 + A(4,4)*tmp23 - A(4,5)*tmp24;
734  tmp37 = A(4,0)*tmp17 - A(4,2)*tmp26 + A(4,4)*tmp29 - A(4,5)*tmp30;
735  tmp38 = A(4,0)*tmp20 - A(4,1)*tmp26 + A(4,4)*tmp32 - A(4,5)*tmp33;
736  tmp39 = A(4,0)*tmp23 - A(4,1)*tmp29 + A(4,2)*tmp32 - A(4,5)*tmp35;
737  tmp40 = A(4,0)*tmp24 - A(4,1)*tmp30 + A(4,2)*tmp33 - A(4,4)*tmp35;
738 
739  B(3,3) = - A(5,0)*tmp36 + A(5,1)*tmp37 - A(5,2)*tmp38 + A(5,4)*tmp39 - A(5,5)*tmp40;
740 
741  B(0,2) = conj( B(2,0) );
742  B(0,3) = conj( B(3,0) );
743  B(0,4) = conj( B(4,0) );
744  B(0,5) = conj( B(5,0) );
745  B(1,0) = conj( B(0,1) );
746  B(1,2) = conj( B(2,1) );
747  B(1,3) = conj( B(3,1) );
748  B(1,4) = conj( B(4,1) );
749  B(1,5) = conj( B(5,1) );
750  B(2,3) = conj( B(3,2) );
751  B(4,2) = conj( B(2,4) );
752  B(4,3) = conj( B(3,4) );
753  B(5,2) = conj( B(2,5) );
754  B(5,3) = conj( B(3,5) );
755  B(5,4) = conj( B(4,5) );
756 
757  const ET det( A(0,0)*B(0,0) + A(0,1)*B(1,0) + A(0,2)*B(2,0) +
758  A(0,3)*B(3,0) + A(0,4)*B(4,0) + A(0,5)*B(5,0) );
759 
760  if( isDefault( det ) ) {
761  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
762  }
763 
764  B /= det;
765 
766  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
767 }
769 //*************************************************************************************************
770 
771 
772 //*************************************************************************************************
795 template< typename MT // Type of the dense matrix
796  , bool SO > // Storage order of the dense matrix
797 inline void invertByDefault( HermitianMatrix<MT,SO,true>& m )
798 {
799  invertByLDLH( m );
800 }
802 //*************************************************************************************************
803 
804 
805 //*************************************************************************************************
828 template< typename MT // Type of the dense matrix
829  , bool SO > // Storage order of the dense matrix
830 inline void invertByLU( HermitianMatrix<MT,SO,true>& m )
831 {
833 
834  MT tmp( m.matrix_ );
835  invertByLU( tmp );
836  move( m.matrix_, tmp );
837 
838  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
839 }
841 //*************************************************************************************************
842 
843 
844 //*************************************************************************************************
867 template< typename MT // Type of the dense matrix
868  , bool SO > // Storage order of the dense matrix
869 inline void invertByLDLT( HermitianMatrix<MT,SO,true>& m )
870 {
872 
873  MT tmp( m.matrix_ );
874  invertByLDLT( tmp );
875  move( m.matrix_, tmp );
876 
877  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
878 }
880 //*************************************************************************************************
881 
882 
883 //*************************************************************************************************
906 template< typename MT // Type of the dense matrix
907  , bool SO > // Storage order of the dense matrix
908 inline void invertByLDLH( HermitianMatrix<MT,SO,true>& m )
909 {
911 
912  MT tmp( m.matrix_ );
913  invertByLDLH( tmp );
914  move( m.matrix_, tmp );
915 
916  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
917 }
919 //*************************************************************************************************
920 
921 
922 //*************************************************************************************************
945 template< typename MT // Type of the dense matrix
946  , bool SO > // Storage order of the dense matrix
947 inline void invertByLLH( HermitianMatrix<MT,SO,true>& m )
948 {
950 
951  MT tmp( m.matrix_ );
952  invertByLLH( tmp );
953  move( m.matrix_, tmp );
954 
955  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
956 }
958 //*************************************************************************************************
959 
960 
961 //*************************************************************************************************
977 template< typename MT // Type of the adapted matrix
978  , bool SO // Storage order of the adapted matrix
979  , bool DF // Density flag
980  , typename VT > // Type of the right-hand side vector
981 inline bool tryAssign( const HermitianMatrix<MT,SO,DF>& lhs,
982  const Vector<VT,false>& rhs, size_t row, size_t column )
983 {
985 
986  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
987  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
988  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
989 
990  UNUSED_PARAMETER( lhs );
991 
992  typedef typename HermitianMatrix<MT,SO,DF>::ElementType ET;
993 
994  return ( IsBuiltin<ET>::value ||
995  column < row ||
996  (~rhs).size() <= column - row ||
997  isReal( (~rhs)[column-row] ) );
998 
999  return true;
1000 }
1002 //*************************************************************************************************
1003 
1004 
1005 //*************************************************************************************************
1021 template< typename MT // Type of the adapted matrix
1022  , bool SO // Storage order of the adapted matrix
1023  , bool DF // Density flag
1024  , typename VT > // Type of the right-hand side vector
1025 inline bool tryAssign( const HermitianMatrix<MT,SO,DF>& lhs,
1026  const Vector<VT,true>& rhs, size_t row, size_t column )
1027 {
1029 
1030  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1031  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1032  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1033 
1034  UNUSED_PARAMETER( lhs );
1035 
1036  typedef typename HermitianMatrix<MT,SO,DF>::ElementType ET;
1037 
1038  return ( IsBuiltin<ET>::value ||
1039  row < column ||
1040  (~rhs).size() <= row - column ||
1041  isReal( (~rhs)[row-column] ) );
1042 
1043  return true;
1044 }
1046 //*************************************************************************************************
1047 
1048 
1049 //*************************************************************************************************
1065 template< typename MT1 // Type of the adapted matrix
1066  , bool SO1 // Storage order of the adapted matrix
1067  , bool DF // Density flag
1068  , typename MT2 // Type of the right-hand side matrix
1069  , bool SO2 > // Storage order of the right-hand side matrix
1070 inline bool tryAssign( const HermitianMatrix<MT1,SO1,DF>& lhs,
1071  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1072 {
1074 
1075  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1076  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1077  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1078  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1079 
1080  UNUSED_PARAMETER( lhs );
1081 
1082  const size_t M( (~rhs).rows() );
1083  const size_t N( (~rhs).columns() );
1084 
1085  if( ( row + M <= column ) || ( column + N <= row ) )
1086  return true;
1087 
1088  const bool lower( row > column );
1089  const size_t size ( min( row + M, column + N ) - ( lower ? row : column ) );
1090 
1091  if( size < 2UL )
1092  return true;
1093 
1094  const size_t subrow( lower ? 0UL : column - row );
1095  const size_t subcol( lower ? row - column : 0UL );
1096 
1097  return isHermitian( submatrix( ~rhs, subrow, subcol, size, size ) );
1098 }
1100 //*************************************************************************************************
1101 
1102 
1103 //*************************************************************************************************
1119 template< typename MT // Type of the adapted matrix
1120  , bool SO // Storage order of the adapted matrix
1121  , bool DF // Density flag
1122  , typename VT // Type of the right-hand side vector
1123  , bool TF > // Transpose flag of the right-hand side vector
1124 inline bool tryAddAssign( const HermitianMatrix<MT,SO,DF>& lhs,
1125  const Vector<VT,TF>& rhs, size_t row, size_t column )
1126 {
1127  return tryAssign( lhs, ~rhs, row, column );
1128 }
1130 //*************************************************************************************************
1131 
1132 
1133 //*************************************************************************************************
1149 template< typename MT1 // Type of the adapted matrix
1150  , bool SO1 // Storage order of the adapted matrix
1151  , bool DF // Density flag
1152  , typename MT2 // Type of the right-hand side matrix
1153  , bool SO2 > // Storage order of the right-hand side matrix
1154 inline bool tryAddAssign( const HermitianMatrix<MT1,SO1,DF>& lhs,
1155  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1156 {
1157  return tryAssign( lhs, ~rhs, row, column );
1158 }
1160 //*************************************************************************************************
1161 
1162 
1163 //*************************************************************************************************
1180 template< typename MT // Type of the adapted matrix
1181  , bool SO // Storage order of the adapted matrix
1182  , bool DF // Density flag
1183  , typename VT // Type of the right-hand side vector
1184  , bool TF > // Transpose flag of the right-hand side vector
1185 inline bool trySubAssign( const HermitianMatrix<MT,SO,DF>& lhs,
1186  const Vector<VT,TF>& rhs, size_t row, size_t column )
1187 {
1188  return tryAssign( lhs, ~rhs, row, column );
1189 }
1191 //*************************************************************************************************
1192 
1193 
1194 //*************************************************************************************************
1211 template< typename MT1 // Type of the adapted matrix
1212  , bool SO1 // Storage order of the adapted matrix
1213  , bool DF // Density flag
1214  , typename MT2 // Type of the right-hand side matrix
1215  , bool SO2 > // Storage order of the right-hand side matrix
1216 inline bool trySubAssign( const HermitianMatrix<MT1,SO1,DF>& lhs,
1217  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1218 {
1219  return tryAssign( lhs, ~rhs, row, column );
1220 }
1222 //*************************************************************************************************
1223 
1224 
1225 //*************************************************************************************************
1242 template< typename MT // Type of the adapted matrix
1243  , bool SO // Storage order of the adapted matrix
1244  , bool DF // Density flag
1245  , typename VT // Type of the right-hand side vector
1246  , bool TF > // Transpose flag of the right-hand side vector
1247 inline bool tryMultAssign( const HermitianMatrix<MT,SO,DF>& lhs,
1248  const Vector<VT,TF>& rhs, size_t row, size_t column )
1249 {
1250  return tryAssign( lhs, ~rhs, row, column );
1251 }
1253 //*************************************************************************************************
1254 
1255 
1256 
1257 
1258 //=================================================================================================
1259 //
1260 // ROWS SPECIALIZATIONS
1261 //
1262 //=================================================================================================
1263 
1264 //*************************************************************************************************
1266 template< typename MT, bool SO, bool DF >
1267 struct Rows< HermitianMatrix<MT,SO,DF> > : public Rows<MT>
1268 {};
1270 //*************************************************************************************************
1271 
1272 
1273 
1274 
1275 //=================================================================================================
1276 //
1277 // COLUMNS SPECIALIZATIONS
1278 //
1279 //=================================================================================================
1280 
1281 //*************************************************************************************************
1283 template< typename MT, bool SO, bool DF >
1284 struct Columns< HermitianMatrix<MT,SO,DF> > : public Columns<MT>
1285 {};
1287 //*************************************************************************************************
1288 
1289 
1290 
1291 
1292 //=================================================================================================
1293 //
1294 // ISSQUARE SPECIALIZATIONS
1295 //
1296 //=================================================================================================
1297 
1298 //*************************************************************************************************
1300 template< typename MT, bool SO, bool DF >
1301 struct IsSquare< HermitianMatrix<MT,SO,DF> > : public IsTrue<true>
1302 {};
1304 //*************************************************************************************************
1305 
1306 
1307 
1308 
1309 //=================================================================================================
1310 //
1311 // ISSYMMETRIC SPECIALIZATIONS
1312 //
1313 //=================================================================================================
1314 
1315 //*************************************************************************************************
1317 template< typename MT, bool SO, bool DF >
1318 struct IsSymmetric< HermitianMatrix<MT,SO,DF> >
1319  : public IsTrue< IsBuiltin<typename MT::ElementType>::value >
1320 {};
1322 //*************************************************************************************************
1323 
1324 
1325 
1326 
1327 //=================================================================================================
1328 //
1329 // ISHERMITIAN SPECIALIZATIONS
1330 //
1331 //=================================================================================================
1332 
1333 //*************************************************************************************************
1335 template< typename MT, bool SO, bool DF >
1336 struct IsHermitian< HermitianMatrix<MT,SO,DF> > : public IsTrue<true>
1337 {};
1339 //*************************************************************************************************
1340 
1341 
1342 
1343 
1344 //=================================================================================================
1345 //
1346 // ISADAPTOR SPECIALIZATIONS
1347 //
1348 //=================================================================================================
1349 
1350 //*************************************************************************************************
1352 template< typename MT, bool SO, bool DF >
1353 struct IsAdaptor< HermitianMatrix<MT,SO,DF> > : public IsTrue<true>
1354 {};
1356 //*************************************************************************************************
1357 
1358 
1359 
1360 
1361 //=================================================================================================
1362 //
1363 // ISRESTRICTED SPECIALIZATIONS
1364 //
1365 //=================================================================================================
1366 
1367 //*************************************************************************************************
1369 template< typename MT, bool SO, bool DF >
1370 struct IsRestricted< HermitianMatrix<MT,SO,DF> > : public IsTrue<true>
1371 {};
1373 //*************************************************************************************************
1374 
1375 
1376 
1377 
1378 //=================================================================================================
1379 //
1380 // HASCONSTDATAACCESS SPECIALIZATIONS
1381 //
1382 //=================================================================================================
1383 
1384 //*************************************************************************************************
1386 template< typename MT, bool SO >
1387 struct HasConstDataAccess< HermitianMatrix<MT,SO,true> > : public IsTrue<true>
1388 {};
1390 //*************************************************************************************************
1391 
1392 
1393 
1394 
1395 //=================================================================================================
1396 //
1397 // ISALIGNED SPECIALIZATIONS
1398 //
1399 //=================================================================================================
1400 
1401 //*************************************************************************************************
1403 template< typename MT, bool SO, bool DF >
1404 struct IsAligned< HermitianMatrix<MT,SO,DF> > : public IsTrue< IsAligned<MT>::value >
1405 {};
1407 //*************************************************************************************************
1408 
1409 
1410 
1411 
1412 //=================================================================================================
1413 //
1414 // ISPADDED SPECIALIZATIONS
1415 //
1416 //=================================================================================================
1417 
1418 //*************************************************************************************************
1420 template< typename MT, bool SO, bool DF >
1421 struct IsPadded< HermitianMatrix<MT,SO,DF> > : public IsTrue< IsPadded<MT>::value >
1422 {};
1424 //*************************************************************************************************
1425 
1426 
1427 
1428 
1429 //=================================================================================================
1430 //
1431 // ISRESIZABLE SPECIALIZATIONS
1432 //
1433 //=================================================================================================
1434 
1435 //*************************************************************************************************
1437 template< typename MT, bool SO, bool DF >
1438 struct IsResizable< HermitianMatrix<MT,SO,DF> > : public IsTrue< IsResizable<MT>::value >
1439 {};
1441 //*************************************************************************************************
1442 
1443 
1444 
1445 
1446 //=================================================================================================
1447 //
1448 // REMOVEADAPTOR SPECIALIZATIONS
1449 //
1450 //=================================================================================================
1451 
1452 //*************************************************************************************************
1454 template< typename MT, bool SO, bool DF >
1455 struct RemoveAdaptor< HermitianMatrix<MT,SO,DF> >
1456 {
1457  typedef MT Type;
1458 };
1460 //*************************************************************************************************
1461 
1462 
1463 
1464 
1465 //=================================================================================================
1466 //
1467 // ADDTRAIT SPECIALIZATIONS
1468 //
1469 //=================================================================================================
1470 
1471 //*************************************************************************************************
1473 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1474 struct AddTrait< HermitianMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1475 {
1476  typedef typename AddTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1477 };
1478 
1479 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1480 struct AddTrait< StaticMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1481 {
1482  typedef typename AddTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1483 };
1484 
1485 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1486 struct AddTrait< HermitianMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1487 {
1488  typedef typename AddTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1489 };
1490 
1491 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1492 struct AddTrait< HybridMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1493 {
1494  typedef typename AddTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1495 };
1496 
1497 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1498 struct AddTrait< HermitianMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1499 {
1500  typedef typename AddTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1501 };
1502 
1503 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1504 struct AddTrait< DynamicMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1505 {
1506  typedef typename AddTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1507 };
1508 
1509 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1510 struct AddTrait< HermitianMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1511 {
1512  typedef typename AddTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1513 };
1514 
1515 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1516 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, HermitianMatrix<MT,SO2,DF> >
1517 {
1518  typedef typename AddTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1519 };
1520 
1521 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1522 struct AddTrait< HermitianMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1523 {
1524  typedef typename AddTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1525 };
1526 
1527 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1528 struct AddTrait< CompressedMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1529 {
1530  typedef typename AddTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1531 };
1532 
1533 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1534 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1535 {
1536  typedef typename If< IsSymmetric< HermitianMatrix<MT1,SO1,DF1> >
1537  , SymmetricMatrix< typename AddTrait<MT1,MT2>::Type >
1538  , typename AddTrait<MT1,MT2>::Type >::Type Type;
1539 };
1540 
1541 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1542 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1543 {
1544  typedef typename If< IsSymmetric< HermitianMatrix<MT2,SO2,DF2> >
1545  , SymmetricMatrix< typename AddTrait<MT1,MT2>::Type >
1546  , typename AddTrait<MT1,MT2>::Type >::Type Type;
1547 };
1548 
1549 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1550 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1551 {
1552  typedef HermitianMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1553 };
1555 //*************************************************************************************************
1556 
1557 
1558 
1559 
1560 //=================================================================================================
1561 //
1562 // SUBTRAIT SPECIALIZATIONS
1563 //
1564 //=================================================================================================
1565 
1566 //*************************************************************************************************
1568 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1569 struct SubTrait< HermitianMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1570 {
1571  typedef typename SubTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1572 };
1573 
1574 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1575 struct SubTrait< StaticMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1576 {
1577  typedef typename SubTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1578 };
1579 
1580 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1581 struct SubTrait< HermitianMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1582 {
1583  typedef typename SubTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1584 };
1585 
1586 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1587 struct SubTrait< HybridMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1588 {
1589  typedef typename SubTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1590 };
1591 
1592 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1593 struct SubTrait< HermitianMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1594 {
1595  typedef typename SubTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1596 };
1597 
1598 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1599 struct SubTrait< DynamicMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1600 {
1601  typedef typename SubTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1602 };
1603 
1604 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1605 struct SubTrait< HermitianMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1606 {
1607  typedef typename SubTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1608 };
1609 
1610 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1611 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, HermitianMatrix<MT,SO2,DF> >
1612 {
1613  typedef typename SubTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1614 };
1615 
1616 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1617 struct SubTrait< HermitianMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1618 {
1619  typedef typename SubTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1620 };
1621 
1622 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1623 struct SubTrait< CompressedMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1624 {
1625  typedef typename SubTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1626 };
1627 
1628 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1629 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2> >
1630 {
1631  typedef typename If< IsSymmetric< HermitianMatrix<MT1,SO1,DF1> >
1632  , SymmetricMatrix< typename SubTrait<MT1,MT2>::Type >
1633  , typename SubTrait<MT1,MT2>::Type >::Type Type;
1634 };
1635 
1636 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1637 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1638 {
1639  typedef typename If< IsSymmetric< HermitianMatrix<MT2,SO2,DF2> >
1640  , SymmetricMatrix< typename SubTrait<MT1,MT2>::Type >
1641  , typename SubTrait<MT1,MT2>::Type >::Type Type;
1642 };
1643 
1644 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1645 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1646 {
1647  typedef HermitianMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1648 };
1650 //*************************************************************************************************
1651 
1652 
1653 
1654 
1655 //=================================================================================================
1656 //
1657 // MULTTRAIT SPECIALIZATIONS
1658 //
1659 //=================================================================================================
1660 
1661 //*************************************************************************************************
1663 template< typename MT, bool SO, bool DF, typename T >
1664 struct MultTrait< HermitianMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
1665 {
1666  typedef HermitianMatrix< typename MultTrait<MT,T>::Type > Type;
1667 };
1668 
1669 template< typename T, typename MT, bool SO, bool DF >
1670 struct MultTrait< T, HermitianMatrix<MT,SO,DF>, typename EnableIf< IsNumeric<T> >::Type >
1671 {
1672  typedef HermitianMatrix< typename MultTrait<T,MT>::Type > Type;
1673 };
1674 
1675 template< typename MT, bool SO, bool DF, typename T, size_t N >
1676 struct MultTrait< HermitianMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1677 {
1678  typedef typename MultTrait< MT, StaticVector<T,N,false> >::Type Type;
1679 };
1680 
1681 template< typename T, size_t N, typename MT, bool SO, bool DF >
1682 struct MultTrait< StaticVector<T,N,true>, HermitianMatrix<MT,SO,DF> >
1683 {
1684  typedef typename MultTrait< StaticVector<T,N,true>, MT >::Type Type;
1685 };
1686 
1687 template< typename MT, bool SO, bool DF, typename T, size_t N >
1688 struct MultTrait< HermitianMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1689 {
1690  typedef typename MultTrait< MT, HybridVector<T,N,false> >::Type Type;
1691 };
1692 
1693 template< typename T, size_t N, typename MT, bool SO, bool DF >
1694 struct MultTrait< HybridVector<T,N,true>, HermitianMatrix<MT,SO,DF> >
1695 {
1696  typedef typename MultTrait< HybridVector<T,N,true>, MT >::Type Type;
1697 };
1698 
1699 template< typename MT, bool SO, bool DF, typename T >
1700 struct MultTrait< HermitianMatrix<MT,SO,DF>, DynamicVector<T,false> >
1701 {
1702  typedef typename MultTrait< MT, DynamicVector<T,false> >::Type Type;
1703 };
1704 
1705 template< typename T, typename MT, bool SO, bool DF >
1706 struct MultTrait< DynamicVector<T,true>, HermitianMatrix<MT,SO,DF> >
1707 {
1708  typedef typename MultTrait< DynamicVector<T,true>, MT >::Type Type;
1709 };
1710 
1711 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1712 struct MultTrait< HermitianMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1713 {
1714  typedef typename MultTrait< MT, CustomVector<T,AF,PF,false> >::Type Type;
1715 };
1716 
1717 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1718 struct MultTrait< CustomVector<T,AF,PF,true>, HermitianMatrix<MT,SO,DF> >
1719 {
1720  typedef typename MultTrait< CustomVector<T,AF,PF,true>, MT >::Type Type;
1721 };
1722 
1723 template< typename MT, bool SO, bool DF, typename T >
1724 struct MultTrait< HermitianMatrix<MT,SO,DF>, CompressedVector<T,false> >
1725 {
1726  typedef typename MultTrait< MT, CompressedVector<T,false> >::Type Type;
1727 };
1728 
1729 template< typename T, typename MT, bool SO, bool DF >
1730 struct MultTrait< CompressedVector<T,true>, HermitianMatrix<MT,SO,DF> >
1731 {
1732  typedef typename MultTrait< CompressedVector<T,true>, MT >::Type Type;
1733 };
1734 
1735 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1736 struct MultTrait< HermitianMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1737 {
1738  typedef typename MultTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1739 };
1740 
1741 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1742 struct MultTrait< StaticMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1743 {
1744  typedef typename MultTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1745 };
1746 
1747 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1748 struct MultTrait< HermitianMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1749 {
1750  typedef typename MultTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1751 };
1752 
1753 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1754 struct MultTrait< HybridMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1755 {
1756  typedef typename MultTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1757 };
1758 
1759 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1760 struct MultTrait< HermitianMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1761 {
1762  typedef typename MultTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1763 };
1764 
1765 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1766 struct MultTrait< DynamicMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1767 {
1768  typedef typename MultTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1769 };
1770 
1771 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1772 struct MultTrait< HermitianMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1773 {
1774  typedef typename MultTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1775 };
1776 
1777 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1778 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, HermitianMatrix<MT,SO2,DF> >
1779 {
1780  typedef typename MultTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1781 };
1782 
1783 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1784 struct MultTrait< HermitianMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1785 {
1786  typedef typename MultTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1787 };
1788 
1789 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1790 struct MultTrait< CompressedMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1791 {
1792  typedef typename MultTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1793 };
1794 
1795 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1796 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2> >
1797 {
1798  typedef typename MultTrait<MT1,MT2>::Type Type;
1799 };
1800 
1801 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1802 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1803 {
1804  typedef typename MultTrait<MT1,MT2>::Type Type;
1805 };
1806 
1807 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1808 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1809 {
1810  typedef typename MultTrait<MT1,MT2>::Type Type;
1811 };
1813 //*************************************************************************************************
1814 
1815 
1816 
1817 
1818 //=================================================================================================
1819 //
1820 // DIVTRAIT SPECIALIZATIONS
1821 //
1822 //=================================================================================================
1823 
1824 //*************************************************************************************************
1826 template< typename MT, bool SO, bool DF, typename T >
1827 struct DivTrait< HermitianMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
1828 {
1829  typedef HermitianMatrix< typename DivTrait<MT,T>::Type > Type;
1830 };
1832 //*************************************************************************************************
1833 
1834 
1835 
1836 
1837 //=================================================================================================
1838 //
1839 // MATHTRAIT SPECIALIZATIONS
1840 //
1841 //=================================================================================================
1842 
1843 //*************************************************************************************************
1845 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1846 struct MathTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1847 {
1848  typedef HermitianMatrix< typename MathTrait<MT1,MT2>::HighType > HighType;
1849  typedef HermitianMatrix< typename MathTrait<MT1,MT2>::LowType > LowType;
1850 };
1852 //*************************************************************************************************
1853 
1854 
1855 
1856 
1857 //=================================================================================================
1858 //
1859 // SUBMATRIXTRAIT SPECIALIZATIONS
1860 //
1861 //=================================================================================================
1862 
1863 //*************************************************************************************************
1865 template< typename MT, bool SO, bool DF >
1866 struct SubmatrixTrait< HermitianMatrix<MT,SO,DF> >
1867 {
1868  typedef typename SubmatrixTrait<MT>::Type Type;
1869 };
1871 //*************************************************************************************************
1872 
1873 
1874 
1875 
1876 //=================================================================================================
1877 //
1878 // ROWTRAIT SPECIALIZATIONS
1879 //
1880 //=================================================================================================
1881 
1882 //*************************************************************************************************
1884 template< typename MT, bool SO, bool DF >
1885 struct RowTrait< HermitianMatrix<MT,SO,DF> >
1886 {
1887  typedef typename RowTrait<MT>::Type Type;
1888 };
1890 //*************************************************************************************************
1891 
1892 
1893 
1894 
1895 //=================================================================================================
1896 //
1897 // COLUMNTRAIT SPECIALIZATIONS
1898 //
1899 //=================================================================================================
1900 
1901 //*************************************************************************************************
1903 template< typename MT, bool SO, bool DF >
1904 struct ColumnTrait< HermitianMatrix<MT,SO,DF> >
1905 {
1906  typedef typename ColumnTrait<MT>::Type Type;
1907 };
1909 //*************************************************************************************************
1910 
1911 } // namespace blaze
1912 
1913 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Header file for mathematical functions.
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Header file for the row trait.
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:569
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
MT::ElementType det(const DenseMatrix< MT, SO > &dm)
Computation of the determinant of the given dense square matrix.
Definition: DMatDetExpr.h:382
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:107
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
void move(CustomMatrix< Type, AF, PF, SO > &dst, CustomMatrix< Type, AF, PF, SO > &src)
Moving the contents of one custom matrix to another.
Definition: CustomMatrix.h:6085
Header file for the implementation of the base template of the SymmetricMatrix.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
ConjExprTrait< typename DiagonalProxy< MT >::RepresentedType >::Type conj(const DiagonalProxy< MT > &proxy)
Computing the complex conjugate of the represented element.
Definition: DiagonalProxy.h:487
Header file for the IsSquare type trait.
Header file for the multiplication trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for all forward declarations of the math module.
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1682
Header file for the Columns type trait.
Header file for the implementation of a fixed-size matrix.
Header file for the IsAligned type trait.
HermitianMatrix specialization for dense matrices.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Constraint on the data type.
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
Header file for the implementation of the base template of the HeritianMatrix.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:107
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Matrix adapter for Hermitian matrices.
Definition: Forward.h:49
Header file for the column trait.
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i...
Definition: BlasCompatible.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:256
Header file for the mathematical trait.
SubmatrixExprTrait< MT, unaligned >::Type submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:146
Header file for the IsBuiltin type trait.
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:767
Header file for the IsTrue value trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
HermitianMatrix specialization for sparse matrices.
Header file for exception macros.
Header file for the IsHermitian type trait.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the isReal shim.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101