# Legendre–Fenchel transformation of discrete data

Let us define the Legendre–Fenchel transformation of a function $$f(s)$$ as:
$$g(j)=max_s (js – f(s)); .$$
I have a list of data $${ {s_1 , f(s_1)} , { s_2, f(s_2) },cdots }$$. I am looking for a way to do the transformation. Any idea?