Two equivalent problems: Gyrostats in free motion and parametric quadratic hamiltonians