Level2.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_BLAS_LEVEL2_H_
36 #define _BLAZE_MATH_BLAS_LEVEL2_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <boost/cast.hpp>
50 #include <blaze/system/BLAS.h>
51 #include <blaze/system/Inline.h>
52 #include <blaze/util/Assert.h>
53 #include <blaze/util/Complex.h>
57 
58 
59 namespace blaze {
60 
61 //=================================================================================================
62 //
63 // BLAS LEVEL 2 FUNCTIONS
64 //
65 //=================================================================================================
66 
67 //*************************************************************************************************
70 #if BLAZE_BLAS_MODE
71 
72 template< typename VT1, typename MT1, bool SO, typename VT2 >
73 BLAZE_ALWAYS_INLINE void sgemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
74  const DenseVector<VT2,false>& x, float alpha, float beta );
75 
76 template< typename VT1, typename VT2, typename MT1, bool SO >
77 BLAZE_ALWAYS_INLINE void sgemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
78  const DenseMatrix<MT1,SO>& A, float alpha, float beta );
79 
80 template< typename VT1, typename MT1, bool SO, typename VT2 >
81 BLAZE_ALWAYS_INLINE void dgemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
82  const DenseVector<VT2,false>& x, double alpha, double beta );
83 
84 template< typename VT1, typename VT2, typename MT1, bool SO >
85 BLAZE_ALWAYS_INLINE void dgemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
86  const DenseMatrix<MT1,SO>& A, double alpha, double beta );
87 
88 template< typename VT1, typename MT1, bool SO, typename VT2 >
89 BLAZE_ALWAYS_INLINE void cgemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
90  const DenseVector<VT2,false>& x, complex<float> alpha, complex<float> beta );
91 
92 template< typename VT1, typename VT2, typename MT1, bool SO >
93 BLAZE_ALWAYS_INLINE void cgemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
94  const DenseMatrix<MT1,SO>& A, complex<float> alpha, complex<float> beta );
95 
96 template< typename VT1, typename MT1, bool SO, typename VT2 >
97 BLAZE_ALWAYS_INLINE void zgemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
98  const DenseVector<VT2,false>& x, complex<double> alpha, complex<double> beta );
99 
100 template< typename VT1, typename VT2, typename MT1, bool SO >
101 BLAZE_ALWAYS_INLINE void zgemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
102  const DenseMatrix<MT1,SO>& A, complex<double> alpha, complex<double> beta );
103 
104 template< typename VT, typename MT, bool SO >
105 BLAZE_ALWAYS_INLINE void strmv( DenseVector<VT,false>& y, const DenseMatrix<MT,SO>& A,
106  CBLAS_UPLO uplo );
107 
108 template< typename VT, typename MT, bool SO >
109 BLAZE_ALWAYS_INLINE void strmv( DenseVector<VT,true>& y, const DenseMatrix<MT,SO>& A,
110  CBLAS_UPLO uplo );
111 
112 template< typename VT, typename MT, bool SO >
113 BLAZE_ALWAYS_INLINE void dtrmv( DenseVector<VT,false>& y, const DenseMatrix<MT,SO>& A,
114  CBLAS_UPLO uplo );
115 
116 template< typename VT, typename MT, bool SO >
117 BLAZE_ALWAYS_INLINE void dtrmv( DenseVector<VT,true>& y, const DenseMatrix<MT,SO>& A,
118  CBLAS_UPLO uplo );
119 
120 template< typename VT, typename MT, bool SO >
121 BLAZE_ALWAYS_INLINE void ctrmv( DenseVector<VT,false>& y, const DenseMatrix<MT,SO>& A,
122  CBLAS_UPLO uplo );
123 
124 template< typename VT, typename MT, bool SO >
125 BLAZE_ALWAYS_INLINE void ctrmv( DenseVector<VT,true>& y, const DenseMatrix<MT,SO>& A,
126  CBLAS_UPLO uplo );
127 
128 template< typename VT, typename MT, bool SO >
129 BLAZE_ALWAYS_INLINE void ztrmv( DenseVector<VT,false>& y, const DenseMatrix<MT,SO>& A,
130  CBLAS_UPLO uplo );
131 
132 template< typename VT, typename MT, bool SO >
133 BLAZE_ALWAYS_INLINE void ztrmv( DenseVector<VT,true>& y, const DenseMatrix<MT,SO>& A,
134  CBLAS_UPLO uplo );
135 
136 #endif
137 
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
142 #if BLAZE_BLAS_MODE
143 
159 template< typename VT1 // Type of the left-hand side target vector
160  , typename MT1 // Type of the left-hand side matrix operand
161  , bool SO // Storage order of the left-hand side matrix operand
162  , typename VT2 > // Type of the right-hand side vector operand
163 BLAZE_ALWAYS_INLINE void sgemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
164  const DenseVector<VT2,false>& x, float alpha, float beta )
165 {
166  using boost::numeric_cast;
167 
171 
175 
179 
180  const int M ( numeric_cast<int>( (~A).rows() ) );
181  const int N ( numeric_cast<int>( (~A).columns() ) );
182  const int lda( numeric_cast<int>( (~A).spacing() ) );
183 
184  cblas_sgemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasNoTrans, M, N, alpha,
185  (~A).data(), lda, (~x).data(), 1, beta, (~y).data(), 1 );
186 }
187 #endif
188 //*************************************************************************************************
189 
190 
191 //*************************************************************************************************
192 #if BLAZE_BLAS_MODE
193 
209 template< typename VT1 // Type of the left-hand side target vector
210  , typename VT2 // Type of the left-hand side vector operand
211  , typename MT1 // Type of the right-hand side matrix operand
212  , bool SO > // Storage order of the right-hand side matrix operand
213 BLAZE_ALWAYS_INLINE void sgemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
214  const DenseMatrix<MT1,SO>& A, float alpha, float beta )
215 {
216  using boost::numeric_cast;
217 
221 
225 
229 
230  const int M ( numeric_cast<int>( (~A).rows() ) );
231  const int N ( numeric_cast<int>( (~A).columns() ) );
232  const int lda( numeric_cast<int>( (~A).spacing() ) );
233 
234  cblas_sgemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasTrans, M, N, alpha,
235  (~A).data(), lda, (~x).data(), 1, beta, (~y).data(), 1 );
236 }
237 #endif
238 //*************************************************************************************************
239 
240 
241 //*************************************************************************************************
242 #if BLAZE_BLAS_MODE
243 
259 template< typename VT1 // Type of the left-hand side target vector
260  , typename MT1 // Type of the left-hand side matrix operand
261  , bool SO // Storage order of the left-hand side matrix operand
262  , typename VT2 > // Type of the right-hand side vector operand
263 BLAZE_ALWAYS_INLINE void dgemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
264  const DenseVector<VT2,false>& x, double alpha, double beta )
265 {
266  using boost::numeric_cast;
267 
271 
275 
279 
280  const int M ( numeric_cast<int>( (~A).rows() ) );
281  const int N ( numeric_cast<int>( (~A).columns() ) );
282  const int lda( numeric_cast<int>( (~A).spacing() ) );
283 
284  cblas_dgemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasNoTrans, M, N, alpha,
285  (~A).data(), lda, (~x).data(), 1, beta, (~y).data(), 1 );
286 }
287 #endif
288 //*************************************************************************************************
289 
290 
291 //*************************************************************************************************
292 #if BLAZE_BLAS_MODE
293 
309 template< typename VT1 // Type of the left-hand side target vector
310  , typename VT2 // Type of the left-hand side vector operand
311  , typename MT1 // Type of the right-hand side matrix operand
312  , bool SO > // Storage order of the right-hand side matrix operand
313 BLAZE_ALWAYS_INLINE void dgemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
314  const DenseMatrix<MT1,SO>& A, double alpha, double beta )
315 {
316  using boost::numeric_cast;
317 
321 
325 
329 
330  const int M ( numeric_cast<int>( (~A).rows() ) );
331  const int N ( numeric_cast<int>( (~A).columns() ) );
332  const int lda( numeric_cast<int>( (~A).spacing() ) );
333 
334  cblas_dgemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasTrans, M, N, alpha,
335  (~A).data(), lda, (~x).data(), 1, beta, (~y).data(), 1 );
336 }
337 #endif
338 //*************************************************************************************************
339 
340 
341 //*************************************************************************************************
342 #if BLAZE_BLAS_MODE
343 
360 template< typename VT1 // Type of the left-hand side target vector
361  , typename MT1 // Type of the left-hand side matrix operand
362  , bool SO // Storage order of the left-hand side matrix operand
363  , typename VT2 > // Type of the right-hand side vector operand
364 BLAZE_ALWAYS_INLINE void cgemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
365  const DenseVector<VT2,false>& x, complex<float> alpha, complex<float> beta )
366 {
367  using boost::numeric_cast;
368 
372 
376 
380  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename VT1::ElementType::value_type );
381  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename MT1::ElementType::value_type );
382  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename VT2::ElementType::value_type );
383 
384  const int M ( numeric_cast<int>( (~A).rows() ) );
385  const int N ( numeric_cast<int>( (~A).columns() ) );
386  const int lda( numeric_cast<int>( (~A).spacing() ) );
387 
388  cblas_cgemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasNoTrans, M, N, &alpha,
389  (~A).data(), lda, (~x).data(), 1, &beta, (~y).data(), 1 );
390 }
391 #endif
392 //*************************************************************************************************
393 
394 
395 //*************************************************************************************************
396 #if BLAZE_BLAS_MODE
397 
414 template< typename VT1 // Type of the left-hand side target vector
415  , typename VT2 // Type of the left-hand side vector operand
416  , typename MT1 // Type of the right-hand side matrix operand
417  , bool SO > // Storage order of the right-hand side matrix operand
418 BLAZE_ALWAYS_INLINE void cgemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
419  const DenseMatrix<MT1,SO>& A, complex<float> alpha, complex<float> beta )
420 {
421  using boost::numeric_cast;
422 
426 
430 
434  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename VT1::ElementType::value_type );
435  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename VT2::ElementType::value_type );
436  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename MT1::ElementType::value_type );
437 
438  const int M ( numeric_cast<int>( (~A).rows() ) );
439  const int N ( numeric_cast<int>( (~A).columns() ) );
440  const int lda( numeric_cast<int>( (~A).spacing() ) );
441 
442  cblas_cgemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasTrans, M, N, &alpha,
443  (~A).data(), lda, (~x).data(), 1, &beta, (~y).data(), 1 );
444 }
445 #endif
446 //*************************************************************************************************
447 
448 
449 //*************************************************************************************************
450 #if BLAZE_BLAS_MODE
451 
468 template< typename VT1 // Type of the left-hand side target vector
469  , typename MT1 // Type of the left-hand side matrix operand
470  , bool SO // Storage order of the left-hand side matrix operand
471  , typename VT2 > // Type of the right-hand side vector operand
472 BLAZE_ALWAYS_INLINE void zgemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
473  const DenseVector<VT2,false>& x, complex<double> alpha, complex<double> beta )
474 {
475  using boost::numeric_cast;
476 
480 
484 
488  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename VT1::ElementType::value_type );
489  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename MT1::ElementType::value_type );
490  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename VT2::ElementType::value_type );
491 
492  const int M ( numeric_cast<int>( (~A).rows() ) );
493  const int N ( numeric_cast<int>( (~A).columns() ) );
494  const int lda( numeric_cast<int>( (~A).spacing() ) );
495 
496  cblas_zgemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasNoTrans, M, N, &alpha,
497  (~A).data(), lda, (~x).data(), 1, &beta, (~y).data(), 1 );
498 }
499 #endif
500 //*************************************************************************************************
501 
502 
503 //*************************************************************************************************
504 #if BLAZE_BLAS_MODE
505 
522 template< typename VT1 // Type of the left-hand side target vector
523  , typename VT2 // Type of the left-hand side vector operand
524  , typename MT1 // Type of the right-hand side matrix operand
525  , bool SO > // Storage order of the right-hand side matrix operand
526 BLAZE_ALWAYS_INLINE void zgemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
527  const DenseMatrix<MT1,SO>& A, complex<double> alpha, complex<double> beta )
528 {
529  using boost::numeric_cast;
530 
534 
538 
542  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename VT1::ElementType::value_type );
543  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename VT2::ElementType::value_type );
544  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename MT1::ElementType::value_type );
545 
546  const int M ( numeric_cast<int>( (~A).rows() ) );
547  const int N ( numeric_cast<int>( (~A).columns() ) );
548  const int lda( numeric_cast<int>( (~A).spacing() ) );
549 
550  cblas_zgemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasTrans, M, N, &alpha,
551  (~A).data(), lda, (~x).data(), 1, &beta, (~y).data(), 1 );
552 }
553 #endif
554 //*************************************************************************************************
555 
556 
557 //*************************************************************************************************
558 #if BLAZE_BLAS_MODE
559 
573 template< typename VT // Type of the target vector
574  , typename MT // Type of the matrix operand
575  , bool SO > // Storage order of the matrix operand
576 BLAZE_ALWAYS_INLINE void strmv( DenseVector<VT,false>& y, const DenseMatrix<MT,SO>& A,
577  CBLAS_UPLO uplo )
578 {
579  using boost::numeric_cast;
580 
583 
586 
589 
590  BLAZE_INTERNAL_ASSERT( (~A).rows() == (~A).columns(), "Non-square triangular matrix detected" );
591  BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
592 
593  const int N ( numeric_cast<int>( (~A).rows() ) );
594  const int lda( numeric_cast<int>( (~A).spacing() ) );
595 
596  cblas_strmv( ( IsRowMajorMatrix<MT>::value )?( CblasRowMajor ):( CblasColMajor ),
597  uplo, CblasNoTrans, CblasNonUnit, N, (~A).data(), lda, (~y).data(), 1 );
598 }
599 #endif
600 //*************************************************************************************************
601 
602 
603 //*************************************************************************************************
604 #if BLAZE_BLAS_MODE
605 
619 template< typename VT // Type of the target vector
620  , typename MT // Type of the matrix operand
621  , bool SO > // Storage order of the matrix operand
622 BLAZE_ALWAYS_INLINE void strmv( DenseVector<VT,true>& y, const DenseMatrix<MT,SO>& A,
623  CBLAS_UPLO uplo )
624 {
625  using boost::numeric_cast;
626 
629 
632 
635 
636  BLAZE_INTERNAL_ASSERT( (~A).rows() == (~A).columns(), "Non-square triangular matrix detected" );
637  BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
638 
639  const int N ( numeric_cast<int>( (~A).rows() ) );
640  const int lda( numeric_cast<int>( (~A).spacing() ) );
641 
642  cblas_strmv( ( IsRowMajorMatrix<MT>::value )?( CblasRowMajor ):( CblasColMajor ),
643  uplo, CblasTrans, CblasNonUnit, N, (~A).data(), lda, (~y).data(), 1 );
644 }
645 #endif
646 //*************************************************************************************************
647 
648 
649 //*************************************************************************************************
650 #if BLAZE_BLAS_MODE
651 
665 template< typename VT // Type of the target vector
666  , typename MT // Type of the matrix operand
667  , bool SO > // Storage order of the matrix operand
668 BLAZE_ALWAYS_INLINE void dtrmv( DenseVector<VT,false>& y, const DenseMatrix<MT,SO>& A,
669  CBLAS_UPLO uplo )
670 {
671  using boost::numeric_cast;
672 
675 
678 
681 
682  BLAZE_INTERNAL_ASSERT( (~A).rows() == (~A).columns(), "Non-square triangular matrix detected" );
683  BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
684 
685  const int N ( numeric_cast<int>( (~A).rows() ) );
686  const int lda( numeric_cast<int>( (~A).spacing() ) );
687 
688  cblas_dtrmv( ( IsRowMajorMatrix<MT>::value )?( CblasRowMajor ):( CblasColMajor ),
689  uplo, CblasNoTrans, CblasNonUnit, N, (~A).data(), lda, (~y).data(), 1 );
690 }
691 #endif
692 //*************************************************************************************************
693 
694 
695 //*************************************************************************************************
696 #if BLAZE_BLAS_MODE
697 
711 template< typename VT // Type of the target vector
712  , typename MT // Type of the matrix operand
713  , bool SO > // Storage order of the matrix operand
714 BLAZE_ALWAYS_INLINE void dtrmv( DenseVector<VT,true>& y, const DenseMatrix<MT,SO>& A,
715  CBLAS_UPLO uplo )
716 {
717  using boost::numeric_cast;
718 
721 
724 
727 
728  BLAZE_INTERNAL_ASSERT( (~A).rows() == (~A).columns(), "Non-square triangular matrix detected" );
729  BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
730 
731  const int N ( numeric_cast<int>( (~A).rows() ) );
732  const int lda( numeric_cast<int>( (~A).spacing() ) );
733 
734  cblas_dtrmv( ( IsRowMajorMatrix<MT>::value )?( CblasRowMajor ):( CblasColMajor ),
735  uplo, CblasTrans, CblasNonUnit, N, (~A).data(), lda, (~y).data(), 1 );
736 }
737 #endif
738 //*************************************************************************************************
739 
740 
741 //*************************************************************************************************
742 #if BLAZE_BLAS_MODE
743 
757 template< typename VT // Type of the target vector
758  , typename MT // Type of the matrix operand
759  , bool SO > // Storage order of the matrix operand
760 BLAZE_ALWAYS_INLINE void ctrmv( DenseVector<VT,false>& y, const DenseMatrix<MT,SO>& A,
761  CBLAS_UPLO uplo )
762 {
763  using boost::numeric_cast;
764 
767 
770 
773  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename VT::ElementType::value_type );
774  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename MT::ElementType::value_type );
775 
776  BLAZE_INTERNAL_ASSERT( (~A).rows() == (~A).columns(), "Non-square triangular matrix detected" );
777  BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
778 
779  const int N ( numeric_cast<int>( (~A).rows() ) );
780  const int lda( numeric_cast<int>( (~A).spacing() ) );
781 
782  cblas_ctrmv( ( IsRowMajorMatrix<MT>::value )?( CblasRowMajor ):( CblasColMajor ),
783  uplo, CblasNoTrans, CblasNonUnit, N, (~A).data(), lda, (~y).data(), 1 );
784 }
785 #endif
786 //*************************************************************************************************
787 
788 
789 //*************************************************************************************************
790 #if BLAZE_BLAS_MODE
791 
805 template< typename VT // Type of the target vector
806  , typename MT // Type of the matrix operand
807  , bool SO > // Storage order of the matrix operand
808 BLAZE_ALWAYS_INLINE void ctrmv( DenseVector<VT,true>& y, const DenseMatrix<MT,SO>& A,
809  CBLAS_UPLO uplo )
810 {
811  using boost::numeric_cast;
812 
815 
818 
821  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename VT::ElementType::value_type );
822  BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE ( typename MT::ElementType::value_type );
823 
824  BLAZE_INTERNAL_ASSERT( (~A).rows() == (~A).columns(), "Non-square triangular matrix detected" );
825  BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
826 
827  const int N ( numeric_cast<int>( (~A).rows() ) );
828  const int lda( numeric_cast<int>( (~A).spacing() ) );
829 
830  cblas_ctrmv( ( IsRowMajorMatrix<MT>::value )?( CblasRowMajor ):( CblasColMajor ),
831  uplo, CblasTrans, CblasNonUnit, N, (~A).data(), lda, (~y).data(), 1 );
832 }
833 #endif
834 //*************************************************************************************************
835 
836 
837 //*************************************************************************************************
838 #if BLAZE_BLAS_MODE
839 
853 template< typename VT // Type of the target vector
854  , typename MT // Type of the matrix operand
855  , bool SO > // Storage order of the matrix operand
856 BLAZE_ALWAYS_INLINE void ztrmv( DenseVector<VT,false>& y, const DenseMatrix<MT,SO>& A,
857  CBLAS_UPLO uplo )
858 {
859  using boost::numeric_cast;
860 
863 
866 
869  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename VT::ElementType::value_type );
870  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename MT::ElementType::value_type );
871 
872  BLAZE_INTERNAL_ASSERT( (~A).rows() == (~A).columns(), "Non-square triangular matrix detected" );
873  BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
874 
875  const int N ( numeric_cast<int>( (~A).rows() ) );
876  const int lda( numeric_cast<int>( (~A).spacing() ) );
877 
878  cblas_ztrmv( ( IsRowMajorMatrix<MT>::value )?( CblasRowMajor ):( CblasColMajor ),
879  uplo, CblasNoTrans, CblasNonUnit, N, (~A).data(), lda, (~y).data(), 1 );
880 }
881 #endif
882 //*************************************************************************************************
883 
884 
885 //*************************************************************************************************
886 #if BLAZE_BLAS_MODE
887 
901 template< typename VT // Type of the target vector
902  , typename MT // Type of the matrix operand
903  , bool SO > // Storage order of the matrix operand
904 BLAZE_ALWAYS_INLINE void ztrmv( DenseVector<VT,true>& y, const DenseMatrix<MT,SO>& A,
905  CBLAS_UPLO uplo )
906 {
907  using boost::numeric_cast;
908 
911 
914 
917  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename VT::ElementType::value_type );
918  BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE ( typename MT::ElementType::value_type );
919 
920  BLAZE_INTERNAL_ASSERT( (~A).rows() == (~A).columns(), "Non-square triangular matrix detected" );
921  BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
922 
923  const int N ( numeric_cast<int>( (~A).rows() ) );
924  const int lda( numeric_cast<int>( (~A).spacing() ) );
925 
926  cblas_ztrmv( ( IsRowMajorMatrix<MT>::value )?( CblasRowMajor ):( CblasColMajor ),
927  uplo, CblasTrans, CblasNonUnit, N, (~A).data(), lda, (~y).data(), 1 );
928 }
929 #endif
930 //*************************************************************************************************
931 
932 } // namespace blaze
933 
934 #endif
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_HAVE_MUTABLE_DATA_ACCESS(T)
Constraint on the data type.In case the given data type T does not provide low-level data access to m...
Definition: MutableDataAccess.h:79
#define BLAZE_CONSTRAINT_MUST_HAVE_CONST_DATA_ACCESS(T)
Constraint on the data type.In case the given data type T does not provide low-level data access to c...
Definition: ConstDataAccess.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:118
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
Header file for the DenseVector base class.
#define BLAZE_CONSTRAINT_MUST_BE_FLOAT_TYPE(T)
Constraint on the data type.This compile time constraint checks that the given data type T is of type...
Definition: Float.h:80
Constraint on the data type.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_CONSTRAINT_MUST_BE_DOUBLE_TYPE(T)
Constraint on the data type.This compile time constraint checks that the given data type T is of type...
Definition: Double.h:80
Header file for the DenseMatrix base class.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
Constraint on the data type.
const bool spacing
Adding an additional spacing line between two log messages.This setting gives the opportunity to add ...
Definition: Logging.h:70
System settings for the BLAS mode.
Header file for run time assertion macros.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_COMPLEX_TYPE(T)
Constraint on the data type.This compile time constraint checks that the given data type T is a compl...
Definition: Complex.h:80
Header file for the IsRowMajorMatrix type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
Header file for the complex data type.
Constraint on the data type.
System settings for the inline keywords.
#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