note
	description: "Numerical array with sum and product"
	author: ""
	date: "$Date$"
	revision: "$Revision$"

class interface
	NUM_ARRAY [G -> {COMPARABLE rename copy as comparable_copy, default_create as comparable_default_create, out as comparable_out, twin as comparable_twin end, NUMERIC} create default_create end]

create 
	make_empty,
	make_filled,
	from_array,
	make_from_array

convert
	from_array ({ARRAY [G]})

feature --is_equal

	is_equal (other: like Current): BOOLEAN
			-- Is array made of the same items as other?
	
feature -- sum and product

	sum_all (factor: FUNCTION [G, INTEGER_32, G]): G
			-- summation quantifier that sums all factors of elements of the array

	element (g: G; i: INTEGER_32): G
		ensure
				Result = g

	sum: G
		ensure
				Result = sum_all (agent element (?, ?))
	
end -- class NUM_ARRAY

Generated by ISE EiffelStudio