Math Lib: add range_vn_u

This commit is contained in:
Campbell Barton
2015-04-28 06:54:17 +10:00
parent f478c2cfbd
commit a4965249ec
2 changed files with 11 additions and 0 deletions

View File

@@ -314,6 +314,7 @@ double len_squared_vn(const float *array, const int size) ATTR_WARN_UNUSED_RESUL
float normalize_vn_vn(float *array_tar, const float *array_src, const int size);
float normalize_vn(float *array_tar, const int size);
void range_vn_i(int *array_tar, const int size, const int start);
void range_vn_u(unsigned int *array_tar, const int size, const unsigned int start);
void range_vn_fl(float *array_tar, const int size, const float start, const float step);
void negate_vn(float *array_tar, const int size);
void negate_vn_vn(float *array_tar, const float *array_src, const int size);

View File

@@ -897,6 +897,16 @@ void range_vn_i(int *array_tar, const int size, const int start)
}
}
void range_vn_u(unsigned int *array_tar, const int size, const unsigned int start)
{
unsigned int *array_pt = array_tar + (size - 1);
unsigned int j = start + (unsigned int)(size - 1);
int i = size;
while (i--) {
*(array_pt--) = j--;
}
}
void range_vn_fl(float *array_tar, const int size, const float start, const float step)
{
float *array_pt = array_tar + (size - 1);