New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
View | Details | Raw Unified | Return to bug 1152 | Differences between
and this patch

Collapse All | Expand All

(-)a/blas/level2_cplx_impl.h (-65 / +30 lines)
Lines 14-42 Link Here
14
  *     y := alpha*A*x + beta*y,
14
  *     y := alpha*A*x + beta*y,
15
  *
15
  *
16
  *  where alpha and beta are scalars, x and y are n element vectors and
16
  *  where alpha and beta are scalars, x and y are n element vectors and
17
  *  A is an n by n hermitian matrix.
17
  *  A is an n by n hermitian matrix.
18
  */
18
  */
19
int EIGEN_BLAS_FUNC(hemv)(char *uplo, int *n, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *px, int *incx, RealScalar *pbeta, RealScalar *py, int *incy)
19
int EIGEN_BLAS_FUNC(hemv)(char *uplo, int *n, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *px, int *incx, RealScalar *pbeta, RealScalar *py, int *incy)
20
{
20
{
21
  typedef void (*functype)(int, const Scalar*, int, const Scalar*, Scalar*, Scalar);
21
  typedef void (*functype)(int, const Scalar*, int, const Scalar*, Scalar*, Scalar);
22
  static functype func[2];
22
  static const functype func[2] = {
23
23
    // array index: UP
24
  static bool init = false;
24
    (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Upper,false,false>::run),
25
  if(!init)
25
    // array index: LO
26
  {
26
    (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Lower,false,false>::run),
27
    for(int k=0; k<2; ++k)
27
  };
28
      func[k] = 0;
29
30
    func[UP] = (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Upper,false,false>::run);
31
    func[LO] = (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Lower,false,false>::run);
32
33
    init = true;
34
  }
35
28
36
  Scalar* a = reinterpret_cast<Scalar*>(pa);
29
  Scalar* a = reinterpret_cast<Scalar*>(pa);
37
  Scalar* x = reinterpret_cast<Scalar*>(px);
30
  Scalar* x = reinterpret_cast<Scalar*>(px);
38
  Scalar* y = reinterpret_cast<Scalar*>(py);
31
  Scalar* y = reinterpret_cast<Scalar*>(py);
39
  Scalar alpha  = *reinterpret_cast<Scalar*>(palpha);
32
  Scalar alpha  = *reinterpret_cast<Scalar*>(palpha);
40
  Scalar beta   = *reinterpret_cast<Scalar*>(pbeta);
33
  Scalar beta   = *reinterpret_cast<Scalar*>(pbeta);
41
34
42
  // check arguments
35
  // check arguments
Lines 106-134 int EIGEN_BLAS_FUNC(hemv)(char *uplo, in Link Here
106
  *     A := alpha*x*conjg( x' ) + A,
99
  *     A := alpha*x*conjg( x' ) + A,
107
  *
100
  *
108
  *  where alpha is a real scalar, x is an n element vector and A is an
101
  *  where alpha is a real scalar, x is an n element vector and A is an
109
  *  n by n hermitian matrix, supplied in packed form.
102
  *  n by n hermitian matrix, supplied in packed form.
110
  */
103
  */
111
int EIGEN_BLAS_FUNC(hpr)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pap)
104
int EIGEN_BLAS_FUNC(hpr)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pap)
112
{
105
{
113
  typedef void (*functype)(int, Scalar*, const Scalar*, RealScalar);
106
  typedef void (*functype)(int, Scalar*, const Scalar*, RealScalar);
114
  static functype func[2];
107
  static const functype func[2] = {
115
108
    // array index: UP
116
  static bool init = false;
109
    (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run),
117
  if(!init)
110
    // array index: LO
118
  {
111
    (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run),
119
    for(int k=0; k<2; ++k)
112
  };
120
      func[k] = 0;
121
122
    func[UP] = (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run);
123
    func[LO] = (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run);
124
125
    init = true;
126
  }
127
113
128
  Scalar* x = reinterpret_cast<Scalar*>(px);
114
  Scalar* x = reinterpret_cast<Scalar*>(px);
129
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
115
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
130
  RealScalar alpha = *palpha;
116
  RealScalar alpha = *palpha;
131
117
132
  int info = 0;
118
  int info = 0;
133
  if(UPLO(*uplo)==INVALID)                                            info = 1;
119
  if(UPLO(*uplo)==INVALID)                                            info = 1;
134
  else if(*n<0)                                                       info = 2;
120
  else if(*n<0)                                                       info = 2;
Lines 157-185 int EIGEN_BLAS_FUNC(hpr)(char *uplo, int Link Here
157
  *     A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
143
  *     A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
158
  *
144
  *
159
  *  where alpha is a scalar, x and y are n element vectors and A is an
145
  *  where alpha is a scalar, x and y are n element vectors and A is an
160
  *  n by n hermitian matrix, supplied in packed form.
146
  *  n by n hermitian matrix, supplied in packed form.
161
  */
147
  */
162
int EIGEN_BLAS_FUNC(hpr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pap)
148
int EIGEN_BLAS_FUNC(hpr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pap)
163
{
149
{
164
  typedef void (*functype)(int, Scalar*, const Scalar*, const Scalar*, Scalar);
150
  typedef void (*functype)(int, Scalar*, const Scalar*, const Scalar*, Scalar);
165
  static functype func[2];
151
  static const functype func[2] = {
166
152
    // array index: UP
167
  static bool init = false;
153
    (internal::packed_rank2_update_selector<Scalar,int,Upper>::run),
168
  if(!init)
154
    // array index: LO
169
  {
155
    (internal::packed_rank2_update_selector<Scalar,int,Lower>::run),
170
    for(int k=0; k<2; ++k)
156
  };
171
      func[k] = 0;
172
173
    func[UP] = (internal::packed_rank2_update_selector<Scalar,int,Upper>::run);
174
    func[LO] = (internal::packed_rank2_update_selector<Scalar,int,Lower>::run);
175
176
    init = true;
177
  }
178
157
179
  Scalar* x = reinterpret_cast<Scalar*>(px);
158
  Scalar* x = reinterpret_cast<Scalar*>(px);
180
  Scalar* y = reinterpret_cast<Scalar*>(py);
159
  Scalar* y = reinterpret_cast<Scalar*>(py);
181
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
160
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
182
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
161
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
183
162
184
  int info = 0;
163
  int info = 0;
185
  if(UPLO(*uplo)==INVALID)                                            info = 1;
164
  if(UPLO(*uplo)==INVALID)                                            info = 1;
Lines 212-240 int EIGEN_BLAS_FUNC(hpr2)(char *uplo, in Link Here
212
  *     A := alpha*x*conjg( x' ) + A,
191
  *     A := alpha*x*conjg( x' ) + A,
213
  *
192
  *
214
  *  where alpha is a real scalar, x is an n element vector and A is an
193
  *  where alpha is a real scalar, x is an n element vector and A is an
215
  *  n by n hermitian matrix.
194
  *  n by n hermitian matrix.
216
  */
195
  */
217
int EIGEN_BLAS_FUNC(her)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pa, int *lda)
196
int EIGEN_BLAS_FUNC(her)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pa, int *lda)
218
{
197
{
219
  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, const Scalar&);
198
  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, const Scalar&);
220
  static functype func[2];
199
  static const functype func[2] = {
221
200
    // array index: UP
222
  static bool init = false;
201
    (selfadjoint_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run),
223
  if(!init)
202
    // array index: LO
224
  {
203
    (selfadjoint_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run),
225
    for(int k=0; k<2; ++k)
204
  };
226
      func[k] = 0;
227
228
    func[UP] = (selfadjoint_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run);
229
    func[LO] = (selfadjoint_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run);
230
231
    init = true;
232
  }
233
205
234
  Scalar* x = reinterpret_cast<Scalar*>(px);
206
  Scalar* x = reinterpret_cast<Scalar*>(px);
235
  Scalar* a = reinterpret_cast<Scalar*>(pa);
207
  Scalar* a = reinterpret_cast<Scalar*>(pa);
236
  RealScalar alpha = *reinterpret_cast<RealScalar*>(palpha);
208
  RealScalar alpha = *reinterpret_cast<RealScalar*>(palpha);
237
209
238
  int info = 0;
210
  int info = 0;
239
  if(UPLO(*uplo)==INVALID)                                            info = 1;
211
  if(UPLO(*uplo)==INVALID)                                            info = 1;
240
  else if(*n<0)                                                       info = 2;
212
  else if(*n<0)                                                       info = 2;
Lines 266-294 int EIGEN_BLAS_FUNC(her)(char *uplo, int Link Here
266
  *     A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
238
  *     A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
267
  *
239
  *
268
  *  where alpha is a scalar, x and y are n element vectors and A is an n
240
  *  where alpha is a scalar, x and y are n element vectors and A is an n
269
  *  by n hermitian matrix.
241
  *  by n hermitian matrix.
270
  */
242
  */
271
int EIGEN_BLAS_FUNC(her2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pa, int *lda)
243
int EIGEN_BLAS_FUNC(her2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pa, int *lda)
272
{
244
{
273
  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, Scalar);
245
  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, Scalar);
274
  static functype func[2];
246
  static const functype func[2] = {
275
247
    // array index: UP
276
  static bool init = false;
248
    (internal::rank2_update_selector<Scalar,int,Upper>::run),
277
  if(!init)
249
    // array index: LO
278
  {
250
    (internal::rank2_update_selector<Scalar,int,Lower>::run),
279
    for(int k=0; k<2; ++k)
251
  };
280
      func[k] = 0;
281
282
    func[UP] = (internal::rank2_update_selector<Scalar,int,Upper>::run);
283
    func[LO] = (internal::rank2_update_selector<Scalar,int,Lower>::run);
284
285
    init = true;
286
  }
287
252
288
  Scalar* x = reinterpret_cast<Scalar*>(px);
253
  Scalar* x = reinterpret_cast<Scalar*>(px);
289
  Scalar* y = reinterpret_cast<Scalar*>(py);
254
  Scalar* y = reinterpret_cast<Scalar*>(py);
290
  Scalar* a = reinterpret_cast<Scalar*>(pa);
255
  Scalar* a = reinterpret_cast<Scalar*>(pa);
291
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
256
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
292
257
293
  int info = 0;
258
  int info = 0;
294
  if(UPLO(*uplo)==INVALID)                                            info = 1;
259
  if(UPLO(*uplo)==INVALID)                                            info = 1;
(-)a/blas/level2_impl.h (-144 / +159 lines)
Lines 21-50 struct general_matrix_vector_product_wra Link Here
21
        <Index,Scalar,LhsMapper,StorageOrder,ConjugateLhs,Scalar,RhsMapper,ConjugateRhs>::run(
21
        <Index,Scalar,LhsMapper,StorageOrder,ConjugateLhs,Scalar,RhsMapper,ConjugateRhs>::run(
22
        rows, cols, LhsMapper(lhs, lhsStride), RhsMapper(rhs, rhsIncr), res, resIncr, alpha);
22
        rows, cols, LhsMapper(lhs, lhsStride), RhsMapper(rhs, rhsIncr), res, resIncr, alpha);
23
  }
23
  }
24
};
24
};
25
25
26
int EIGEN_BLAS_FUNC(gemv)(char *opa, int *m, int *n, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pb, int *incb, RealScalar *pbeta, RealScalar *pc, int *incc)
26
int EIGEN_BLAS_FUNC(gemv)(char *opa, int *m, int *n, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pb, int *incb, RealScalar *pbeta, RealScalar *pc, int *incc)
27
{
27
{
28
  typedef void (*functype)(int, int, const Scalar *, int, const Scalar *, int , Scalar *, int, Scalar);
28
  typedef void (*functype)(int, int, const Scalar *, int, const Scalar *, int , Scalar *, int, Scalar);
29
  static functype func[4];
29
  static const functype func[4] = {
30
30
    // array index: NOTR
31
  static bool init = false;
31
    (general_matrix_vector_product_wrapper<int,Scalar,ColMajor,false,false>::run),
32
  if(!init)
32
    // array index: TR  
33
  {
33
    (general_matrix_vector_product_wrapper<int,Scalar,RowMajor,false,false>::run),
34
    for(int k=0; k<4; ++k)
34
    // array index: ADJ 
35
      func[k] = 0;
35
    (general_matrix_vector_product_wrapper<int,Scalar,RowMajor,Conj ,false>::run),
36
36
    0
37
    func[NOTR] = (general_matrix_vector_product_wrapper<int,Scalar,ColMajor,false,false>::run);
37
  };
38
    func[TR  ] = (general_matrix_vector_product_wrapper<int,Scalar,RowMajor,false,false>::run);
39
    func[ADJ ] = (general_matrix_vector_product_wrapper<int,Scalar,RowMajor,Conj ,false>::run);
40
41
    init = true;
42
  }
43
38
44
  Scalar* a = reinterpret_cast<Scalar*>(pa);
39
  Scalar* a = reinterpret_cast<Scalar*>(pa);
45
  Scalar* b = reinterpret_cast<Scalar*>(pb);
40
  Scalar* b = reinterpret_cast<Scalar*>(pb);
46
  Scalar* c = reinterpret_cast<Scalar*>(pc);
41
  Scalar* c = reinterpret_cast<Scalar*>(pc);
47
  Scalar alpha  = *reinterpret_cast<Scalar*>(palpha);
42
  Scalar alpha  = *reinterpret_cast<Scalar*>(palpha);
48
  Scalar beta   = *reinterpret_cast<Scalar*>(pbeta);
43
  Scalar beta   = *reinterpret_cast<Scalar*>(pbeta);
49
44
50
  // check arguments
45
  // check arguments
Lines 85-126 int EIGEN_BLAS_FUNC(gemv)(char *opa, int Link Here
85
  if(actual_c!=c) delete[] copy_back(actual_c,c,actual_m,*incc);
80
  if(actual_c!=c) delete[] copy_back(actual_c,c,actual_m,*incc);
86
81
87
  return 1;
82
  return 1;
88
}
83
}
89
84
90
int EIGEN_BLAS_FUNC(trsv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pa, int *lda, RealScalar *pb, int *incb)
85
int EIGEN_BLAS_FUNC(trsv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pa, int *lda, RealScalar *pb, int *incb)
91
{
86
{
92
  typedef void (*functype)(int, const Scalar *, int, Scalar *);
87
  typedef void (*functype)(int, const Scalar *, int, Scalar *);
93
  static functype func[16];
88
  static const functype func[16] = {
94
89
    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
95
  static bool init = false;
90
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,ColMajor>::run),
96
  if(!init)
91
    // array index: TR    | (UP << 2) | (NUNIT << 3)
97
  {
92
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,RowMajor>::run),
98
    for(int k=0; k<16; ++k)
93
    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
99
      func[k] = 0;
94
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       Conj, RowMajor>::run),
100
95
    0,
101
    func[NOTR  | (UP << 2) | (NUNIT << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,ColMajor>::run);
96
    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
102
    func[TR    | (UP << 2) | (NUNIT << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,RowMajor>::run);
97
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,ColMajor>::run),
103
    func[ADJ   | (UP << 2) | (NUNIT << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       Conj, RowMajor>::run);
98
    // array index: TR    | (LO << 2) | (NUNIT << 3)
104
99
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,RowMajor>::run),
105
    func[NOTR  | (LO << 2) | (NUNIT << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,ColMajor>::run);
100
    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
106
    func[TR    | (LO << 2) | (NUNIT << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,RowMajor>::run);
101
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       Conj, RowMajor>::run),
107
    func[ADJ   | (LO << 2) | (NUNIT << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       Conj, RowMajor>::run);
102
    0,
108
103
    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
109
    func[NOTR  | (UP << 2) | (UNIT  << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,ColMajor>::run);
104
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,ColMajor>::run),
110
    func[TR    | (UP << 2) | (UNIT  << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,RowMajor>::run);
105
    // array index: TR    | (UP << 2) | (UNIT  << 3)
111
    func[ADJ   | (UP << 2) | (UNIT  << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,Conj, RowMajor>::run);
106
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,RowMajor>::run),
112
107
    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
113
    func[NOTR  | (LO << 2) | (UNIT  << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,ColMajor>::run);
108
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,Conj, RowMajor>::run),
114
    func[TR    | (LO << 2) | (UNIT  << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,RowMajor>::run);
109
    0,
115
    func[ADJ   | (LO << 2) | (UNIT  << 3)] = (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,Conj, RowMajor>::run);
110
    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
116
111
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,ColMajor>::run),
117
    init = true;
112
    // array index: TR    | (LO << 2) | (UNIT  << 3)
118
  }
113
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,RowMajor>::run),
114
    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
115
    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,Conj, RowMajor>::run),
116
    0
117
  };
119
118
120
  Scalar* a = reinterpret_cast<Scalar*>(pa);
119
  Scalar* a = reinterpret_cast<Scalar*>(pa);
121
  Scalar* b = reinterpret_cast<Scalar*>(pb);
120
  Scalar* b = reinterpret_cast<Scalar*>(pb);
122
121
123
  int info = 0;
122
  int info = 0;
124
  if(UPLO(*uplo)==INVALID)                                            info = 1;
123
  if(UPLO(*uplo)==INVALID)                                            info = 1;
125
  else if(OP(*opa)==INVALID)                                          info = 2;
124
  else if(OP(*opa)==INVALID)                                          info = 2;
126
  else if(DIAG(*diag)==INVALID)                                       info = 3;
125
  else if(DIAG(*diag)==INVALID)                                       info = 3;
Lines 140-181 int EIGEN_BLAS_FUNC(trsv)(char *uplo, ch Link Here
140
  return 0;
139
  return 0;
141
}
140
}
142
141
143
142
144
143
145
int EIGEN_BLAS_FUNC(trmv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pa, int *lda, RealScalar *pb, int *incb)
144
int EIGEN_BLAS_FUNC(trmv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pa, int *lda, RealScalar *pb, int *incb)
146
{
145
{
147
  typedef void (*functype)(int, int, const Scalar *, int, const Scalar *, int, Scalar *, int, const Scalar&);
146
  typedef void (*functype)(int, int, const Scalar *, int, const Scalar *, int, Scalar *, int, const Scalar&);
148
  static functype func[16];
147
  static const functype func[16] = {
149
148
    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
150
  static bool init = false;
149
    (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,ColMajor>::run),
151
  if(!init)
150
    // array index: TR    | (UP << 2) | (NUNIT << 3)
152
  {
151
    (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,RowMajor>::run),
153
    for(int k=0; k<16; ++k)
152
    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
154
      func[k] = 0;
153
    (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,Conj, Scalar,false,RowMajor>::run),
155
154
    0,
156
    func[NOTR  | (UP << 2) | (NUNIT << 3)] = (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,ColMajor>::run);
155
    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
157
    func[TR    | (UP << 2) | (NUNIT << 3)] = (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,RowMajor>::run);
156
    (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,ColMajor>::run),
158
    func[ADJ   | (UP << 2) | (NUNIT << 3)] = (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,Conj, Scalar,false,RowMajor>::run);
157
    // array index: TR    | (LO << 2) | (NUNIT << 3)
159
158
    (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,RowMajor>::run),
160
    func[NOTR  | (LO << 2) | (NUNIT << 3)] = (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,ColMajor>::run);
159
    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
161
    func[TR    | (LO << 2) | (NUNIT << 3)] = (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,RowMajor>::run);
160
    (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,Conj, Scalar,false,RowMajor>::run),
162
    func[ADJ   | (LO << 2) | (NUNIT << 3)] = (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,Conj, Scalar,false,RowMajor>::run);
161
    0,
163
162
    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
164
    func[NOTR  | (UP << 2) | (UNIT  << 3)] = (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run);
163
    (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run),
165
    func[TR    | (UP << 2) | (UNIT  << 3)] = (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run);
164
    // array index: TR    | (UP << 2) | (UNIT  << 3)
166
    func[ADJ   | (UP << 2) | (UNIT  << 3)] = (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run);
165
    (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run),
167
166
    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
168
    func[NOTR  | (LO << 2) | (UNIT  << 3)] = (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run);
167
    (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run),
169
    func[TR    | (LO << 2) | (UNIT  << 3)] = (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run);
168
    0,
170
    func[ADJ   | (LO << 2) | (UNIT  << 3)] = (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run);
169
    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
171
170
    (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run),
172
    init = true;
171
    // array index: TR    | (LO << 2) | (UNIT  << 3)
173
  }
172
    (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run),
173
    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
174
    (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run),
175
    0
176
  };
174
177
175
  Scalar* a = reinterpret_cast<Scalar*>(pa);
178
  Scalar* a = reinterpret_cast<Scalar*>(pa);
176
  Scalar* b = reinterpret_cast<Scalar*>(pb);
179
  Scalar* b = reinterpret_cast<Scalar*>(pb);
177
180
178
  int info = 0;
181
  int info = 0;
179
  if(UPLO(*uplo)==INVALID)                                            info = 1;
182
  if(UPLO(*uplo)==INVALID)                                            info = 1;
180
  else if(OP(*opa)==INVALID)                                          info = 2;
183
  else if(OP(*opa)==INVALID)                                          info = 2;
181
  else if(DIAG(*diag)==INVALID)                                       info = 3;
184
  else if(DIAG(*diag)==INVALID)                                       info = 3;
Lines 341-382 int EIGEN_BLAS_FUNC(tbmv)(char *uplo, ch Link Here
341
  *  diagonals.
344
  *  diagonals.
342
  *
345
  *
343
  *  No test for singularity or near-singularity is included in this
346
  *  No test for singularity or near-singularity is included in this
344
  *  routine. Such tests must be performed before calling this routine.
347
  *  routine. Such tests must be performed before calling this routine.
345
  */
348
  */
346
int EIGEN_BLAS_FUNC(tbsv)(char *uplo, char *op, char *diag, int *n, int *k, RealScalar *pa, int *lda, RealScalar *px, int *incx)
349
int EIGEN_BLAS_FUNC(tbsv)(char *uplo, char *op, char *diag, int *n, int *k, RealScalar *pa, int *lda, RealScalar *px, int *incx)
347
{
350
{
348
  typedef void (*functype)(int, int, const Scalar *, int, Scalar *);
351
  typedef void (*functype)(int, int, const Scalar *, int, Scalar *);
349
  static functype func[16];
352
  static const functype func[16] = {
350
353
    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
351
  static bool init = false;
354
    (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,false,Scalar,ColMajor>::run),
352
  if(!init)
355
    // array index: TR    | (UP << 2) | (NUNIT << 3)
353
  {
356
    (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,false,Scalar,RowMajor>::run),
354
    for(int i=0; i<16; ++i)
357
    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
355
      func[i] = 0;
358
    (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,Conj, Scalar,RowMajor>::run),
356
359
    0,
357
    func[NOTR  | (UP << 2) | (NUNIT << 3)] = (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,false,Scalar,ColMajor>::run);
360
    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
358
    func[TR    | (UP << 2) | (NUNIT << 3)] = (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,false,Scalar,RowMajor>::run);
361
    (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,false,Scalar,ColMajor>::run),
359
    func[ADJ   | (UP << 2) | (NUNIT << 3)] = (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,Conj, Scalar,RowMajor>::run);
362
    // array index: TR    | (LO << 2) | (NUNIT << 3)
360
363
    (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,false,Scalar,RowMajor>::run),
361
    func[NOTR  | (LO << 2) | (NUNIT << 3)] = (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,false,Scalar,ColMajor>::run);
364
    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
362
    func[TR    | (LO << 2) | (NUNIT << 3)] = (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,false,Scalar,RowMajor>::run);
365
    (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,Conj, Scalar,RowMajor>::run),
363
    func[ADJ   | (LO << 2) | (NUNIT << 3)] = (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,Conj, Scalar,RowMajor>::run);
366
    0,
364
367
    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
365
    func[NOTR  | (UP << 2) | (UNIT  << 3)] = (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,false,Scalar,ColMajor>::run);
368
    (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,false,Scalar,ColMajor>::run),
366
    func[TR    | (UP << 2) | (UNIT  << 3)] = (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,false,Scalar,RowMajor>::run);
369
    // array index: TR    | (UP << 2) | (UNIT  << 3)
367
    func[ADJ   | (UP << 2) | (UNIT  << 3)] = (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,Conj, Scalar,RowMajor>::run);
370
    (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,false,Scalar,RowMajor>::run),
368
371
    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
369
    func[NOTR  | (LO << 2) | (UNIT  << 3)] = (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,false,Scalar,ColMajor>::run);
372
    (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,Conj, Scalar,RowMajor>::run),
370
    func[TR    | (LO << 2) | (UNIT  << 3)] = (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,false,Scalar,RowMajor>::run);
373
    0,
371
    func[ADJ   | (LO << 2) | (UNIT  << 3)] = (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,Conj, Scalar,RowMajor>::run);
374
    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
372
375
    (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,false,Scalar,ColMajor>::run),
373
    init = true;
376
    // array index: TR    | (LO << 2) | (UNIT  << 3)
374
  }
377
    (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,false,Scalar,RowMajor>::run),
378
    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
379
    (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,Conj, Scalar,RowMajor>::run),
380
    0,
381
  };
375
382
376
  Scalar* a = reinterpret_cast<Scalar*>(pa);
383
  Scalar* a = reinterpret_cast<Scalar*>(pa);
377
  Scalar* x = reinterpret_cast<Scalar*>(px);
384
  Scalar* x = reinterpret_cast<Scalar*>(px);
378
  int coeff_rows = *k+1;
385
  int coeff_rows = *k+1;
379
386
380
  int info = 0;
387
  int info = 0;
381
       if(UPLO(*uplo)==INVALID)                                       info = 1;
388
       if(UPLO(*uplo)==INVALID)                                       info = 1;
382
  else if(OP(*op)==INVALID)                                           info = 2;
389
  else if(OP(*op)==INVALID)                                           info = 2;
Lines 411-452 int EIGEN_BLAS_FUNC(tbsv)(char *uplo, ch Link Here
411
  *     x := A*x,   or   x := A'*x,
418
  *     x := A*x,   or   x := A'*x,
412
  *
419
  *
413
  *  where x is an n element vector and  A is an n by n unit, or non-unit,
420
  *  where x is an n element vector and  A is an n by n unit, or non-unit,
414
  *  upper or lower triangular matrix, supplied in packed form.
421
  *  upper or lower triangular matrix, supplied in packed form.
415
  */
422
  */
416
int EIGEN_BLAS_FUNC(tpmv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx)
423
int EIGEN_BLAS_FUNC(tpmv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx)
417
{
424
{
418
  typedef void (*functype)(int, const Scalar*, const Scalar*, Scalar*, Scalar);
425
  typedef void (*functype)(int, const Scalar*, const Scalar*, Scalar*, Scalar);
419
  static functype func[16];
426
  static const functype func[16] = {
420
427
    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
421
  static bool init = false;
428
    (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,ColMajor>::run),
422
  if(!init)
429
    // array index: TR    | (UP << 2) | (NUNIT << 3)
423
  {
430
    (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,RowMajor>::run),
424
    for(int k=0; k<16; ++k)
431
    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
425
      func[k] = 0;
432
    (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,Conj, Scalar,false,RowMajor>::run),
426
433
    0,
427
    func[NOTR  | (UP << 2) | (NUNIT << 3)] = (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,ColMajor>::run);
434
    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
428
    func[TR    | (UP << 2) | (NUNIT << 3)] = (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,RowMajor>::run);
435
    (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,ColMajor>::run),
429
    func[ADJ   | (UP << 2) | (NUNIT << 3)] = (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,Conj, Scalar,false,RowMajor>::run);
436
    // array index: TR    | (LO << 2) | (NUNIT << 3)
430
437
    (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,RowMajor>::run),
431
    func[NOTR  | (LO << 2) | (NUNIT << 3)] = (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,ColMajor>::run);
438
    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
432
    func[TR    | (LO << 2) | (NUNIT << 3)] = (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,RowMajor>::run);
439
    (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,Conj, Scalar,false,RowMajor>::run),
433
    func[ADJ   | (LO << 2) | (NUNIT << 3)] = (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,Conj, Scalar,false,RowMajor>::run);
440
    0,
434
441
    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
435
    func[NOTR  | (UP << 2) | (UNIT  << 3)] = (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run);
442
    (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run),
436
    func[TR    | (UP << 2) | (UNIT  << 3)] = (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run);
443
    // array index: TR    | (UP << 2) | (UNIT  << 3)
437
    func[ADJ   | (UP << 2) | (UNIT  << 3)] = (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run);
444
    (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run),
438
445
    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
439
    func[NOTR  | (LO << 2) | (UNIT  << 3)] = (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run);
446
    (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run),
440
    func[TR    | (LO << 2) | (UNIT  << 3)] = (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run);
447
    0,
441
    func[ADJ   | (LO << 2) | (UNIT  << 3)] = (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run);
448
    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
442
449
    (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run),
443
    init = true;
450
    // array index: TR    | (LO << 2) | (UNIT  << 3)
444
  }
451
    (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run),
452
    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
453
    (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run),
454
    0
455
  };
445
456
446
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
457
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
447
  Scalar* x = reinterpret_cast<Scalar*>(px);
458
  Scalar* x = reinterpret_cast<Scalar*>(px);
448
459
449
  int info = 0;
460
  int info = 0;
450
  if(UPLO(*uplo)==INVALID)                                            info = 1;
461
  if(UPLO(*uplo)==INVALID)                                            info = 1;
451
  else if(OP(*opa)==INVALID)                                          info = 2;
462
  else if(OP(*opa)==INVALID)                                          info = 2;
452
  else if(DIAG(*diag)==INVALID)                                       info = 3;
463
  else if(DIAG(*diag)==INVALID)                                       info = 3;
Lines 482-523 int EIGEN_BLAS_FUNC(tpmv)(char *uplo, ch Link Here
482
  *  non-unit, upper or lower triangular matrix, supplied in packed form.
493
  *  non-unit, upper or lower triangular matrix, supplied in packed form.
483
  *
494
  *
484
  *  No test for singularity or near-singularity is included in this
495
  *  No test for singularity or near-singularity is included in this
485
  *  routine. Such tests must be performed before calling this routine.
496
  *  routine. Such tests must be performed before calling this routine.
486
  */
497
  */
487
int EIGEN_BLAS_FUNC(tpsv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx)
498
int EIGEN_BLAS_FUNC(tpsv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx)
488
{
499
{
489
  typedef void (*functype)(int, const Scalar*, Scalar*);
500
  typedef void (*functype)(int, const Scalar*, Scalar*);
490
  static functype func[16];
501
  static const functype func[16] = {
491
502
    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
492
  static bool init = false;
503
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,ColMajor>::run),
493
  if(!init)
504
    // array index: TR    | (UP << 2) | (NUNIT << 3)
494
  {
505
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,RowMajor>::run),
495
    for(int k=0; k<16; ++k)
506
    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
496
      func[k] = 0;
507
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       Conj, RowMajor>::run),
497
508
    0,
498
    func[NOTR  | (UP << 2) | (NUNIT << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,ColMajor>::run);
509
    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
499
    func[TR    | (UP << 2) | (NUNIT << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,RowMajor>::run);
510
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,ColMajor>::run),
500
    func[ADJ   | (UP << 2) | (NUNIT << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       Conj, RowMajor>::run);
511
    // array index: TR    | (LO << 2) | (NUNIT << 3)
501
512
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,RowMajor>::run),
502
    func[NOTR  | (LO << 2) | (NUNIT << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,ColMajor>::run);
513
    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
503
    func[TR    | (LO << 2) | (NUNIT << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,RowMajor>::run);
514
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       Conj, RowMajor>::run),
504
    func[ADJ   | (LO << 2) | (NUNIT << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       Conj, RowMajor>::run);
515
    0,
505
516
    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
506
    func[NOTR  | (UP << 2) | (UNIT  << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,ColMajor>::run);
517
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,ColMajor>::run),
507
    func[TR    | (UP << 2) | (UNIT  << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,RowMajor>::run);
518
    // array index: TR    | (UP << 2) | (UNIT  << 3)
508
    func[ADJ   | (UP << 2) | (UNIT  << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,Conj, RowMajor>::run);
519
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,RowMajor>::run),
509
520
    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
510
    func[NOTR  | (LO << 2) | (UNIT  << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,ColMajor>::run);
521
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,Conj, RowMajor>::run),
511
    func[TR    | (LO << 2) | (UNIT  << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,RowMajor>::run);
522
    0,
512
    func[ADJ   | (LO << 2) | (UNIT  << 3)] = (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,Conj, RowMajor>::run);
523
    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
513
524
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,ColMajor>::run),
514
    init = true;
525
    // array index: TR    | (LO << 2) | (UNIT  << 3)
515
  }
526
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,RowMajor>::run),
527
    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
528
    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,Conj, RowMajor>::run),
529
    0
530
  };
516
531
517
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
532
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
518
  Scalar* x = reinterpret_cast<Scalar*>(px);
533
  Scalar* x = reinterpret_cast<Scalar*>(px);
519
534
520
  int info = 0;
535
  int info = 0;
521
  if(UPLO(*uplo)==INVALID)                                            info = 1;
536
  if(UPLO(*uplo)==INVALID)                                            info = 1;
522
  else if(OP(*opa)==INVALID)                                          info = 2;
537
  else if(OP(*opa)==INVALID)                                          info = 2;
523
  else if(DIAG(*diag)==INVALID)                                       info = 3;
538
  else if(DIAG(*diag)==INVALID)                                       info = 3;
(-)a/blas/level2_real_impl.h (-93 / +30 lines)
Lines 8-36 Link Here
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
9
10
#include "common.h"
10
#include "common.h"
11
11
12
// y = alpha*A*x + beta*y
12
// y = alpha*A*x + beta*y
13
int EIGEN_BLAS_FUNC(symv) (char *uplo, int *n, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *px, int *incx, RealScalar *pbeta, RealScalar *py, int *incy)
13
int EIGEN_BLAS_FUNC(symv) (char *uplo, int *n, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *px, int *incx, RealScalar *pbeta, RealScalar *py, int *incy)
14
{
14
{
15
  typedef void (*functype)(int, const Scalar*, int, const Scalar*, Scalar*, Scalar);
15
  typedef void (*functype)(int, const Scalar*, int, const Scalar*, Scalar*, Scalar);
16
  static functype func[2];
16
  static const functype func[2] = {
17
17
    // array index: UP
18
  static bool init = false;
18
    (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Upper,false,false>::run),
19
  if(!init)
19
    // array index: LO
20
  {
20
    (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Lower,false,false>::run),
21
    for(int k=0; k<2; ++k)
21
  };
22
      func[k] = 0;
23
24
    func[UP] = (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Upper,false,false>::run);
25
    func[LO] = (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Lower,false,false>::run);
26
27
    init = true;
28
  }
29
22
30
  Scalar* a = reinterpret_cast<Scalar*>(pa);
23
  Scalar* a = reinterpret_cast<Scalar*>(pa);
31
  Scalar* x = reinterpret_cast<Scalar*>(px);
24
  Scalar* x = reinterpret_cast<Scalar*>(px);
32
  Scalar* y = reinterpret_cast<Scalar*>(py);
25
  Scalar* y = reinterpret_cast<Scalar*>(py);
33
  Scalar alpha  = *reinterpret_cast<Scalar*>(palpha);
26
  Scalar alpha  = *reinterpret_cast<Scalar*>(palpha);
34
  Scalar beta   = *reinterpret_cast<Scalar*>(pbeta);
27
  Scalar beta   = *reinterpret_cast<Scalar*>(pbeta);
35
28
36
  // check arguments
29
  // check arguments
Lines 66-109 int EIGEN_BLAS_FUNC(symv) (char *uplo, i Link Here
66
59
67
  return 1;
60
  return 1;
68
}
61
}
69
62
70
// C := alpha*x*x' + C
63
// C := alpha*x*x' + C
71
int EIGEN_BLAS_FUNC(syr)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pc, int *ldc)
64
int EIGEN_BLAS_FUNC(syr)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pc, int *ldc)
72
{
65
{
73
66
74
//   typedef void (*functype)(int, const Scalar *, int, Scalar *, int, Scalar);
75
//   static functype func[2];
76
77
//   static bool init = false;
78
//   if(!init)
79
//   {
80
//     for(int k=0; k<2; ++k)
81
//       func[k] = 0;
82
//
83
//     func[UP] = (internal::selfadjoint_product<Scalar,ColMajor,ColMajor,false,UpperTriangular>::run);
84
//     func[LO] = (internal::selfadjoint_product<Scalar,ColMajor,ColMajor,false,LowerTriangular>::run);
85
86
//     init = true;
87
//   }
88
  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, const Scalar&);
67
  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, const Scalar&);
89
  static functype func[2];
68
  static const functype func[2] = {
90
69
    // array index: UP
91
  static bool init = false;
70
    (selfadjoint_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run),
92
  if(!init)
71
    // array index: LO
93
  {
72
    (selfadjoint_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run),
94
    for(int k=0; k<2; ++k)
73
  };
95
      func[k] = 0;
96
97
    func[UP] = (selfadjoint_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run);
98
    func[LO] = (selfadjoint_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run);
99
100
    init = true;
101
  }
102
74
103
  Scalar* x = reinterpret_cast<Scalar*>(px);
75
  Scalar* x = reinterpret_cast<Scalar*>(px);
104
  Scalar* c = reinterpret_cast<Scalar*>(pc);
76
  Scalar* c = reinterpret_cast<Scalar*>(pc);
105
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
77
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
106
78
107
  int info = 0;
79
  int info = 0;
108
  if(UPLO(*uplo)==INVALID)                                            info = 1;
80
  if(UPLO(*uplo)==INVALID)                                            info = 1;
109
  else if(*n<0)                                                       info = 2;
81
  else if(*n<0)                                                       info = 2;
Lines 126-169 int EIGEN_BLAS_FUNC(syr)(char *uplo, int Link Here
126
  if(x_cpy!=x)  delete[] x_cpy;
98
  if(x_cpy!=x)  delete[] x_cpy;
127
99
128
  return 1;
100
  return 1;
129
}
101
}
130
102
131
// C := alpha*x*y' + alpha*y*x' + C
103
// C := alpha*x*y' + alpha*y*x' + C
132
int EIGEN_BLAS_FUNC(syr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, int *ldc)
104
int EIGEN_BLAS_FUNC(syr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, int *ldc)
133
{
105
{
134
//   typedef void (*functype)(int, const Scalar *, int, const Scalar *, int, Scalar *, int, Scalar);
135
//   static functype func[2];
136
//
137
//   static bool init = false;
138
//   if(!init)
139
//   {
140
//     for(int k=0; k<2; ++k)
141
//       func[k] = 0;
142
//
143
//     func[UP] = (internal::selfadjoint_product<Scalar,ColMajor,ColMajor,false,UpperTriangular>::run);
144
//     func[LO] = (internal::selfadjoint_product<Scalar,ColMajor,ColMajor,false,LowerTriangular>::run);
145
//
146
//     init = true;
147
//   }
148
  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, Scalar);
106
  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, Scalar);
149
  static functype func[2];
107
  static const functype func[2] = {
150
108
    // array index: UP
151
  static bool init = false;
109
    (internal::rank2_update_selector<Scalar,int,Upper>::run),
152
  if(!init)
110
    // array index: LO
153
  {
111
    (internal::rank2_update_selector<Scalar,int,Lower>::run),
154
    for(int k=0; k<2; ++k)
112
  };
155
      func[k] = 0;
156
157
    func[UP] = (internal::rank2_update_selector<Scalar,int,Upper>::run);
158
    func[LO] = (internal::rank2_update_selector<Scalar,int,Lower>::run);
159
160
    init = true;
161
  }
162
113
163
  Scalar* x = reinterpret_cast<Scalar*>(px);
114
  Scalar* x = reinterpret_cast<Scalar*>(px);
164
  Scalar* y = reinterpret_cast<Scalar*>(py);
115
  Scalar* y = reinterpret_cast<Scalar*>(py);
165
  Scalar* c = reinterpret_cast<Scalar*>(pc);
116
  Scalar* c = reinterpret_cast<Scalar*>(pc);
166
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
117
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
167
118
168
  int info = 0;
119
  int info = 0;
169
  if(UPLO(*uplo)==INVALID)                                            info = 1;
120
  if(UPLO(*uplo)==INVALID)                                            info = 1;
Lines 229-257 int EIGEN_BLAS_FUNC(syr2)(char *uplo, in Link Here
229
  *     A := alpha*x*x' + A,
180
  *     A := alpha*x*x' + A,
230
  *
181
  *
231
  *  where alpha is a real scalar, x is an n element vector and A is an
182
  *  where alpha is a real scalar, x is an n element vector and A is an
232
  *  n by n symmetric matrix, supplied in packed form.
183
  *  n by n symmetric matrix, supplied in packed form.
233
  */
184
  */
234
int EIGEN_BLAS_FUNC(spr)(char *uplo, int *n, Scalar *palpha, Scalar *px, int *incx, Scalar *pap)
185
int EIGEN_BLAS_FUNC(spr)(char *uplo, int *n, Scalar *palpha, Scalar *px, int *incx, Scalar *pap)
235
{
186
{
236
  typedef void (*functype)(int, Scalar*, const Scalar*, Scalar);
187
  typedef void (*functype)(int, Scalar*, const Scalar*, Scalar);
237
  static functype func[2];
188
  static const functype func[2] = {
238
189
    // array index: UP
239
  static bool init = false;
190
    (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Upper,false,false>::run),
240
  if(!init)
191
    // array index: LO
241
  {
192
    (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Lower,false,false>::run),
242
    for(int k=0; k<2; ++k)
193
  };
243
      func[k] = 0;
244
245
    func[UP] = (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Upper,false,false>::run);
246
    func[LO] = (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Lower,false,false>::run);
247
248
    init = true;
249
  }
250
194
251
  Scalar* x = reinterpret_cast<Scalar*>(px);
195
  Scalar* x = reinterpret_cast<Scalar*>(px);
252
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
196
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
253
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
197
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
254
198
255
  int info = 0;
199
  int info = 0;
256
  if(UPLO(*uplo)==INVALID)                                            info = 1;
200
  if(UPLO(*uplo)==INVALID)                                            info = 1;
257
  else if(*n<0)                                                       info = 2;
201
  else if(*n<0)                                                       info = 2;
Lines 280-308 int EIGEN_BLAS_FUNC(spr)(char *uplo, int Link Here
280
  *     A := alpha*x*y' + alpha*y*x' + A,
224
  *     A := alpha*x*y' + alpha*y*x' + A,
281
  *
225
  *
282
  *  where alpha is a scalar, x and y are n element vectors and A is an
226
  *  where alpha is a scalar, x and y are n element vectors and A is an
283
  *  n by n symmetric matrix, supplied in packed form.
227
  *  n by n symmetric matrix, supplied in packed form.
284
  */
228
  */
285
int EIGEN_BLAS_FUNC(spr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pap)
229
int EIGEN_BLAS_FUNC(spr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pap)
286
{
230
{
287
  typedef void (*functype)(int, Scalar*, const Scalar*, const Scalar*, Scalar);
231
  typedef void (*functype)(int, Scalar*, const Scalar*, const Scalar*, Scalar);
288
  static functype func[2];
232
  static const functype func[2] = {
289
233
    // array index: UP
290
  static bool init = false;
234
    (internal::packed_rank2_update_selector<Scalar,int,Upper>::run),
291
  if(!init)
235
    // array index: LO
292
  {
236
    (internal::packed_rank2_update_selector<Scalar,int,Lower>::run),
293
    for(int k=0; k<2; ++k)
237
  };
294
      func[k] = 0;
295
296
    func[UP] = (internal::packed_rank2_update_selector<Scalar,int,Upper>::run);
297
    func[LO] = (internal::packed_rank2_update_selector<Scalar,int,Lower>::run);
298
299
    init = true;
300
  }
301
238
302
  Scalar* x = reinterpret_cast<Scalar*>(px);
239
  Scalar* x = reinterpret_cast<Scalar*>(px);
303
  Scalar* y = reinterpret_cast<Scalar*>(py);
240
  Scalar* y = reinterpret_cast<Scalar*>(py);
304
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
241
  Scalar* ap = reinterpret_cast<Scalar*>(pap);
305
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
242
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
306
243
307
  int info = 0;
244
  int info = 0;
308
  if(UPLO(*uplo)==INVALID)                                            info = 1;
245
  if(UPLO(*uplo)==INVALID)                                            info = 1;
(-)a/blas/level3_impl.h (-102 / +177 lines)
Lines 8-41 Link Here
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
#include <iostream>
9
#include <iostream>
10
#include "common.h"
10
#include "common.h"
11
11
12
int EIGEN_BLAS_FUNC(gemm)(char *opa, char *opb, int *m, int *n, int *k, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pb, int *ldb, RealScalar *pbeta, RealScalar *pc, int *ldc)
12
int EIGEN_BLAS_FUNC(gemm)(char *opa, char *opb, int *m, int *n, int *k, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pb, int *ldb, RealScalar *pbeta, RealScalar *pc, int *ldc)
13
{
13
{
14
//   std::cerr << "in gemm " << *opa << " " << *opb << " " << *m << " " << *n << " " << *k << " " << *lda << " " << *ldb << " " << *ldc << " " << *palpha << " " << *pbeta << "\n";
14
//   std::cerr << "in gemm " << *opa << " " << *opb << " " << *m << " " << *n << " " << *k << " " << *lda << " " << *ldb << " " << *ldc << " " << *palpha << " " << *pbeta << "\n";
15
  typedef void (*functype)(DenseIndex, DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, Scalar, internal::level3_blocking<Scalar,Scalar>&, Eigen::internal::GemmParallelInfo<DenseIndex>*);
15
  typedef void (*functype)(DenseIndex, DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, Scalar, internal::level3_blocking<Scalar,Scalar>&, Eigen::internal::GemmParallelInfo<DenseIndex>*);
16
  static functype func[12];
16
  static const functype func[12] = {
17
17
    // array index: NOTR  | (NOTR << 2)
18
  static bool init = false;
18
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,ColMajor,false,ColMajor>::run),
19
  if(!init)
19
    // array index: TR    | (NOTR << 2)
20
  {
20
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,false,ColMajor>::run),
21
    for(int i=0; i<12; ++i)
21
    // array index: ADJ   | (NOTR << 2)
22
      func[i] = 0;
22
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor>::run),
23
    func[NOTR  | (NOTR << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,ColMajor,false,ColMajor>::run);
23
    0,
24
    func[TR    | (NOTR << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,false,ColMajor>::run);
24
    // array index: NOTR  | (TR   << 2)
25
    func[ADJ   | (NOTR << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor>::run);
25
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,false,ColMajor>::run),
26
    func[NOTR  | (TR   << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,false,ColMajor>::run);
26
    // array index: TR    | (TR   << 2)
27
    func[TR    | (TR   << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,RowMajor,false,ColMajor>::run);
27
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,RowMajor,false,ColMajor>::run),
28
    func[ADJ   | (TR   << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,RowMajor,false,ColMajor>::run);
28
    // array index: ADJ   | (TR   << 2)
29
    func[NOTR  | (ADJ  << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor>::run);
29
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,RowMajor,false,ColMajor>::run),
30
    func[TR    | (ADJ  << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,RowMajor,Conj, ColMajor>::run);
30
    0,
31
    func[ADJ   | (ADJ  << 2)] = (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,RowMajor,Conj, ColMajor>::run);
31
    // array index: NOTR  | (ADJ  << 2)
32
    init = true;
32
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor>::run),
33
  }
33
    // array index: TR    | (ADJ  << 2)
34
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,RowMajor,Conj, ColMajor>::run),
35
    // array index: ADJ   | (ADJ  << 2)
36
    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,RowMajor,Conj, ColMajor>::run),
37
    0
38
  };
34
39
35
  Scalar* a = reinterpret_cast<Scalar*>(pa);
40
  Scalar* a = reinterpret_cast<Scalar*>(pa);
36
  Scalar* b = reinterpret_cast<Scalar*>(pb);
41
  Scalar* b = reinterpret_cast<Scalar*>(pb);
37
  Scalar* c = reinterpret_cast<Scalar*>(pc);
42
  Scalar* c = reinterpret_cast<Scalar*>(pc);
38
  Scalar alpha  = *reinterpret_cast<Scalar*>(palpha);
43
  Scalar alpha  = *reinterpret_cast<Scalar*>(palpha);
39
  Scalar beta   = *reinterpret_cast<Scalar*>(pbeta);
44
  Scalar beta   = *reinterpret_cast<Scalar*>(pbeta);
40
45
41
  int info = 0;
46
  int info = 0;
Lines 68-126 int EIGEN_BLAS_FUNC(gemm)(char *opa, cha Link Here
68
  func[code](*m, *n, *k, a, *lda, b, *ldb, c, *ldc, alpha, blocking, 0);
73
  func[code](*m, *n, *k, a, *lda, b, *ldb, c, *ldc, alpha, blocking, 0);
69
  return 0;
74
  return 0;
70
}
75
}
71
76
72
int EIGEN_BLAS_FUNC(trsm)(char *side, char *uplo, char *opa, char *diag, int *m, int *n, RealScalar *palpha,  RealScalar *pa, int *lda, RealScalar *pb, int *ldb)
77
int EIGEN_BLAS_FUNC(trsm)(char *side, char *uplo, char *opa, char *diag, int *m, int *n, RealScalar *palpha,  RealScalar *pa, int *lda, RealScalar *pb, int *ldb)
73
{
78
{
74
//   std::cerr << "in trsm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << "," << *n << " " << *palpha << " " << *lda << " " << *ldb<< "\n";
79
//   std::cerr << "in trsm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << "," << *n << " " << *palpha << " " << *lda << " " << *ldb<< "\n";
75
  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, internal::level3_blocking<Scalar,Scalar>&);
80
  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, internal::level3_blocking<Scalar,Scalar>&);
76
  static functype func[32];
81
  static const functype func[32] = {
77
82
    // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
78
  static bool init = false;
83
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          false,ColMajor,ColMajor>::run),
79
  if(!init)
84
    // array index: TR    | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
80
  {
85
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          false,RowMajor,ColMajor>::run),
81
    for(int i=0; i<32; ++i)
86
    // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
82
      func[i] = 0;
87
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          Conj, RowMajor,ColMajor>::run),\
83
88
    0,
84
    func[NOTR  | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          false,ColMajor,ColMajor>::run);
89
    // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
85
    func[TR    | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          false,RowMajor,ColMajor>::run);
90
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          false,ColMajor,ColMajor>::run),
86
    func[ADJ   | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          Conj, RowMajor,ColMajor>::run);
91
    // array index: TR    | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
87
92
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          false,RowMajor,ColMajor>::run),
88
    func[NOTR  | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          false,ColMajor,ColMajor>::run);
93
    // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
89
    func[TR    | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          false,RowMajor,ColMajor>::run);
94
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          Conj, RowMajor,ColMajor>::run),
90
    func[ADJ   | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          Conj, RowMajor,ColMajor>::run);
95
    0,
91
96
    // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
92
    func[NOTR  | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          false,ColMajor,ColMajor>::run);
97
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          false,ColMajor,ColMajor>::run),
93
    func[TR    | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          false,RowMajor,ColMajor>::run);
98
    // array index: TR    | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
94
    func[ADJ   | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          Conj, RowMajor,ColMajor>::run);
99
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          false,RowMajor,ColMajor>::run),
95
100
    // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
96
    func[NOTR  | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          false,ColMajor,ColMajor>::run);
101
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          Conj, RowMajor,ColMajor>::run),
97
    func[TR    | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          false,RowMajor,ColMajor>::run);
102
    0,
98
    func[ADJ   | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          Conj, RowMajor,ColMajor>::run);
103
    // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
99
104
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          false,ColMajor,ColMajor>::run),
100
105
    // array index: TR    | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
101
    func[NOTR  | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,false,ColMajor,ColMajor>::run);
106
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          false,RowMajor,ColMajor>::run),
102
    func[TR    | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,false,RowMajor,ColMajor>::run);
107
    // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
103
    func[ADJ   | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,Conj, RowMajor,ColMajor>::run);
108
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          Conj, RowMajor,ColMajor>::run),
104
109
    0,
105
    func[NOTR  | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,false,ColMajor,ColMajor>::run);
110
    // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
106
    func[TR    | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,false,RowMajor,ColMajor>::run);
111
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,false,ColMajor,ColMajor>::run),
107
    func[ADJ   | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,Conj, RowMajor,ColMajor>::run);
112
    // array index: TR    | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
108
113
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,false,RowMajor,ColMajor>::run),
109
    func[NOTR  | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,false,ColMajor,ColMajor>::run);
114
    // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
110
    func[TR    | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,false,RowMajor,ColMajor>::run);
115
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,Conj, RowMajor,ColMajor>::run),
111
    func[ADJ   | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,Conj, RowMajor,ColMajor>::run);
116
    0,
112
117
    // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
113
    func[NOTR  | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,false,ColMajor,ColMajor>::run);
118
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,false,ColMajor,ColMajor>::run),
114
    func[TR    | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,false,RowMajor,ColMajor>::run);
119
    // array index: TR    | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
115
    func[ADJ   | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)] = (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,Conj, RowMajor,ColMajor>::run);
120
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,false,RowMajor,ColMajor>::run),
116
121
    // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
117
    init = true;
122
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,Conj, RowMajor,ColMajor>::run),
118
  }
123
    0,
124
    // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
125
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,false,ColMajor,ColMajor>::run),
126
    // array index: TR    | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
127
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,false,RowMajor,ColMajor>::run),
128
    // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
129
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,Conj, RowMajor,ColMajor>::run),
130
    0,
