mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Stable place to commit
This commit is contained in:
10
src/utils.c
10
src/utils.c
@ -262,6 +262,16 @@ void translate_array(float *a, int n, float s)
|
||||
}
|
||||
}
|
||||
|
||||
float mag_array(float *a, int n)
|
||||
{
|
||||
int i;
|
||||
float sum = 0;
|
||||
for(i = 0; i < n; ++i){
|
||||
sum += a[i]*a[i];
|
||||
}
|
||||
return sqrt(sum);
|
||||
}
|
||||
|
||||
void scale_array(float *a, int n, float s)
|
||||
{
|
||||
int i;
|
||||
|
Reference in New Issue
Block a user