45using Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>;
48using Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>;
74 return Vector::Constant(
static_cast<Index>(count),
missing());
85 return Matrix::Constant(
static_cast<Index>(rows),
static_cast<Index>(columns),
missing());
115 const auto present = (values.array() == values.array());
118 parts.
present_ = present.template cast<Scalar>();
131 return (values.array() == values.array()).select(values, filler);
145 return left.cwiseProduct(right);
153inline constexpr unsigned int LOWER = Eigen::Lower;
155inline constexpr unsigned int UPPER = Eigen::Upper;
162using Llt = Eigen::LLT<Matrix>;
165using Ldlt = Eigen::LDLT<Matrix>;
176using ColPivQr = Eigen::ColPivHouseholderQR<Matrix>;
190#if EIGEN_VERSION_AT_LEAST(3, 4, 90)
191using Svd = Eigen::BDCSVD<Matrix, Eigen::ComputeThinU | Eigen::ComputeThinV>;
193using Svd = Eigen::BDCSVD<Matrix>;
203#if EIGEN_VERSION_AT_LEAST(3, 4, 90)
206 return Svd(a, Eigen::ComputeThinU | Eigen::ComputeThinV);
214inline constexpr auto SUCCESS = Eigen::Success;
The numeric vocabulary: Scalar, missing(), and the matrix and vector types.
Observed observed_parts(SeriesView values)
Splits a series into zero-filled values and a presence mask.
Eigen::BDCSVD< Matrix > Svd
Divide-and-conquer SVD: minimum-norm least-squares solutions and singular values.
Eigen::HouseholderQR< Matrix > HouseholderQr
Householder QR decomposition: the fastest QR, with no rank information.
double Scalar
The floating-point type the analytics and math layers compute in (double).
Vector both_present(const Vector &left, const Vector &right)
Combines two presence masks: 1 only where both series are observed.
Eigen::SelfAdjointEigenSolver< Matrix > SelfAdjointEigen
Eigenvalues (ascending) and eigenvectors of a symmetric matrix. Check info().
Eigen::Ref< Vector > MutableSeriesView
A writable reference to one series, such as a Vector or a column of a Matrix.
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
A dense, column-major matrix of Scalar.
Eigen::Index Index
The signed index type of rows and columns.
Vector unobserved(std::size_t count)
Makes a vector filled with missing().
Svd thin_svd(const Matrix &a)
Computes a thin SVD, ready to solve().
Vector observed_or(SeriesView values, Scalar filler)
Replaces every unobserved entry of a series.
constexpr unsigned int LOWER
Selects the lower triangle, as in matrix.selfadjointView<math::LOWER>().
Eigen::Ref< const Matrix > MatrixView
A read-only reference to a whole matrix.
Eigen::LDLT< Matrix > Ldlt
Pivoting Cholesky (LDLT) decomposition of a symmetric, possibly semi-definite matrix.
constexpr unsigned int UNIT_UPPER
Selects the upper triangle with an implicit unit diagonal.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
A dense column vector of Scalar.
constexpr unsigned int UNIT_LOWER
Selects the lower triangle with an implicit unit diagonal.
Eigen::FullPivLU< Matrix > FullPivLu
LU decomposition with full pivoting, for a square system with no known structure.
Eigen::LLT< Matrix > Llt
Cholesky decomposition of a symmetric positive-definite matrix. Check info().
constexpr auto SUCCESS
The value a decomposition's info() returns on success.
Scalar missing()
Returns the value that stands for "no observation" (a quiet NaN).
Eigen::ColPivHouseholderQR< Matrix > ColPivQr
Column-pivoting Householder QR: a least-squares solution and a rank.
constexpr unsigned int UPPER
Selects the upper triangle.
Eigen::Ref< const Vector > SeriesView
A read-only reference to one series.
Eigen::FullPivHouseholderQR< Matrix > FullPivQr
Full-pivoting Householder QR: slower than ColPivQr, with the most reliable rank.
The library: broker-neutral types (core), and the modules below.
A series split into zero-filled values and a presence mask, for sums that skip gaps.
Vector values_
The input, with every unobserved entry replaced by 0.
Vector present_
1 where the input is observed and 0 where it is not.