added AQDG_Graph_DataPair_List_GetMinDiffX/Y()

This commit is contained in:
Martin Preuss
2025-12-30 10:50:57 +01:00
parent 87053c5029
commit 42c81e32ce

View File

@@ -22,6 +22,82 @@
<header type="sys" loc="pre">aqdiagram/aqdg_api.h</header> <header type="sys" loc="pre">aqdiagram/aqdg_api.h</header>
</headers> </headers>
<inlines>
<inline loc="end" access="public">
<content>
$(api) double $(struct_prefix)_List_GetMinDiffX(const $(struct_type)_LIST *st);
</content>
</inline>
<inline loc="code">
<content>
double $(struct_prefix)_List_GetMinDiffX(const $(struct_type)_LIST *stList) \n
{ \n
int idx=0; \n
double diff=0.0; \n
const $(struct_type) *dp; \n
const $(struct_type) *dpPrevious=NULL; \n
\n
dp=$(struct_prefix)_List_First(stList); \n
while(dp) { \n
if (idx==1) \n
diff=dp-&gt;valueX-dpPrevious-&gt;valueX; \n
else if (idx>1) { \n
double newDiff; \n
\n
newDiff=dp-&gt;valueX-dpPrevious-&gt;valueX; \n
if (newDiff&lt;diff) \n
diff=newDiff; \n
} \n
dpPrevious=dp; \n
idx++; \n
\n
dp=$(struct_prefix)_List_Next(dp); \n
} \n
return diff; \n
} \n
</content>
</inline>
<inline loc="end" access="public">
<content>
$(api) double $(struct_prefix)_List_GetMinDiffY(const $(struct_type)_LIST *st);
</content>
</inline>
<inline loc="code">
<content>
double $(struct_prefix)_List_GetMinDiffY(const $(struct_type)_LIST *stList) \n
{ \n
int idx=0; \n
double diff=0.0; \n
const $(struct_type) *dp; \n
const $(struct_type) *dpPrevious=NULL; \n
\n
dp=$(struct_prefix)_List_First(stList); \n
while(dp) { \n
if (idx==1) \n
diff=dp-&gt;valueY-dpPrevious-&gt;valueY; \n
else if (idx>1) { \n
double newDiff; \n
\n
newDiff=dp-&gt;valueY-dpPrevious-&gt;valueY; \n
if (newDiff&lt;diff) \n
diff=newDiff; \n
} \n
dpPrevious=dp; \n
idx++; \n
\n
dp=$(struct_prefix)_List_Next(dp); \n
} \n
return diff; \n
} \n
</content>
</inline>
</inlines>
</lang> </lang>
<members> <members>