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

Function rmatrixgemm

src/ablas.cpp:1521–1615  ·  view source on GitHub ↗

Same as CMatrixGEMM, but for real numbers. OpType may be only 0 or 1. -- ALGLIB routine -- 16.12.2009 Bochkanov Sergey *************************************************************************/

Source from the content-addressed store, hash-verified

1519 Bochkanov Sergey
1520*************************************************************************/
1521void rmatrixgemm(int m,
1522 int n,
1523 int k,
1524 double alpha,
1525 const ap::real_2d_array& a,
1526 int ia,
1527 int ja,
1528 int optypea,
1529 const ap::real_2d_array& b,
1530 int ib,
1531 int jb,
1532 int optypeb,
1533 double beta,
1534 ap::real_2d_array& c,
1535 int ic,
1536 int jc)
1537{
1538 int s1;
1539 int s2;
1540 int bs;
1541
1542 bs = ablasblocksize(a);
1543 if( m<=bs&&n<=bs&&k<=bs )
1544 {
1545 rmatrixgemmk(m, n, k, alpha, a, ia, ja, optypea, b, ib, jb, optypeb, beta, c, ic, jc);
1546 return;
1547 }
1548 if( m>=n&&m>=k )
1549 {
1550
1551 //
1552 // A*B = (A1 A2)^T*B
1553 //
1554 ablassplitlength(a, m, s1, s2);
1555 if( optypea==0 )
1556 {
1557 rmatrixgemm(s1, n, k, alpha, a, ia, ja, optypea, b, ib, jb, optypeb, beta, c, ic, jc);
1558 rmatrixgemm(s2, n, k, alpha, a, ia+s1, ja, optypea, b, ib, jb, optypeb, beta, c, ic+s1, jc);
1559 }
1560 else
1561 {
1562 rmatrixgemm(s1, n, k, alpha, a, ia, ja, optypea, b, ib, jb, optypeb, beta, c, ic, jc);
1563 rmatrixgemm(s2, n, k, alpha, a, ia, ja+s1, optypea, b, ib, jb, optypeb, beta, c, ic+s1, jc);
1564 }
1565 return;
1566 }
1567 if( n>=m&&n>=k )
1568 {
1569
1570 //
1571 // A*B = A*(B1 B2)
1572 //
1573 ablassplitlength(a, n, s1, s2);
1574 if( optypeb==0 )
1575 {
1576 rmatrixgemm(m, s1, k, alpha, a, ia, ja, optypea, b, ib, jb, optypeb, beta, c, ic, jc);
1577 rmatrixgemm(m, s2, k, alpha, a, ia, ja, optypea, b, ib, jb+s1, optypeb, beta, c, ic, jc+s1);
1578 }

Callers 7

rmatrixqrFunction · 0.85
rmatrixlqFunction · 0.85
rmatrixqrunpackqFunction · 0.85
rmatrixlqunpackqFunction · 0.85
rmatrixrighttrsmFunction · 0.85
rmatrixlefttrsmFunction · 0.85
rmatrixsyrkFunction · 0.85

Calls 3

ablasblocksizeFunction · 0.85
rmatrixgemmkFunction · 0.85
ablassplitlengthFunction · 0.85

Tested by

no test coverage detected