13int EIGEN_BLAS_FUNC(symv) (
const char *uplo,
const int *n,
const RealScalar *palpha,
const RealScalar *pa,
const int *lda,
14 const RealScalar *px,
const int *incx,
const RealScalar *pbeta, RealScalar *py,
const int *incy)
16 typedef void (*functype)(int,
const Scalar*, int,
const Scalar*, Scalar*, Scalar);
17 static const functype func[2] = {
19 (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Upper,false,false>::run),
21 (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Lower,false,false>::run),
24 const Scalar* a =
reinterpret_cast<const Scalar*
>(pa);
25 const Scalar* x =
reinterpret_cast<const Scalar*
>(px);
26 Scalar* y =
reinterpret_cast<Scalar*
>(py);
27 Scalar alpha = *
reinterpret_cast<const Scalar*
>(palpha);
28 Scalar beta = *
reinterpret_cast<const Scalar*
>(pbeta);
32 if(UPLO(*uplo)==INVALID) info = 1;
33 else if(*n<0) info = 2;
34 else if(*lda<std::max(1,*n)) info = 5;
35 else if(*incx==0) info = 7;
36 else if(*incy==0) info = 10;
38 return xerbla_(SCALAR_SUFFIX_UP
"SYMV ",&info,6);
43 const Scalar* actual_x = get_compact_vector(x,*n,*incx);
44 Scalar* actual_y = get_compact_vector(y,*n,*incy);
48 if(beta==Scalar(0)) make_vector(actual_y, *n).setZero();
49 else make_vector(actual_y, *n) *= beta;
52 int code = UPLO(*uplo);
53 if(code>=2 || func[code]==0)
56 func[code](*n, a, *lda, actual_x, actual_y, alpha);
58 if(actual_x!=x)
delete[] actual_x;
59 if(actual_y!=y)
delete[] copy_back(actual_y,y,*n,*incy);
65int EIGEN_BLAS_FUNC(syr)(
const char *uplo,
const int *n,
const RealScalar *palpha,
const RealScalar *px,
const int *incx, RealScalar *pc,
const int *ldc)
68 typedef void (*functype)(int, Scalar*, int,
const Scalar*,
const Scalar*,
const Scalar&);
69 static const functype func[2] = {
76 const Scalar* x =
reinterpret_cast<const Scalar*
>(px);
77 Scalar* c =
reinterpret_cast<Scalar*
>(pc);
78 Scalar alpha = *
reinterpret_cast<const Scalar*
>(palpha);
81 if(UPLO(*uplo)==INVALID) info = 1;
82 else if(*n<0) info = 2;
83 else if(*incx==0) info = 5;
84 else if(*ldc<std::max(1,*n)) info = 7;
86 return xerbla_(SCALAR_SUFFIX_UP
"SYR ",&info,6);
88 if(*n==0 || alpha==Scalar(0))
return 1;
91 const Scalar* x_cpy = get_compact_vector(x,*n,*incx);
93 int code = UPLO(*uplo);
94 if(code>=2 || func[code]==0)
97 func[code](*n, c, *ldc, x_cpy, x_cpy, alpha);
99 if(x_cpy!=x)
delete[] x_cpy;
105int EIGEN_BLAS_FUNC(syr2)(
const char *uplo,
const int *n,
const RealScalar *palpha,
const RealScalar *px,
const int *incx,
const RealScalar *py,
const int *incy, RealScalar *pc,
const int *ldc)
107 typedef void (*functype)(int, Scalar*, int,
const Scalar*,
const Scalar*, Scalar);
108 static const functype func[2] = {
115 const Scalar* x =
reinterpret_cast<const Scalar*
>(px);
116 const Scalar* y =
reinterpret_cast<const Scalar*
>(py);
117 Scalar* c =
reinterpret_cast<Scalar*
>(pc);
118 Scalar alpha = *
reinterpret_cast<const Scalar*
>(palpha);
121 if(UPLO(*uplo)==INVALID) info = 1;
122 else if(*n<0) info = 2;
123 else if(*incx==0) info = 5;
124 else if(*incy==0) info = 7;
125 else if(*ldc<std::max(1,*n)) info = 9;
127 return xerbla_(SCALAR_SUFFIX_UP
"SYR2 ",&info,6);
132 const Scalar* x_cpy = get_compact_vector(x,*n,*incx);
133 const Scalar* y_cpy = get_compact_vector(y,*n,*incy);
135 int code = UPLO(*uplo);
136 if(code>=2 || func[code]==0)
139 func[code](*n, c, *ldc, x_cpy, y_cpy, alpha);
141 if(x_cpy!=x)
delete[] x_cpy;
142 if(y_cpy!=y)
delete[] y_cpy;
186int EIGEN_BLAS_FUNC(spr)(
char *uplo,
int *n, Scalar *palpha, Scalar *px,
int *incx, Scalar *pap)
188 typedef void (*functype)(int, Scalar*,
const Scalar*, Scalar);
189 static const functype func[2] = {
196 Scalar* x =
reinterpret_cast<Scalar*
>(px);
197 Scalar* ap =
reinterpret_cast<Scalar*
>(pap);
198 Scalar alpha = *
reinterpret_cast<Scalar*
>(palpha);
201 if(UPLO(*uplo)==INVALID) info = 1;
202 else if(*n<0) info = 2;
203 else if(*incx==0) info = 5;
205 return xerbla_(SCALAR_SUFFIX_UP
"SPR ",&info,6);
210 Scalar* x_cpy = get_compact_vector(x, *n, *incx);
212 int code = UPLO(*uplo);
213 if(code>=2 || func[code]==0)
216 func[code](*n, ap, x_cpy, alpha);
218 if(x_cpy!=x)
delete[] x_cpy;
230int EIGEN_BLAS_FUNC(spr2)(
char *uplo,
int *n, RealScalar *palpha, RealScalar *px,
int *incx, RealScalar *py,
int *incy, RealScalar *pap)
232 typedef void (*functype)(int, Scalar*,
const Scalar*,
const Scalar*, Scalar);
233 static const functype func[2] = {
240 Scalar* x =
reinterpret_cast<Scalar*
>(px);
241 Scalar* y =
reinterpret_cast<Scalar*
>(py);
242 Scalar* ap =
reinterpret_cast<Scalar*
>(pap);
243 Scalar alpha = *
reinterpret_cast<Scalar*
>(palpha);
246 if(UPLO(*uplo)==INVALID) info = 1;
247 else if(*n<0) info = 2;
248 else if(*incx==0) info = 5;
249 else if(*incy==0) info = 7;
251 return xerbla_(SCALAR_SUFFIX_UP
"SPR2 ",&info,6);
256 Scalar* x_cpy = get_compact_vector(x, *n, *incx);
257 Scalar* y_cpy = get_compact_vector(y, *n, *incy);
259 int code = UPLO(*uplo);
260 if(code>=2 || func[code]==0)
263 func[code](*n, ap, x_cpy, y_cpy, alpha);
265 if(x_cpy!=x)
delete[] x_cpy;
266 if(y_cpy!=y)
delete[] y_cpy;
278int EIGEN_BLAS_FUNC(ger)(
int *m,
int *n, Scalar *palpha, Scalar *px,
int *incx, Scalar *py,
int *incy, Scalar *pa,
int *lda)
280 Scalar* x =
reinterpret_cast<Scalar*
>(px);
281 Scalar* y =
reinterpret_cast<Scalar*
>(py);
282 Scalar* a =
reinterpret_cast<Scalar*
>(pa);
283 Scalar alpha = *
reinterpret_cast<Scalar*
>(palpha);
287 else if(*n<0) info = 2;
288 else if(*incx==0) info = 5;
289 else if(*incy==0) info = 7;
290 else if(*lda<std::max(1,*m)) info = 9;
292 return xerbla_(SCALAR_SUFFIX_UP
"GER ",&info,6);
297 Scalar* x_cpy = get_compact_vector(x,*m,*incx);
298 Scalar* y_cpy = get_compact_vector(y,*n,*incy);
300 internal::general_rank1_update<Scalar,int,ColMajor,false,false>::run(*m, *n, a, *lda, x_cpy, y_cpy, alpha);
302 if(x_cpy!=x)
delete[] x_cpy;
303 if(y_cpy!=y)
delete[] y_cpy;
Definition GeneralMatrixMatrixTriangular.h:16
Definition GeneralRank1Update.h:17
Definition Rank2Update.h:38
Definition Rank2Update.h:20
Definition PackedSelfadjointProduct.h:19