  In this note, we present an algorithm that allows to answer any individual
instance of the following question. Let $G_{\mathbb{R}}$ be a semisimple real
Lie group, and $V$ an irreducible representation of $G_{\mathbb{R}}$. How does
the longest element $w_0$ of the restricted Weyl group $W$ act on the subspace
$V^L$ of $V$ formed by vectors that are invariant by $L$, the centralizer of a
maximal split torus of $G_{\mathbb{R}}$? This algorithm comprises two parts.
First we describe a complete answer to this question in the particular case
where $G_{\mathbb{R}} = \operatorname{SO}(1,n)$ for any $n \geq 2$. Then, for
an arbitrary $G_{\mathbb{R}}$, we show that it suffices to do the computation
in a well-chosen subgroup $S_{\mathbb{R}} \subset G_{\mathbb{R}}$ which is (up
to isogeny) the product of several groups that are either compact, abelian or
isomorphic to $\operatorname{SO}(1,n)$ for some $n \geq 2$.
