MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / cmatrixsyrk

Function cmatrixsyrk

src/ablas.cpp:1206–1283  ·  view source on GitHub ↗

This subroutine calculates C=alpha*A*A^H+beta*C or C=alpha*A^H*A+beta*C where: * C is NxN Hermitian matrix given by its upper/lower triangle * A is NxK matrix when A*A^H is calculated, KxN matrix otherwise Additional info: * cache-oblivious algorithm is used. * multiplication result replaces C. If Beta=0, C elements are not used in calculations (not multiplied by zero - just not referenced)

Source from the content-addressed store, hash-verified

1204 Bochkanov Sergey
1205*************************************************************************/
1206void cmatrixsyrk(int n,
1207 int k,
1208 double alpha,
1209 const ap::complex_2d_array& a,
1210 int ia,
1211 int ja,
1212 int optypea,
1213 double beta,
1214 ap::complex_2d_array& c,
1215 int ic,
1216 int jc,
1217 bool isupper)
1218{
1219 int s1;
1220 int s2;
1221 int bs;
1222
1223 bs = ablascomplexblocksize(a);
1224 if( n<=bs&&k<=bs )
1225 {
1226 cmatrixsyrk2(n, k, alpha, a, ia, ja, optypea, beta, c, ic, jc, isupper);
1227 return;
1228 }
1229 if( k>=n )
1230 {
1231
1232 //
1233 // Split K
1234 //
1235 ablascomplexsplitlength(a, k, s1, s2);
1236 if( optypea==0 )
1237 {
1238 cmatrixsyrk(n, s1, alpha, a, ia, ja, optypea, beta, c, ic, jc, isupper);
1239 cmatrixsyrk(n, s2, alpha, a, ia, ja+s1, optypea, 1.0, c, ic, jc, isupper);
1240 }
1241 else
1242 {
1243 cmatrixsyrk(n, s1, alpha, a, ia, ja, optypea, beta, c, ic, jc, isupper);
1244 cmatrixsyrk(n, s2, alpha, a, ia+s1, ja, optypea, 1.0, c, ic, jc, isupper);
1245 }
1246 }
1247 else
1248 {
1249
1250 //
1251 // Split N
1252 //
1253 ablascomplexsplitlength(a, n, s1, s2);
1254 if( optypea==0&&isupper )
1255 {
1256 cmatrixsyrk(s1, k, alpha, a, ia, ja, optypea, beta, c, ic, jc, isupper);
1257 cmatrixgemm(s1, s2, k, alpha, a, ia, ja, 0, a, ia+s1, ja, 2, beta, c, ic, jc+s1);
1258 cmatrixsyrk(s2, k, alpha, a, ia+s1, ja, optypea, beta, c, ic+s1, jc+s1, isupper);
1259 return;
1260 }
1261 if( optypea==0&&!isupper )
1262 {
1263 cmatrixsyrk(s1, k, alpha, a, ia, ja, optypea, beta, c, ic, jc, isupper);

Callers

nothing calls this directly

Calls 4

ablascomplexblocksizeFunction · 0.85
cmatrixsyrk2Function · 0.85
ablascomplexsplitlengthFunction · 0.85
cmatrixgemmFunction · 0.85

Tested by

no test coverage detected