131
    // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
132
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,false,ColMajor,ColMajor>::run),
133
    // array index: TR    | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
134
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,false,RowMajor,ColMajor>::run),
135
    // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
136
    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,Conj, RowMajor,ColMajor>::run),
137
    0
138
  };
119
139
120
  Scalar* a = reinterpret_cast<Scalar*>(pa);
140
  Scalar* a = reinterpret_cast<Scalar*>(pa);
121
  Scalar* b = reinterpret_cast<Scalar*>(pb);
141
  Scalar* b = reinterpret_cast<Scalar*>(pb);
122
  Scalar  alpha = *reinterpret_cast<Scalar*>(palpha);
142
  Scalar  alpha = *reinterpret_cast<Scalar*>(palpha);
123
143
124
  int info = 0;
144
  int info = 0;
125
  if(SIDE(*side)==INVALID)                                            info = 1;
145
  if(SIDE(*side)==INVALID)                                            info = 1;
126
  else if(UPLO(*uplo)==INVALID)                                       info = 2;
146
  else if(UPLO(*uplo)==INVALID)                                       info = 2;
Lines 157-213 int EIGEN_BLAS_FUNC(trsm)(char *side, ch Link Here
157
177
158
178
159
// b = alpha*op(a)*b  for side = 'L'or'l'
179
// b = alpha*op(a)*b  for side = 'L'or'l'
160
// b = alpha*b*op(a)  for side = 'R'or'r'
180
// b = alpha*b*op(a)  for side = 'R'or'r'
161
int EIGEN_BLAS_FUNC(trmm)(char *side, char *uplo, char *opa, char *diag, int *m, int *n, RealScalar *palpha,  RealScalar *pa, int *lda, RealScalar *pb, int *ldb)
181
int EIGEN_BLAS_FUNC(trmm)(char *side, char *uplo, char *opa, char *diag, int *m, int *n, RealScalar *palpha,  RealScalar *pa, int *lda, RealScalar *pb, int *ldb)
162
{
182
{
163
//   std::cerr << "in trmm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << " " << *n << " " << *lda << " " << *ldb << " " << *palpha << "\n";
183
//   std::cerr << "in trmm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << " " << *n << " " << *lda << " " << *ldb << " " << *palpha << "\n";
164
  typedef void (*functype)(DenseIndex, DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
184
  typedef void (*functype)(DenseIndex, DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
165
  static functype func[32];
185
  static const functype func[32] = {
166
  static bool init = false;
186
    // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
167
  if(!init)
187
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, ColMajor,false,ColMajor,false,ColMajor>::run),
168
  {
188
    // array index: TR    | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
169
    for(int k=0; k<32; ++k)
189
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, RowMajor,false,ColMajor,false,ColMajor>::run),
170
      func[k] = 0;
190
    // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
171
191
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, RowMajor,Conj, ColMajor,false,ColMajor>::run),
172
    func[NOTR  | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, ColMajor,false,ColMajor,false,ColMajor>::run);
192
    0,
173
    func[TR    | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, RowMajor,false,ColMajor,false,ColMajor>::run);
193
    // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
174
    func[ADJ   | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, RowMajor,Conj, ColMajor,false,ColMajor>::run);
194
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,ColMajor,false,ColMajor>::run),
175
195
    // array index: TR    | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
176
    func[NOTR  | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,ColMajor,false,ColMajor>::run);
196
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,RowMajor,false,ColMajor>::run),
177
    func[TR    | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,RowMajor,false,ColMajor>::run);
197
    // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
178
    func[ADJ   | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,RowMajor,Conj, ColMajor>::run);
198
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,RowMajor,Conj, ColMajor>::run),
179
199
    0,
180
    func[NOTR  | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, ColMajor,false,ColMajor,false,ColMajor>::run);
200
    // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
181
    func[TR    | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, RowMajor,false,ColMajor,false,ColMajor>::run);
201
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, ColMajor,false,ColMajor,false,ColMajor>::run),
182
    func[ADJ   | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, RowMajor,Conj, ColMajor,false,ColMajor>::run);
