Go back to NetworkStructure
This function defines a function that converts the index of effective degree (degree k, with e neighbors being infected) to a linear index in an array of state variables.
<project-file type=“source”/> <content> #ifndef KE_INDEX_H #define KE_INDEX_H
inline int ke_index(int k, int e) {
return ((k-1)*(k-1+3)/2 + e + 1);
}
#endif </content>