* svec_summate - computes the sum of all the elements in an svec */
| 599 | * svec_summate - computes the sum of all the elements in an svec |
| 600 | */ |
| 601 | Datum svec_summate(PG_FUNCTION_ARGS) |
| 602 | { |
| 603 | SvecType *svec = PG_GETARG_SVECTYPE_P(0); |
| 604 | SparseData sdata = sdata_from_svec(svec); |
| 605 | double accum; |
| 606 | accum = sum_sdata_values_double(sdata); |
| 607 | |
| 608 | if (IS_NVP(accum)) PG_RETURN_NULL(); |
| 609 | |
| 610 | PG_RETURN_FLOAT8(accum); |
| 611 | } |
| 612 | |
| 613 | PG_FUNCTION_INFO_V1( svec_log ); |
| 614 | /** |
nothing calls this directly
no test coverage detected