202
    // array index: TR    | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
183
203
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, RowMajor,false,ColMajor,false,ColMajor>::run),
184
    func[NOTR  | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,ColMajor,false,ColMajor>::run);
204
    // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
185
    func[TR    | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,RowMajor,false,ColMajor>::run);
205
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, RowMajor,Conj, ColMajor,false,ColMajor>::run),
186
    func[ADJ   | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,RowMajor,Conj, ColMajor>::run);
206
    0,
187
207
    // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
188
    func[NOTR  | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, ColMajor,false,ColMajor,false,ColMajor>::run);
208
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,ColMajor,false,ColMajor>::run),
189
    func[TR    | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, RowMajor,false,ColMajor,false,ColMajor>::run);
209
    // array index: TR    | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
190
    func[ADJ   | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, RowMajor,Conj, ColMajor,false,ColMajor>::run);
210
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,RowMajor,false,ColMajor>::run),
191
211
    // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
192
    func[NOTR  | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,ColMajor,false,ColMajor>::run);
212
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,RowMajor,Conj, ColMajor>::run),
193
    func[TR    | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,RowMajor,false,ColMajor>::run);
213
    0,
194
    func[ADJ   | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,RowMajor,Conj, ColMajor>::run);
214
    // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
195
215
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, ColMajor,false,ColMajor,false,ColMajor>::run),
196
    func[NOTR  | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, ColMajor,false,ColMajor,false,ColMajor>::run);
