We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa64aa3 commit a42b5b1Copy full SHA for a42b5b1
1 file changed
mat.h
@@ -3495,6 +3495,16 @@ MATDEF mat_elem_t mat_norm_fro(const Mat *a) {
3495
return MAT_DISPATCH(norm_fro)(a);
3496
}
3497
3498
+MAT_INTERNAL_STATIC mat_elem_t mat__norm_fro_fast_scalar(const Mat *a) {
3499
+ size_t len = a->rows * a->cols;
3500
+ mat_elem_t *pa = a->data;
3501
+ mat_elem_t sum = 0;
3502
+ for (size_t i = 0; i < len; i++) {
3503
+ sum += pa[i] * pa[i];
3504
+ }
3505
+ return MAT_SQRT(sum);
3506
+}
3507
+
3508
#ifdef MAT_HAS_ARM_NEON
3509
MAT_INTERNAL_STATIC mat_elem_t mat__norm_fro_fast_neon(const Mat *a) {
3510
size_t len = a->rows * a->cols;
0 commit comments