%~MoulinĂ© par MaN_auto v.0.21.2 2019-02-26 08:43:34
\documentclass[ALCO, ThmDefs, Unicode]{cedram}
\OneNumberAllTheorems
%\usepackage{xr}
%\usepackage{graphicx}
%\usepackage{epstopdf}
\usepackage{booktabs}
%\usepackage{amssymb}
%\externaldocument[sl2:]{figures/ref_ext}
\DeclareMathOperator{\lin}{lin}
\DeclareMathOperator{\vol}{vol}
\newcommand{\bbC}{{\mathbb C}}
\newcommand{\R}{{\mathbb R}}
\newcommand{\Z}{{\mathbb Z}}
\newcommand{\N}{{\mathbb N}}
\newcommand{\Q}{{\mathbb Q}}
\newcommand{\CB}{{\mathcal B}}
\newcommand{\CJ}{{\mathcal J}}
\newcommand\BjoernerLovasz[1]{\Pi_{#1}}
\newcommand{\CL}{{\mathcal L}}
\newcommand{\CM}{{\mathcal M}}
\newcommand{\CP}{{\mathcal P}}
\newcommand{\Barvi}{\mathrm{Barvinok}}
\newcommand{\Todd}{\mathrm{Todd}}
\newcommand{\ConeByCone}{\mathrm{cone\text{-}by\text{-}cone}}
\newcommand{\Barvinok}{{E^{k, \Barvi}}}
\newcommand{\retroS}{{M}}
\newcommand{\polypp}{{\mathcal Q}}
\newcommand{\CR}{{\mathcal R}}
%\newcommand{\CS}{{\mathcal S}}
\newcommand{\CV}{{\mathcal V}}
\newcommand{\la}{{\langle}}
\newcommand{\ra}{{\rangle}}
\newcommand{\e}{{\mathrm{e}}}
%\newcommand*\binomial[2]{\binom{#1}{#2}}
\renewcommand{\c}{{\mathfrak{c}}}
\renewcommand{\d}{{\mathfrak{d}}}
\newcommand{\f}{{\mathfrak{f}}}
\renewcommand{\t}{{\mathfrak{t}}}
\newcommand{\p}{{\mathfrak{p}}}
\newcommand{\pp}{{\mathfrak{p}^{\mathrm{partition}}}}
\renewcommand{\u}{{\mathfrak{u}}}
\newcommand{\lattice}{\Lambda}
\newcommand{\Jposet}[2]{\mathcal J^{#1}_{\geq #2}}
\newcommand{\Moebius}{\textup{M\"obius}}
\graphicspath{{./figures/}}
\newcommand*{\mk}{\mkern -1mu}
\newcommand*{\Mk}{\mkern -2mu}
\newcommand*{\mK}{\mkern 1mu}
\newcommand*{\MK}{\mkern 2mu}
\hypersetup{urlcolor=purple, linkcolor=blue, citecolor=red}
\newcommand*{\romanenumi}{\renewcommand*{\theenumi}{\roman{enumi}}}
\newcommand*{\Romanenumi}{\renewcommand*{\theenumi}{\Roman{enumi}}}
\newcommand*{\alphenumi}{\renewcommand*{\theenumi}{\alph{enumi}}}
\newcommand*{\Alphenumi}{\renewcommand*{\theenumi}{\Alph{enumi}}}
\title{Three Ehrhart quasi-polynomials}
\author[\initial{V.} Baldoni]{\firstname{Velleda} \lastname{Baldoni}}
\address{Dipartimento di Matematica\\ Universit\`a degli studi di Roma ``Tor Vergata''\\
Via della ricerca scientifica 1\\ I-00133\\ Italy}
\email{baldoni@mat.uniroma2.it}
\author[\initial{N.} Berline]{\firstname{Nicole} \lastname{Berline}}
\address{\'Ecole Polytechnique\\ Centre de Math\'ematiques Laurent Schwartz\\ 91128 Palaiseau Cedex\\ France}
\email{nf.berline@gmail.com}
\author[\initial{J.} \middlename{A.} De Loera]{\firstname{Jes\'us} \middlename{A.} \lastname{De Loera}}
\address{Department of Mathematics\\ University of California\\
Davis\\ One Shields Avenue\\ Davis, CA, 95616\\ USA}
\email{deloera@math.ucdavis.edu}
\author[\initial{M.} K\"oppe]{\firstname{Matthias}\nobreakauthor\lastname{K\"oppe}}
\address{Department of Mathematics\\ University of California\\
Davis\\ One Shields Avenue\\ Davis, CA, 95616\\ USA}
\email{mkoeppe@math.ucdavis.edu}
\author[\initial{M.} Vergne]{\firstname{Mich\`ele} \lastname{Vergne}}
\address{Universit\'e Paris 7 Diderot\\ Institut Math\'ematique de Jussieu\\ Sophie Germain, case 75205\\ Paris Cedex 13\\ France}
\email{michele.vergne@imj-prg.fr}
\keywords{Ehrhart polynomials, generating functions, Barvinok's algorithm, parametric polytopes}
\subjclass{05A15, 52C07, 68R05, 68U05, 52B20}
\begin{abstract}
Let $\mathfrak{p}(b)\subset \mathbb{R}^d$ be a semi-rational parametric polytope, where $b=(b_j)\in \mathbb{R}^N$ is a real multi-parameter. We study intermediate sums of polynomial functions $h(x)$ on $\mathfrak{p}(b)$,
\begin{equation*}
S^L (\mathfrak{p}(b),h)=\sum_{y}\int_{\mathfrak{p}(b)\cap (y+L)} h(x)\,\mathrm dx,
\end{equation*}
where we integrate over the intersections of $\mathfrak{p}(b)$ with the subspaces parallel to a fixed rational subspace $L$ through all lattice points, and sum the integrals. The purely discrete sum is of course a particular case ($L=0$), so $S^0(\mathfrak{p}(b), 1)$ counts the integer points in the parametric polytopes.
The chambers are the open conical subsets of $\mathbb{R}^N$ such that the shape of $\mathfrak{p}(b)$ does not change when $b$ runs over a chamber. We first prove that on every chamber of $\mathbb{R}^N$, $ S^L (\mathfrak{p}(b),h)$ is given by a quasi-polynomial function of $b\in \mathbb{R}^N$. A key point of our paper is an analysis of the interplay between two notions of degree on quasi-polynomials: the usual polynomial degree and a filtration, called the local degree.
Then, for a fixed $k\leq d$, we consider a particular linear combination of such intermediate weighted sums, which was introduced by Barvinok in order to compute efficiently the $k+1$ highest coefficients of the Ehrhart quasi-polynomial which gives the number of points of a dilated rational polytope. Thus, for each chamber, we obtain a quasi-polynomial function of $b$, which we call \emph{Barvinok's patched quasi-polyno\-mial} (at codimension level $k$).
Finally, for each chamber, we introduce a new quasi-polyno\-mial function of $b$, the \emph{cone-by-cone patched quasi-polyno\-mial} (at codimension level $k$), defined in a refined way by linear combinations of intermediate generating functions for the cones at vertices of $\mathfrak{p}(b)$.
We prove that both patched quasi-poly\-nomials agree with the discrete weighted sum $b\mapsto S^{\{0\}}(\mathfrak{p}(b),h)$ in the terms corresponding to the $k+1$ highest polynomial degrees.
\end{abstract}
\begin{document}
\maketitle
\begin{figure}
\begin{center}
\includegraphics[width=4cm]{mirage1}\hfill
\hfill \includegraphics[width=4cm]{mirage2sanssommets}\hfill \includegraphics[width=4cm]{mirage3}
\caption{ The parametric polytope $\p(b)$ from Example~\ref{ex:parametric-dim2}, for $b$ in various chambers.}\label{fig:parametric-dim2again}
\end{center}
\end{figure}
\section{Introduction}
In this article, a \emph{parametric semi-rational polytope} $\p(b)\subset \R^d$ is defined by inequalities:
\begin{equation}\label{def:pb}
\p(b)=\bigl\{\,x\in \R^d: \langle \alpha_j, x\rangle \leq b_j,\; j=1,\ldots, N\,\bigr\}
\end{equation}
where $\alpha_1,\alpha_2,\ldots,\alpha_N$ are \emph{fixed} linear forms with integer coefficients (the case of rational $\alpha_j$ can be treated by rescaling $\alpha_j$ and $b$) and the parameter $b=(b_1,b_2,\ldots,b_N)$ varies in $\R^N$.
The shape of the polytope $\p(b)$ varies when the parameter $b$ varies (see Figure~\ref{fig:parametric-dim2again}).
\emph{Chambers} $\tau\subset \R^N$ are open convex polyhedral cones such that the shape of $\p(b)$ does not change when $b$ runs over $\tau$ (see Definition~\ref{def:chamber}). We consider weighted integrals and sums, where the weight is a polynomial function $h(x)$ of degree~$m$ on $\R^d$.
\[
I(\p(b),h)=\int_{\p(b)} h(x) \,\mathrm dx, \;\;\;\;\quad S(\p(b),h)=\sum_{x\in \p(b)\cap \Z^d} h(x).
\]
When the weight is the constant $1$, then $I(\p(b),1)$ is the volume of $\p(b)$, while $S(\p(b),1)$ is the number of integral points in $\p(b)$.
As introduced by Barvinok, we also study intermediate sums associated to a rational subspace $L$:
\begin{equation}
S^L(\p(b),h)=\sum_{y} \int_{\p(b)\cap (y+L)} h(x)\,\mathrm dx.
\end{equation}
Here, we integrate over the intersections of $\p(b)$ with the subspaces parallel to a fixed rational subspace $L$ through all lattice points, and sum the integrals.
The unweighted case ($h=1$), the study of the counting function~$S(\p(b),1)$ is, of course, very important in algebraic combinatorics. Polytopes depending on multiple parameters have appeared, for example, in the celebrated Knutson--Tao honeycomb model~\cite{MR1671451}. Also the classical vector partition functions~\cite{Brion1997residue} appear as a special case. However, a large part of the literature has focused on the case of one-parameter families of dilations of a single polytope (see our discussion on Ehrhart theory in Section~\ref{s:intro-single-parameter} below), with few exceptions~\cite{beck:multidimensional-reciprocity, HenkLinke, koeppe-verdoolaege:parametric}. Indeed~\cite{HenkLinke} was part of our motivation to consider the case of a real multi-parameter and not just one-parameter dilations as in our previous articles on the subject. Our interest in the general problem $S(\p(b),h)$ is motivated in part by the important applications in compiler optimization and automatic code parallelization, in which multiple parameters arise naturally (see~\cite{Clauss1998parametric,Verdoolaege2005PhD,Verdoolaege2007parametric} and the references within). For a broader context of analytic combinatorics, we refer to~\cite{Pemantle:2013:ACS:2505450}.
The relations between the two functions $I(\p(b),h)$ and $S(\p(b),h)$ of the parameter vector $b$ have been the central theme of several works. In this article, we (hope to) add a contribution to these questions.
We introduce the new notion of \emph{local degree}, which we believe is important. A function $b\mapsto f(b)$ of the real multi-parameter $b$ is of local degree (at most) $\ell$ if it can be expressed as a linear combination of products of a number less or equal to $\ell$ of step-linear forms of $b$ and linear forms of $b$ (see Definition~\ref{def:step-poly-V} below and Figure~\ref{fig:irrational-rectangle}, left). If the number of linear forms is less than or equal to~$q$, we say that $f$ is of \emph{polynomial degree} (at most) $q$.
The present article is the culmination of a study based on~\cite{SLII2014,so-called-paper-2}. These two articles were devoted to the properties of intermediate generating functions only for polyhedral \emph{cones}. Here, using the Brianchon--Gram set-theoretic decomposition of a polytope as a signed sum of its supporting cones, we study the function $b\mapsto S^L(\p(b),h)$.
We show first that, on each chamber, the function $b\mapsto S^L(\p(b),h)$ is of local degree at most $d+m$. In particular its term of polynomial degree~$0$ is expressed as a linear combination of at most $d+m$ step-linear functions of $b$.
Then we study the terms of highest polynomial degree of $S(\p(b),h)$ on each\linebreak chamber.
Given a fixed integer $k\leq d$ we construct two quasi-polynomials, \emph{Barvinok's patched quasi-polyno\-mial} (at level $k$) and the \emph{cone-by-cone patched quasi-polyno\-mial} (at level~$k$). The two constructions use linear combinations of intermediate sums associated to rational subspaces $L$ of codimension less or equal to $k$. The first one is due to Barvinok~\cite{barvinok-2006-ehrhart-quasipolynomial}. We give a more streamlined proof of Barvinok's Theorem~1.3 in~\cite{barvinok-2006-ehrhart-quasipolynomial} and a more explicit formula for it when $\p(b)$ is a simplex. The cone-by-cone patched quasi-polyno\-mial is a new construction. We prove that both patched quasi-poly\-nomials agree with the discrete weighted sum $b\mapsto S(\p(b),h)$ in the terms corresponding to the $k+1$ highest polynomial degrees $d+m, d+m-1,\ldots, d+m-k$.
We now give more details on the content of this article.
\subsection{Weighted Ehrhart quasi-polynomials and intermediate sums}\label{s:intro-single-parameter}
When a rational parameter vector~$b$ is fixed, then the polytope $\p=\p(b)$ is a rational polytope. If we dilate it by a non-negative number~$t$, the function $t\mapsto S(t\p,h)$ is a quasi-polynomial function of $t$, i.e., it takes the form
\[
S(t\p,h) = E(t) = \sum_{j=0}^{d+m} E_j(t) t^j,
\]
where the coefficients $E_j(t)$ are periodic functions of~$t$, rather than constants. It is called the \emph{weighted Ehrhart quasi-polynomial} of $\p$. In traditional Ehrhart theory, only non-negative \emph{integer} dilation factors~$t$ are considered, and so a coefficient function with period~$q\in\Z_{>0}$ can be given as a list of $q$~values, one for each residue class modulo~$q$. However, the approach to computing Ehrhart quasi-polynomials via generating functions of parametric polyhedra~\cite{koeppe-verdoolaege:parametric, Verdoolaege2005PhD, Verdoolaege2007parametric}, which we follow in the present paper, leads to a natural, shorter representation of the coefficient functions as closed-form formulas (so-called \emph{step-polynomials}) of the dilation parameter~$t$, using the ``fractional part'' function. These closed-form formulas are naturally valid for arbitrary non-negative \emph{real} dilation parameters~$t$, as well as any real (not just rational) parameter $b$. This fact was implicit in the computational works following this method~\cite{Verdoolaege2005PhD, Verdoolaege2007parametric}, and was made explicit in~\cite{koeppe-verdoolaege:parametric}. The resulting \emph{real Ehrhart theory} has recently caught the interest of other authors~\cite{HenkLinke, linke:rational-ehrhart}; see also~\cite{so-called-paper-2}.
The highest ``expected'' degree term of the weighted Ehrhart quasi-polyno\-mial is $I(\p,h) t^{d+m}$, if $h(x)$ is homogeneous of degree $m$; of course, this term may vanish, as the example $\p =[-1,1]$, $h(x) = x$ illustrates. For a study of the coefficients of degree $d+m$, $d+m-1$, \dots, $d+m-k$ of the quasi-polynomial $S(t\p,h)$, a key tool introduced by Barvinok (in~\cite{barvinok-2006-ehrhart-quasipolynomial}, for the unweighted case $h=1$) is the \emph{intermediate weighted sum} $S^L(\p,h)$, where $L$ is a rational subspace of~$V=\R^d$:
\begin{equation}\label{eq:abstract-first}
S^L (\p,h)=\sum_{y}\int_{\p\cap (y+L)} h(x)\,\mathrm dx,
\end{equation}
where the summation variable $y$ runs over the projected lattice in $V/L$. The polytope $\p$ is sliced by subspaces parallel to $L$ through lattice points and the integrals of $h$ over the slices are added (see Figure~\ref{fig:parametric-dim2againagain}). When $L=V$, $S^L(\p,h)$ is just the integral $I(\p,h)$, while for $L=\{0\}$, we recover the discrete sum $S(\p,h)$. In the present study, we generalize Barvinok's ideas in several ways, building on our previous work in~\cite{so-called-paper-1,SLII2014,so-called-paper-2}.
\begin{figure}
\begin{center}
\includegraphics[width=6cm]{mirage2sliced}
\caption{ Intermediate sum over a polytope $\p$ (blue). We sum the integrals over the slices of~$p$ parallel to~$L$ going through lattice points (vertical lines). }\label{fig:parametric-dim2againagain}
\end{center}
\end{figure}
\begin{figure}
\begin{center}
\includegraphics[width=6cm]{rectangle-irrationnel-basis}\hfill
\includegraphics[width=6.3cm]{rectangle-irrationnel} \\
\caption{ Example~\ref{ex:irrational-rectangle}. \emph{Left.} The linear function $t$ (\emph{top, blue}), the rational step-linear function $\{t\}$ (\emph{center, green}), and the irrational step-linear function $\{\sqrt2 t\}$ (\emph{bottom, red}). \emph{Right.} The number of lattice points (\emph{black}) of the rectangle $[0,t]\times[0,t\sqrt{2}]$ is a function in the algebra generated by these three functions; the area (\emph{blue}) is a polynomial function.}\label{fig:irrational-rectangle}
\end{center}
\end{figure}
\subsection{Real multi-parameter quasi-polynomials and their degrees}
To describe our contributions, let us first define our notion of (real, multi-parameter) \emph{quasi-polynomials on $\R^N$} and notions of degree, which are crucial for our paper.
First we define \emph{(rational) step-polynomials}. For $t\in \R$, we denote by $\{t\}\in [0,1[$ the fractional part of $t$. Thus $t\mapsto \{t\}$ is a function on $\R/\Z$. Let $\eta=(\eta_1,\eta_2,\ldots, \eta_N)\in \Q^N$, which we consider as a linear form on $\R^N$. We say that the function $b\mapsto \{\langle \eta,b\rangle \}$ is a \emph{(rational) step-polynomial function} of \emph{(step) degree} (at most) one (or a \emph{(rational) step-linear function}). If all $\eta_i$ have the same denominator $q$, this is a function of $b\in \R^N/q\Z^N$. We define $\polypp(\R^N)$ to be the algebra of functions on $\R^N$ generated by the functions $b\mapsto \{\langle \eta,b\rangle \}$. An element of $\polypp(\R^N)$ is called a \emph{(rational) step-polynomial} on $\R^N$. The space $\polypp(\R^N)$ has an obvious filtration, where $\polypp_{[\leq k]}(\R^N)$ is the linear span of $k$ or fewer products of functions $b\mapsto \{\langle \eta,b\rangle \}$. The elements of $\polypp_{[\leq k]}(\R^N)$ are said to be (rational) step-polynomials of
\emph{(step) degree (at most)~$k$}.
Next, we define $\polypp\CP(\R^N)$ to be the algebra of functions on $\R^N $ generated by (rational) step-polynomials and ordinary polynomial functions of $b$. Elements of $\polypp\CP(\R^N)$ are called \emph{quasi-polynomials} on $\R^N$ and take the form
\begin{equation}
E(b) = \sum_{\substack{j=(j_1,\dots,j_N) \in \Z_{\geq0}^N\\
|j| = j_1 + \dots + j_N \leq d + m}} E_j(b)\, b^j,\label{eq:quasi-polynomial-by-monomials}
\end{equation}
using multi-index notation for the monomials $b^j = b^{j_1} \cdots b^{j_N}$. Here the $E_j(b)$ are step-polynomials.
This definition of quasi-polynomials on $\R^N$ is a natural generalization of the notion of quasi-polynomial function on the lattice $\Z^N$, which is more familiar in Ehrhart theory and the theory of vector partition functions. Describing quasi-polynomials in this form, using step-polynomials as its coefficient functions, has been implicit in the computational works using the method of parametric generating functions~\cite{Verdoolaege2005PhD, Verdoolaege2007parametric}. The extension to real (rather than integer or rational) multi-parameters~$b$ appeared in~\cite{koeppe-verdoolaege:parametric}.
The algebra $\polypp\CP(\R^N)$ inherits a grading from the degree of polynomials, which we call the \emph{polynomial degree}. This is the notion of degree that has been used throughout the literature on Ehrhart theory.
Crucial to our study will be the interplay of the polynomial degree with another notion of degree, first introduced in our paper~\cite{SLII2014}. The algebra $\polypp\CP(\R^N)$ also has a filtration, which we call the \emph{local degree}. It combines the polynomial degree and the filtration according to step degrees on step-polynomials. For instance, ${b \mapsto b_1b_2^2 \{b_1\!+\Mk b_3\}}$ has polynomial degree~$3$, step degree~$1$, and local degree~$4$. This terminology of local degree comes from the fact that on each local region $n0}\phi_1+ \R_{>0}\phi_3\,\}$.
%
$\tau_2$ is the cone $\{\, b : \sum_{j=1}^4 b_j\phi_j\in \R_{>0}\phi_2+ \R_{>0}\phi_3\,\}$.
%
$\tau_3$ is the cone $\{\, b : \sum_{j=1}^4 b_j\phi_j\in \R_{>0}\phi_2+ \R_{>0}\phi_4\,\}$.
For instance, $\tau_2$ is defined by the inequalities $-b_1+b_2+b_4>0, 2b_1+b_3-b_4>0$.
As we see on Figure~\ref{fig:parametric-dim2}, for $b\in \tau_1$, $\p(b)$ is a triangle, for $b\in \tau_2$, it is a quadrilateral, for $b\in \tau_3$, it is again a triangle.
We have $\CB_{\tau_1}=\{[2,3],[2,4],[3,4]\}$, $\CB_{\tau_2}=\{[1,2],[1,4],[2,3],[3,4]\}$, and $\CB_{\tau_3}=\{[1,2],[1,3],[2,3]\}$.
The index $1$ does not belong to the union of the sets $B$ when $B$ varies in $\CB_{\tau_1}$, thus the condition $-x_1\leq b_1$ is redundant for the polytope $\p(b)$ when $b\in \tau_1$, as seen on Figure~\ref{fig:parametric-dim2}.
Similarly, the condition $-x_1+x_2\leq b_4$ is redundant for the polytope $\p(b)$ when $b\in \tau_3$.
For $b\in \tau_2$, the four equations $\la\alpha_j,x\ra=b_j$ define facets of the quadrilateral $\p(b)$.
\end{exem}
If $b$ lies in the boundary of an admissible chamber $\tau$, then all vertices of $\p(b)$ are of the form $s_B(b)$, for $B\in \CB_\tau$, but several $B\in \CB_\tau$ may give the same vertex $s_B(b)$.
\begin{rema}[Minkowski sums of polytopes]
Remark finally the following relation between parametric polytopes and Minkowski sums $t_1\p_1+t_2\p_2+\cdots+t_q\p_q$ of polytopes. Let $\tau$ be an admissible chamber. Let $b_1,b_2,\ldots, b_q$ in $\overline \tau$ and $t_1\geq 0,\ldots, t_q\geq 0$, then $t_1b_1+t_2b_2+\cdots+t_q b_q$ is in $\overline \tau$, and
\begin{equation}\label{eq:Minkowski}
t_1\p(b_1)+t_2\p(b_2)+\cdots+t_q \p(b_q)=
\p(t_1b_1+\cdots+t_q b_q).
\end{equation}
Indeed, using the linearity of the map $b\mapsto s_B(b)$, we see immediately that any point in the convex hull of the elements $s_B(t_1b_1+\cdots+t_q b_q)$ with $B\in \CB_\tau$ is a sum of points in $\p(t_1 b_1),\ldots, \p(t_q b_q)$.
Conversely (see Section~\ref{subsubMinkowski}), it can be shown that any Minkowski linear sum $t_1\p_1+t_2\p_2+\cdots+t_q\p_q$ can be embedded in a parametric family of polytopes.
\end{rema}
\begin{rema}[Wall crossing]
One of the interest of parametric polytopes is that we can also observe the variation of $\p(b)$ (see Figure~\ref{fig:parametric-dim2}), when the parameter $b$ crosses a wall of a chamber $\tau$. This corresponds to flips of the corresponding toric varieties. The variation of the set $\p(b)$ has been studied in detail in~\cite{BV-2011}. In this article we will only be concerned with the behavior of the function $b\mapsto S^L(\p(b),h)$ when $b$ runs in the closure of a fixed admissible chamber.
\end{rema}
\subsubsection{Brion's theorem on supporting cones at vertices}
The basis of the present article is the following theorem, which follows from the Brianchon--Gram decomposition of a polytope $\p(b)$.
\begin{prop}
The indicator function of a polytope is equal to the sum of the indicator functions of its supporting cones at vertices, modulo linear combinations of indicator functions of affine cones with lines.
\end{prop}
\begin{figure}
\begin{center}
%\vspace*{-2cm}
%\begin{minipage}[t]{4cm}
%\mbox{}\vspace*{-6cm}
\includegraphics[width=4cm]{BrianchonGramContinu}
%\end{minipage}
%\hfill
%\begin{minipage}[t]{8cm}
\includegraphics[width=8cm]{BrianchonGramContinu-2}
%\end{minipage}
%\vspace*{-1.5cm}
\caption{ \emph{Left,} in the parametric polytope of Examples~\ref{ex:parametric-dim2} and~\ref{ex:parametric-dim2-chambers}, as the face $-x_1=b_1$ moves to the left, for $b \in \overline\tau_2$, the vertex $s_{[2,4]}$ merges with vertices $s_{[1,2]}$ and $s_{[1,4]}$, when $b$ reaches the boundary of the chamber $\tau_2$ and the quadrilateral degenerates to a triangle.
\emph{Right,} the indicator function of the supporting cone of $\p(b)$ at vertex $s_{[2,4]}(b) = s_{[1,2]}(b) = s_{[1,4]}$ (\emph{yellow}) is the sum of the indicator functions of the cones $s_{[1,2]}(b)+\c_{[1,2]}$ and $s_{[1,4]}(b)+\c_{[1,4]}$ (\emph{blue}), modulo the indicator function of an affine cone with a line (\emph{yellow}).}\label{fig:BrianchonGramContinu}
\end{center}
\end{figure}
For parametric polytopes, combined with the above description of cones at vertices, this gives a decomposition of the indicator function $[\p(b)]$ for $b\in \tau$. If $b$ lies in the boundary of an admissible chamber~$\tau$, then several $B\in \CB_\tau$ may give the same vertex~$s_B(b)$. Nevertheless, when $b$ lies in the closure $\overline{\tau}$, then modulo indicator functions of affine cones with lines, the indicator function of the supporting cone of $\p(b)$ at vertex~$s_B(b)$ is the sum of the indicator functions of the cones $s_B(b)+\c_B$ for all the $B\in \CB_\tau$ which give this vertex (Figure~\ref{fig:BrianchonGramContinu}). One way to prove it is to use the continuity of the Brianchon--Gram decomposition of $[\p(b)]$, proven in~\cite{BV-2011}.
\begin{prop}\label{th:brion-for-parametric-polytopes}
Let $\tau$ be an admissible $\alpha$-chamber with closure $\overline{\tau}$. For $b\in \overline{\tau}$, the indicator function of $\p(b)$ is given by
\[
[\p(b)]\equiv\sum_{B\in \CB_\tau}[s_B(b)+\c_B] \mbox{ mod indicator functions of cones with lines}.
\]
\end{prop}
From Proposition~\ref{th:brion-for-parametric-polytopes} and the valuation property of intermediate generating functions, we obtain Brion's formula (cf.~\cite{barvinokzurichbook}), which expresses the holomorphic function $S^L(\p(b))(\xi)$ as a sum of meromorphic functions indexed by the vertices of the polytope~$\p(b)$.
\begin{equation}\label{th:brion}
S^L(\p(b))(\xi)=\sum_{B\in \CB_\tau} S^L(s_B(b)+\c_B)(\xi), \mbox{ for } b\in \overline{\tau}.
\end{equation}
\subsection{Step-polynomials and (semi-)quasi-polynomials of the multi-parame\-ter \texorpdfstring{$b$}{b}}\label{sub:quasipoly}
In this section, we consider a fixed rational subspace $L\subseteq V$. There corresponds an intermediate generating function $S^L(\p(b))(\xi)$ and intermediate weighted sums $S^L(\p(b),h)$ on a parametric polytope $\p(b)$.
Recall from the introduction the algebras of step-polynomials and quasi-polyno\-mi\-als on $\R^N$, in terms of which we will describe these intermediate sums as functions of the parameter $b\in \R^N$. We give more general definitions now.
\begin{defi}\label{def:step-poly-V}
Let $\Psi \subseteq \R^N$.
\begin{enumerate}%[label=\rm(\roman*)]
\item $\polypp^\Psi(\R^N)$ is the algebra of functions on $\R^N $ generated by the functions $b \mapsto \{\langle\eta,b \rangle\}$, where $\eta\in \Psi$. An element of $\polypp^{\Psi}(\R^N)$ is called a \emph{step-polynomial} on~$\R^N$.
\item For $\Psi=\Q^N$, we obtain the \emph{algebra of rational step-polynomials}, which we abbreviate as $\polypp(\R^N)$.
\item For $\Psi=\R^N$, we obtain the \emph{algebra of step-polynomials} $\polypp^{\R^N}(\R^N)$.
\end{enumerate}
\end{defi}
Note that a step-polynomial function (whether rational or not) is a bounded function on~$\R^N$.
The algebra $\polypp^{\Psi}(\R^N)$ has a natural filtration, where $\polypp^{\Psi}_{[\leq k]}(\R^N)$ is the subspace spanned by products of at most $k$ functions $\{\langle \eta,b \rangle\}$. Again this is a filtration, not a grading, because several step-polynomials with different (step) degrees may represent the same function.
\begin{exem}
For every $t\in \R$,
\[
1-\{t\}-\{-t\}-(1-\{2t\}-\{-2t\})(1-\{3t\}-\{-3t\})=0.
\]
\end{exem}
\begin{defi}\label{def:semi-quasi-poly}
Again let $\Psi \subseteq \R^N$.
\begin{enumerate}%[label=\rm(\roman*)]
\item The tensor product $\polypp\CP^\Psi(\R^N) = \polypp^\Psi(\R^N) \otimes \CP(\R^N)$ is the algebra of functions on $\R^N$ generated by step-polynomials in $\polypp^\Psi(\R^N)$ and ordinary polynomials on~$\R^N$. An element of $\polypp\CP^\Psi(\R^N)$ is called a \emph{semi-quasi-polynomial} on~$\R^N$.
\item For $\Psi=\Q^N$, we obtain the \emph{algebra of quasi-polynomials} on $\R^N$, which we abbreviate as $\polypp\CP(\R^N)$.
\item For $\Psi=\R^N$, we obtain the \emph{algebra of semi-quasi-polynomials} on~$\R^N$, denoted by $\polypp\CP^{\R^N}(\R^N)$.
\end{enumerate}
\end{defi}
A (semi-)quasi-polynomial $f(b)$ is a piecewise polynomial. More precisely, let $\Psi$ be a \emph{finite} set of $\eta\in \R^N$ such that $f \in \polypp^\Psi(\R^N)$, i.e., $f(b)$ can be expressed as a polynomial in the functions $b\mapsto\{\langle \eta,b\rangle\}$, with $\eta\in \Psi$. The open ``pieces'' on which $f(b)$ is a polynomial function of~$b$ are the $\Psi$-alcoves defined as follows.
\begin{defi}\label{def:Psi-alcove}
Let $\Psi$ be a finite subset of $\R^N$. We consider the hyperplanes in $\R^N$ defined by the equations
\[
\langle \eta,b\rangle= n, \mbox{ for } \eta\in \Psi \mbox{ and } n\in \Z.
\]
A connected component of the complement of the union of these hyperplanes is called a \emph{$\Psi$-alcove}.
\end{defi}
On the tensor product $\polypp\CP^{\Psi}(\R^N)$, we will consider the grading inherited from the usual degree on $\CP(\R^N)$. We will call the corresponding degree the \emph{polynomial degree}.
We consider also the degree arising from the tensor product filtration, which we call the \emph{local degree}. With these notations, if $f(b)\in \polypp\CP^{\Psi}_{[\leq k]}(\R^N)$, then $f(b)$ restricts as a polynomial function of degree $\leq k$ on any $\Psi$-alcove.
\begin{exem}
The quasi-polynomial $f(b)=b^3\{ b\}$ on $\R$ has polynomial degree~$3$ and local degree~$4$. It is equal to $b^4- n b^3$, a polynomial of degree~$4$, for $n\leq b < n+1$.
\end{exem}
%\medskip
In the remainder of this section, we will have $\Psi \subset \Q^N$, and hence work with rational step-polynomials and quasi-polynomials; however, in Subsection~\ref{sub:weighted-ehrhart-semi-quasi}, we will use more general~$\Psi$.
We now explain how to construct a finite set~$\Psi$ that is suitable for our multi-parameter Ehrhart quasi-polynomials.
%[Definition~\ref{sl2:def:PsiL}]{SLII2014}
In~\cite{SLII2014}, for any rational cone $\c\subset V$, and a rational subspace $L$, we constructed a finite subset $\Psi_{\c}^L \subset\lattice^*\cap L^\perp$ of integral linear forms on $V$~\cite[Definition~2.24]{SLII2014}. We briefly recall the steps of this construction; the details can be found in~\cite[proof of Lemma~2.10]{SLII2014}. We start by decomposing $\c$ in cones $\u$ (modulo cones with lines) with a face parallel to $L$, then we decompose the projections of $\u$ on $V/L$ as a signed decomposition of unimodular cones with respect to the projected lattice $\lattice_{V/L}$ with dual lattice $\Lambda^*\cap L^{\perp}$. In the set $\Psi_{\c}^L$, we collect all the generators of the dual cones used in this decomposition. (The decomposition is not unique, but we do not record the dependence of $\Psi_{\c}^L$ on the decomposition in the notation.) As $\Psi^L_\c\subset \Lambda^*\cap L^{\perp}$, the step-polynomials in the algebra $\polypp^{ \Psi^L_\c}(V)$ (see Subsection~\ref{subsection:polyhedra}) are functions on $V/(\Lambda+L)$.
\begin{defi}\label{def:polyppB}\
\begin{enumerate}%[label=\rm(\roman*)]
\item \label{2.25.1} Let $B\in \CB$. Define $\Psi_B^L(\alpha)$ as the set of rational linear forms on $\R^N$ defined by $ \langle \eta,b\rangle = \langle
\gamma,s_B(b)\rangle$, for $\gamma\in \Psi^L_{\c_B}$.
\item \label{2.25.2} If $\tau$ is an $\alpha$-chamber, $\Psi^L_\tau(\alpha)$ is the union of the sets $\Psi^L_B(\alpha)$ when $B$ runs in~$\CB_\tau$.
\end{enumerate}
\end{defi}
By definition, if $f\in \polypp\CP^{\Psi^L_{\c_B}}(V)$ (see Subsection~\ref{subsection:polyhedra}), then the function $b\mapsto f(s_B(b))$ is in $\polypp\CP^{\Psi^L_{B}(\alpha)}(\R^N)$.
Let us describe a little more precisely the sets $\Psi_{\c_B}^L $ and the corresponding step-polynomials on $\R^N$ when $L=V$ or $L=\{0\}$.
When $L=V$, the sets $\Psi^L_{\c_B}$ are empty, thus the step-polynomials in $\polypp^{ \Psi^L_\tau(\alpha)}(\R^N)$ are just the constants.
When $L=\{0\}$, let $q\in \N$ be such that the lattice $q\lattice^*$ is contained in the lattice generated by the elements $\alpha_j$, for $j\in B$. Then the multiple $q s_B(b)$ of the vertex $s_B(b)$ belongs to $\lattice$ if $b\in \Z^N$, therefore any step-polynomial $f(b)\in \polypp^{ \Psi^{\{0\}}_B(\alpha)}(\R^N)$ is $q\Z^N$-periodic. Thus a quasi-polynomial $f$ on $\R^N$ gives by restriction to $\Z^N$ a periodic function of period $q$, and we recover the usual notion of quasi-periodic function on a lattice.
If $\c_B$ is the simplicial cone described by inequalities $\la\alpha_j,x\ra\leq 0$, with $j\in B$, and if the $\alpha_j, j\in B$ form a basis of $\Lambda^*$, then the set $\Psi_{\c_B}^{\{0\}} \subset\lattice^*$ is just equal to $\{\,\alpha_j: j\in B\,\}$. Thus if the sequence $\alpha$ is \emph{unimodular}, that is, if $\{\, \alpha_j : j\in B\,\}$ is a basis of $\lattice^*$ for any $B\in \CB$, any step-polynomial $f(b)\in \polypp^{ \Psi^L_\tau(\alpha)}(\R^N)$ is $\Z^N$-periodic, in particular $f(b)$ is constant on $ \Z^N$.
\subsection{Weighted Ehrhart (semi-)quasi-polynomials}\label{sub:weighted-ehrhart-semi-quasi}
\subsubsection{Case of a parametric polytope}
We can now state the first important result of this article. We summarized it in the introduction, in a less technical form, as Theorem~\ref{th:ehrhart-chamber-intro-summary}.
\begin{theo}\label{th:ehrhart-chamber}
Let $V$ be a rational vector space with lattice $\lattice$. Let $L\subseteq V$ be a rational subspace. Let $\alpha=(\alpha_1,\dots,\alpha_N)$ be a list of elements of $\lattice^*$ which generate $V^*$ as a cone. For $b\in \R^N$, let $\p(b)\subset V$ be the polytope defined by
\[
\p(b)=\{\,x\in V: \la \alpha_j,x\ra\leq b_j,\, j=1,\ldots,N\,\}.
\]
Let $\tau\subset \R^N$ be an admissible $\alpha$-chamber. Let $h$ be a polynomial function on $V$ of degree $m$.
\begin{enumerate}%[label=\rm(\roman*)]
\item \label{2.26.1} There exists a quasi-polynomial of local degree equal to $m+d$,
\begin{equation}\label{eq:ehrhart-chamber}
E^L(\alpha,h,\tau) \in
\polypp\CP_{[\leq {m+d}]}^{ \Psi^L_\tau(\alpha)}(\R^N)
\end{equation}
such that
\begin{equation}\label{eq:Ehrhart-quasi-poly}
S^L(\p(b),h)=E^L(\alpha,h,\tau)(b),
\end{equation}
for every $b\in \overline{\tau}$ (the closure of $\tau$ in $\R^N$).
\item\label{thpart:ehrhart-chamber:highest-degree}
If $h(x)$ is homogeneous of degree $m$, then the terms of $E^L(\alpha,h,\tau)(b)$ of polynomial degree $m+d$ form a homogeneous polynomial of degree $m+d$ that is equal to the integral $\int_{\p(b)} h(x)\, \mathrm dx$ for $b \in \overline{\tau}$.
\item More precisely, if $h(x)=\frac{\langle \ell,x \rangle ^m}{m!} $ for some $\ell\in V^*$, we have
\begin{equation}\label{eq:top-parametric-Ehrhart}
E^L(\alpha,h,\tau)(b)=
\sum_{r=0}^{m+d} E^L_{[r]}(\alpha,h,\tau)(b)
\end{equation}
for $b \in \overline{\tau}$, where for each $r$, the function of $b\in\R^N$ given by
\[
E^L_{[r]}(\alpha,h,\tau)(b)=\left(\sum_{B\in \CB_\tau}
\retroS^L(s_B(b),\c_B)_{[m-r]}(\xi)
\frac{\langle\xi,s_B(b)\rangle^r}{r!}\right)\bigg|_{\xi=\ell}
\]
is an element of $\polypp_{[\leq {m+d-r}]}^{ \Psi^L_\tau(\alpha)}(\R^N)\otimes
\CP_{[r]}(\R^N)$, i.e., of polynomial degree $r$ and local degree at most $m+d$.
\end{enumerate}
\end{theo}
In fact, for a single $B$, $\retroS^L(s_B(b),\c_B)_{[m-r]}$ is a rational function of $\xi$ and may be singular at $\ell$, so that the value $\retroS^L(s_B(b),\c_B)_{[m-r]}(\ell)$ may not be well defined. However, as we will see in the proof, for each $r$, the sum over the $B\in \CB_\tau$ of the rational functions $\retroS^L(s_B(b),\c_B)_{[m-r]}(\xi)
\frac{\langle\xi,s_B(b)\rangle^r}{r!}$ is a polynomial function of $\xi$, so it can be evaluated at $\xi=\ell$. So Formula~\eqref{eq:top-parametric-Ehrhart} is well defined.
\begin{proof}
The proof of Theorem~\ref{th:ehrhart-chamber} rests on Brion's formula~\eqref {th:brion}. We observe that it is enough to prove the theorem in the case where the weight $h$ is a power of a linear form,
\[
h(x)= \frac{\langle\ell,x\rangle^m}{m!},
\]
for some $\ell\in V^*$, as any weight can be written as a linear combination of those. In this case, $ S^L(\p(b),h)$ is the value at $\xi=\ell$ of the homogeneous term of degree $m$ of the holomorphic function $ S^L(\p(b))(\xi)$. So we write (using the fundamental Equation~\eqref{eq:MversusS})
\begin{align*}
S^L(\p(b),h)_{[m]}(\ell) &= \left(\sum_{B\in \CB_\tau} S^L(s_B(b)+\c_B)_{[m]}(\xi)\right)\bigg|_{\xi=\ell}\\
&= \sum_{r=0}^{m+d}\left(\sum_{B\in \CB_\tau}
\retroS^L(s_B(b),\c_B)_{[m-r]}(\xi) \frac{\langle\xi,s_B(b)\rangle^r}{r!}\right)\bigg|_{\xi=\ell}.
\end{align*}
For an individual $B$, the term $S^L(s_B(b)+\c_B)_{[m]}(\xi)$ may be singular at $\xi=\ell$. However the sum over the set of vertices $\CB_\tau$ is a polynomial function of $\xi$.
%\ref{sl2:prop:homogeneous-ML}
In~\cite{SLII2014} we studied the bidegree structure of $\retroS^L(s,\c)(\xi)$, i.e., the interaction of the local degree in $s$ and the homogeneous degree in~$\xi$, which allows us to extract the refined asymptotics. For each $r$ and $B$, we consider the function of $s\in V$, $\xi\in V^*$, given by $(s,\xi)\mapsto \retroS^L(s,\c_B)_{[m-r]}(\xi)$. By Theorem~2.25 of~\cite{SLII2014}, this function belongs to the space
\[
\polypp_{[\leq m+d-r]}^{ \Psi^L_{\c_B}}(V)\otimes \CR_{[m-r]}(V^*).
\]
Compose with the linear map $b\mapsto s_B(b)$. We obtain that, for each $r$ and $B$, the function of $b\in \R^N$, $\xi\in V^*$ given by
\[
(b,\xi)\mapsto
\retroS^L(s_B(b),\c_B)_{[m-r]}(\xi) \frac{\langle\xi,s_B(b)\rangle^r}{r!}
\]
belongs to
\[
\polypp_{[\leq {m+d-r}]}^{ \Psi_B^L(\alpha)}(\R^N)\otimes \CP_{[r]}(\R^N)
\otimes \CR_{[m]}(V^*).
\]
Therefore the sum over $B\in \CB_\tau$ of these terms, for a fixed $r$, belongs to
\[
\polypp_{[\leq {m+d-r}]}^{ \Psi^L_\tau(\alpha)}(\R^N)\otimes \CP_{[r]}(\R^N)
\otimes \CR_{[m]}(V^*).
\]
Now the sum over $B\in \CB_\tau$ is a quasi-polynomial function of $b$ with values in the space of {polynomials} in $\xi$, not just rational functions of~$\xi$. It follows that for each $r$, the term of polynomial degree $r$ in $b$ of the full sum depends also polynomially on $\xi$. This term is
\[
\sum_{B\in \CB_\tau} \retroS^L(s_B(b),\c_B)_{[m-r]}(\xi) \frac{\langle\xi,s_B(b)\rangle^r}{r!}.
\]
When we evaluate it at $\xi=\ell$, we obtain~\eqref{eq:top-parametric-Ehrhart}, and all statements but part~\eqref{thpart:ehrhart-chamber:highest-degree}, which we prove now.
Let us compute the term of polynomial degree $r=m+d$ with respect to $b$, in~\eqref{eq:top-parametric-Ehrhart}. From Equation~\eqref{eq:lowest}, we know that $\retroS^L(s_B(b),\c_B)_{[-d]}(\xi)=I(\c_B)(\xi)$, thus the term of index $r=m+d$ in~\eqref{eq:top-parametric-Ehrhart} is equal to
\[
\left(\sum_{B\in \CB_\tau} \frac{\langle\xi,s_B(b)\rangle^{m+d}}{(m+d)!}I(\c_B)(\xi)\right)\bigg|_{\xi=\ell}=
\left(\sum_{B\in \CB_\tau} I(s_B(b)+\c_B)_{[m]}(\xi)\right)\bigg|_{\xi=\ell}.
\]
By Proposition~\ref{th:brion-for-parametric-polytopes}, this last sum is equal to $I(\p(b))_{[m]}(\ell)$, which is precisely the integral $\int_{\p(b)}\frac{\langle \ell,x \rangle ^m}{m!} \, \mathrm dx$.
\end{proof}
\begin{defi}\label{def:ehrhart-chamber}
The function $E^L(\alpha,h,\tau)(b)$ of Theorem~\ref{th:ehrhart-chamber} is called the \emph{weighted intermediate Ehrhart quasi-polynomial} of the parametric polytope $\p(b)$ (with respect to the weight $h$, the subspace $L$ and the chamber $\tau$).
\end{defi}
\begin{exem}[Example~\ref{ex:parametric-dim1}, continued]\label{ex:generalizedEhrh-interval}
Let $\alpha = (x, -x)$. Then for $b = (b_1, b_2) \in \R^2$, $\p(b)$ is the interval $\{\, x: -b_2\leq x\leq b_1\,\}$. There are two chambers, $\{\, b : -b_2b_1\,\}$. For the first chamber the number of integers in $\p(b)$ is $\lfloor b_1\rfloor - \lceil -b_2\rceil+1= b_1+ b_2 -\{b_1\}-\{b_2\}+1$. For the other chamber, it is of course~$0$.
\end{exem}
\begin{exem}[continuation of Examples~\ref{ex:parametric-dim2}, \ref{ex:parametric-dim2-vertices}, and~\ref{ex:parametric-dim2-chambers}]
%\let\frac=\tfrac
We compute the quasi-polynomial function $ E^{L}(\alpha,h,\tau_2)(b)$ ($\p(b)$ is a quadrilateral for $b\in \tau_2$), first for $L=\{0\}$, then for the case when $L$ is the vertical line $L=\R(0,1)$. The weight is $h(x)=1$.
\begin{enumerate}%[label=\rm(\roman*)]
\item \label{2.29.1} For $L={\{0\}}$ and $h=1$, i.e., we count the integer points in $\p(b)$, we write
\[
E^{\{0\}}(\alpha,1,\tau_2)(b) = E_{[2]}(b)+E_{[1]}(b)+E_{[0]}(b),
\]
where $E_{[r]}(b)$
collects the terms of polynomial degree $r$ with respect to~$b$. $E_{[2]}(b)$ is the volume of the quadrilateral. It is a polynomial function, easy to compute. The other two functions were computed with our Maple program.
\begin{align*}
E_{[2]}(b)&= -\frac{b_1^2}{2}+\frac{b_2^2}{2}+\frac{b_3^2}{4}-\frac{b_4^2}{4}+b_1b_2+b_1b_4+b_2b_3+\frac{b_3b_4}{2}.\\
E_{[1]}(b)&=\left(\frac{1}{2}+\{b_1\}-\{b_2\}-\{b_4\}\right)b_1\\
&\qquad +\left(\frac{3}{2}-\{b_1\}-\{b_2\}-\{b_3\}\right)b_2\\
&\qquad +\left(1-\{b_2\}-\frac{1}{2}\{b_3\}-\frac{1}{2}\{b_4\}\right)b_3\\
&\qquad +\left(\frac{1}{2}-\{b_1\}-\frac{\{b_3\}}{2}+\frac{\{b_4\}}{2}\right)b_4.\\
E_{[0]}(b)&=1-\frac12{\{b_1\}}-\frac32{\{b_2\}}-\{b_3\}-\frac12{\{b_4\}}\\
&\qquad-\frac{1}{2}\{b_1\}^2+\frac{1}{2}\{b_2\}^2-\frac{1}{2}\{b_4\}^2 -\left\{\frac{b_4+b_3}{2}\right\}^2\\
&\qquad+\{b_1\}\{b_2\}+\{b_1\}\{b_4\}+\{b_2\}\{b_3\}\\
&\qquad+\{b_3\}\left\{\frac{b_4+b_3}{2}\right\}+\{b_4\}\left\{\frac{b_4+b_3}{2}\right\}.
\end{align*}
We see that $E_{[2]}(b)$ is a linear combination of products of two linear forms, $E_{[1]}(b)$ is a linear combination of products of linear forms with step-linear forms, while $E_{[0]}(b)$ is a linear combination of products of at most two step-linear forms. Thus each of the $E_{[r]}(b)$ is of local degree~$2$.
\item \label{2.29.2} We compute the intermediate quasi-polynomial
\[
E^L(\alpha,1,\tau_2)(b)=E^L_{[2]}(b)+E^L_{[1]}(b)+E^L_{[0]}(b)
\]
for the same chamber $\tau_2$,
when $L$ is the vertical line $L=\R(0,1)$, and again $h=1$. Thus we compute the sum $S^L(\p(b),1)$ of the lengths of vertical segments in the quadrilateral $\p(b)$. Then $E^L_{[2]}(b)= E_{[2]}(b)=\vol(\p(b))$ is again the volume of $\p(b)$, and we compute
\begin{align*}
E^L_{[1]}(b)&=-\frac{1}{2}b_1+\frac{1}{2}b_2+\frac{1}{2}b_4+ \{b_1\}b_1-\{b_1\}b_2 -\{b_1\}b_4,\\
E^L_{[0]}(b)&=\frac{1}{2}\{b_1\} +\frac{1}{2}\{b_2+b_3\} -\left\{\frac{b_3-b_4}{2}\right\}\\
&\qquad -\frac{1}{2}\{b_1\}^2-\frac{1}{2}\{b_2+b_3\}^2+\left\{\frac{b_3-b_4}{2}\right\}^2.
\end{align*}
Again, we observe that the local degree of $E^L_{[r]}(b)$ is indeed $2$ for $r=0,1,2$.
\end{enumerate}
\end{exem}
\begin{rema}
In this theorem, the parameter $b$ varies in $\R^N$. In particular, the results of~\cite{HenkLinke} on ``vector dilated polytopes'' follow easily from this theorem.\footnote{Note that~\cite{HenkLinke} states and proves results for \emph{rational} vector dilations only.} The article~\cite{HenkLinke} was part of our motivation to consider the case of a multidimensional real-valued parameter and not just one parameter dilations.
\end{rema}
\begin{rema}
When $L=V$, we are computing an integral over $\p(b)$. It is clearly a polynomial function of $b$ on any chamber. This is consistent with the fact that $\polypp^{ \Psi^V_\tau(\alpha)}(\R^N) $ is just the constants.
Classically, in particular when computing the number of lattice points (case $L=\{0\}$, $h(x)=1$), the parameter $b$ was restricted to $\Z^N$. As we already observed, if $q\lattice^*$ is contained in the lattice generated by $(\alpha_j,j\in B)$ for any $B\in \CB_\tau$, then the coefficients of the Ehrhart quasi-polynomial~\eqref{eq:ehrhart-chamber} are $q\Z^N$-periodic functions on~$\R^N$, therefore the Ehrhart quasi-polynomial restricts to any coset $\{\, b_0+q n : n\in\Z^N \,\}$ as a true polynomial function of $n\in \Z^N$.
\end{rema}
\begin{rema}[Case of partition polytopes]\label{rem:parametric-versus-partition}
The paper~\cite{BV-2011} deals with Ehrhart quasi-polynomials for weighted sums and integrals over a partition polytope. Their variation is computed, when the parameter crosses a wall between two chambers. Let us recall how a parametric polytope $\p(\alpha,b)$ is associated to a partition polytope $\pp(\Phi,\lambda)$. Let $F$ be a vector space of dimension $N-d$ and let $\Phi=(\phi_1,\ldots,\phi_N)$ be a sequence of elements of $F$. We assume that $\Phi$ generates a full-dimensional pointed cone in $F$. For $\lambda\in F$, let
\[
\pp(\Phi,\lambda)=\Bigl\{\,y=(y_j)\in \R^N : y_j\geq 0,\, \textstyle\sum_{j=1}^N y_j \phi_j=\lambda \,\Bigr\}.
\]
This is a polytope contained in the affine subspace $\bigl\{\, y=(y_j)\in \R^N : \sum_{j=1}^N y_j \phi_j=\lambda \,\bigr\}$. Define $V:=\bigl\{\,y=(y_j)\in \R^N : \sum_{j=1}^N y_j \phi_j=0\,\bigr\}$. Let $\alpha_j$ be the linear form on $V$ defined by $\langle\alpha_j,x\rangle=-x_j$. For $b\in \R^N$, let $\lambda=\sum_{j=1}^N b_j \phi_j$. Then $x\mapsto x+b$ is a bijection between $\p(\alpha,b)$ and $ \pp(\Phi, \lambda)$.
\end{rema}
\begin{rema}[Wall crossing]
Finally, it would be interesting to study the variation of the quasi-polynomials $S^L(\p(b),h)$ when $b$ crosses the wall of a chamber $\tau$. The method of~\cite{BV-2011} could probably be adapted to the more general case of intermediate weighted sums of a parametric polytope.
\end{rema}
\subsubsection{Specialization to other parameter domains}\label{s:other-parameter-domains}
From the study of a general parametric polytope, it is not difficult to derive results when the multi-parameter $b \in \R^N$ is itself a function of another parameter $t \in \R^q$, $b = b(t_1,\dots,t_q)$. We restrict ourselves to the setting where $b$ is a (homogeneous) linear function of~$t$, which we write as $b(t) = Tt$, where $T \in \R^{N\times q}$ is a matrix. This is sufficient for two popular settings, which we explain in the following sections. In Section~\ref{subsubdilated}, we will consider the case of a fixed semi-rational polytope $\p$ dilated by a one-dimensional real parameter $t\geq 0$. In Section~\ref{subsubMinkowski}, we will consider the more general case of a Minkowski linear system $t_1\p_1+\dots + t_q\p_q$.
To describe how the specialization yields the function $t \mapsto E^L(\alpha, h, \tau)(Tt)$, let us first describe the alcoves. Let $T^* \in \R^{q\times N}$ be the adjoint (transpose) matrix. The linear forms $\eta \in \Psi^L_\tau(\alpha) \subset \Q^N$ defining the alcoves of~$\R^N$ (see~Theorem~\ref{th:ehrhart-chamber}) give rise to linear forms on~$\R^q$,
\begin{equation}
\langle T^* \eta, t \rangle = \langle \eta, Tt \rangle \quad\text{for $t \in \R^q$}.
\end{equation}
Thus we consider the alcoves of~$\R^q$ defined by the finite set $T^*(\Psi^L_\tau(\alpha)) \subset \R^q$. Note that, when $T$ is not rational, $T^*(\Psi^L_\tau(\alpha))$ will no longer be rational, in contrast to the development in Subsection~\ref{sub:quasipoly}. The function $t \mapsto E^L(\alpha, h, \tau)(Tt)$ will therefore belong to the subalgebra $\polypp\CP^{T^*(\Psi^L_\tau(\alpha))}(\R^q)$ of semi-quasi-polynomials. (When $T$ is rational, this is a subalgebra of quasi-polynomials.)
Using this notation, we can formulate a theorem analogous to Theorem~\ref{th:ehrhart-chamber}. We omit the statement.
In contrast to Theorem~\ref{th:ehrhart-chamber}, we no longer know the precise local degree of the semi-quasi-polynomial $t \mapsto E^L(\alpha, h, \tau)(Tt)$. The ``expected'' degree is $m+d$, but there may be cancellations of terms, as illustrated by the example $\p =[-1,1]$, $h(x) = x$ given in the introduction.
\subsubsection{Case of a dilated polytope}\label{subsubdilated}
A first example appeared in the introduction as Example~\ref{ex:irrational-rectangle}, which already illustrated that in the case of semi-rational polytopes~$\p$ which are not rational, we may not get quasi-polynomials of the dilation factor~$t$ but merely semi-quasi-polynomials. Let us give a few more examples for the rational case.
\begin{figure}
\begin{center}
\includegraphics[width=6.5cm]{SlicedDilatedtetra0-1}\hfill
\includegraphics[width=6.5cm]{SlicedDilatedtetra1-2}
\caption{ $S^L(t\p,1)$ for the quadrilateral of Example~\ref{ex:parametric-dim2-rational-Ehrhart}, for $L=\{0\}$ (\emph{black}), $L$ vertical (\emph{red}), $L=\R^2$ (\emph{blue}). On the left, $ t$ varies from $0$ to $1$, new lattice points occur for $t=0, \frac15, \frac13, \frac{2}{5}, \frac35, \frac23, \frac45,1$. On the right, $ t$ varies from $1$ to $2.4$, new lattice points occur for $t= \frac65, \frac43, \frac75, \frac85,\frac53,2,\frac{11}5,\frac73,\frac{12}5 $. For $L$ vertical, $S^L(t\p,1)$ is continuous, but its derivative has discontinuities.}\label{fig:dilatedtetra-rational}
\end{center}
\end{figure}
\begin{exem}[Continuation of Examples~\ref{ex:parametric-dim2}, \ref{ex:parametric-dim2-vertices} and~\ref{ex:parametric-dim2-chambers}]\label{ex:parametric-dim2-rational-Ehrhart}
%\let\frac=\tfrac
Fix $b_0=(0,0,5,3)$, so that $\p=\p(b_0)$ is the quadrilateral of Figure~\ref{fig:parametric-dim2} with vertices $[0, 0], [0, 3], [1, 4], [5, 0]$. We specialize the formula for $E^{L}(\alpha,1,\tau_2)(b)$ to the line $b=tb_0$. We consider the cases $L=\{0\}$, $L$ the vertical line, and $L=V$.
\begin{enumerate}%[label=\rm(\alph*)]
\item First, with $L=V$, we compute the volume. For $t\geq 0$, $S^V(t\p)=\frac{23}{2}t^2$. It is a polynomial function of $t$ with rational coefficients.
\item Next, with $L=\{0\}$, we count the lattice points of $t\p$, for $t\geq 0$.
\begin{equation*}
\begin{aligned}
S^{\{0\}}(t\p,1)&=\frac{23}{2}t^2+\left(\frac{13}{2}-\{3t\} -4\{5t\}\right)t \\
&\qquad-\frac{1}{2}\{3t\}^2-\{4t\}^2+\{4t\}\{3t\}+\{5t\}\{4t\}\\
&\qquad -\{5t\}-\frac{1}{2}\{3t\}+1.
\end{aligned}
\end{equation*}
It takes only integral values, and is locally constant over some rational intervals. These facts are more apparent on the graph (Figure~\ref{fig:dilatedtetra-rational}) than on the formula. When $t$ is in $\Z$, all terms $\{qt\}$, for $q\in \Z$, are equal to $0$, and we obtain the usual Ehrhart polynomial of $\p$ over $\Z$ (it is a polynomial as $\p$ has integral vertices)
\[
\frac{23}{2}t^2+\frac{13}{2} t+1.
\]
The value at $t=1$ is $19$, the number of integral points in $\p$.
\item When $L$ is the vertical line, we add the lengths of the vertical segments in $t\p$, for $t\geq 0$.
\[
S^{L}(t\p,1) =\frac{23}{2}t^2+\frac{3}{2}t+\frac{1}{2}\{5t\}^2+\{t\}^2-\{4t\}^2+\frac{1}{2}\{5t\}-\{t\}.
\]
This is a continuous function of $t$. Its value at $t=1$ is $13$.
\end{enumerate}
\end{exem}
Now we describe how this specialization works in general. Let $L$ be a rational subspace of $V$. We take a (semi-)rational polytope $\p = \p(b_0)$ associated to a fixed real multi-parameter~$b_0$, and specialize the formula for $E^L(\alpha,h,\tau)(b)$, where $b_0 \in \bar\tau$, when $b = tb_0$ for $t \in \R$, $t>0$. Using the notation from Subsubsection~\ref{s:other-parameter-domains}, we have the matrix $T = (b_0) \in \R^{N\times 1}$. We then compute the finite set $\Psi := T^*(\Psi^L_\tau(\alpha)) \subset \R$. It can be described in a simpler way as follows. Denote by $\Psi^L_\p$ the union of the sets $\Psi_\c^L \subset \Lambda^*\cap L^{\perp}$, described in Subsection~\ref{sub:quasipoly}, where $\c$ varies over the cones of feasible directions at the vertices of $\p$ (they are rational polyhedral cones).
Then $\Psi$ is the finite set of real numbers $\langle \gamma, s\rangle$, where $\gamma$ runs in $\Psi^L_\p$, and $s$ runs over the vertices of~$\p$. It describes the alcoves of~$\R$. Thus the function $t\mapsto S^L(t\p,h)$ is a (semi-)quasi-polynomial, which coincides with a polynomial function of $t$ on intervals with possibly irrational ends, as in Example~\ref{ex:irrational-rectangle}. Its coefficient functions are bounded functions of the variable $t\in \R$. If $\p$ is rational, then $\Psi$ is rational, and thus the coefficient functions are periodic functions.
We summarize this discussion in the following result.
\begin{theo}\label{th:ray}
Let $\p$ be a (semi-)rational polytope and $h$ a polynomial function of degree $m$ on $V$. Let $\Psi \subset \R$ be the set of real numbers $\langle \gamma, s\rangle$, where $\gamma$ runs in $\Psi^L_\p$ and $s$ runs over the vertices of~$\p$.
\begin{enumerate}%[label=\rm(\roman*)]
\item There exists a (semi-)quasi-polynomial
\[
E^L(\p,h)(t)=\sum_{r=0}^{d+m} E^L_r(\p,h)(t) \, t^r,
\]
such that $S^L(t\p,h)= E^L(\p,h)(t)$ for all $t\in \R$ with $t\geq 0$. It belongs to $\polypp\CP^\Psi_{[\leq m+d]}(\R)$.
\item The coefficient functions $E^L_r(\p,h)(t)$ are step-polynomials; they belong to the space $\polypp_{[\leq m+d-r]}^\Psi(\R)$.
\item Let $\p$ be rational and $q\in \N$ is such that $q\p$ has lattice vertices. Then the coefficient functions $E^L_r(\p,h)(t)$ are rational step-polynomials on~$\R$; they are periodic functions with period~$q$. Thus $E^L(\p,h)(t)$ is a quasi-polynomial.
\end{enumerate}
\end{theo}
One can also prove the theorem directly with a proof similar to that of Theorem~\ref{th:ehrhart-chamber}, based on Brion's theorem for $\p$, without embedding~$\p$ in a parametric family. This was done in~\cite{so-called-paper-2} under the assumption that $\p$ is rational.
\begin{figure}
\begin{center}
\includegraphics[width=6.5cm]{SlicedDilatedtetra-irrational0-1}\hfill\includegraphics[width=6.5cm]{SlicedDilatedtetra-irrational1-2}
\caption{ $S^L(t\p_I,1)$ where $\p_I$ is the quadrilateral with irrational vertices of Example~\ref{ex:parametric-dim2-irrational-Ehrhart}, for $L=\{0\}$ (\emph{black}), $L$ vertical (\emph{red}), $L=\R^2$ (\emph{blue}). On the left, $ t$ varies from $0$ to $1$. On the right, $ t$ varies from $1$ to $2$. }\label{fig:dilatedtetra-irrational}
\end{center}
\end{figure}
\begin{exem}[continuation of Examples~\ref{ex:parametric-dim2}, \ref{ex:parametric-dim2-chambers}]\label{ex:parametric-dim2-irrational-Ehrhart}
%\let\frac=\tfrac
Consider now the quadrilateral $\p_I=\p(b_I)$ with $b_I=[0,0,3\sqrt{2},3]$. Its four vertices are $[0,0]$, $[0,3]$, $[-\frac{3}{2}+\frac{3}{2}\,\sqrt {2},\linebreak \frac{3}{2}+\frac{3}{2}\,\sqrt {2}]$, and $[3\,\sqrt {2},0]$.
We specialize the formula which gives $E^{L}(\alpha,1,\tau_2)(b)$ for $b=tb_I$, when $L=V$, $L$ is the vertical line, $L=\{0\}$, respectively.
\begin{enumerate}%[label=\rm(\alph*)]
\item \label{2.36.1} First, for $L=V$, $E^{L}(\alpha,1,\tau_2)(tb_I)$ is the volume given by
\[
V(t\p_I)= \frac{9}{4} \left(1+2\,\sqrt {2} \right) {t}^{2}.
\]
This is a polynomial function of $t$ with real coefficients.
\item \label{2.36.2} When $L$ is the vertical line, we add the lengths of the vertical segments in $t\p_I$, for $t\geq 0$. $S^{L}(t\p_I,1)=E_2^L(t)\, t^2 +E_1^L(t)\, t+E_0^L(t)$ with coefficient functions
\begin{align*}
\qquad E_2^L(t)&= \frac{9}{4} \left(1+2\,\sqrt {2} \right),
\qquad\qquad E_1^L(t)=\frac{3}{2},\\
\qquad E_0^L(t)&= -\frac12 \bigl\{ 3\sqrt {2}t \bigr\} ^{2}+\frac{1}{2}\bigl\{ 3\sqrt {2}t \bigr\} -\left\{ -\frac{3}{2}t+ \frac{3}{2}\sqrt {2}t \right\} + \left\{ -\frac{3}{2}t+\frac{3}{2}\sqrt{2}t \right\}^{2}.
\end{align*}
This is a semi-quasi-polynomial, but not a quasi-polynomial, because the coefficient function $E^L_0(t)$ is not periodic but merely bounded.
\item \label{2.36.3} Finally, we compute the number of integral points $S^{\{0\}}(t\p_I,1)$ in $t\p_I$, for $t\geq 0$. We have $ S^{\{0\}}(t\p_I,1)=E_2(t)\,t^2+E_1(t)\,t+E_0(t), $ where the coefficient functions $E_r(t)$ are step-polynomial functions of $t$,
\begin{align*}
E_2(t)&= \frac{9}{4}(1+2\,\sqrt {2}), \\
E_1(t)&= \frac{3}{2}+\frac{3}{2}\{ 3\,t \} -\frac{3\sqrt {2}}{2}\{ 3\sqrt {2}\,t \} -\frac{3}{2}\{ 3\sqrt {2}\,t
\} -\frac{3\sqrt {2}}{2}\{ 3t \} +3\sqrt {2},\\
E_0(t)&= 1-\frac12\,\{ 3\,t \} -\{ 3\,\sqrt {2}\,t\} -\frac{1}{2}\, \{ 3\,t \}^{2}- \left\{ \frac{3}{2}\,t+\frac{3}{2}\,\sqrt {2}\,t \right\} ^{2}\\
& \qquad +\left\{ \frac{3}{2}\,t+ \frac{3}{2}\,\sqrt {2}\,t \right\} \{ 3\,t \} +\{ 3\,\sqrt {2}\,t \} \left\{ \frac{3}{2}\,t+\frac{3}{2}\,\sqrt {2}\,t \right\}.
\end{align*}
Thus again $S^{\{0\}}(t\p_I,1)$ is a semi-quasi-polynomial, but not a quasi-polynomial. It takes only integral values, and is constant over some intervals with end points of the form $\frac{n}{3}, \frac{n}{3 \sqrt{ 2}}, \frac{n}{3 (1+\sqrt{ 2})}$ with $n$ an integer.
\end{enumerate}
The graphs of these three semi-quasi-polynomials are displayed in Figure~\ref{fig:dilatedtetra-irrational}.
\end{exem}
%\bigskip
Let us discuss some qualitative properties of the (semi-)quasi-polyno\-mial function $E^L(\p,h)(t)=\sum_{r=0}^{d+m} E^L_r(\p,h)(t)\, t^r,$ defined in Theorem~\ref{th:ray}. The coefficient functions $E^L_r(\p,h)(t)$ are given by polynomial formulae (with rational coefficients) of functions $\{r_j t\}$, where some $r_j$ may be irrational. In particular, $E^L_r(\p,h)(t)$ is a bounded function on $\R$. (If the polytope~$\p$ is rational, the coefficients $r_j$ are rationals, and $E^L_r(\p,h)(t)$ is a periodic function on~$\R$ and thus $E^L(\p,h)(t)$ is an ordinary quasi-polynomial function on~$\R$.) The individual function $\{r_jt\}$ is right-continuous if $r_j>0 $, and coincides with the affine linear function $r_jt- n$ on the semi-open interval $[n/r_j, (n+1)/r_j[$. If $r_j<0$, $\{r_jt\}$ is left-continuous. It follows that there is a sequence $0\leq d_10$. We fix a weight $h(x)$ on $V$ and a codimension $k$. If $\p$ is simple, then we have again three canonical quasi-polynomials of the parameter $t$ associated with $\p$ and $h(x)$, all three of polynomial degree $d+m$. If $\p$ is not simple, only the first two quasi-polynomials are defined.\footnote{Of course, we could define $E^{k, \ConeByCone}(\p, h)$ as well for non-simple polytopes by taking limits. However, it would no longer be canonical, as it would depend on the path. It is an open question whether a canonical definition is possible, which also should have a toric interpretation (Remark~\ref{remark:intermediate-todd}).} The first quasi-polynomial is defined by
\[
E(\p,h)(t) = E^{\{0\}}(\p,h)(t)=S(t\p,h) \quad\mbox{ for } t> 0.
\]
The second quasi-polynomial is defined by
\[
\Barvinok(\p,h)(t)=S^{\CL_k^{\Barvi}}(t\p,h) \quad\mbox{ for } t> 0.
\]
If $\p$ is simple, the third quasi-polynomial is defined as follows. If $h(x) =
\frac{\langle\ell,x\rangle^m}{m!}$, then
\[
E^{k,\ConeByCone}(\p,h)(t)= A^{k}(t\p)_{[m]}(\ell)
\quad\mbox{ for } t>0.
\]
This definition is again extended to arbitrary polynomial functions $h(x)$ on~$V$ by decomposition as a sum of powers of linear forms.
Those three quasi-polynomials have the same terms of polynomial degree $\geq d+m-k$.
Furthermore, if $\p$ is a rational simple polytope, and if $h$ is a power of a rational linear form, $\Barvinok(\p,h)(t)$ and $E^{k,\ConeByCone}(\p,h)(t)$ can be computed in polynomial time when the codimension $k$ is fixed. (We suppress a detailed statement of the algorithm and its complexity.) Similar results on polynomial complexity hold for a more general weight $ h(x)$. One can assume that the weight is given as a polynomial in a fixed number $R$ of linear forms, $h(x)=f(\langle\ell_1,x\rangle,\dots,\langle\ell_R,x\rangle)$, or has a fixed degree~$D$.
For $E^{k,\ConeByCone}(\p,\langle\ell,x\rangle^M)(t)$, this result is obtained in~\cite{so-called-paper-1}. In this article, we used the step-functions $n\mapsto \{\zeta n\}_q$ which are defined as $\zeta n \bmod q$ for $\zeta,q,n \in \Z$. However, as noted in~\cite{so-called-paper-2}, the same proof\/\footnote{Of course, we can no longer reduce $\zeta$ modulo $q$ in the case of real parameters.} gives the result for real parameters using $t\mapsto q \{\frac{\zeta}{q} t\}$.
For the case of $\Barvinok(\p,\langle\ell,x\rangle^M)(t)$, we apply directly Theorem~28 in~\cite{so-called-paper-2} where we considered just one intermediate sum $S^L(t\p,h)$. The crucial point is that the codimension of $L$ is bounded by $k$, which is fixed. Here, we need also to compute the patching function. This can be done by computing recursively the M\"obius function of the poset $\CL_k^{\Barvi}$.
The algorithm for computing $E^{k,\ConeByCone}(\p,\langle\ell,x\rangle^M)(t)$ is simpler than the original algorithm given by Barvinok in~\cite{barvinok-2006-ehrhart-quasipolynomial}, where the subspaces~$L$ in the Barvinok family do not necessarily correspond to faces of $\p$.
%\bigbreak
We have implemented these algorithms in the case where $\p$ is a simplex, in Maple. The Maple programs are distributed as part of \emph{LattE integrale}, version 1.7.2~\cite{latteintegrale}, and also separately via the LattE website.\footnote{The most current versions are available at
\url{https://www.math.ucdavis.edu/~latte/software/packages/maple/}.} We give below some examples computed with our Maple programs.
In the case of a lattice simplex, when restricted to $t\in \N$, the three quasi-polynomials are usual polynomials in $t$. Here is an example.
\begin{exem}\label{ex:4-simplex}
Let $\p$ be the $4$-dimensional simplex with vertices
\[
[4,6,4,3],[5,7,9,1],[5,7,3,7],[6,8,3,9],[2,1,8,0].
\]
We use the weight function $h=1$. Table~\ref{tab:4-simplex} shows the quasi-polynomials $E^{k,\Barvi}\allowbreak(\p,1)(t)$ and $E^{k,\ConeByCone}(\p,1)(t)$, for maximal codimension $k$, $0\leq k\leq 4$. For $k=0$, both give the volume of the dilated simplex, for $k=4$, both give the exact number of points.
\begin{table}[t]
\centering
\caption{ The two polynomials $E^{k,\Barvi}(\p,1)(t)$ and $E^{k,\ConeByCone}(\p,1)(t)$ for integer dilations of the lattice simplex of Example~\ref{ex:4-simplex}.}\label{tab:4-simplex}
$
\renewcommand*\arraystretch{1.3}
\begin{array}{c@{\qquad}c@{\qquad}c}
\toprule k & E^{k,\ConeByCone}(\p,1)(t) & E^{k,\Barvi}(\p,1)(t) \\
\midrule 0 & \frac{3}{4} t^4 & \frac{3}{4} t^4
\\
1 & \frac{3}{4}{t}^{4}+2\,{t}^{3}+{\frac {7}{24}}\,{t}^{2}-{\frac {5}{5184}} & \frac{3}{4} t^4+2 t^3+\frac{7}{24} t^2
\\
2 & \frac{3}{4}{t}^{4}+2\,{t}^{3}+{\frac {15}{4}}\,{t}^{2}+{\frac {15}{8}}\,t+{\frac {67}{432}} & \frac{3}{4} t^4+2 t^3+\frac {15}{4} t^2+\frac {15}{8} t
\\
3 & \frac{3}{4}{t}^{4}+2\,{t}^{3}+{\frac {15}{4}}\,{t}^{2}+\frac{7}{2}\,t+{\frac {389}{ 432}} & \frac{3}{4} t^4+2 t^3+\frac {15}{4} t^2+\frac{7}{2} t
\\
4 & \frac{3}{4}{t}^{4}+2\,{t}^{3}+{\frac {15}{4}}\,{t}^{2}+\frac{7}{2}\,t+1 & \frac{3}{4}{t}^{4}+2\,{t}^{3}+{\frac {15}{4}}\,{t}^{2}+\frac{7}{2}\,t+1
\\
\bottomrule
\end{array}$
\end{table}
\end{exem}
Next, an example of a rational triangle dilated by a real parameter~$t$.
\begin{exem}\label{ex:3poly-dim3}
%\let\frac=\tfrac
Let $\p$ be the triangle with vertices $ [1,1], [1, 2], [2, 2]$. We use the weight function $h(x)=1$, so we approximate the number of lattice points in the triangle dilated by a real number~$t$. We list below the cone-by-cone and the full-Barvinok quasi-polynomials, for codimension $k$, $0\leq k\leq 2$. For $k=0$, both $E^{k,\ConeByCone}(\p,1)(t)$ and $\Barvinok(\p,1)(t)$ give the area of the dilated triangle, which is $\frac{t^2}{2}$.
For $k=1$,
\begin{align*}
E^{k,\ConeByCone}(\p,1)(t) &= \frac{t^2}{2} + \left(\frac{3}{2}- \{-t\}-\{2t\}\right)t\\
&\qquad +\frac14-\frac{\{-t\}}{2}-\frac{\{2t\}}{2}+\frac{\{-t\}^2}{2}+\frac{\{2t\}^2}{2}, \\
E^{k,\Barvi}(\p,1)(t) &= \frac{t^2}{2} + \left(\frac{3}{2} -\{-t\} -\{2t\} \right)t -\frac{\{t\}^2}{2}+\frac{\{t\}}{2}.
\end{align*}
For $k=2$, both give the exact number of points,
\begin{multline}\label{eq:exemple-triangle}
\frac{t^2}{2}+ \left(\frac{3}{2}-\{-t\} -\{2t\}\right)t \\
+\frac{1}{2}\{2t\}^2+\frac{1}{2}\{-t\}^2+\{2t\}\{-t\} -\frac{3}{2}\{-t\} -\frac{3}{2}\{2 t\}+1.
\end{multline}
For instance, for $t=\frac12$, $t=\frac16\pi=0.52359877
\dots$, or $t=\frac12 {\sqrt[3]{17/10}}=0.59674159
\dots$, the last expression gives $ 1$, which is indeed the number of lattice points in the triangle with vertices $ [\frac12,\frac12]$, $[\frac12, 1]$, and $[1, 1]$.
On the other hand, for $t=1$, Formula~\eqref{eq:exemple-triangle} gives~$3$, which is indeed the number of lattice points in the triangle with vertices $ [1,1]$, $[1, 2]$, and $[2, 2]$, while for $t=1\pm \epsilon$, with any small $\epsilon$, Formula~\eqref{eq:exemple-triangle} gives~$1$. We leave it as an exercise to the reader to understand the mystery; Figure~\ref{fig:epsilon} may help. Figure~\ref{fig:exemple-triangle} displays the graphs of the above quasi-polynomials.
\end{exem}
\begin{figure}
\begin{center}
\includegraphics[width=6cm]{marsplus} \hfill \includegraphics[width=6cm]{demimars}\\
\caption{ In blue, the triangle with vertices $[1,1]$, $[1, 2]$, and $[2, 2]$, dilated by $t=1+\epsilon$ and $t=1-\epsilon$. In red, the same triangle, dilated by $t=\frac12$ and $t=\frac12\pm\epsilon$. }\label{fig:epsilon}
\end{center}
\end{figure}
\begin{figure}
\begin{center}
\includegraphics[width=6cm]{pic-en-dim2-conebycone} \hfill \includegraphics[width=6cm]{pic-en-dim2-barvinok}
\caption{ Graphs of the quasi-polynomials $E^{k,\ConeByCone}(\p,1)(t)$ (\emph{left}) and $E^{k,\Barvi}(\p,1)(t)$ (\emph{right}) for the triangle~$\p$ with vertices $ [1,1], [1, 2], [2, 2]$ and $k = 0$ (\emph{green}), $k=1$ (\emph{red}), and $k=2$ (\emph{black}).}\label{fig:exemple-triangle}
\end{center}
\end{figure}
In higher dimensions, the quasi-polynomials of a real variable $t$ which arise are too long to display. We will only show some graphs.
\begin{exem}\label{ex:3-simplex}
Figures~\ref{fig:simplexDim3-cone-by-cone} and~\ref{fig:simplexDim3-Barvinok} display the graphs of the quasi-polynomials $E^{k,\ConeByCone}(\p,1)(t)$ and $E^{k,\Barvi}(\p,1)(t)$ for the
$3$-dimen\-sional simplex with vertices
\[
[0,1,1],[4,2,1],[1,1,2],[1,2,4],
\]
for $t\in [1.3,3.9]$. For $k=0$, both quasi-polynomials give the volume $t^3$ of the dilated simplex; for $k=3$, they are both equal to $S(t\p,1)$ which gives the number of integral points. In this example, we see that the function $t\mapsto S(t\p,1)$ has discontinuities on any side (left, right or both).
\end{exem}
%\clearpage
\begin{figure}%[p]
\includegraphics[width=7cm]{conebycone-simplexDim3v3}
\caption{ $E^{k,\ConeByCone}(\p,1)(t)$ for the 3-dimensional simplex with vertices $[0,1,1]$, $[4,2,1]$, $[1,1,2]$, and $[1,2,4]$ from Example~\ref{ex:3-simplex}, for $t\in [1.3,3.9]$ and $k = 0$ (\emph{green}), $k=1$ (\emph{blue}), $k=2$ (\emph{red}), $k=3$ (\emph{black}).}\label{fig:simplexDim3-cone-by-cone}
\end{figure}
\begin{figure}%[p]
\includegraphics[width=7cm]{fullbarvinok-simplexDim3v3}
\caption{ $E^{k,\Barvi}(\p,1)(t)$ for the same simplex as in Figure~\ref{fig:simplexDim3-cone-by-cone}.}\label{fig:simplexDim3-Barvinok}
\end{figure}
%\clearpage
\longthanks{This article is part of a research project which was made possible by several meetings of the authors, at the Centro di Ricerca Matematica Ennio De Giorgi of the Scuola Normale Superiore, Pisa in 2009, in a SQuaRE program at the American Institute of Mathematics, Palo Alto, in July 2009, September 2010, and February 2012, in the Research in Pairs program at Mathematisches Forschungsinstitut Oberwolfach in March/April 2010, and at the Institute for Mathematical Sciences (IMS) of the National University of Singapore in November/December 2013. The support of all four institutions is gratefully acknowledged. V.~Baldoni was partially supported by a PRIN2009 grant. J. De Loera was partially supported by grant DMS-0914107 of the National Science Foundation. M.~K\"oppe was partially supported by grant DMS-0914873 of the National Science Foundation.}
\bibliographystyle{amsplain-ac}
\bibliography{ALCO_Baldoni_141}
\end{document}