216
    // array index: TR    | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
197
    func[TR    | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, RowMajor,false,ColMajor,false,ColMajor>::run);
217
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, RowMajor,false,ColMajor,false,ColMajor>::run),
198
    func[ADJ   | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, RowMajor,Conj, ColMajor,false,ColMajor>::run);
218
    // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
199
219
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, RowMajor,Conj, ColMajor,false,ColMajor>::run),
200
    func[NOTR  | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,ColMajor,false,ColMajor>::run);
220
    0,
201
    func[TR    | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,RowMajor,false,ColMajor>::run);
221
    // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
202
    func[ADJ   | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)] = (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,RowMajor,Conj, ColMajor>::run);
222
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,ColMajor,false,ColMajor>::run),
203
223
    // array index: TR    | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
204
    init = true;
224
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,RowMajor,false,ColMajor>::run),
205
  }
225
    // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
226
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,RowMajor,Conj, ColMajor>::run),
227
    0,
228
    // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
229
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, ColMajor,false,ColMajor,false,ColMajor>::run),
230
    // array index: TR    | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
231
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, RowMajor,false,ColMajor,false,ColMajor>::run),
232
    // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
233
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, RowMajor,Conj, ColMajor,false,ColMajor>::run),
234
    0,
235
    // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
236
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,ColMajor,false,ColMajor>::run),
237
    // array index: TR    | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
