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

Function ablasinternalsplitlength

src/ablas.cpp:1625–1670  ·  view source on GitHub ↗

Complex ABLASSplitLength -- ALGLIB routine -- 15.12.2009 Bochkanov Sergey *************************************************************************/

Source from the content-addressed store, hash-verified

1623 Bochkanov Sergey
1624*************************************************************************/
1625static void ablasinternalsplitlength(int n, int nb, int& n1, int& n2)
1626{
1627 int r;
1628
1629 if( n<=nb )
1630 {
1631
1632 //
1633 // Block size, no further splitting
1634 //
1635 n1 = n;
1636 n2 = 0;
1637 }
1638 else
1639 {
1640
1641 //
1642 // Greater than block size
1643 //
1644 if( n%nb!=0 )
1645 {
1646
1647 //
1648 // Split remainder
1649 //
1650 n2 = n%nb;
1651 n1 = n-n2;
1652 }
1653 else
1654 {
1655
1656 //
1657 // Split on block boundaries
1658 //
1659 n2 = n/2;
1660 n1 = n-n2;
1661 if( n1%nb==0 )
1662 {
1663 return;
1664 }
1665 r = nb-n1%nb;
1666 n1 = n1+r;
1667 n2 = n2-r;
1668 }
1669 }
1670}
1671
1672
1673/*************************************************************************

Callers 2

ablassplitlengthFunction · 0.85
ablascomplexsplitlengthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected