define get_v div_z div_x v_num div_y div_z div_z div_y-1 div_z-1 div_y

1
2
3
4
#define get_v(x, y, z) \
((0 == (x)) ? (y)*(div_z+1) + (z) : ((div_x) == (x)) ? v_num - (div_y+1)*(div_z+1) + (y)*(div_z+1) + (z) : \
(div_y-1)*(div_z-1) + (div_y+div_z)*2*(x) + ((0 == (y)) ? (z) : ((div_y) == (y)) ? (div_z-1) + 2*(y) + (z) : \
(div_z-1) + 2*(y) + ((z)?1:0) ))