238
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,RowMajor,false,ColMajor>::run),
239
    // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
240
    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,RowMajor,Conj, ColMajor>::run),
241
    0
242
  };
206
243
207
  Scalar* a = reinterpret_cast<Scalar*>(pa);
244
  Scalar* a = reinterpret_cast<Scalar*>(pa);
208
  Scalar* b = reinterpret_cast<Scalar*>(pb);
245
  Scalar* b = reinterpret_cast<Scalar*>(pb);
209
  Scalar  alpha = *reinterpret_cast<Scalar*>(palpha);
246
  Scalar  alpha = *reinterpret_cast<Scalar*>(palpha);
210
247
211
  int info = 0;
248
  int info = 0;
212
  if(SIDE(*side)==INVALID)                                            info = 1;
249
  if(SIDE(*side)==INVALID)                                            info = 1;
213
  else if(UPLO(*uplo)==INVALID)                                       info = 2;
250
  else if(UPLO(*uplo)==INVALID)                                       info = 2;
Lines 312-327 int EIGEN_BLAS_FUNC(symm)(char *side, ch Link Here
312
}
349
}
313
350
314
// c = alpha*a*a' + beta*c  for op = 'N'or'n'
351
// c = alpha*a*a' + beta*c  for op = 'N'or'n'
315
// c = alpha*a'*a + beta*c  for op = 'T'or't','C'or'c'
352
// c = alpha*a'*a + beta*c  for op = 'T'or't','C'or'c'
316
int EIGEN_BLAS_FUNC(syrk)(char *uplo, char *op, int *n, int *k, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pbeta, RealScalar *pc, int *ldc)
353
int EIGEN_BLAS_FUNC(syrk)(char *uplo, char *op, int *n, int *k, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pbeta, RealScalar *pc, int *ldc)
317
{
354
{
318
//   std::cerr << "in syrk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " " << *pbeta << " " << *ldc << "\n";
355
//   std::cerr << "in syrk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " " << *pbeta << " " << *ldc << "\n";
319
  #if !ISCOMPLEX
356
  #if !ISCOMPLEX
357
<<<<<<< local
358
  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, const Scalar&);
359
  static const functype func[8] = {
360
    // array index: NOTR  | (UP << 2)
361
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,ColMajor,Conj, Upper>::run),
362
    // array index: TR    | (UP << 2)
363
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,ColMajor,Conj, Upper>::run),
364
    // array index: ADJ   | (UP << 2)
