Given a twice-differentiable function $f: \mathbb{R}^n \to \mathbb{R}$, $f$ is convex iff $\nabla ^2 f(x) \succeq 0, \forall x \in \text{dom} f$.
This is the definition given on these sets of notes https://www.seas.ucla.edu/~vandenbe/ee236b/lectures/functions.pdf
But I feel like something is missing in the definition...
What does it mean for $\nabla ^2 f(x) \succeq 0$?
Does it mean:
$y^T\nabla ^2 f(x)y \geq 0, \forall y \in \text{dom} f$ or...
$y^T\nabla ^2 f(x)y \geq 0, \forall y \in \mathbb{R}^n$
Check the section "Generalized Inequalities" of chapter 2.
$$ x \succeq y \iff x_i \ge y_i \quad (i \in \{ 1, \dotsc, n \}) \\ X \succeq Y \iff X - Y \text{ is positive semidefinite} $$