% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare.R
\name{mt_linear-compare}
\alias{mt_linear-compare}
\alias{==,mt_linear-method}
\alias{!=,mt_linear-method}
\alias{<,mt_linear-method}
\alias{<=,mt_linear-method}
\alias{>,mt_linear-method}
\alias{>=,mt_linear-method}
\title{Comparison operators for linear time (\code{mt_linear})}
\usage{
\S4method{==}{mt_linear}(e1, e2)
\S4method{!=}{mt_linear}(e1, e2)
\S4method{<}{mt_linear}(e1, e2)
\S4method{<=}{mt_linear}(e1, e2)
\S4method{>}{mt_linear}(e1, e2)
\S4method{>=}{mt_linear}(e1, e2)
}
\arguments{
\item{e1, e2}{\code{mt_linear} vectors (or values castable to one, such as
plain numeric vectors sharing the other operand's chronon).}
}
\value{
A logical vector.
}
\description{
Discrete linear time values represent a \emph{closed interval} spanning their
chronon (e.g. \code{year(2020)} spans every instant from the start of 2020 to
the end of 2020), while continuous linear time values represent a single
instant. Comparing two \code{mt_linear} vectors therefore compares the
start/end instants of the (possibly zero-width) interval each value
represents:
\itemize{
\item \code{a == b} iff \code{start(a) == start(b)} and \code{end(a) == end(b)}
\item \code{a < b} iff \code{end(a) < start(b)}
\item \code{a > b} iff \code{start(a) > end(b)}
\item \code{a <= b} iff \code{end(a) <= end(b)} (right-bound comparison)
\item \code{a >= b} iff \code{start(a) >= start(b)} (left-bound comparison)
}

This is \strong{not} a total order: \code{<=}/\code{>=} are endpoint comparisons, not
shorthand for \verb{(< or ==)}/\verb{(> or ==)}, so it is possible for none of
\code{==}, \code{<}, \code{>} to hold between two values.

If both operands are continuous (fractional chronons), or share an
identical chronon, the comparison simplifies to a direct numeric
comparison, since there is no interval to consider.
}