365
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,ColMajor,false,Upper>::run),
366
    0,
367
    // array index: NOTR  | (LO << 2)
368
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,ColMajor,Conj, Lower>::run),
369
    // array index: TR    | (LO << 2)
370
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,ColMajor,Conj, Lower>::run),
371
    // array index: ADJ   | (LO << 2)
372
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,ColMajor,false,Lower>::run),
373
    0
374
  };
375
=======
320
  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
376
  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
321
  static functype func[8];
377
  static functype func[8];
322
378
323
  static bool init = false;
379
  static bool init = false;
324
  if(!init)
380
  if(!init)
325
  {
381
  {
326
    for(int i=0; i<8; ++i)
382
    for(int i=0; i<8; ++i)
327
      func[i] = 0;
383
      func[i] = 0;
Lines 331-346 int EIGEN_BLAS_FUNC(syrk)(char *uplo, ch Link Here
331
    func[ADJ   | (UP << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,ColMajor,false,Upper>::run);
387
    func[ADJ   | (UP << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,ColMajor,false,Upper>::run);
332
388
333
    func[NOTR  | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,ColMajor,Conj, Lower>::run);
389
    func[NOTR  | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,ColMajor,Conj, Lower>::run);
334
    func[TR    | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,ColMajor,Conj, Lower>::run);
390
    func[TR    | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,ColMajor,Conj, Lower>::run);
335
    func[ADJ   | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,ColMajor,false,Lower>::run);
391
    func[ADJ   | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,ColMajor,false,Lower>::run);
336
392
337
    init = true;
393
    init = true;
338
  }
394
  }
395
>>>>>>> other
339
  #endif
396
  #endif
340
397
341
  Scalar* a = reinterpret_cast<Scalar*>(pa);
398
  Scalar* a = reinterpret_cast<Scalar*>(pa);
342
  Scalar* c = reinterpret_cast<Scalar*>(pc);
399
  Scalar* c = reinterpret_cast<Scalar*>(pc);
343
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
400
  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
344
  Scalar beta  = *reinterpret_cast<Scalar*>(pbeta);
401
  Scalar beta  = *reinterpret_cast<Scalar*>(pbeta);
345
402
346
  int info = 0;
403
  int info = 0;
Lines 518-533 int EIGEN_BLAS_FUNC(hemm)(char *side, ch Link Here
518
}
575
}
519
576
520
// c = alpha*a*conj(a') + beta*c  for op = 'N'or'n'
577
// c = alpha*a*conj(a') + beta*c  for op = 'N'or'n'
521
// c = alpha*conj(a')*a + beta*c  for op  = 'C'or'c'
578
// c = alpha*conj(a')*a + beta*c  for op  = 'C'or'c'
522
int EIGEN_BLAS_FUNC(herk)(char *uplo, char *op, int *n, int *k, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pbeta, RealScalar *pc, int *ldc)
579
int EIGEN_BLAS_FUNC(herk)(char *uplo, char *op, int *n, int *k, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pbeta, RealScalar *pc, int *ldc)
523
{
580
{
524
//   std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " " << *pbeta << " " << *ldc << "\n";
581
//   std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " " << *pbeta << " " << *ldc << "\n";
525
582
583
<<<<<<< local
584
  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, const Scalar&);
585
  static const functype func[8] = {
586
    // array index: NOTR  | (UP << 2)
587
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,Upper>::run),
588
    0,
589
    // array index: ADJ   | (UP << 2)
590
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,Upper>::run),
591
    0,
592
    // array index: NOTR  | (LO << 2)
593
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,Lower>::run),
594
    0,
595
    // array index: ADJ   | (LO << 2)
596
    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,Lower>::run),
