42 #include <visp3/core/vpArray2D.h>
43 #include <visp3/core/vpException.h>
63 template<
unsigned int>
137 template<
unsigned int>
143 for(
unsigned int r=0;r<Arows;r++)
144 for(
unsigned int c=0;c<Bcols;c++){
146 for(
unsigned int n=0;n<Brows;n++)
147 sum+=A[r][n]*B[n][c]*alpha;
155 for(
unsigned int r=0;r<Arows;r++)
156 for(
unsigned int c=0;c<Bcols;c++){
158 for(
unsigned int n=0;n<Brows;n++)
159 sum+=A[n][r]*B[n][c]*alpha;
167 for(
unsigned int r=0;r<Arows;r++)
168 for(
unsigned int c=0;c<Bcols;c++){
170 for(
unsigned int n=0;n<Brows;n++)
171 sum+=A[r][n]*B[c][n]*alpha;
179 for(
unsigned int r=0;r<Arows;r++)
180 for(
unsigned int c=0;c<Bcols;c++){
182 for(
unsigned int n=0;n<Brows;n++)
183 sum+=A[n][r]*B[c][n]*alpha;
188 template<
unsigned int>
195 for(
unsigned int r=0;r<Arows;r++)
196 for(
unsigned int c=0;c<Bcols;c++){
198 for(
unsigned int n=0;n<Brows;n++)
199 sum+=A[r][n]*B[n][c]*alpha;
200 D[r][c]=sum+C[r][c]*beta;
207 for(
unsigned int r=0;r<Arows;r++)
208 for(
unsigned int c=0;c<Bcols;c++){
210 for(
unsigned int n=0;n<Brows;n++)
211 sum+=A[n][r]*B[n][c]*alpha;
212 D[r][c]=sum+C[r][c]*beta;
219 for(
unsigned int r=0;r<Arows;r++)
220 for(
unsigned int c=0;c<Bcols;c++){
222 for(
unsigned int n=0;n<Brows;n++)
223 sum+=A[r][n]*B[c][n]*alpha;
224 D[r][c]=sum+C[r][c]*beta;
231 for(
unsigned int r=0;r<Arows;r++)
232 for(
unsigned int c=0;c<Bcols;c++){
234 for(
unsigned int n=0;n<Brows;n++)
235 sum+=A[n][r]*B[c][n]*alpha;
236 D[r][c]=sum+C[r][c]*beta;
244 for(
unsigned int r=0;r<Arows;r++)
245 for(
unsigned int c=0;c<Bcols;c++){
247 for(
unsigned int n=0;n<Brows;n++)
248 sum+=A[r][n]*B[n][c]*alpha;
249 D[r][c]=sum+C[c][r]*beta;
256 for(
unsigned int r=0;r<Arows;r++)
257 for(
unsigned int c=0;c<Bcols;c++){
259 for(
unsigned int n=0;n<Brows;n++)
260 sum+=A[n][r]*B[n][c]*alpha;
261 D[r][c]=sum+C[c][r]*beta;
269 for(
unsigned int r=0;r<Arows;r++)
270 for(
unsigned int c=0;c<Bcols;c++){
272 for(
unsigned int n=0;n<Brows;n++)
273 sum+=A[r][n]*B[c][n]*alpha;
274 D[r][c]=sum+C[c][r]*beta;
281 for(
unsigned int r=0;r<Arows;r++)
282 for(
unsigned int c=0;c<Bcols;c++){
284 for(
unsigned int n=0;n<Brows;n++)
285 sum+=A[n][r]*B[c][n]*alpha;
286 D[r][c]=sum+C[c][r]*beta;
290 template<
unsigned int T>
298 GEMMsize<T>(A,B,Arows,Acols,Brows,Bcols);
307 if (Acols != Brows) {
309 "In vpGEMM, cannot multiply (%dx%d) matrix by (%dx%d) matrix",
310 Arows, Acols, Brows, Bcols)) ;
316 "In vpGEMM, cannot add resulting (%dx%d) matrix to (%dx%d) matrix",
320 GEMM2<T>(Arows,Brows,Bcols,A,B,alpha,C,beta,D);
322 GEMM1<T>(Arows,Brows,Bcols,A,B,alpha,D);
364 vpTGEMM<0>( A, B, alpha , C, beta, D);
367 vpTGEMM<1>( A, B, alpha , C, beta, D);
370 vpTGEMM<2>( A, B, alpha , C, beta, D);
373 vpTGEMM<3>( A, B, alpha , C, beta, D);
376 vpTGEMM<4>( A, B, alpha , C, beta, D);
379 vpTGEMM<5>( A, B, alpha , C, beta, D);
382 vpTGEMM<6>( A, B, alpha , C, beta, D);
385 vpTGEMM<7>( A, B, alpha , C, beta, D);
389 "Operation on vpGEMM not implemented")) ;
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
error that can be emited by ViSP classes.
unsigned int getCols() const
Return the number of columns of the 2D array.
unsigned int getRows() const
Return the number of rows of the 2D array.
void vpGEMM(const vpArray2D< double > &A, const vpArray2D< double > &B, const double &alpha, const vpArray2D< double > &C, const double &beta, vpArray2D< double > &D, const unsigned int &ops=0)