MCPcopy Create free account
hub / github.com/Singular/Singular / MivAbsMax

Function MivAbsMax

Singular/walk.cc:1816–1845  ·  view source on GitHub ↗

* Look for the smallest absolut value in vec * **********************************************/

Source from the content-addressed store, hash-verified

1814 * Look for the smallest absolut value in vec *
1815 **********************************************/
1816static int MivAbsMax(intvec* vec)
1817{
1818 int i,k;
1819 if((*vec)[0] < 0)
1820 {
1821 k = -(*vec)[0];
1822 }
1823 else
1824 {
1825 k = (*vec)[0];
1826 }
1827 for(i=1; i < (vec->length()); i++)
1828 {
1829 if((*vec)[i] < 0)
1830 {
1831 if(-(*vec)[i] > k)
1832 {
1833 k = -(*vec)[i];
1834 }
1835 }
1836 else
1837 {
1838 if((*vec)[i] > k)
1839 {
1840 k = (*vec)[i];
1841 }
1842 }
1843 }
1844 return k;
1845}
1846
1847
1848/**************************************************************

Callers 2

MivAbsMaxArgFunction · 0.85
MwalkNextWeightCCFunction · 0.85

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected