Matrices.h
Go to the documentation of this file.
1 /*
2  * This file is part of qpOASES.
3  *
4  * qpOASES -- An Implementation of the Online Active Set Strategy.
5  * Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka,
6  * Christian Kirches et al. All rights reserved.
7  *
8  * qpOASES is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * qpOASES is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with qpOASES; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23 
24 
37 #ifndef QPOASES_MATRICES_H
38 #define QPOASES_MATRICES_H
39 
40 #ifdef __USE_SINGLE_PRECISION__
41 
43  #define GEMM sgemm_
44 
45  #define SYR ssyr_
46 
47  #define SYR2 ssyr2_
48 
49  #define POTRF spotrf_
50 
51 #else
52 
54  #define GEMM dgemm_
55 
56  #define SYR dsyr_
57 
58  #define SYR2 dsyr2_
59 
60  #define POTRF dpotrf_
61 
62 #endif /* __USE_SINGLE_PRECISION__ */
63 
64 
66  void dgemm_ ( const char*, const char*, const unsigned long*, const unsigned long*, const unsigned long*,
67  const double*, const double*, const unsigned long*, const double*, const unsigned long*,
68  const double*, double*, const unsigned long* );
70  void sgemm_ ( const char*, const char*, const unsigned long*, const unsigned long*, const unsigned long*,
71  const float*, const float*, const unsigned long*, const float*, const unsigned long*,
72  const float*, float*, const unsigned long* );
73 
75  void dsyr_ ( const char *, const unsigned long *, const double *, const double *,
76  const unsigned long *, double *, const unsigned long *);
78  void ssyr_ ( const char *, const unsigned long *, const float *, const float *,
79  const unsigned long *, float *, const unsigned long *);
80 
82  void dsyr2_ ( const char *, const unsigned long *, const double *, const double *,
83  const unsigned long *, const double *, const unsigned long *, double *, const unsigned long *);
85  void ssyr2_ ( const char *, const unsigned long *, const float *, const float *,
86  const unsigned long *, const float *, const unsigned long *, float *, const unsigned long *);
87 
89  void dpotrf_ ( const char *, const unsigned long *, double *, const unsigned long *, long * );
91  void spotrf_ ( const char *, const unsigned long *, float *, const unsigned long *, long * );
92 
93 
94 #include <qpOASES_e/Indexlist.h>
95 
96 
98 
99 
109 typedef struct
110 {
111  int nRows;
112  int nCols;
113  int leaDim;
115 } DenseMatrix;
116 
117 
118 
122 void DenseMatrixCON( DenseMatrix* _THIS,
123  int m,
124  int n,
125  int lD,
126  real_t *v
127  );
128 
129 void DenseMatrixCPY( DenseMatrix* FROM,
130  DenseMatrix* TO
131  );
132 
133 
135 void DenseMatrix_free( DenseMatrix* _THIS );
136 
141  int m,
142  int n,
143  int lD,
144  real_t *v
145  );
146 
147 
151  int i
152  );
153 
158 
163  int type
164  );
165 
170  int rNum,
171  int type
172  );
173 
177  int rNum,
178  const Indexlist* const icols,
179  real_t alpha,
180  real_t *row
181  );
182 
186  int cNum,
187  const Indexlist* const irows,
188  real_t alpha,
189  real_t *col
190  );
191 
195  int xN,
196  real_t alpha,
197  const real_t *x,
198  int xLD,
199  real_t beta,
200  real_t *y,
201  int yLD
202  );
203 
207  int xN,
208  real_t alpha,
209  const real_t *x,
210  int xLD,
211  real_t beta,
212  real_t *y,
213  int yLD
214  );
215 
219  const Indexlist* const irows,
220  const Indexlist* const icols,
221  int xN,
222  real_t alpha,
223  const real_t *x,
224  int xLD,
225  real_t beta,
226  real_t *y,
227  int yLD,
228  BooleanType yCompr
229  );
230 
234  const Indexlist* const irows,
235  const Indexlist* const icols,
236  int xN,
237  real_t alpha,
238  const real_t *x,
239  int xLD,
240  real_t beta,
241  real_t *y,
242  int yLD
243  );
244 
249  real_t alpha
250  );
251 
255  );
256 
257 static inline real_t* DenseMatrix_getVal( DenseMatrix* _THIS ) { return _THIS->val; }
258 
262  const Indexlist* const icols,
263  int xN,
264  const real_t *x,
265  int xLD,
266  real_t *y,
267  int yLD
268  );
269 
270 
271 
273 
274 
275 #endif /* QPOASES_MATRICES_H */
void spotrf_(const char *, const unsigned long *, float *, const unsigned long *, long *)
real_t DenseMatrix_getNorm(DenseMatrix *_THIS, int type)
Definition: Matrices.c:135
void dgemm_(const char *, const char *, const unsigned long *, const unsigned long *, const unsigned long *, const double *, const double *, const unsigned long *, const double *, const unsigned long *, const double *, double *, const unsigned long *)
returnValue DenseMatrix_subTimes(DenseMatrix *_THIS, const Indexlist *const irows, const Indexlist *const icols, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD, BooleanType yCompr)
Definition: Matrices.c:230
real_t DenseMatrix_diag(DenseMatrix *_THIS, int i)
Definition: Matrices.c:108
void dsyr2_(const char *, const unsigned long *, const double *, const double *, const unsigned long *, const double *, const unsigned long *, double *, const unsigned long *)
returnValue DenseMatrix_addToDiag(DenseMatrix *_THIS, real_t alpha)
Definition: Matrices.c:474
returnValue DenseMatrix_bilinear(DenseMatrix *_THIS, const Indexlist *const icols, int xN, const real_t *x, int xLD, real_t *y, int yLD)
Definition: Matrices.c:490
real_t DenseMatrix_getRowNorm(DenseMatrix *_THIS, int rNum, int type)
Definition: Matrices.c:141
returnValue DenseMatrix_getCol(DenseMatrix *_THIS, int cNum, const Indexlist *const irows, real_t alpha, real_t *col)
Definition: Matrices.c:178
Allows to pass back messages to the calling function.
returnValue DenseMatrix_getRow(DenseMatrix *_THIS, int rNum, const Indexlist *const icols, real_t alpha, real_t *row)
Definition: Matrices.c:147
returnValue DenseMatrix_transTimes(DenseMatrix *_THIS, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD)
Definition: Matrices.c:213
void ssyr_(const char *, const unsigned long *, const float *, const float *, const unsigned long *, float *, const unsigned long *)
BooleanType DenseMatrix_isDiag(DenseMatrix *_THIS)
Definition: Matrices.c:119
void dsyr_(const char *, const unsigned long *, const double *, const double *, const unsigned long *, double *, const unsigned long *)
void DenseMatrixCPY(DenseMatrix *FROM, DenseMatrix *TO)
Definition: Matrices.c:58
returnValue DenseMatrix_subTransTimes(DenseMatrix *_THIS, const Indexlist *const irows, const Indexlist *const icols, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD)
Definition: Matrices.c:416
void DenseMatrix_free(DenseMatrix *_THIS)
Definition: Matrices.c:75
void DenseMatrixCON(DenseMatrix *_THIS, int m, int n, int lD, real_t *v)
Definition: Matrices.c:47
Interfaces matrix-vector operations tailored to general dense matrices.
#define v
returnValue DenseMatrix_print(DenseMatrix *_THIS)
Definition: Matrices.c:484
void dpotrf_(const char *, const unsigned long *, double *, const unsigned long *, long *)
static real_t * DenseMatrix_getVal(DenseMatrix *_THIS)
Definition: Matrices.h:257
RowXpr row(Index i)
Definition: BlockMethods.h:725
void sgemm_(const char *, const char *, const unsigned long *, const unsigned long *, const unsigned long *, const float *, const float *, const unsigned long *, const float *, const unsigned long *, const float *, float *, const unsigned long *)
void ssyr2_(const char *, const unsigned long *, const float *, const float *, const unsigned long *, const float *, const unsigned long *, float *, const unsigned long *)
ColXpr col(Index i)
Definition: BlockMethods.h:708
returnValue DenseMatrix_times(DenseMatrix *_THIS, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD)
Definition: Matrices.c:196
double real_t
Definition: AD_test.c:10
returnValue DenseMatrix_init(DenseMatrix *_THIS, int m, int n, int lD, real_t *v)
Definition: Matrices.c:80


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:50