597
    0
598
  };
599
=======
526
  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
600
  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
527
  static functype func[8];
601
  static functype func[8];
528
602
529
  static bool init = false;
603
  static bool init = false;
530
  if(!init)
604
  if(!init)
531
  {
605
  {
532
    for(int i=0; i<8; ++i)
606
    for(int i=0; i<8; ++i)
533
      func[i] = 0;
607
      func[i] = 0;
Lines 535-550 int EIGEN_BLAS_FUNC(herk)(char *uplo, ch Link Here
535
    func[NOTR  | (UP << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,Upper>::run);
609
    func[NOTR  | (UP << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,Upper>::run);
536
    func[ADJ   | (UP << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,Upper>::run);
610
    func[ADJ   | (UP << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,Upper>::run);
537
611
538
    func[NOTR  | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,Lower>::run);
612
    func[NOTR  | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,Lower>::run);
539
    func[ADJ   | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,Lower>::run);
613
    func[ADJ   | (LO << 2)] = (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,Lower>::run);
540
614
541
    init = true;
615
    init = true;
542
  }
616
  }
617
>>>>>>> other
543
618
544
  Scalar* a = reinterpret_cast<Scalar*>(pa);
619
  Scalar* a = reinterpret_cast<Scalar*>(pa);
545
  Scalar* c = reinterpret_cast<Scalar*>(pc);
620
  Scalar* c = reinterpret_cast<Scalar*>(pc);
546
  RealScalar alpha = *palpha;
621
  RealScalar alpha = *palpha;
547
  RealScalar beta  = *pbeta;
622
  RealScalar beta  = *pbeta;
548
623
549
//   std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " " << beta << " " << *ldc << "\n";
624
//   std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " " << beta << " " << *ldc << "\n";
550
625

Return to bug 1152