I am trying to open a file in c++ and the server the progam in running on is based on tux.

string filename = "../dir/input.txt"; works but
string filename = "~jal/dir1/dir/input.txt"; fails


Is there any way to open a file in c++ when the filename provided is in the second format?


Question: Negatively curved metrics minimizing the length of a homotopy class of simple closed curves
Answer: We have $0&lt;\inf_{g\in \mathcal{T}} L_g(\gamma) \leq \sup_{g\in \mathcal{T}} L_g(\gamma) &lt;\infty$. In fact, there should be a universal bound on the ratio
$\sup_{g\in \mathcal{T}} L_g(\gamma)/ \inf_{g\in \mathcal{T}} L_g(\gamma)$ for all $\gamma \in \pi_1 M$.

This follows from a theorem of Belegradek, who proves that the class of such metrics (actually, with just a fixed fundamental group $\pi$) is precompact in the Lipschitz topology. In particular, all such metrics are uniformly bi-Lipschitz, and thus one has the bound on the ratio between maximal and minimal lengths, as well as absolute bounds. 

Quoting from the paper: 
Recall that the class of all compact Riemannian manifolds of a given dimension
has the so-called Lipschitz topology, namely, two manifolds $M$ and $N$ are said to be
$\epsilon$-close if there exists a diffeomorphism $f : M → N$ such that both $f$ and $f^{−1}$ are
$e^\epsilon$-Lipschitz. A class of manifolds is called precompact if for any positive $\epsilon$, every
sequence of manifolds in the class has a subsequence whose members are mutually
$\epsilon$-close. 

Now, suppose there is no upper bound $C$ so that any two metric $g,h\in \mathcal{T}$ are $C$-close. Take sequences $g_i,h_i\in \mathcal{T}$, such
that $g_i$ and $h_i$ are not $N_i$-close, for a sequence $N_i\to \infty$. Passing to subsequences, we may assume that $\{g_i\}$ are mutually $\delta$-close for any $\delta&gt;0$, and similarly for $\{h_i\}$. But $g_i$ is $\delta$-close to $g_1$, which is $C$-close to $h_1$ for some $C$ (since these are metrics on the same manifold), and which is $\delta$-close to $h_i$ for all $i$. Thus, $g_i$ is $2\delta+C$-close to $h_i$ for all $i$, a contradiction. 

So we see that any two metrics in $\mathcal{T}$ are $C$-close for some $C$. This implies that $\sup_{g\in \mathcal{T}} L_g(\gamma)/ \inf_{g\in \mathcal{T}} L_g(\gamma)\leq e^C$ for all $\gamma \in \pi_1 M$. Moreover, comparing to any fixed metric in $\mathcal{T}$, we see that $0&lt;\inf_{g\in \mathcal{T}} L_g(\gamma) \leq \sup_{g\in \mathcal{T}} L_g(\gamma) &lt;\infty$.