Schema
public
Owner
albenard
Descriptions
There is no description for function st_sum4ma
Options
Option | Value |
---|---|
Returns |
double precision |
Language |
plpgsql |
Parameters |
matrix double precision [] nodatamode text variadic args text [] |
Definition
CREATE OR REPLACE FUNCTION public.st_sum4ma (
matrix double precision [],
nodatamode text,
variadic args text []
)
RETURNS double precision AS
$span$
DECLARE
_matrix float[][];
sum float;
BEGIN
_matrix := matrix;
sum := 0;
FOR x in array_lower(matrix, 1)..array_upper(matrix, 1) LOOP
FOR y in array_lower(matrix, 2)..array_upper(matrix, 2) LOOP
IF _matrix[x][y] IS NULL THEN
IF nodatamode = 'ignore' THEN
_matrix[x][y] := 0;
ELSE
_matrix[x][y] := nodatamode::float;
END IF;
END IF;
sum := sum + _matrix[x][y];
END LOOP;
END LOOP;
RETURN sum;
END;
$span$
LANGUAGE 'plpgsql'
IMMUTABLE
CALLED ON NULL INPUT
SECURITY INVOKER
COST 100;
This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 26/02/2014 11:51 |