00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <string.h>
00024 #include "flgrCoreIO.h"
00025 #include "flgrCoreVector.h"
00026 #include "flgrCoreDispatch.h"
00027 #include "flgrCoreArithDef.h"
00028 #include "flgrCoreMeasureVector.h"
00029
00030 #define FLGR_MACRO_VECTOR_MEASURE_VOLUME(dtype,vtype) \
00031 dtype *array=(dtype*)vec->array; \
00032 vtype volume=0; \
00033 int spp=vec->spp; \
00034 int k; \
00035 \
00036 \
00037 \
00038 for(k=0; k<spp ; k++) { \
00039 volume+=(vtype) (flgr_get_array_##dtype(array,k)); \
00040 } \
00041 return volume
00042
00043
00044
00045
00046
00047
00048 fgUINT64 flgr_vector_measure_volume_u64_fgBIT(FLGR_Vector *vec) {
00049 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgBIT,fgUINT64);
00050 }
00051 fgUINT64 flgr_vector_measure_volume_u64_fgUINT8(FLGR_Vector *vec) {
00052 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT8,fgUINT64);
00053 }
00054 fgUINT64 flgr_vector_measure_volume_u64_fgUINT16(FLGR_Vector *vec) {
00055 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT16,fgUINT64);
00056 }
00057 fgUINT64 flgr_vector_measure_volume_u64_fgUINT32(FLGR_Vector *vec) {
00058 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT32,fgUINT64);
00059 }
00060 fgUINT64 flgr_vector_measure_volume_u64_fgUINT64(FLGR_Vector *vec) {
00061 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT64,fgUINT64);
00062 }
00063 fgUINT64 flgr_vector_measure_volume_u64_fgINT8(FLGR_Vector *vec) {
00064 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT8,fgUINT64);
00065 }
00066 fgUINT64 flgr_vector_measure_volume_u64_fgINT16(FLGR_Vector *vec) {
00067 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT16,fgUINT64);
00068 }
00069 fgUINT64 flgr_vector_measure_volume_u64_fgINT32(FLGR_Vector *vec) {
00070 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT32,fgUINT64);
00071 }
00072 fgUINT64 flgr_vector_measure_volume_u64_fgINT64(FLGR_Vector *vec) {
00073 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT64,fgUINT64);
00074 }
00075 fgUINT64 flgr_vector_measure_volume_u64_fgFLOAT32(FLGR_Vector *vec) {
00076 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT32,fgUINT64);
00077 }
00078 fgUINT64 flgr_vector_measure_volume_u64_fgFLOAT64(FLGR_Vector *vec) {
00079 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT64,fgUINT64);
00080 }
00081
00082
00084
00089
00090 fgUINT64 flgr_vector_measure_volume_u64(FLGR_Vector *vec) {
00091
00092
00093 if(vec==NULL) {
00094 POST_ERROR("Null objects\n");
00095 return 0;
00096 }
00097
00098 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_volume_u64,vec);
00099 }
00100
00101
00102
00103
00104
00105 fgINT64 flgr_vector_measure_volume_s64_fgBIT(FLGR_Vector *vec) {
00106 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgBIT,fgINT64);
00107 }
00108 fgINT64 flgr_vector_measure_volume_s64_fgUINT8(FLGR_Vector *vec) {
00109 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT8,fgINT64);
00110 }
00111 fgINT64 flgr_vector_measure_volume_s64_fgUINT16(FLGR_Vector *vec) {
00112 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT16,fgINT64);
00113 }
00114 fgINT64 flgr_vector_measure_volume_s64_fgUINT32(FLGR_Vector *vec) {
00115 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT32,fgINT64);
00116 }
00117 fgINT64 flgr_vector_measure_volume_s64_fgUINT64(FLGR_Vector *vec) {
00118 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT64,fgINT64);
00119 }
00120 fgINT64 flgr_vector_measure_volume_s64_fgINT8(FLGR_Vector *vec) {
00121 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT8,fgINT64);
00122 }
00123 fgINT64 flgr_vector_measure_volume_s64_fgINT16(FLGR_Vector *vec) {
00124 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT16,fgINT64);
00125 }
00126 fgINT64 flgr_vector_measure_volume_s64_fgINT32(FLGR_Vector *vec) {
00127 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT32,fgINT64);
00128 }
00129 fgINT64 flgr_vector_measure_volume_s64_fgINT64(FLGR_Vector *vec) {
00130 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT64,fgINT64);
00131 }
00132 fgINT64 flgr_vector_measure_volume_s64_fgFLOAT32(FLGR_Vector *vec) {
00133 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT32,fgINT64);
00134 }
00135 fgINT64 flgr_vector_measure_volume_s64_fgFLOAT64(FLGR_Vector *vec) {
00136 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT64,fgINT64);
00137 }
00138
00139
00141
00146
00147 fgINT64 flgr_vector_measure_volume_s64(FLGR_Vector *vec) {
00148
00149
00150 if(vec==NULL) {
00151 POST_ERROR("Null objects\n");
00152 return 0;
00153 }
00154
00155 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_volume_s64,vec);
00156 }
00157
00158
00159
00160
00161
00162
00163
00164 fgUINT32 flgr_vector_measure_volume_u32_fgBIT(FLGR_Vector *vec) {
00165 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgBIT,fgUINT32);
00166 }
00167 fgUINT32 flgr_vector_measure_volume_u32_fgUINT8(FLGR_Vector *vec) {
00168 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT8,fgUINT32);
00169 }
00170 fgUINT32 flgr_vector_measure_volume_u32_fgUINT16(FLGR_Vector *vec) {
00171 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT16,fgUINT32);
00172 }
00173 fgUINT32 flgr_vector_measure_volume_u32_fgUINT32(FLGR_Vector *vec) {
00174 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT32,fgUINT32);
00175 }
00176 fgUINT32 flgr_vector_measure_volume_u32_fgUINT64(FLGR_Vector *vec) {
00177 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT64,fgUINT32);
00178 }
00179 fgUINT32 flgr_vector_measure_volume_u32_fgINT8(FLGR_Vector *vec) {
00180 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT8,fgUINT32);
00181 }
00182 fgUINT32 flgr_vector_measure_volume_u32_fgINT16(FLGR_Vector *vec) {
00183 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT16,fgUINT32);
00184 }
00185 fgUINT32 flgr_vector_measure_volume_u32_fgINT32(FLGR_Vector *vec) {
00186 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT32,fgUINT32);
00187 }
00188 fgUINT32 flgr_vector_measure_volume_u32_fgINT64(FLGR_Vector *vec) {
00189 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT64,fgUINT32);
00190 }
00191 fgUINT32 flgr_vector_measure_volume_u32_fgFLOAT32(FLGR_Vector *vec) {
00192 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT32,fgUINT32);
00193 }
00194 fgUINT32 flgr_vector_measure_volume_u32_fgFLOAT64(FLGR_Vector *vec) {
00195 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT64,fgUINT32);
00196 }
00197
00198
00200
00205
00206 fgUINT32 flgr_vector_measure_volume_u32(FLGR_Vector *vec) {
00207
00208
00209 if(vec==NULL) {
00210 POST_ERROR("Null objects\n");
00211 return 0;
00212 }
00213
00214 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_volume_u32,vec);
00215 }
00216
00217
00218
00219
00220 fgINT32 flgr_vector_measure_volume_s32_fgBIT(FLGR_Vector *vec) {
00221 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgBIT,fgINT32);
00222 }
00223 fgINT32 flgr_vector_measure_volume_s32_fgUINT8(FLGR_Vector *vec) {
00224 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT8,fgINT32);
00225 }
00226 fgINT32 flgr_vector_measure_volume_s32_fgUINT16(FLGR_Vector *vec) {
00227 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT16,fgINT32);
00228 }
00229 fgINT32 flgr_vector_measure_volume_s32_fgUINT32(FLGR_Vector *vec) {
00230 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT32,fgINT32);
00231 }
00232 fgINT32 flgr_vector_measure_volume_s32_fgUINT64(FLGR_Vector *vec) {
00233 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT64,fgINT32);
00234 }
00235 fgINT32 flgr_vector_measure_volume_s32_fgINT8(FLGR_Vector *vec) {
00236 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT8,fgINT32);
00237 }
00238 fgINT32 flgr_vector_measure_volume_s32_fgINT16(FLGR_Vector *vec) {
00239 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT16,fgINT32);
00240 }
00241 fgINT32 flgr_vector_measure_volume_s32_fgINT32(FLGR_Vector *vec) {
00242 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT32,fgINT32);
00243 }
00244 fgINT32 flgr_vector_measure_volume_s32_fgINT64(FLGR_Vector *vec) {
00245 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT64,fgINT32);
00246 }
00247 fgINT32 flgr_vector_measure_volume_s32_fgFLOAT32(FLGR_Vector *vec) {
00248 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT32,fgINT32);
00249 }
00250 fgINT32 flgr_vector_measure_volume_s32_fgFLOAT64(FLGR_Vector *vec) {
00251 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT64,fgINT32);
00252 }
00253
00254
00256
00261
00262 fgINT32 flgr_vector_measure_volume_s32(FLGR_Vector *vec) {
00263
00264
00265 if(vec==NULL) {
00266 POST_ERROR("Null objects\n");
00267 return 0;
00268 }
00269
00270 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_volume_s32,vec);
00271 }
00272
00273
00274
00275
00276
00277
00278 fgFLOAT32 flgr_vector_measure_volume_f32_fgBIT(FLGR_Vector *vec) {
00279 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgBIT,fgFLOAT32);
00280 }
00281 fgFLOAT32 flgr_vector_measure_volume_f32_fgUINT8(FLGR_Vector *vec) {
00282 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT8,fgFLOAT32);
00283 }
00284 fgFLOAT32 flgr_vector_measure_volume_f32_fgUINT16(FLGR_Vector *vec) {
00285 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT16,fgFLOAT32);
00286 }
00287 fgFLOAT32 flgr_vector_measure_volume_f32_fgUINT32(FLGR_Vector *vec) {
00288 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT32,fgFLOAT32);
00289 }
00290 fgFLOAT32 flgr_vector_measure_volume_f32_fgUINT64(FLGR_Vector *vec) {
00291 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT64,fgFLOAT32);
00292 }
00293 fgFLOAT32 flgr_vector_measure_volume_f32_fgINT8(FLGR_Vector *vec) {
00294 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT8,fgFLOAT32);
00295 }
00296 fgFLOAT32 flgr_vector_measure_volume_f32_fgINT16(FLGR_Vector *vec) {
00297 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT16,fgFLOAT32);
00298 }
00299 fgFLOAT32 flgr_vector_measure_volume_f32_fgINT32(FLGR_Vector *vec) {
00300 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT32,fgFLOAT32);
00301 }
00302 fgFLOAT32 flgr_vector_measure_volume_f32_fgINT64(FLGR_Vector *vec) {
00303 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT64,fgFLOAT32);
00304 }
00305 fgFLOAT32 flgr_vector_measure_volume_f32_fgFLOAT32(FLGR_Vector *vec) {
00306 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT32,fgFLOAT32);
00307 }
00308 fgFLOAT32 flgr_vector_measure_volume_f32_fgFLOAT64(FLGR_Vector *vec) {
00309 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT64,fgFLOAT32);
00310 }
00311
00312
00314
00319
00320 fgFLOAT32 flgr_vector_measure_volume_f32(FLGR_Vector *vec) {
00321
00322
00323 if(vec==NULL) {
00324 POST_ERROR("Null objects\n");
00325 return 0;
00326 }
00327
00328 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_volume_f32,vec);
00329 }
00330
00331
00332
00333
00334
00335
00336 fgFLOAT64 flgr_vector_measure_volume_f64_fgBIT(FLGR_Vector *vec) {
00337 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgBIT,fgFLOAT64);
00338 }
00339 fgFLOAT64 flgr_vector_measure_volume_f64_fgUINT8(FLGR_Vector *vec) {
00340 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT8,fgFLOAT64);
00341 }
00342 fgFLOAT64 flgr_vector_measure_volume_f64_fgUINT16(FLGR_Vector *vec) {
00343 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT16,fgFLOAT64);
00344 }
00345 fgFLOAT64 flgr_vector_measure_volume_f64_fgUINT32(FLGR_Vector *vec) {
00346 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT32,fgFLOAT64);
00347 }
00348 fgFLOAT64 flgr_vector_measure_volume_f64_fgUINT64(FLGR_Vector *vec) {
00349 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgUINT64,fgFLOAT64);
00350 }
00351 fgFLOAT64 flgr_vector_measure_volume_f64_fgINT8(FLGR_Vector *vec) {
00352 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT8,fgFLOAT64);
00353 }
00354 fgFLOAT64 flgr_vector_measure_volume_f64_fgINT16(FLGR_Vector *vec) {
00355 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT16,fgFLOAT64);
00356 }
00357 fgFLOAT64 flgr_vector_measure_volume_f64_fgINT32(FLGR_Vector *vec) {
00358 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT32,fgFLOAT64);
00359 }
00360 fgFLOAT64 flgr_vector_measure_volume_f64_fgINT64(FLGR_Vector *vec) {
00361 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgINT64,fgFLOAT64);
00362 }
00363 fgFLOAT64 flgr_vector_measure_volume_f64_fgFLOAT32(FLGR_Vector *vec) {
00364 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT32,fgFLOAT64);
00365 }
00366 fgFLOAT64 flgr_vector_measure_volume_f64_fgFLOAT64(FLGR_Vector *vec) {
00367 FLGR_MACRO_VECTOR_MEASURE_VOLUME(fgFLOAT64,fgFLOAT64);
00368 }
00369
00370
00372
00377
00378 fgFLOAT64 flgr_vector_measure_volume_f64(FLGR_Vector *vec) {
00379
00380
00381 if(vec==NULL) {
00382 POST_ERROR("Null objects\n");
00383 return 0;
00384 }
00385
00386 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_volume_f64,vec);
00387 }
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00403
00405
00406 #define FLGR_MACRO_VECTOR_MEASURE_NORM(dtype,vtype) \
00407 dtype *array=(dtype*)vec->array; \
00408 vtype norm=0; \
00409 vtype val=0; \
00410 int spp=vec->spp; \
00411 int k; \
00412 \
00413 \
00414 \
00415 for(k=0; k<spp ; k++) { \
00416 val = (vtype) (flgr_get_array_##dtype(array,k)); \
00417 norm+= flgr_defop_square_##vtype(val); \
00418 } \
00419 return flgr_defop_sqrt_##vtype(norm);
00420
00421
00422 fgUINT64 flgr_vector_measure_norm_u64_fgBIT(FLGR_Vector *vec) {
00423 FLGR_MACRO_VECTOR_MEASURE_NORM(fgBIT,fgUINT64);
00424 }
00425 fgUINT64 flgr_vector_measure_norm_u64_fgUINT8(FLGR_Vector *vec) {
00426 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT8,fgUINT64);
00427 }
00428 fgUINT64 flgr_vector_measure_norm_u64_fgUINT16(FLGR_Vector *vec) {
00429 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT16,fgUINT64);
00430 }
00431 fgUINT64 flgr_vector_measure_norm_u64_fgUINT32(FLGR_Vector *vec) {
00432 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT32,fgUINT64);
00433 }
00434 fgUINT64 flgr_vector_measure_norm_u64_fgUINT64(FLGR_Vector *vec) {
00435 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT64,fgUINT64);
00436 }
00437 fgUINT64 flgr_vector_measure_norm_u64_fgINT8(FLGR_Vector *vec) {
00438 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT8,fgUINT64);
00439 }
00440 fgUINT64 flgr_vector_measure_norm_u64_fgINT16(FLGR_Vector *vec) {
00441 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT16,fgUINT64);
00442 }
00443 fgUINT64 flgr_vector_measure_norm_u64_fgINT32(FLGR_Vector *vec) {
00444 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT32,fgUINT64);
00445 }
00446 fgUINT64 flgr_vector_measure_norm_u64_fgINT64(FLGR_Vector *vec) {
00447 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT64,fgUINT64);
00448 }
00449 fgUINT64 flgr_vector_measure_norm_u64_fgFLOAT32(FLGR_Vector *vec) {
00450 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT32,fgUINT64);
00451 }
00452 fgUINT64 flgr_vector_measure_norm_u64_fgFLOAT64(FLGR_Vector *vec) {
00453 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT64,fgUINT64);
00454 }
00455
00456
00458
00463
00464 fgUINT64 flgr_vector_measure_norm_u64(FLGR_Vector *vec) {
00465
00466
00467 if(vec==NULL) {
00468 POST_ERROR("Null objects\n");
00469 return 0;
00470 }
00471
00472 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_norm_u64,vec);
00473 }
00474
00475
00476
00477
00478
00479 fgINT64 flgr_vector_measure_norm_s64_fgBIT(FLGR_Vector *vec) {
00480 FLGR_MACRO_VECTOR_MEASURE_NORM(fgBIT,fgINT64);
00481 }
00482 fgINT64 flgr_vector_measure_norm_s64_fgUINT8(FLGR_Vector *vec) {
00483 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT8,fgINT64);
00484 }
00485 fgINT64 flgr_vector_measure_norm_s64_fgUINT16(FLGR_Vector *vec) {
00486 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT16,fgINT64);
00487 }
00488 fgINT64 flgr_vector_measure_norm_s64_fgUINT32(FLGR_Vector *vec) {
00489 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT32,fgINT64);
00490 }
00491 fgINT64 flgr_vector_measure_norm_s64_fgUINT64(FLGR_Vector *vec) {
00492 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT64,fgINT64);
00493 }
00494 fgINT64 flgr_vector_measure_norm_s64_fgINT8(FLGR_Vector *vec) {
00495 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT8,fgINT64);
00496 }
00497 fgINT64 flgr_vector_measure_norm_s64_fgINT16(FLGR_Vector *vec) {
00498 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT16,fgINT64);
00499 }
00500 fgINT64 flgr_vector_measure_norm_s64_fgINT32(FLGR_Vector *vec) {
00501 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT32,fgINT64);
00502 }
00503 fgINT64 flgr_vector_measure_norm_s64_fgINT64(FLGR_Vector *vec) {
00504 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT64,fgINT64);
00505 }
00506 fgINT64 flgr_vector_measure_norm_s64_fgFLOAT32(FLGR_Vector *vec) {
00507 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT32,fgINT64);
00508 }
00509 fgINT64 flgr_vector_measure_norm_s64_fgFLOAT64(FLGR_Vector *vec) {
00510 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT64,fgINT64);
00511 }
00512
00513
00515
00520
00521 fgINT64 flgr_vector_measure_norm_s64(FLGR_Vector *vec) {
00522
00523
00524 if(vec==NULL) {
00525 POST_ERROR("Null objects\n");
00526 return 0;
00527 }
00528
00529 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_norm_s64,vec);
00530 }
00531
00532
00533
00534
00535
00536
00537
00538 fgUINT32 flgr_vector_measure_norm_u32_fgBIT(FLGR_Vector *vec) {
00539 FLGR_MACRO_VECTOR_MEASURE_NORM(fgBIT,fgUINT32);
00540 }
00541 fgUINT32 flgr_vector_measure_norm_u32_fgUINT8(FLGR_Vector *vec) {
00542 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT8,fgUINT32);
00543 }
00544 fgUINT32 flgr_vector_measure_norm_u32_fgUINT16(FLGR_Vector *vec) {
00545 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT16,fgUINT32);
00546 }
00547 fgUINT32 flgr_vector_measure_norm_u32_fgUINT32(FLGR_Vector *vec) {
00548 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT32,fgUINT32);
00549 }
00550 fgUINT32 flgr_vector_measure_norm_u32_fgUINT64(FLGR_Vector *vec) {
00551 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT64,fgUINT32);
00552 }
00553 fgUINT32 flgr_vector_measure_norm_u32_fgINT8(FLGR_Vector *vec) {
00554 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT8,fgUINT32);
00555 }
00556 fgUINT32 flgr_vector_measure_norm_u32_fgINT16(FLGR_Vector *vec) {
00557 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT16,fgUINT32);
00558 }
00559 fgUINT32 flgr_vector_measure_norm_u32_fgINT32(FLGR_Vector *vec) {
00560 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT32,fgUINT32);
00561 }
00562 fgUINT32 flgr_vector_measure_norm_u32_fgINT64(FLGR_Vector *vec) {
00563 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT64,fgUINT32);
00564 }
00565 fgUINT32 flgr_vector_measure_norm_u32_fgFLOAT32(FLGR_Vector *vec) {
00566 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT32,fgUINT32);
00567 }
00568 fgUINT32 flgr_vector_measure_norm_u32_fgFLOAT64(FLGR_Vector *vec) {
00569 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT64,fgUINT32);
00570 }
00571
00572
00574
00579
00580 fgUINT32 flgr_vector_measure_norm_u32(FLGR_Vector *vec) {
00581
00582
00583 if(vec==NULL) {
00584 POST_ERROR("Null objects\n");
00585 return 0;
00586 }
00587
00588 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_norm_u32,vec);
00589 }
00590
00591
00592
00593
00594 fgINT32 flgr_vector_measure_norm_s32_fgBIT(FLGR_Vector *vec) {
00595 FLGR_MACRO_VECTOR_MEASURE_NORM(fgBIT,fgINT32);
00596 }
00597 fgINT32 flgr_vector_measure_norm_s32_fgUINT8(FLGR_Vector *vec) {
00598 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT8,fgINT32);
00599 }
00600 fgINT32 flgr_vector_measure_norm_s32_fgUINT16(FLGR_Vector *vec) {
00601 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT16,fgINT32);
00602 }
00603 fgINT32 flgr_vector_measure_norm_s32_fgUINT32(FLGR_Vector *vec) {
00604 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT32,fgINT32);
00605 }
00606 fgINT32 flgr_vector_measure_norm_s32_fgUINT64(FLGR_Vector *vec) {
00607 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT64,fgINT32);
00608 }
00609 fgINT32 flgr_vector_measure_norm_s32_fgINT8(FLGR_Vector *vec) {
00610 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT8,fgINT32);
00611 }
00612 fgINT32 flgr_vector_measure_norm_s32_fgINT16(FLGR_Vector *vec) {
00613 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT16,fgINT32);
00614 }
00615 fgINT32 flgr_vector_measure_norm_s32_fgINT32(FLGR_Vector *vec) {
00616 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT32,fgINT32);
00617 }
00618 fgINT32 flgr_vector_measure_norm_s32_fgINT64(FLGR_Vector *vec) {
00619 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT64,fgINT32);
00620 }
00621 fgINT32 flgr_vector_measure_norm_s32_fgFLOAT32(FLGR_Vector *vec) {
00622 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT32,fgINT32);
00623 }
00624 fgINT32 flgr_vector_measure_norm_s32_fgFLOAT64(FLGR_Vector *vec) {
00625 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT64,fgINT32);
00626 }
00627
00628
00630
00635
00636 fgINT32 flgr_vector_measure_norm_s32(FLGR_Vector *vec) {
00637
00638
00639 if(vec==NULL) {
00640 POST_ERROR("Null objects\n");
00641 return 0;
00642 }
00643
00644 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_norm_s32,vec);
00645 }
00646
00647
00648
00649
00650
00651
00652 fgFLOAT32 flgr_vector_measure_norm_f32_fgBIT(FLGR_Vector *vec) {
00653 FLGR_MACRO_VECTOR_MEASURE_NORM(fgBIT,fgFLOAT32);
00654 }
00655 fgFLOAT32 flgr_vector_measure_norm_f32_fgUINT8(FLGR_Vector *vec) {
00656 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT8,fgFLOAT32);
00657 }
00658 fgFLOAT32 flgr_vector_measure_norm_f32_fgUINT16(FLGR_Vector *vec) {
00659 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT16,fgFLOAT32);
00660 }
00661 fgFLOAT32 flgr_vector_measure_norm_f32_fgUINT32(FLGR_Vector *vec) {
00662 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT32,fgFLOAT32);
00663 }
00664 fgFLOAT32 flgr_vector_measure_norm_f32_fgUINT64(FLGR_Vector *vec) {
00665 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT64,fgFLOAT32);
00666 }
00667 fgFLOAT32 flgr_vector_measure_norm_f32_fgINT8(FLGR_Vector *vec) {
00668 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT8,fgFLOAT32);
00669 }
00670 fgFLOAT32 flgr_vector_measure_norm_f32_fgINT16(FLGR_Vector *vec) {
00671 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT16,fgFLOAT32);
00672 }
00673 fgFLOAT32 flgr_vector_measure_norm_f32_fgINT32(FLGR_Vector *vec) {
00674 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT32,fgFLOAT32);
00675 }
00676 fgFLOAT32 flgr_vector_measure_norm_f32_fgINT64(FLGR_Vector *vec) {
00677 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT64,fgFLOAT32);
00678 }
00679 fgFLOAT32 flgr_vector_measure_norm_f32_fgFLOAT32(FLGR_Vector *vec) {
00680 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT32,fgFLOAT32);
00681 }
00682 fgFLOAT32 flgr_vector_measure_norm_f32_fgFLOAT64(FLGR_Vector *vec) {
00683 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT64,fgFLOAT32);
00684 }
00685
00686
00688
00693
00694 fgFLOAT32 flgr_vector_measure_norm_f32(FLGR_Vector *vec) {
00695
00696
00697 if(vec==NULL) {
00698 POST_ERROR("Null objects\n");
00699 return 0;
00700 }
00701
00702 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_norm_f32,vec);
00703 }
00704
00705
00706
00707
00708
00709
00710 fgFLOAT64 flgr_vector_measure_norm_f64_fgBIT(FLGR_Vector *vec) {
00711 FLGR_MACRO_VECTOR_MEASURE_NORM(fgBIT,fgFLOAT64);
00712 }
00713 fgFLOAT64 flgr_vector_measure_norm_f64_fgUINT8(FLGR_Vector *vec) {
00714 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT8,fgFLOAT64);
00715 }
00716 fgFLOAT64 flgr_vector_measure_norm_f64_fgUINT16(FLGR_Vector *vec) {
00717 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT16,fgFLOAT64);
00718 }
00719 fgFLOAT64 flgr_vector_measure_norm_f64_fgUINT32(FLGR_Vector *vec) {
00720 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT32,fgFLOAT64);
00721 }
00722 fgFLOAT64 flgr_vector_measure_norm_f64_fgUINT64(FLGR_Vector *vec) {
00723 FLGR_MACRO_VECTOR_MEASURE_NORM(fgUINT64,fgFLOAT64);
00724 }
00725 fgFLOAT64 flgr_vector_measure_norm_f64_fgINT8(FLGR_Vector *vec) {
00726 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT8,fgFLOAT64);
00727 }
00728 fgFLOAT64 flgr_vector_measure_norm_f64_fgINT16(FLGR_Vector *vec) {
00729 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT16,fgFLOAT64);
00730 }
00731 fgFLOAT64 flgr_vector_measure_norm_f64_fgINT32(FLGR_Vector *vec) {
00732 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT32,fgFLOAT64);
00733 }
00734 fgFLOAT64 flgr_vector_measure_norm_f64_fgINT64(FLGR_Vector *vec) {
00735 FLGR_MACRO_VECTOR_MEASURE_NORM(fgINT64,fgFLOAT64);
00736 }
00737 fgFLOAT64 flgr_vector_measure_norm_f64_fgFLOAT32(FLGR_Vector *vec) {
00738 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT32,fgFLOAT64);
00739 }
00740 fgFLOAT64 flgr_vector_measure_norm_f64_fgFLOAT64(FLGR_Vector *vec) {
00741 FLGR_MACRO_VECTOR_MEASURE_NORM(fgFLOAT64,fgFLOAT64);
00742 }
00743
00744
00746
00751
00752 fgFLOAT64 flgr_vector_measure_norm_f64(FLGR_Vector *vec) {
00753
00754
00755 if(vec==NULL) {
00756 POST_ERROR("Null objects\n");
00757 return 0;
00758 }
00759
00760 FLGR_FULL_FUNCTION_DISPATCH(0,vec->type,flgr_vector_measure_norm_f64,vec);
00761 }
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781 #define FLGR_MACRO_VECTOR_MEASURE_MIN(dtype) \
00782 dtype *array=(dtype*)vec->array; \
00783 dtype _min; \
00784 int spp=vec->spp; \
00785 int k; \
00786 \
00787 \
00788 \
00789 _min=flgr_get_array_##dtype(array,0); \
00790 \
00791 for(k=1 ; k<spp ; k++) { \
00792 _min = flgr_defop_inf_##dtype(_min,flgr_get_array_##dtype(array,k)); \
00793 } \
00794 \
00795 *min = _min
00796
00797 void flgr_vector_measure_min_fgBIT(FLGR_Vector *vec, fgBIT *min) {
00798 FLGR_MACRO_VECTOR_MEASURE_MIN(fgBIT);
00799 }
00800 void flgr_vector_measure_min_fgUINT8(FLGR_Vector *vec, fgUINT8 *min) {
00801 FLGR_MACRO_VECTOR_MEASURE_MIN(fgUINT8);
00802 }
00803 void flgr_vector_measure_min_fgUINT16(FLGR_Vector *vec, fgUINT16 *min) {
00804 FLGR_MACRO_VECTOR_MEASURE_MIN(fgUINT16);
00805 }
00806 void flgr_vector_measure_min_fgUINT32(FLGR_Vector *vec, fgUINT32 *min) {
00807 FLGR_MACRO_VECTOR_MEASURE_MIN(fgUINT32);
00808 }
00809 void flgr_vector_measure_min_fgUINT64(FLGR_Vector *vec, fgUINT64 *min) {
00810 FLGR_MACRO_VECTOR_MEASURE_MIN(fgUINT64);
00811 }
00812 void flgr_vector_measure_min_fgINT8(FLGR_Vector *vec, fgINT8 *min) {
00813 FLGR_MACRO_VECTOR_MEASURE_MIN(fgINT8);
00814 }
00815 void flgr_vector_measure_min_fgINT16(FLGR_Vector *vec, fgINT16 *min) {
00816 FLGR_MACRO_VECTOR_MEASURE_MIN(fgINT16);
00817 }
00818 void flgr_vector_measure_min_fgINT32(FLGR_Vector *vec, fgINT32 *min) {
00819 FLGR_MACRO_VECTOR_MEASURE_MIN(fgINT32);
00820 }
00821 void flgr_vector_measure_min_fgINT64(FLGR_Vector *vec, fgINT64 *min) {
00822 FLGR_MACRO_VECTOR_MEASURE_MIN(fgINT64);
00823 }
00824 void flgr_vector_measure_min_fgFLOAT32(FLGR_Vector *vec, fgFLOAT32 *min) {
00825 FLGR_MACRO_VECTOR_MEASURE_MIN(fgFLOAT32);
00826 }
00827 void flgr_vector_measure_min_fgFLOAT64(FLGR_Vector *vec, fgFLOAT64 *min) {
00828 FLGR_MACRO_VECTOR_MEASURE_MIN(fgFLOAT64);
00829 }
00830
00831
00833
00838
00839 FLGR_Ret flgr_vector_measure_min(FLGR_Vector *vec, void *min) {
00840
00841
00842 if(vec==NULL) {
00843 POST_ERROR("Null objects\n");
00844 return FLGR_RET_NULL_OBJECT;
00845 }
00846
00847 FLGR_FULL_DISPATCH_CONST_PTR_PROCEDURE(vec->type,flgr_vector_measure_min,min,vec);
00848
00849 }
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861 #define FLGR_MACRO_VECTOR_MEASURE_MAX(dtype) \
00862 dtype *array=(dtype*)vec->array; \
00863 dtype _max=flgr_get_array_##dtype(array,0); \
00864 int spp=vec->spp; \
00865 int k; \
00866 \
00867 \
00868 \
00869 for(k=1; k<spp ; k++) { \
00870 _max = flgr_defop_sup_##dtype(_max,flgr_get_array_##dtype(array,k)); \
00871 } \
00872 *max = _max
00873
00874 void flgr_vector_measure_max_fgBIT(FLGR_Vector *vec, fgBIT *max) {
00875 FLGR_MACRO_VECTOR_MEASURE_MAX(fgBIT);
00876 }
00877 void flgr_vector_measure_max_fgUINT8(FLGR_Vector *vec, fgUINT8 *max) {
00878 FLGR_MACRO_VECTOR_MEASURE_MAX(fgUINT8);
00879 }
00880 void flgr_vector_measure_max_fgUINT16(FLGR_Vector *vec, fgUINT16 *max) {
00881 FLGR_MACRO_VECTOR_MEASURE_MAX(fgUINT16);
00882 }
00883 void flgr_vector_measure_max_fgUINT32(FLGR_Vector *vec, fgUINT32 *max) {
00884 FLGR_MACRO_VECTOR_MEASURE_MAX(fgUINT32);
00885 }
00886 void flgr_vector_measure_max_fgUINT64(FLGR_Vector *vec, fgUINT64 *max) {
00887 FLGR_MACRO_VECTOR_MEASURE_MAX(fgUINT64);
00888 }
00889 void flgr_vector_measure_max_fgINT8(FLGR_Vector *vec, fgINT8 *max) {
00890 FLGR_MACRO_VECTOR_MEASURE_MAX(fgINT8);
00891 }
00892 void flgr_vector_measure_max_fgINT16(FLGR_Vector *vec, fgINT16 *max) {
00893 FLGR_MACRO_VECTOR_MEASURE_MAX(fgINT16);
00894 }
00895 void flgr_vector_measure_max_fgINT32(FLGR_Vector *vec, fgINT32 *max) {
00896 FLGR_MACRO_VECTOR_MEASURE_MAX(fgINT32);
00897 }
00898 void flgr_vector_measure_max_fgINT64(FLGR_Vector *vec, fgINT64 *max) {
00899 FLGR_MACRO_VECTOR_MEASURE_MAX(fgINT64);
00900 }
00901 void flgr_vector_measure_max_fgFLOAT32(FLGR_Vector *vec, fgFLOAT32 *max) {
00902 FLGR_MACRO_VECTOR_MEASURE_MAX(fgFLOAT32);
00903 }
00904 void flgr_vector_measure_max_fgFLOAT64(FLGR_Vector *vec, fgFLOAT64 *max) {
00905 FLGR_MACRO_VECTOR_MEASURE_MAX(fgFLOAT64);
00906 }
00907
00908
00910
00915
00916 FLGR_Ret flgr_vector_measure_max(FLGR_Vector *vec, void *max) {
00917
00918
00919 if(vec==NULL) {
00920 POST_ERROR("Null objects\n");
00921 return FLGR_RET_NULL_OBJECT;
00922 }
00923
00924 FLGR_FULL_DISPATCH_CONST_PTR_PROCEDURE(vec->type,flgr_vector_measure_max,max,vec);
00925 }