.. index:: pair: namespace; gpr::linalg .. _doxid-namespacegpr_1_1linalg: namespace gpr::linalg ===================== .. toctree:: :hidden: namespace_gpr_linalg_backend.rst namespace_gpr_linalg_canonical.rst namespace_gpr_linalg_cutlass.rst namespace_gpr_linalg_fixed.rst namespace_gpr_linalg_kokkos_joint.rst namespace_gpr_linalg_linop.rst namespace_gpr_linalg_portable_tiles.rst namespace_gpr_linalg_schemeii.rst enum_gpr_linalg_ArithmeticClass.rst enum_gpr_linalg_DistributedBackendKind.rst enum_gpr_linalg_DistributedFactorization.rst enum_gpr_linalg_ExecutionKind.rst enum_gpr_linalg_Lp64DescriptorField.rst enum_gpr_linalg_MemoryKind.rst enum_gpr_linalg_ProductMode.rst struct_gpr_linalg_BackendTraits.rst struct_gpr_linalg_BackendTraits-2.rst struct_gpr_linalg_BackendTraits-3.rst struct_gpr_linalg_BackendTraits-4.rst struct_gpr_linalg_BackendTraits-5.rst struct_gpr_linalg_BackendTraits-6.rst struct_gpr_linalg_BackendTraits-7.rst struct_gpr_linalg_BackendTraits-8.rst struct_gpr_linalg_CompensatedSum.rst struct_gpr_linalg_ConstTileView.rst struct_gpr_linalg_DistributedShape.rst struct_gpr_linalg_ExactProductAccumulator.rst struct_gpr_linalg_KokkosMolecularStats.rst struct_gpr_linalg_KokkosTransferAuditStats.rst struct_gpr_linalg_KokkosTransferDirectionStats.rst struct_gpr_linalg_KokkosTransferStats.rst struct_gpr_linalg_MpiContext.rst struct_gpr_linalg_PCGResult.rst struct_gpr_linalg_PCGSettings.rst struct_gpr_linalg_ProviderTraits.rst struct_gpr_linalg_RayleighRitzOptions.rst struct_gpr_linalg_RayleighRitzResult.rst struct_gpr_linalg_SchemeIIIntegers.rst struct_gpr_linalg_SchemeIIWide.rst struct_gpr_linalg_SchemeISlices.rst struct_gpr_linalg_StoredProduct.rst struct_gpr_linalg_ThreadBudget.rst struct_gpr_linalg_TileView.rst class_gpr_linalg_BackendContext.rst class_gpr_linalg_CholeskyPanels.rst class_gpr_linalg_CovarianceEquilibration.rst class_gpr_linalg_CusolverEighLib.rst class_gpr_linalg_CusolverInverse.rst class_gpr_linalg_DenseLLTInverse.rst class_gpr_linalg_DistributedKernelProvider.rst class_gpr_linalg_DistributedState.rst class_gpr_linalg_EnvironmentGpuExecutor.rst class_gpr_linalg_ExactSum.rst class_gpr_linalg_KernelInverse.rst class_gpr_linalg_KernelWall.rst class_gpr_linalg_KokkosFactor.rst class_gpr_linalg_KokkosMolecularPosterior.rst class_gpr_linalg_KokkosWorkspace.rst class_gpr_linalg_LocalExecutor.rst class_gpr_linalg_MpiCommunicator.rst class_gpr_linalg_PredictProduct.rst class_gpr_linalg_ProbeExecutor.rst class_gpr_linalg_ScalapackLib.rst class_gpr_linalg_ScopedLp64IndexLimit.rst class_gpr_linalg_ScopedSerialEigenThreads.rst class_gpr_linalg_ScopedSolveThreads.rst class_gpr_linalg_ScopedTileKernelThreads.rst class_gpr_linalg_StableVarianceError.rst class_gpr_linalg_TileBackground.rst class_gpr_linalg_TileCholesky.rst class_gpr_linalg_TilePool.rst class_gpr_linalg_TwoStageEigenLib.rst Overview ~~~~~~~~ Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators, backend selection. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block namespace linalg { // namespaces namespace :ref:`gpr::linalg::backend`; namespace :ref:`gpr::linalg::canonical`; namespace :ref:`gpr::linalg::cutlass`; namespace :ref:`gpr::linalg::fixed`; namespace :ref:`gpr::linalg::kokkos_joint`; namespace :ref:`gpr::linalg::linop`; namespace :ref:`gpr::linalg::portable_tiles`; namespace :ref:`gpr::linalg::schemeii`; // typedefs typedef :ref:`backend::EigenTag` :target:`ActiveBackend`; typedef :ref:`BackendTraits`<:ref:`ActiveBackend`> :target:`ActiveBackendTraits`; typedef std::optional :target:`AvailableMemory`; typedef int :target:`MpiCommType`; typedef :ref:`DistributedState` :target:`ScalapackState`; typedef Eigen::Ref> :target:`ConstProductMatrix`; typedef Eigen::Ref> :target:`ProductMatrix`; // enums enum :ref:`ArithmeticClass`; enum :ref:`DistributedBackendKind`; enum :ref:`DistributedFactorization`; enum :ref:`ExecutionKind`; enum :ref:`Lp64DescriptorField`; enum :ref:`MemoryKind`; enum :ref:`ProductMode`; // structs template struct :ref:`BackendTraits`; template <> struct :ref:`BackendTraits`; template <> struct :ref:`BackendTraits`; template <> struct :ref:`BackendTraits`; template <> struct :ref:`BackendTraits`; template <> struct :ref:`BackendTraits`; template <> struct :ref:`BackendTraits`; template <> struct :ref:`BackendTraits`; struct :ref:`CompensatedSum`; struct :ref:`ConstTileView`; struct :ref:`DistributedShape`; struct :ref:`ExactProductAccumulator`; struct :ref:`KokkosMolecularStats`; struct :ref:`KokkosTransferAuditStats`; struct :ref:`KokkosTransferDirectionStats`; struct :ref:`KokkosTransferStats`; struct :ref:`MpiContext`; struct :ref:`PCGResult`; struct :ref:`PCGSettings`; struct :ref:`ProviderTraits`; struct :ref:`RayleighRitzOptions`; struct :ref:`RayleighRitzResult`; struct :ref:`SchemeIIIntegers`; struct :ref:`SchemeIIWide`; struct :ref:`SchemeISlices`; struct :ref:`StoredProduct`; struct :ref:`ThreadBudget`; struct :ref:`TileView`; // classes class :ref:`BackendContext`; class :ref:`CholeskyPanels`; class :ref:`CovarianceEquilibration`; class :ref:`CusolverEighLib`; class :ref:`CusolverInverse`; class :ref:`DenseLLTInverse`; class :ref:`DistributedKernelProvider`; class :ref:`DistributedState`; class :ref:`EnvironmentGpuExecutor`; class :ref:`ExactSum`; class :ref:`KernelInverse`; class :ref:`KernelWall`; class :ref:`KokkosFactor`; class :ref:`KokkosMolecularPosterior`; class :ref:`KokkosWorkspace`; class :ref:`LocalExecutor`; class :ref:`MpiCommunicator`; class :ref:`PredictProduct`; class :ref:`ProbeExecutor`; class :ref:`ScalapackLib`; class :ref:`ScopedLp64IndexLimit`; class :ref:`ScopedSerialEigenThreads`; class :ref:`ScopedSolveThreads`; class :ref:`ScopedTileKernelThreads`; class :ref:`StableVarianceError`; class :ref:`TileBackground`; class :ref:`TileCholesky`; class :ref:`TilePool`; class :ref:`TwoStageEigenLib`; // global variables const char* :target:`kPredictSumOption` = "--predict-sum"; const char* :target:`kPredictSumHelp` = "Predict product. compensated sums each TwoProductFMA expansion and " "rounds once, and is the default. scheme1 is Ozaki Scheme I, scheme2 is " "Ozaki Scheme II, and kernel_float is the Scheme II product formed with " "kernel_float vectors."; std::atomic_bool :ref:`stable_posterior_variance` {false}; int :ref:`kStablePosteriorVarianceRoundoffUlps` = 4; std::int64_t :ref:`kLp64IndexLimit` = std::numeric_limits::max(); :ref:`MpiCommType` :target:`kMpiCommNull` = 0; int :target:`kSchemeIIModulusCount` = 8; int :target:`kSchemeIIMaxShift` = 120; Eigen::Index :target:`kMinDistributedGemmOrder` = 512; Eigen::Index :target:`kMinDistributedSymmetricEigenOrder` = 1; // global functions bool :ref:`arrowheadEigenRankOne`(const Eigen::VectorXd& d, const Eigen::VectorXd& z, double alpha, Eigen::VectorXd& evals_asc, Eigen::MatrixXd& evecs); bool :ref:`arrowheadEigen`(const Eigen::VectorXd& d, const Eigen::MatrixXd& B, const Eigen::MatrixXd& A, Eigen::VectorXd& evals_asc, Eigen::MatrixXd& evecs); bool :ref:`cholesky`(const :ref:`EigenMatrix`& C, :ref:`EigenMatrix`& L); Eigen::VectorXd :ref:`forward_solve`(const :ref:`EigenMatrix`& L, const Eigen::VectorXd& b); Eigen::VectorXd :ref:`back_solve`(const :ref:`EigenMatrix`& L, const Eigen::VectorXd& b); :ref:`EigenMatrix` :ref:`forward_solve_mat`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B); :ref:`EigenMatrix` :ref:`back_solve_mat`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B); Eigen::VectorXd :ref:`forward_solve_mat_colwise_squared_norm`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B); Eigen::VectorXd :ref:`bordered_cholesky_diagonal`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B, const Eigen::VectorXd& prior); :ref:`EigenMatrix` :ref:`cholesky_inverse`(const :ref:`EigenMatrix`& L); double :ref:`trace_product`(const :ref:`EigenMatrix`& A, const :ref:`EigenMatrix`& B); double :ref:`log_det_cholesky`(const :ref:`EigenMatrix`& L); bool :target:`hostAccessible`(:ref:`MemoryKind` kind); const char* :target:`memoryKindName`(:ref:`MemoryKind` kind); const char* :target:`executionKindName`(:ref:`ExecutionKind` kind); const char* :target:`arithmeticClassName`(:ref:`ArithmeticClass` cls); bool :ref:`satisfies`(:ref:`ArithmeticClass` provided, :ref:`ArithmeticClass` required); double :ref:`symmetricBackwardError`(Eigen::Index n, double scale); bool :ref:`curvatureIsNegative`(double lambda, double scale, Eigen::Index n); void :target:`canonicalizeEigenvectorSign`(Eigen::Ref vector, double tolerance); bool :target:`signedEigenvectorLess`(const Eigen::Ref& left, const Eigen::Ref& right); void :ref:`canonicalizeEigenpairs`(Eigen::Ref evals, Eigen::Ref evecs); Eigen::Index :ref:`resolvedSingularRank`(const Eigen::VectorXd& singular, double cutoff); double :target:`twoSumResidual`(double a, double b, double rounded); bool :target:`tryCertifiedProduct`(const double* left, const double* right, int length, double& result); bool :ref:`rank_one_update_lower`(:ref:`EigenMatrix`& lower, const Eigen::VectorXd& vector); bool :ref:`cholesky_rank_update`(:ref:`EigenMatrix`& lower, const Eigen::VectorXd& vector); template void :ref:`assembleCollectively`(const :ref:`MpiContext`& context, Matrices& result, const Body& body); :ref:`ProductMode` :target:`productMode`(); bool :target:`kernelFloatProductAvailable`(); bool :target:`selectPredictProduct`(const char* value); double :target:`evaluateStoredProduct`(const double* left, const double* right, int length, :ref:`ProductMode` mode); void :target:`contractPredictionMatrix`(const double* column_major, int rows, int cols, const double* coefficients, double* output, :ref:`ProductMode` mode); void :target:`evaluateStoredProducts`(const :ref:`StoredProduct`* products, int count, :ref:`ProductMode` mode, double* values); double :ref:`trace_solve_product`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& A); double :ref:`dense_factor_inverse_trace`(const :ref:`EigenMatrix`& L); :ref:`DistributedBackendKind` :target:`compiled_distributed_backend`(); const char* :target:`distributed_backend_name`(:ref:`DistributedBackendKind` backend); void :ref:`configureEnvironmentGpu`(const std::string& library); std::shared_ptr`> :target:`configuredEnvironmentGpu`(); void :ref:`configureStablePosteriorVariance`(bool enabled); bool :ref:`stablePosteriorVarianceEnabled`(); bool :ref:`acceptStablePosteriorVariance`(double& variance, double signal_variance, double relative_allowance); bool :ref:`acceptStablePosteriorVariance`(double& variance, double signal_variance); bool :ref:`acceptStablePosteriorVariance`(Eigen::VectorXd& variance, const Eigen::VectorXd& signal); void :ref:`requireStablePosteriorVariance`(double& variance, double signal_variance, double relative_allowance); void :target:`requireStablePosteriorVariance`(double& variance, double signal_variance); void :ref:`requireStablePosteriorVariance`(Eigen::VectorXd& variance, const Eigen::VectorXd& signal); template void :ref:`requireStableSchurDiagonal`(Eigen::VectorXd& variance, const Eigen::VectorXd& signal, RelativeError&& relative_error); template double :ref:`estimateLowerInverseNorm1`(Eigen::Index order, Solve&& solve, SolveTranspose&& solve_transpose); double :ref:`choleskySchurRelativeError`(Eigen::Index order, double factor_frobenius_norm, double inverse_norm1); double :ref:`upperInverseNorm1FromComputed`(double computed_norm, Eigen::Index order); double :ref:`upperInverseNorm1FromResidual`(double computed_norm, double residual_norm, double factor_abs_norm, Eigen::Index order); template double :ref:`upperInverseNorm1`(const Eigen::MatrixBase& factor); template double :ref:`denseCholeskySchurRelativeError`(const Eigen::MatrixBase& factor); template double :ref:`subsetFactorSchurRelativeError`(Backend& backend, const Eigen::MatrixBase& factor, int order); template Eigen::VectorXd :ref:`borderedCholeskyDiagonalWith`(const Eigen::VectorXd& prior, const Eigen::MatrixBase& whitened, RelativeError&& relative_error); template Eigen::VectorXd :ref:`borderedCholeskyDiagonal`(const Eigen::VectorXd& prior, const Eigen::MatrixBase& whitened); template Eigen::VectorXd :ref:`borderedCholeskyDiagonal`(const Eigen::VectorXd& prior, const Eigen::MatrixBase& whitened, const Eigen::MatrixBase& factor); template double :ref:`borderedCholeskyActionVarianceWith`(const Eigen::MatrixBase& prior, const Eigen::MatrixBase& weights, const Eigen::MatrixBase& whitened_action, RelativeError&& relative_error); template double :ref:`borderedCholeskyActionVariance`(const Eigen::MatrixBase& prior, const Eigen::MatrixBase& weights, const Eigen::MatrixBase& whitened_action); template double :ref:`borderedCholeskyActionVariance`(const Eigen::MatrixBase& prior, const Eigen::MatrixBase& weights, const Eigen::MatrixBase& whitened_action, const Eigen::MatrixBase& factor); double :ref:`pcg_dot`(const Eigen::VectorXd& a, const Eigen::VectorXd& b); :ref:`PCGResult` :ref:`preconditioned_cg`(const std::function& apply_A, const std::function& apply_M_inv, const Eigen::VectorXd& b, const :ref:`PCGSettings`& settings = {}); void :target:`resetKokkosTransferAuditStats`(); :ref:`KokkosTransferAuditStats` :target:`kokkosTransferAuditStats`(); bool :ref:`kokkosHostExecutionMemory`(); :ref:`DistributedFactorization` :ref:`distributedFactorization`(); std::uint64_t :ref:`distributedFactorizationGeneration`(); void :ref:`configureDistributedFactorization`(:ref:`DistributedFactorization` mode); const char* :target:`distributedFactorizationName`(:ref:`DistributedFactorization` mode); std::optional<:ref:`DistributedFactorization`> :ref:`parseDistributedFactorization`(std::string_view name); int :ref:`configuredLinalgThreads`(); void :ref:`configureLinalgThreads`(int threads); void :ref:`configureProductThreads`(int threads); void :ref:`configureLibrarySerialKernels`(bool enabled); bool :target:`librarySerialKernels`(); void :ref:`configureUnconstrainedLibraryReductions`(bool enabled); bool :target:`unconstrainedLibraryReductions`(); void :ref:`configureTileThreads`(int threads); int :ref:`affinityCpuCount`(); int :ref:`blasThreadCount`(); bool :ref:`teamPanelKernels`(); void :ref:`configureKernelThreads`(int threads); void :ref:`refreshKernelTeam`(); std::int64_t :ref:`blockCyclicLocalExtent`(std::int64_t n, std::int64_t nb, std::int64_t iproc, std::int64_t isrc, std::int64_t nprocs); std::int64_t :ref:`largestLocalEntries`(std::int64_t m, std::int64_t n, std::int64_t mb, std::int64_t nb, std::int64_t rsrc, std::int64_t csrc, std::int64_t nprow, std::int64_t npcol); std::int64_t :ref:`largestLocalEntries`(const int* desc, int nprow, int npcol); std::atomic& :ref:`lp64IndexLimitStore`(); std::int64_t :target:`lp64IndexLimit`(); bool :ref:`exceedsLp64`(const int* desc, int nprow, int npcol); bool :ref:`exceedsLp64`(std::int64_t count); :ref:`AvailableMemory` :ref:`availableHostBudget`(); std::int64_t :ref:`availableHostBytes`(); bool :target:`fitsRankShare`(std::int64_t needed, :ref:`AvailableMemory` available, int node_ranks); bool :ref:`fitsRankShare`(std::int64_t needed, std::int64_t available, int node_ranks); void :ref:`requireRankShare`(const char* what, std::int64_t needed, :ref:`AvailableMemory` available, int node_ranks); void :target:`requireRankShare`(const char* what, std::int64_t needed, std::int64_t available, int node_ranks); void :ref:`replicate_owned_values`(double* data, std::size_t count, const :ref:`MpiContext`& context); void :ref:`disjoint_sum_bcast`(double* data, int count, const :ref:`MpiContext`& context); void :ref:`ordered_sum_bcast`(double* data, int count, const :ref:`MpiContext`& context); void :ref:`compensated_sum_bcast`(:ref:`CompensatedSum`* data, int count, const :ref:`MpiContext`& context); void :ref:`exact_sum_bcast`(:ref:`ExactSum`* sums, int count, const :ref:`MpiContext`& context); int :ref:`schemeISliceBits`(Eigen::Index length); :ref:`SchemeISlices` :ref:`splitSchemeI`(const Eigen::Ref& values); double :ref:`accumulateSchemeI`(const :ref:`SchemeISlices`& left, const :ref:`SchemeISlices`& right); double :target:`scheme_i_trunc`(double value); int :target:`scheme_i_slice_bits`(int length); int :target:`scheme_i_split`(const double* values, int length, int bits, double* slices, int cap); int :target:`scheme_i_slice_cap`(const double* values, int length, int bits); double :ref:`schemeIProductRaw`(const double* left, const double* right, int length); template double :ref:`schemeIProduct`(const Eigen::MatrixBase& left, const Eigen::MatrixBase& right); uint32_t :target:`schemeIIModulus`(int index); const uint32_t* :target:`schemeIIModuli`(); bool :target:`scaleSchemeII`(const double* left, const double* right, int length, :ref:`SchemeIIIntegers`* scaled); uint32_t :target:`modularProductSchemeII`(const :ref:`SchemeIIIntegers`& scaled, uint32_t modulus); bool :target:`takeSchemeIIWindow`(const :ref:`SchemeIIIntegers`& scaled, char* consumed, :ref:`SchemeIIIntegers`* window); :ref:`SchemeIIWide` :target:`crtSchemeII`(const uint32_t* residues); double :target:`unscaleSchemeII`(const :ref:`SchemeIIWide`& coefficient, int exponent); double :target:`schemeIIProductRaw`(const double* left, const double* right, int length); bool :target:`jacobiDavidsonCorrection`(const Eigen::MatrixXd& A, const double theta, const Eigen::VectorXd& residual, const Eigen::VectorXd& ritz_vector, Eigen::VectorXd& correction, double* alpha = nullptr); template :ref:`RayleighRitzResult` :target:`lowestEigenpairRayleighRitz`(const Eigen::Index dimension, Apply&& apply, const Eigen::VectorXd& seed, :ref:`RayleighRitzOptions` options); void :target:`requireRebuildableDenseL`(const :ref:`EigenMatrix`& L, int m, const char* fn, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); void :target:`ordered_sum_bcast`(double* data, int count, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); void :target:`exact_sum_bcast`(:ref:`ExactSum`* sums, int count, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); void :ref:`disjoint_sum_bcast`(double* data, int count, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); bool :target:`distributed_gemm_nn`(const :ref:`EigenMatrix`& A, const :ref:`EigenMatrix`& B, :ref:`EigenMatrix`& C, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); int :ref:`lp64Workspace`(double query, const char* routine, const :ref:`DistributedState`& st); void :target:`cached_trsm_left_lower`(int m, int ncols, double* b_buf, const int* desc_b, bool transpose, const char* fn, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); void :target:`transformDistributedLower`(std::vector& buffer, const int* desc, int n, const :ref:`CovarianceEquilibration`& scaling, bool restore_factor, :ref:`DistributedState`& st); bool :target:`equilibrateDistributedLower`(std::vector& buffer, const int* desc, int n, :ref:`CovarianceEquilibration`& scaling, :ref:`DistributedState`& st); bool :target:`cholesky`(const :ref:`EigenMatrix`& C, :ref:`EigenMatrix`& L, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); bool :target:`cholesky_distributed`(std::vector C_dist, const int* desc, int n, :ref:`EigenMatrix`& L, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); :ref:`EigenMatrix` :target:`forward_solve_mat`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); bool :target:`distributed_thin_svd`(const :ref:`EigenMatrix`& A, :ref:`EigenMatrix`& U, Eigen::VectorXd& S, :ref:`EigenMatrix`& V, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); bool :target:`distributed_symmetric_eigen`(const :ref:`EigenMatrix`& A, Eigen::VectorXd& eigenvalues, :ref:`EigenMatrix`& eigenvectors, const char** driver_name = nullptr, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); bool :target:`distributed_thin_svd_colblock`(const :ref:`EigenMatrix`& A_local, int m, int n, :ref:`EigenMatrix`& U, Eigen::VectorXd& S, :ref:`EigenMatrix`& V, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); bool :target:`distributed_thin_svd_tsqr`(const :ref:`EigenMatrix`& A_local, int nobs, int N, :ref:`EigenMatrix`& U, Eigen::VectorXd& S, :ref:`EigenMatrix`& V, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); :ref:`EigenMatrix` :target:`back_solve_mat`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); Eigen::VectorXd :ref:`columnSquaredNormsExact`(const std::vector& buf, const int* desc, int m, int ncols, :ref:`DistributedState`& st); Eigen::VectorXd :target:`columnSchurComplementsExact`(const std::vector& buf, const int* desc, int m, int ncols, const Eigen::VectorXd& prior, :ref:`DistributedState`& st); Eigen::VectorXd :target:`forward_solve_mat_colwise_squared_norm`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); double :ref:`cachedFactorSchurRelativeError`(int m, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); void :ref:`requireCachedFactorSchurDiagonal`(Eigen::VectorXd& diagonal, const Eigen::VectorXd& prior, int m, :ref:`DistributedState`& st); Eigen::VectorXd :target:`bordered_cholesky_diagonal`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B, const Eigen::VectorXd& prior, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); :ref:`EigenMatrix` :ref:`forward_solve_mat_bilinear_distributed`(const :ref:`EigenMatrix`& L, std::vector b_buf, const int* desc_b, int m, int ncols, :ref:`DistributedState`& st = :ref:`DistributedState::instance`(), const Eigen::VectorXd* prior = nullptr, Eigen::VectorXd* posterior_diagonal = nullptr); Eigen::VectorXd :target:`forward_solve_mat_colwise_squared_norm_distributed`(const :ref:`EigenMatrix`& L, std::vector b_buf, const int* desc_b, int m, int ncols, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); Eigen::VectorXd :target:`bordered_cholesky_diagonal_distributed`(const :ref:`EigenMatrix`& L, std::vector b_buf, const int* desc_b, int m, int ncols, const Eigen::VectorXd& prior, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); Eigen::VectorXd :ref:`cholesky_inverse_diagonal_distributed`(const :ref:`EigenMatrix`& L, int order, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); Eigen::VectorXd :target:`forward_solve`(const :ref:`EigenMatrix`& L, const Eigen::VectorXd& b, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); Eigen::VectorXd :target:`back_solve`(const :ref:`EigenMatrix`& L, const Eigen::VectorXd& b, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); double :target:`trace_cholesky_solve_scalapack`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); :ref:`ExactSum` :target:`trace_cholesky_solve_scalapack_distributed_local`(const :ref:`EigenMatrix`& L, const double* B_dist, const int* desc_b, int m, int ncols, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); double :target:`trace_cholesky_solve_scalapack_distributed`(const :ref:`EigenMatrix`& L, const double* B_dist, const int* desc_b, int m, int ncols, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); bool :ref:`factor_inverse_lower`(const :ref:`EigenMatrix`& L, int n, std::vector& inverse, int* desc, :ref:`DistributedState`& st); template :ref:`ExactSum` :ref:`trace_lower_symmetric_local`(const double* A, int lda, int n, Entry&& b, :ref:`DistributedState`& st); double :ref:`trace_inverse_times_symmetric`(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`* B, int n, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); :ref:`EigenMatrix` :target:`cholesky_inverse`(const :ref:`EigenMatrix`& L, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); void :target:`cache_cholesky_inverse`(const :ref:`EigenMatrix`& L, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); double :target:`observation_tile_lower_trace_colmajor_unchecked`(const double* lower_colmajor, int leading_dim, int n, const :ref:`EigenMatrix`& block, int row_component, int col_component, int tile_size, bool transpose_block = false); double :target:`cached_inverse_observation_tile_trace_np1`(const :ref:`EigenMatrix`& block, int row_component, int col_component, int tile_size, bool transpose_block = false, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); double :target:`trace_cached_inverse_times_symmetric_distributed`(const double* B_dist, const int* desc_b, int n, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); :ref:`EigenMatrix` :target:`cholesky_inverse_root`(const :ref:`EigenMatrix`& L, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); double :target:`trace_product`(const :ref:`EigenMatrix`& A, const :ref:`EigenMatrix`& B, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); double :target:`log_det_cholesky`(const :ref:`EigenMatrix`& L, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()); bool :ref:`teamDivideConquerEigen`(const Eigen::MatrixXd& sym, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs); bool :ref:`covarianceDsyevr`(const Eigen::MatrixXd& sym, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs); std::int64_t :ref:`teamPanelWidth`(); bool :ref:`teamPanelBitsIndependent`(); double :ref:`teamSolveWallSeconds`(); void :target:`teamSolveWallReset`(); void :target:`teamAddSolveWall`(double seconds); double :ref:`teamFactorWallSeconds`(); void :target:`teamFactorWallReset`(); bool :ref:`teamParallelPays`(double flops); bool :ref:`teamCholeskyLower`(double* lower, std::int64_t lda, std::int64_t n); void :ref:`teamSolveLower`(const double* lower, std::int64_t lda, bool lower_factor, double* rhs, std::int64_t ldb, std::int64_t n, std::int64_t cols); void :ref:`teamSolveLowerVector`(const double* lower, std::int64_t lda, bool lower_factor, double* rhs, std::int64_t n); void :ref:`teamSymmetricGram`(const double* b, std::int64_t ldb, double* c, std::int64_t ldc, std::int64_t n); bool :target:`teamCholeskyLower`(Eigen::Ref lower); void :target:`teamSolveLower`(const Eigen::Ref& lower, bool lower_factor, Eigen::Ref rhs); void :target:`teamSolveLowerVector`(const Eigen::Ref& lower, bool lower_factor, Eigen::Ref rhs); std::atomic& :ref:`tileThreadCount`(); void :ref:`setTileThreads`(int threads); template void :ref:`parallelFor`(long count, F&& fn); bool :ref:`trainingCholeskySelected`(Eigen::Index order); bool :ref:`trainingCholeskyDistributedSelected`(Eigen::Index order); bool :ref:`trainingCholeskyLower`(:ref:`ProductMatrix` lower); std::shared_ptr`> :ref:`schemeIIContext`(); void :ref:`configureTrainingProductLibrary`(const std::string& library); bool :ref:`trainingProductConfigured`(); bool :ref:`trainingProductLibraryLoaded`(); bool :ref:`tryTrainingProduct`(:ref:`ConstProductMatrix` a, :ref:`ConstProductMatrix` b, :ref:`ProductMatrix` c, bool transpose_a = false, bool transpose_b = false, double alpha = 1.0, double beta = 0.0, bool partitioned = false); Eigen::MatrixXd :ref:`trainingProduct`(:ref:`ConstProductMatrix` a, :ref:`ConstProductMatrix` b, bool transpose_a, bool transpose_b); } // namespace linalg .. _details-namespacegpr_1_1linalg: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators, backend selection. Two-stage symmetric eigensolver: full -> banded -> eigenpairs. One-stage reduction (LAPACK dsytrd, reached through dsyevr) spends its time in dsymv, a matrix-VECTOR product. That is bandwidth-bound, and a live profile of a Baker cell put dsymv at 56% of the run once MPI wait was removed. The two-stage form exists to replace it: reducing to a BAND first can be done with matrix-MATRIX products, which are not bandwidth-bound. Only stage one is written here. LAPACK already ships the rest and, unlike its \*_2stage drivers, dsbevd supports JOBZ='V', so the band eigenproblem and its eigenvectors come from the library: stage 1 full -> band, blocked Householder (this file, BLAS3) stage 2 band -> eigenpairs (dsbevd) stage 3 back-transform Z through stage 1 (dlarfb, BLAS3) The trailing update applies the block reflector from both sides rather than using the symmetric dsyr2k form. That costs about twice the flops of the symmetry-exploiting update, and is still the right trade here because the point is to leave BLAS2 behind. The result is symmetrized explicitly, since applying the two sides separately leaves asymmetry at roundoff. The reflector block is built with dlarft and applied with dlarfb directly, not through dormqr. dormqr takes its blocked path only when ILAENV's block size is strictly smaller than the number of reflectors k; a panel k chosen to equal that block size sends every update to the unblocked dorm2r, which applies reflectors one at a time through dger. Calling dlarfb makes the panel width a property of this file rather than of a tuning table that can be equal to it. Global Variables ---------------- .. index:: pair: variable; stable_posterior_variance .. _doxid-namespacegpr_1_1linalg_1a2b33db0e2564a0127e5e8232e0f0e226: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::atomic_bool stable_posterior_variance {false} Process-wide switch for stable posterior variance reductions. Off by default; set through configureStablePosteriorVariance. .. index:: pair: variable; kStablePosteriorVarianceRoundoffUlps .. _doxid-namespacegpr_1_1linalg_1ab91bc21e863e3dc51f0f8b7f6bbda3c2: .. ref-code-block:: cpp :class: doxyrest-title-code-block int kStablePosteriorVarianceRoundoffUlps = 4 Ulps of the signal variance that a compensated posterior variance may sit below zero. Higham's bound on compensated summation is about 2\*eps\*sum|terms|. A prior and the squares that cancel it are at most two copies of the signal variance, so a mathematical zero rounds no lower than -4\*eps\*sigma2. The constant does not grow with the number of training rows. .. index:: pair: variable; kLp64IndexLimit .. _doxid-namespacegpr_1_1linalg_1af35f2236fa82f596d6957cb7b0a7267f: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::int64_t kLp64IndexLimit = std::numeric_limits::max() Largest element offset an LP64 ScaLAPACK routine forms without overflow. Global Functions ---------------- .. index:: pair: function; arrowheadEigenRankOne .. _doxid-namespacegpr_1_1linalg_1a234737a874c3b52c3150ed1261c5790d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool arrowheadEigenRankOne(const Eigen::VectorXd& d, const Eigen::VectorXd& z, double alpha, Eigen::VectorXd& evals_asc, Eigen::MatrixXd& evecs) Single-border case, the primitive the block version iterates. M = [diag(d), z; z^T, alpha]. .. index:: pair: function; arrowheadEigen .. _doxid-namespacegpr_1_1linalg_1ad2d76e17c86804a91bd11478df104df8: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool arrowheadEigen(const Eigen::VectorXd& d, const Eigen::MatrixXd& B, const Eigen::MatrixXd& A, Eigen::VectorXd& evals_asc, Eigen::MatrixXd& evecs) Eigenpairs of a symmetric diagonal-plus-border matrix. M = [ diag(d) B ] d in R^p, B in R^{p x k}, A in R^{k x k} [ B^T A ] This is the shape the HS-SVD append builds: the old basis already diagonalises the old kernel, so the leading block is diagonal and the appended observations are a narrow border. A dense eigensolver costs O((p+k)^3) on it; the structure costs O(k (p+k)^2), and k is one or two because that is how many rows an acquisition adds. Accuracy is the whole difficulty, not speed. Two things are needed and both are done here: * the secular equation is solved in a SHIFTED variable, so the quantity that decides an eigenvector is a difference of nearby diagonal entries rather than a difference of a diagonal entry and a nearly equal eigenvalue; * the coupling vector is reconstructed from the computed eigenvalues through Lowner's theorem before eigenvectors are formed. Forming them from the original coupling gives vectors that lose orthogonality when eigenvalues cluster, which is exactly what an eight-decade flat spectrum produces. Deflation handles the two degenerate directions: a negligible border entry means its diagonal entry is already an eigenvalue, and two equal diagonal entries are rotated so that one coupling entry becomes zero and deflates. The zero block that the residual directions contribute deflates through the first of those by construction. Returns false when the structure or the arguments do not hold, leaving the outputs untouched so a caller falls back to a dense solve. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - d - diagonal of the leading block, any order. * - B - border, p x k. * - A - trailing block, k x k, symmetrised internally. * - evals_asc - ascending eigenvalues, size p + k. * - evecs - matching eigenvectors as columns, (p+k) x (p+k). .. index:: pair: function; cholesky .. _doxid-namespacegpr_1_1linalg_1ad9bb88f58b352c87e3447366e8657837: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool cholesky(const :ref:`EigenMatrix`& C, :ref:`EigenMatrix`& L) Cholesky decomposition (LAPACK equivalent: dpotrf). Decomposes a symmetric positive-definite matrix :math:`C = L L^T`. Dense operations execute in the installed :ref:`Kokkos ` execution space. GPU inputs and results cross the host interface as :ref:`Eigen ` matrices. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - C - Symmetric positive-definite matrix. * - L - Lower-triangular Cholesky factor. .. rubric:: Returns: ``true`` if ``C`` is positive-definite, ``false`` otherwise. .. index:: pair: function; forward_solve .. _doxid-namespacegpr_1_1linalg_1a208886ed87fdcbe0a6dae6f24e345fe8: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd forward_solve(const :ref:`EigenMatrix`& L, const Eigen::VectorXd& b) Forward triangular solve with vector RHS (BLAS equivalent: dtrsv). Solves :math:`L\,x = b` where ``L`` is lower-triangular. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - L - Lower-triangular matrix (e.g. from :ref:`cholesky() `). * - b - Right-hand side vector. .. rubric:: Returns: Solution vector :math:`x = L^{-1} b`. .. index:: pair: function; back_solve .. _doxid-namespacegpr_1_1linalg_1aa1a69cdd59edae23b9e172d95e8e369c: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd back_solve(const :ref:`EigenMatrix`& L, const Eigen::VectorXd& b) Back triangular solve with vector RHS (BLAS equivalent: dtrsv). Solves :math:`L^T x = b` where ``L`` is lower-triangular. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - L - Lower-triangular matrix. * - b - Right-hand side vector. .. rubric:: Returns: Solution vector :math:`x = L^{-T} b`. .. index:: pair: function; forward_solve_mat .. _doxid-namespacegpr_1_1linalg_1a417b3d22ac25d3f063f94582bc960510: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` forward_solve_mat(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B) Forward triangular solve with matrix RHS (BLAS equivalent: dtrsm). Solves :math:`L\,X = B` where ``L`` is lower-triangular. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - L - Lower-triangular matrix. * - B - Right-hand side matrix. .. rubric:: Returns: Solution matrix :math:`X = L^{-1} B`. .. index:: pair: function; back_solve_mat .. _doxid-namespacegpr_1_1linalg_1a1238d9d3df04c238f6cb4017d4ee9708: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` back_solve_mat(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B) Back triangular solve with matrix RHS (BLAS equivalent: dtrsm with side=L, uplo=L, trans=T). Solves :math:`L^T X = B` where ``L`` is lower-triangular. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - L - Lower-triangular matrix. * - B - Right-hand side matrix. .. rubric:: Returns: Solution matrix :math:`X = L^{-T} B`. .. index:: pair: function; forward_solve_mat_colwise_squared_norm .. _doxid-namespacegpr_1_1linalg_1a706e343186d0d13af881633dadbff6c9: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd forward_solve_mat_colwise_squared_norm(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B) Forward triangular solve followed by columnwise squared norms. Solves :math:`L\,X = B` where ``L`` is lower-triangular and returns the vector with entries :math:`\sum_i X_{ij}^2`. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - L - Lower-triangular matrix. * - B - Right-hand side matrix. .. rubric:: Returns: Columnwise squared norms of :math:`X = L^{-1} B`. .. index:: pair: function; bordered_cholesky_diagonal .. _doxid-namespacegpr_1_1linalg_1ac0d9fcfbe4162345447765b76e7106a1: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd bordered_cholesky_diagonal(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& B, const Eigen::VectorXd& prior) Posterior diagonal from bordered Cholesky pivots. Solves :math:`L X=B` and returns the correctly rounded Schur-complement diagonal :math:`D-\operatorname{diag}(X^T X)`. The prior and negative squares are accumulated together, so a small posterior pivot is not formed by subtracting two independently rounded signal-scale values. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - L - Lower-triangular training factor. * - B - Training-query cross covariance. * - prior - Query prior diagonal. .. rubric:: Returns: Squared final pivots of the bordered Cholesky factorizations. .. index:: pair: function; cholesky_inverse .. _doxid-namespacegpr_1_1linalg_1ac1826ee41434ddfb034c7bedad161f28: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` cholesky_inverse(const :ref:`EigenMatrix`& L) Symmetric inverse from Cholesky factor (LAPACK equivalent: dpotri). Computes :math:`C^{-1} = L^{-T} L^{-1}` given the lower-triangular Cholesky factor ``L``. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - L - Lower-triangular Cholesky factor. .. rubric:: Returns: The symmetric positive-definite inverse :math:`C^{-1}`. .. index:: pair: function; trace_product .. _doxid-namespacegpr_1_1linalg_1abdc2c96b6b9837a55b4253ad52545e92: .. ref-code-block:: cpp :class: doxyrest-title-code-block double trace_product(const :ref:`EigenMatrix`& A, const :ref:`EigenMatrix`& B) Frobenius inner product / trace of matrix product. Computes :math:`\operatorname{tr}(A\,B) = \sum_{ij} A_{ij}\,B_{ij}`. Equivalent to the Frobenius inner product when one of the matrices is symmetric. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - A - First matrix. * - B - Second matrix (same dimensions as ``A``). .. rubric:: Returns: The scalar trace-product. .. index:: pair: function; log_det_cholesky .. _doxid-namespacegpr_1_1linalg_1a9d94ae09daf61996ccdaa32863e645e6: .. ref-code-block:: cpp :class: doxyrest-title-code-block double log_det_cholesky(const :ref:`EigenMatrix`& L) Half log-determinant from Cholesky factor. Computes :math:`\sum_i \ln L_{ii} = \tfrac{1}{2}\ln|C|`. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - L - Lower-triangular Cholesky factor. .. rubric:: Returns: The half log-determinant. .. index:: pair: function; satisfies .. _doxid-namespacegpr_1_1linalg_1a15d6bf60aeaf31bad9143a104b7bfc3d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool satisfies(:ref:`ArithmeticClass` provided, :ref:`ArithmeticClass` required) True when a provider of class ``provided`` meets the class ``required``. .. index:: pair: function; symmetricBackwardError .. _doxid-namespacegpr_1_1linalg_1a74af79d48ebc7bd8593a2b248a426514: .. ref-code-block:: cpp :class: doxyrest-title-code-block double symmetricBackwardError(Eigen::Index n, double scale) Higham's gamma_n times a scale: the backward error of a symmetric eigensolver on an n-by-n matrix of that scale. .. index:: pair: function; curvatureIsNegative .. _doxid-namespacegpr_1_1linalg_1a4c7d1144dc87b187935e27bb887e2c0c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool curvatureIsNegative(double lambda, double scale, Eigen::Index n) True when ``lambda`` is negative by more than the backward error of an n-dimensional symmetric solve at ``scale``. A value inside that ball is unresolved, not a negative mode. .. index:: pair: function; canonicalizeEigenpairs .. _doxid-namespacegpr_1_1linalg_1a0f32753962bdbfa168782a24fb850a9a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void canonicalizeEigenpairs(Eigen::Ref evals, Eigen::Ref evecs) ``evals`` has one entry per leading column of ``evecs``. Both are rewritten. .. index:: pair: function; resolvedSingularRank .. _doxid-namespacegpr_1_1linalg_1abc830428feb13216b0e046d01023bce0: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::Index resolvedSingularRank(const Eigen::VectorXd& singular, double cutoff) How many leading descending singular values clear ``cutoff``. A value that the backward error cannot separate from the cutoff, or from its neighbour across the cutoff, is not a resolved component: the whole unresolved cluster is dropped, so two solvers that straddle the cutoff by an ulp keep the same rank. .. index:: pair: function; rank_one_update_lower .. _doxid-namespacegpr_1_1linalg_1a7ef767c0c4cbd45afd79e72fc37cfa52: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool rank_one_update_lower(:ref:`EigenMatrix`& lower, const Eigen::VectorXd& vector) Factor L L^T + u u^T through orthogonal rotations of [L^T; u^T]. The base covariance and the update retain their separate rounding scales. .. index:: pair: function; cholesky_rank_update .. _doxid-namespacegpr_1_1linalg_1a3a572c5972b9e8f003221a1e524efa63: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool cholesky_rank_update(:ref:`EigenMatrix`& lower, const Eigen::VectorXd& vector) Update the selected backend's live Cholesky factor in its existing layout. .. index:: pair: function; assembleCollectively .. _doxid-namespacegpr_1_1linalg_1a96822b6ef7e0aaad911073155ee9e3b8: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void assembleCollectively(const :ref:`MpiContext`& context, Matrices& result, const Body& body) Assemble disjoint entries, propagate failures within the owning group, and replicate the tensors. The body joins its workers before returning; only the calling thread enters MPI collectives. .. index:: pair: function; trace_solve_product .. _doxid-namespacegpr_1_1linalg_1a985151017aab8be56d8762db4a078d4b: .. ref-code-block:: cpp :class: doxyrest-title-code-block double trace_solve_product(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`& A) tr(K^{-1} A) for a dense factor K = L L^T already in hand. The solve is :ref:`Eigen ` 's triangular solve on that matrix. It is not the backend solve: under ScaLAPACK and SLATE, forward_solve_mat scatters its factor into :ref:`DistributedState::cache_L ` and runs a collective. A rank-local LLT, such as one SVGD particle, must not enter that path. .. index:: pair: function; dense_factor_inverse_trace .. _doxid-namespacegpr_1_1linalg_1a1bd598a326ee8c52497d0aa5eebad59a: .. ref-code-block:: cpp :class: doxyrest-title-code-block double dense_factor_inverse_trace(const :ref:`EigenMatrix`& L) tr(K^{-1}) = ||L^{-1}||_F^2 for a dense factor already in hand. Same rank-local rule as trace_solve_product. .. index:: pair: function; configureEnvironmentGpu .. _doxid-namespacegpr_1_1linalg_1a83b5838dd7cd92b059e3110fc1c4a593: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureEnvironmentGpu(const std::string& library) Native entry points select the device before constructing model contexts. Existing models retain their execution context when this default changes. .. index:: pair: function; configureStablePosteriorVariance .. _doxid-namespacegpr_1_1linalg_1a9e6f92edefb29d2ef90eefd0d1e3c2ba: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureStablePosteriorVariance(bool enabled) Turn stable posterior variance reductions on or off for the process. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - enabled - True selects :ref:`ExactSum ` reductions and the checks of requireStablePosteriorVariance; false restores the default paths. .. index:: pair: function; stablePosteriorVarianceEnabled .. _doxid-namespacegpr_1_1linalg_1a5dc693b4fa1509a8c9dff03f8aed1fdb: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool stablePosteriorVarianceEnabled() Whether stable posterior variance reductions are enabled. .. index:: pair: function; acceptStablePosteriorVariance .. _doxid-namespacegpr_1_1linalg_1a78c9776b2bff8f6575403f0b5d2a8829: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool acceptStablePosteriorVariance(double& variance, double signal_variance, double relative_allowance) Accept one stable posterior variance. A nonnegative finite value is unchanged. A negative value at or above -relative_allowance \* signal_variance is replaced by 0. Any more negative value, and any NaN or infinity, is rejected. signal_variance is the variance of the diagonal that entered the reduction: the kernel signal k(x,x), plus observation noise when that noise was added to the same diagonal. For the training-row latent identity the same role is the noise variance that bounds the identity. signal_variance is read only for a negative value. The default relative allowance, kStablePosteriorVarianceRoundoffUlps machine epsilons, covers the rounding of a compensated sum. A Schur complement that follows a rounded Cholesky factorization and triangular solve carries the conditioning of the factor as well; its allowance is choleskySchurRelativeError. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - variance - Variance to check; a roundoff negative becomes 0. * - signal_variance - Variance of the diagonal that entered the sum. * - relative_allowance - Forward error of the reduction relative to signal_variance. A negative value is accepted only when this is finite and below 1: an error of the size of the signal certifies no digit, so clamping to 0 would be a guess. Infinity, NaN and 1 or more reject every negative value. .. rubric:: Returns: False when the value is rejected. .. index:: pair: function; acceptStablePosteriorVariance .. _doxid-namespacegpr_1_1linalg_1a2098a3cce8cba1580b34fff829921300: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool acceptStablePosteriorVariance(double& variance, double signal_variance) acceptStablePosteriorVariance with the compensated-sum allowance. .. index:: pair: function; acceptStablePosteriorVariance .. _doxid-namespacegpr_1_1linalg_1ad9f55fd19a7b5998926c0075c09714e7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool acceptStablePosteriorVariance(Eigen::VectorXd& variance, const Eigen::VectorXd& signal) Accept every entry of a stable posterior variance vector. .. rubric:: Returns: False when the sizes differ or any entry is rejected by the scalar overload; entries before the rejected one may already be clamped. .. index:: pair: function; requireStablePosteriorVariance .. _doxid-namespacegpr_1_1linalg_1a1652fb255b1e608b31bc40200eb6fd0e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void requireStablePosteriorVariance(double& variance, double signal_variance, double relative_allowance) Accept one stable posterior variance or throw. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - StableVarianceError - when acceptStablePosteriorVariance rejects the value. .. index:: pair: function; requireStablePosteriorVariance .. _doxid-namespacegpr_1_1linalg_1a4411830e5a6d50692f8a52da721ee74f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void requireStablePosteriorVariance(Eigen::VectorXd& variance, const Eigen::VectorXd& signal) Accept every entry of a stable posterior variance vector or throw. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - StableVarianceError - when the sizes differ or any entry is rejected. .. index:: pair: function; requireStableSchurDiagonal .. _doxid-namespacegpr_1_1linalg_1a38a32c074de864820e1354b20f7362a5: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void requireStableSchurDiagonal(Eigen::VectorXd& variance, const Eigen::VectorXd& signal, RelativeError&& relative_error) requireStablePosteriorVariance over a Schur diagonal whose allowance is the forward error of a solve. ``relative_error`` is called once, and only when an entry is negative, because it may cost triangular solves or a collective. It must return the same value on every rank that reaches this call. Each entry is then accepted down to -relative_error \* signal; NaN, infinity and anything more negative raise :ref:`StableVarianceError `. This is the one check for diagonals that come from a rounded Cholesky solve, whatever holds the factor. .. index:: pair: function; estimateLowerInverseNorm1 .. _doxid-namespacegpr_1_1linalg_1aa55ce6003eacbe981652752859bf67f9: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double estimateLowerInverseNorm1(Eigen::Index order, Solve&& solve, SolveTranspose&& solve_transpose) Estimate of ||L^-1||_1 for a lower triangular L (Hager, with Higham's alternating-sign probe). ``solve`` applies L^-1 to a vector and ``solve_transpose`` applies L^-T. The estimate is a lower bound on the norm, as in LAPACK's xTRCON, and in practice within a small factor of it. It costs at most ten triangular solves. Infinite when a solve is not finite, which is a singular factor. .. index:: pair: function; choleskySchurRelativeError .. _doxid-namespacegpr_1_1linalg_1a2e17324c6f3a9eae9fde40582167fedc: .. ref-code-block:: cpp :class: doxyrest-title-code-block double choleskySchurRelativeError(Eigen::Index order, double factor_frobenius_norm, double inverse_norm1) Relative forward error of a Schur complement computed from a rounded Cholesky factor and triangular solve. Let L be the computed factor of order m, K + dK = L L^T its backward error, w = L^-1 b the exact solve and w^ the rounded one, and nu = ||L||_F ||L^-1||_1, which bounds kappa_2(L) / sqrt(m) because ||L||_2 <= ||L||_F and ||L^-1||_2 <= sqrt(m) ||L^-1||_1. inverse_norm1 is an upper bound on ||L^-1||_1. A lower bound makes nu, and this allowance, a lower bound on the forward error, so a pivot whose negativity is real roundoff is rejected. With u = eps / 2 and gamma_k = k u / (1 - k u): * substitution solves (L + dL) w^ = b with abs(dL) <= gamma_m abs(L) (Higham, Accuracy and Stability, Thm 8.5), so ||w^ - w||_2 <= a ||w^||_2 with a = gamma_m m nu; * Cholesky has abs(dK) <= gamma\_{m+1} abs(L) abs(L^T) (Thm 10.3), which moves b^T K^-1 b by at most b_f ||w||^2 with b_f = gamma\_{m+1} m^2 nu^2. A valid Schur complement has ||w||^2 <= prior, so the computed one prior - ||w^||^2 is off by at most (a (2 + a) + b_f) / (1 - a - b_f)^2 of the prior, plus one rounding of the result, eps. The value is infinite when a + b_f >= 1 or when the bound itself is 1 or more: an error as large as the signal leaves no certified digit, and no negative result can be called roundoff. .. index:: pair: function; upperInverseNorm1FromComputed .. _doxid-namespacegpr_1_1linalg_1a4c677f57e1f25457d5f45664b08b0c09: .. ref-code-block:: cpp :class: doxyrest-title-code-block double upperInverseNorm1FromComputed(double computed_norm, Eigen::Index order) Upper bound on ||L^-1||_1 from a computed inverse's 1-norm. Column sums of a computed inverse can round down, so the value passed to choleskySchurRelativeError is lifted by the unit roundoff of an order-length sum. This is not estimateLowerInverseNorm1: that function is a lower bound and is not an error bound. .. index:: pair: function; upperInverseNorm1FromResidual .. _doxid-namespacegpr_1_1linalg_1a998047d8956fcbb38573d684103e4b05: .. ref-code-block:: cpp :class: doxyrest-title-code-block double upperInverseNorm1FromResidual(double computed_norm, double residual_norm, double factor_abs_norm, Eigen::Index order) Upper bound on ||L^-1||_1 from a computed triangular solve. ``computed_norm`` is ||Y||_1 for Y solving L Y = I, ``residual_norm`` is ||I - L Y||_1, and ``factor_abs_norm`` is ||L||_1. The residual is enlarged by the rounding of I - L Y (Higham), and the result is lifted by upperInverseNorm1FromComputed. A column-sum lift alone is not a certificate: it leaves out the triangular-solve error. A non-finite argument or a residual bound of 1 or more is infinite. .. index:: pair: function; upperInverseNorm1 .. _doxid-namespacegpr_1_1linalg_1a2c95eb7e061d3e8c667068e456457ad9: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double upperInverseNorm1(const Eigen::MatrixBase& factor) Upper bound on ||L^-1||_1 for an explicit lower-triangular factor. Y solves L Y = I. The bound is upperInverseNorm1FromResidual. A singular or non-finite solve is infinite. .. index:: pair: function; denseCholeskySchurRelativeError .. _doxid-namespacegpr_1_1linalg_1ab46c7a989d0e9781b2dbd7a672dfaa94: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double denseCholeskySchurRelativeError(const Eigen::MatrixBase& factor) choleskySchurRelativeError of a dense lower Cholesky factor. The inverse norm is upperInverseNorm1, an upper bound. The Hager estimate is a lower bound and is not used here. .. index:: pair: function; subsetFactorSchurRelativeError .. _doxid-namespacegpr_1_1linalg_1a05f71dc388f3720ce9981d84aa1df6a3: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double subsetFactorSchurRelativeError(Backend& backend, const Eigen::MatrixBase& factor, int order) Schur relative error of a variance-subset factor. A dense host factor is read with denseCholeskySchurRelativeError. An empty host factor is what a distributed factorization leaves behind: the factor is cached on the backend, and the empty matrix reads as +inf, which makes borderedCholeskyDiagonal fall back to four ulps. The backend's cached_factor_schur_relative_error is that factor's conditioning. ``order`` is the cached factor's dimension. .. index:: pair: function; borderedCholeskyDiagonalWith .. _doxid-namespacegpr_1_1linalg_1aba1009abf0cfa9a14519d4fc5f381db2: .. ref-code-block:: cpp :class: doxyrest-title-code-block template Eigen::VectorXd borderedCholeskyDiagonalWith(const Eigen::VectorXd& prior, const Eigen::MatrixBase& whitened, RelativeError&& relative_error) Squared final pivots of bordered Cholesky factorizations. If ``whitened`` is :math:`W=L^{-1}K_{tq}`, entry :math:`j` is .. math:: \ell_j^2 = K_{qq,jj} - \sum_i W_{ij}^2, the square of the last diagonal in the Cholesky factor of :math:`\begin{bmatrix}LL^T&K_{tq}\\K_{tq}^T&K_{qq,jj}\end{bmatrix}`. :ref:`ExactSum ` accumulates the prior and every negative square without rounding; only the final result is rounded to binary64. Consequently the reduction error is at most one rounding of the local posterior variance, rather than :math:`\gamma_n K_{qq,jj}` from a length- :math:`n` dot product followed by a cancellation. .. index:: pair: function; borderedCholeskyDiagonal .. _doxid-namespacegpr_1_1linalg_1ae65a21618ae4a664407f6a3d353a97a9: .. ref-code-block:: cpp :class: doxyrest-title-code-block template Eigen::VectorXd borderedCholeskyDiagonal(const Eigen::VectorXd& prior, const Eigen::MatrixBase& whitened) borderedCholeskyDiagonal for a whitened block L^-1 K_tq with no factor in hand: the allowance is the rounding of the compensated sum alone. .. index:: pair: function; borderedCholeskyDiagonal .. _doxid-namespacegpr_1_1linalg_1a7146388b62110ce8f57d7ef60882a33d: .. ref-code-block:: cpp :class: doxyrest-title-code-block template Eigen::VectorXd borderedCholeskyDiagonal(const Eigen::VectorXd& prior, const Eigen::MatrixBase& whitened, const Eigen::MatrixBase& factor) borderedCholeskyDiagonal for W = L^-1 K_tq solved with the dense lower factor ``factor``; the allowance is choleskySchurRelativeError of that factor. An empty factor means the factor is not held on the host (it is resident on a device), so its conditioning cannot be read; the allowance is then that of the two-argument form. .. index:: pair: function; borderedCholeskyActionVarianceWith .. _doxid-namespacegpr_1_1linalg_1a8350833c7155a0567bf53f468ea6633a: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double borderedCholeskyActionVarianceWith(const Eigen::MatrixBase& prior, const Eigen::MatrixBase& weights, const Eigen::MatrixBase& whitened_action, RelativeError&& relative_error) Variance of a linear query action from its bordered Cholesky solve. The prior action :math:`w^T K_{qq}w` and the negative squared entries of :math:`L^{-1}K_{tq}w` share one exact accumulator. This is the scalar bordered-Cholesky pivot for a directional or integrated observation. .. index:: pair: function; borderedCholeskyActionVariance .. _doxid-namespacegpr_1_1linalg_1a326eae48b615036cab4c4af49b28f10c: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double borderedCholeskyActionVariance(const Eigen::MatrixBase& prior, const Eigen::MatrixBase& weights, const Eigen::MatrixBase& whitened_action) borderedCholeskyActionVariance with the compensated-sum allowance. .. index:: pair: function; borderedCholeskyActionVariance .. _doxid-namespacegpr_1_1linalg_1ace14d38cbeeb0026f0232b5ef6b91784: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double borderedCholeskyActionVariance(const Eigen::MatrixBase& prior, const Eigen::MatrixBase& weights, const Eigen::MatrixBase& whitened_action, const Eigen::MatrixBase& factor) borderedCholeskyActionVariance for L^-1 K_tq w solved with the dense lower factor ``factor``, with the allowance of choleskySchurRelativeError. .. index:: pair: function; pcg_dot .. _doxid-namespacegpr_1_1linalg_1afc698c4f7f6cec887addeb16b77b6fef: .. ref-code-block:: cpp :class: doxyrest-title-code-block double pcg_dot(const Eigen::VectorXd& a, const Eigen::VectorXd& b) Inner product over the replicated CG state. The solver runs the same loop on every rank with x, r, p, z held identically replicated, and apply_A returns an already-assembled (replicated) matvec, so each rank's long-double dot is the full inner product. No cross-rank reduction is taken: summing the P identical replicated copies would scale every dot by P (harmless in the alpha/beta ratios) but the long-double accumulation of P identical doubles rounds differently per rank count, so a reduction here makes the CG trajectory match only within a fixed-P group. Returning the local replicated dot is bit-identical at every rank count. .. index:: pair: function; preconditioned_cg .. _doxid-namespacegpr_1_1linalg_1a5d2447739fec88c46dca1a0f254b89ae: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`PCGResult` preconditioned_cg(const std::function& apply_A, const std::function& apply_M_inv, const Eigen::VectorXd& b, const :ref:`PCGSettings`& settings = {}) Preconditioned conjugate gradient on a SPD matrix A whose action on a vector is given by ``apply_A``. The preconditioner inverse is ``apply_M_inv``. Both are evaluated once per CG iteration. The full CG state (x, r, p, z) is replicated on every rank; ``apply_A`` returns a replicated matvec, so the inner products inside the loop are taken locally without MPI. Each iteration performs: * 1 matvec A @ p * 1 precondit z = M^{-1} r * 3 inner prod p^T A p, r^T z, ||r||^2 (latter for tolerance check) * 2 axpy x += alpha p; r -= alpha A p * 1 vec sum p = z + beta p pcg_dot accumulates in long double over the replicated vector, so the floating-point trajectory of CG is bit-identical at every rank count when the matvec and preconditioner are also bit-identical. .. index:: pair: function; kokkosHostExecutionMemory .. _doxid-namespacegpr_1_1linalg_1a32e6e03c434ec1b9aa2af9e807609b4e: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool kokkosHostExecutionMemory() True when the :ref:`Kokkos ` execution memory is the host. A non-Kokkos build does not call this. Host memory is already the execution space, so a factor that lives in an :ref:`Eigen ` matrix does not cross a boundary. .. index:: pair: function; distributedFactorization .. _doxid-namespacegpr_1_1linalg_1ab00a5d8c1d187108ecc19a1c3456641a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DistributedFactorization` distributedFactorization() Process-wide selection; Reproducible unless configured otherwise. .. index:: pair: function; distributedFactorizationGeneration .. _doxid-namespacegpr_1_1linalg_1a0a77b74818875412429f016490bd76dc: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::uint64_t distributedFactorizationGeneration() Changes each time the selection changes. A cached factor, inverse or replica records the generation it was computed under and is not reused under another one. .. index:: pair: function; configureDistributedFactorization .. _doxid-namespacegpr_1_1linalg_1ad2abc95c89c56497c8b91d931ccb3e85: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureDistributedFactorization(:ref:`DistributedFactorization` mode) Select the distributed factorization and reapply the configured thread count, since the BLAS thread policy depends on the selection. .. index:: pair: function; parseDistributedFactorization .. _doxid-namespacegpr_1_1linalg_1a384fc8c768c6c45db0ff610ee150f5ac: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::optional<:ref:`DistributedFactorization`> parseDistributedFactorization(std::string_view name) "reproducible" or "library"; anything else gives no value. .. index:: pair: function; configuredLinalgThreads .. _doxid-namespacegpr_1_1linalg_1ace93b32baf0331840bc55c683e24fba9: .. ref-code-block:: cpp :class: doxyrest-title-code-block int configuredLinalgThreads() Requested dense numerical budget, independent of nested BLAS controls. .. index:: pair: function; configureLinalgThreads .. _doxid-namespacegpr_1_1linalg_1a6ae3f601145b66d014b75014f6de5386: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureLinalgThreads(int threads) Configure the process thread budget before concurrent numerical work. Keeping the call inside the library reaches private static BLAS symbols without exposing them to an oracle's BLAS runtime. The count is a process-wide run parameter; set it before constructing models. :ref:`Eigen ` and BLAS search products keep one fixed reduction order; canonical tiles and panels spend the requested budget in parallel without changing their inner product order. The count is also the OpenMP team of kernel and Hessian assembly. The OpenMP runtime receives the same count, so ``OMP_NUM_THREADS`` does not fight the team. .. index:: pair: function; configureProductThreads .. _doxid-namespacegpr_1_1linalg_1a4f5a4c2748fea685eaeac9b28cd0fed0: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureProductThreads(int threads) Thread count of :ref:`Eigen ` and BLAS products alone, leaving :ref:`configuredLinalgThreads() ` unchanged. This low-level control honours its argument; callers that require invariant reductions explicitly select one thread per independently scheduled tile. .. index:: pair: function; configureLibrarySerialKernels .. _doxid-namespacegpr_1_1linalg_1ac112e7f87d74c4b3d65a5af02406d56b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureLibrarySerialKernels(bool enabled) When set, the dense factor and the triangular solves use :ref:`Eigen ` 's library kernels (LAPACK when BLAS is linked) instead of the OpenMP panel kernels. One thread is the serial baseline the scaling notes compare with the panel path. Clearing the flag restores the panel kernels for a team of more than one. A single configured thread stays on :ref:`Eigen ` 's factor and triangular solve: the panel kernels are a different rounding even with one worker, and the oracle counts were measured on :ref:`Eigen `. .. index:: pair: function; configureUnconstrainedLibraryReductions .. _doxid-namespacegpr_1_1linalg_1ae487a1bc732788714a5a550190d39ae6: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureUnconstrainedLibraryReductions(bool enabled) Opt into unconstrained library reductions (e.g. SLATE MethodTrsm::Auto hypercube reductions and unaligned ScaLAPACK slab views) for diagnostic overhead comparisons. Disabled by default so both Reproducible and Library factorizations preserve canonical tile order across ranks, grids and threads. .. index:: pair: function; configureTileThreads .. _doxid-namespacegpr_1_1linalg_1aac9715caa460a943643efa7fc3b8fab0: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureTileThreads(int threads) Threads one rank devotes to independent tile products of the canonical factorization and solves. Each product runs on one thread, so the values do not depend on this count. Under the Library factorization the tiles stay on the calling thread as well. .. index:: pair: function; affinityCpuCount .. _doxid-namespacegpr_1_1linalg_1ae3982fda47a52fe1d19dc9b511fbcaa8: .. ref-code-block:: cpp :class: doxyrest-title-code-block int affinityCpuCount() CPUs in this process's scheduling affinity, or 0 when unknown. .. index:: pair: function; blasThreadCount .. _doxid-namespacegpr_1_1linalg_1a04d86fdfffbbfb7769e663b782b7b033: .. ref-code-block:: cpp :class: doxyrest-title-code-block int blasThreadCount() Actual thread count of the BLAS runtime linked inside this library, or zero when the build uses no OpenBLAS runtime. .. index:: pair: function; teamPanelKernels .. _doxid-namespacegpr_1_1linalg_1a3335330bd33edb478821a9865e10441a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool teamPanelKernels() Panel factorization and substitution. False when the library serial flag is set, when OpenMP is off, and when the configured team is one thread. The one-thread case is :ref:`Eigen ` 's own kernels. .. index:: pair: function; configureKernelThreads .. _doxid-namespacegpr_1_1linalg_1ac10263e724d6c8edf19bc9dbf708ee79: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureKernelThreads(int threads) Process default captured by subsequently constructed local executors. Configure before constructing models; CPU allocation and BLAS thread limits belong to the application that owns the process. .. index:: pair: function; refreshKernelTeam .. _doxid-namespacegpr_1_1linalg_1a830b7adda8555bc5746389ce45e08a8f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void refreshKernelTeam() Recompute the default team from the requested kernel threads and the configured linalg threads: the larger of the two when a parallel runtime is built in. configureLinalgThreads calls this. .. index:: pair: function; blockCyclicLocalExtent .. _doxid-namespacegpr_1_1linalg_1a9708435021a8ce9d262f17d001be79a6: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::int64_t blockCyclicLocalExtent(std::int64_t n, std::int64_t nb, std::int64_t iproc, std::int64_t isrc, std::int64_t nprocs) NUMROC in 64-bit arithmetic: the number of the n entries of one dimension, distributed in blocks of nb over nprocs processes starting at process isrc, that process iproc owns. Returns 0 for a non-positive order, block or process count. .. index:: pair: function; largestLocalEntries .. _doxid-namespacegpr_1_1linalg_1a5e585911dd7ef2a84aea630e16421af6: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::int64_t largestLocalEntries(std::int64_t m, std::int64_t n, std::int64_t mb, std::int64_t nb, std::int64_t rsrc, std::int64_t csrc, std::int64_t nprow, std::int64_t npcol) Entries of the largest local array (leading dimension times local columns) any process of an nprow x npcol grid holds for an m x n matrix in mb x nb blocks whose first block sits on process (rsrc, csrc). The source process owns the most rows and the most columns: it receives every complete round of blocks plus the first leftover block. The leading dimension is taken as max(1, local rows) of that process, the convention of every descriptor :ref:`DistributedState ` builds; a descriptor whose leading dimension exceeds the largest local row count on some process is outside this bound (see exceedsLp64). .. index:: pair: function; largestLocalEntries .. _doxid-namespacegpr_1_1linalg_1a176307acab9059d75e8a7ea889295b63: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::int64_t largestLocalEntries(const int* desc, int nprow, int npcol) largestLocalEntries for a ScaLAPACK descriptor on an nprow x npcol grid. The leading dimension field is also taken into account, so a descriptor with a padded leading dimension is measured by the array it describes. .. index:: pair: function; lp64IndexLimitStore .. _doxid-namespacegpr_1_1linalg_1a377f7bac17f9942b9f7f9d64360ba7c4: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::atomic& lp64IndexLimitStore() Limit the routing decision compares against: kLp64IndexLimit, unless a :ref:`ScopedLp64IndexLimit ` lowers it so tests reach the routed paths at small orders. The value is the inline copy of the translation unit that decides. .. index:: pair: function; exceedsLp64 .. _doxid-namespacegpr_1_1linalg_1a786ba2c46307e7531e21483be210932a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool exceedsLp64(const int* desc, int nprow, int npcol) True when an LP64 ScaLAPACK routine on this descriptor would form an element offset past 2^31 - 1 on some process of the grid. Every process that passes the same descriptor fields gets the same answer, except where processes pass different leading dimensions; the descriptors :ref:`DistributedState ` builds use max(1, local rows), whose largest value is the source process's row count, and give the same answer everywhere. .. index:: pair: function; exceedsLp64 .. _doxid-namespacegpr_1_1linalg_1a6a9301af6b70905be17d377565bef5f2: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool exceedsLp64(std::int64_t count) True when an element count or workspace size does not fit LP64 INTEGER. .. index:: pair: function; availableHostBudget .. _doxid-namespacegpr_1_1linalg_1ab618305f3e81abe8215225aedf8cb996: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`AvailableMemory` availableHostBudget() Node headroom restricted by visible cgroup v1 and v2 ancestors. Null means unknown; zero means the allocation has exhausted a measured limit. .. index:: pair: function; availableHostBytes .. _doxid-namespacegpr_1_1linalg_1aecdbc91f89f2e714a86d0bef0ecda605: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::int64_t availableHostBytes() Compatibility query: zero represents unknown or exhausted availability. Allocation decisions use availableHostBudget to distinguish the two. .. index:: pair: function; fitsRankShare .. _doxid-namespacegpr_1_1linalg_1ad441ff0b6aba13fce1ef1a44a043f52e: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool fitsRankShare(std::int64_t needed, std::int64_t available, int node_ranks) True when needed bytes fit this rank's share of available bytes split evenly over the ranks of the node. Unknown availability (zero) fits. .. index:: pair: function; requireRankShare .. _doxid-namespacegpr_1_1linalg_1ab792c9a07d3b69347ffff93c5c1c749b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void requireRankShare(const char* what, std::int64_t needed, :ref:`AvailableMemory` available, int node_ranks) Throws std::runtime_error naming what, the bytes it needs per rank and this rank's share when needed does not fit fitsRankShare. .. index:: pair: function; replicate_owned_values .. _doxid-namespacegpr_1_1linalg_1a7b1d26a6f42a03c70b24ce2b0c60de01: .. ref-code-block:: cpp :class: doxyrest-title-code-block void replicate_owned_values(double* data, std::size_t count, const :ref:`MpiContext`& context) Replicate entries with exactly one owner and positive zero elsewhere. Integer OR preserves the owner's bits, including signed zero, without rounding or a rank-dependent floating-point reduction. .. index:: pair: function; disjoint_sum_bcast .. _doxid-namespacegpr_1_1linalg_1a23613633c328ba650de90ae07578b0a8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void disjoint_sum_bcast(double* data, int count, const :ref:`MpiContext`& context) Replicate a sum with at most one nonzero contributor per entry. Adding positive zeros preserves that contributor's value regardless of the reduction tree. Overlapping contributions require ordered_sum_bcast. .. index:: pair: function; ordered_sum_bcast .. _doxid-namespacegpr_1_1linalg_1a500f587c3ddf0a29e74bc7fed11b4cc7: .. ref-code-block:: cpp :class: doxyrest-title-code-block void ordered_sum_bcast(double* data, int count, const :ref:`MpiContext`& context) :ref:`Sum ` overlapping contributions in rank order and replicate the result. Only the supplied process group participates. Local views enter no MPI. .. index:: pair: function; compensated_sum_bcast .. _doxid-namespacegpr_1_1linalg_1a2658c0737e131a29c01634c34a96f464: .. ref-code-block:: cpp :class: doxyrest-title-code-block void compensated_sum_bcast(:ref:`CompensatedSum`* data, int count, const :ref:`MpiContext`& context) Merge compensated contributions in rank order, retaining the rounding error from adding their main sums in the resulting correction. .. index:: pair: function; exact_sum_bcast .. _doxid-namespacegpr_1_1linalg_1a959e633884d59e1c84b4e2b822ea76c8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void exact_sum_bcast(:ref:`ExactSum`* sums, int count, const :ref:`MpiContext`& context) Replace each accumulator by the exact sum over the process group and replicate the result. Digits are integers, so the reduction is associative: the outcome does not depend on the rank count, the reduction tree or the way the addends were split over ranks. .. index:: pair: function; schemeISliceBits .. _doxid-namespacegpr_1_1linalg_1a500d8985d600cd1976d17334e8157952: .. ref-code-block:: cpp :class: doxyrest-title-code-block int schemeISliceBits(Eigen::Index length) Bit width of one Ozaki Scheme I slice for a product of ``length`` terms. Two slices of this width have an exact binary64 product, and the sum of ``length`` such products is exact as well, with the slice scales kept separate. .. index:: pair: function; splitSchemeI .. _doxid-namespacegpr_1_1linalg_1a7e43297f8143c05e27bafeb1d5748f7f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`SchemeISlices` splitSchemeI(const Eigen::Ref& values) Split one operand into Scheme I slices. The sum of the slices is the operand. This split does not form the product. .. index:: pair: function; accumulateSchemeI .. _doxid-namespacegpr_1_1linalg_1a630fecb73d9b791fd6e9072ae56d7405: .. ref-code-block:: cpp :class: doxyrest-title-code-block double accumulateSchemeI(const :ref:`SchemeISlices`& left, const :ref:`SchemeISlices`& right) :ref:`Sum ` the exact slice products. The split and this accumulation are separate. .. index:: pair: function; schemeIProductRaw .. _doxid-namespacegpr_1_1linalg_1a03d51724611b26f04b66c579fcee54b0: .. ref-code-block:: cpp :class: doxyrest-title-code-block double schemeIProductRaw(const double* left, const double* right, int length) Scheme I product of two length-n factors in term order. .. index:: pair: function; schemeIProduct .. _doxid-namespacegpr_1_1linalg_1a1f8e47e6e4142aebb561725db62455e7: .. ref-code-block:: cpp :class: doxyrest-title-code-block template double schemeIProduct(const Eigen::MatrixBase& left, const Eigen::MatrixBase& right) Scheme I product of two equally shaped operands, in the same term order as the compensated predict contraction (column, then row). .. index:: pair: function; disjoint_sum_bcast .. _doxid-namespacegpr_1_1linalg_1ac3c35330df7aa3e305322ee0f78671c2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void disjoint_sum_bcast(double* data, int count, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()) Reduction for buffers whose per-rank contributions have DISJOINT support: every entry is nonzero on at most one rank and +0.0 (from setZero) everywhere else. IEEE-754 addition gives x + (+0.0) = x and (+0.0) + (+0.0) = +0.0 exactly, so MPI_SUM under any reduction tree returns the unique contributor bit-for-bit identical to ordered_sum_bcast and to the single-rank assembly, at MPI_Allreduce's O(log P) cost instead of the Gather(P \* count) + root long-double sum + Bcast round-trip. Applies to the one-owner-per-block covariance assemblies (ownsBlock gating writes each block and its transpose partner from exactly one rank via assignBlockToMatrix assignment, never accumulation). Overlapping partial sums (per-rank training-slice means, trace terms, scalar log-marginal contributions) require ordered_sum_bcast to fix their reduction order for a given partition. Different partitions can produce different rounded local sums. .. index:: pair: function; lp64Workspace .. _doxid-namespacegpr_1_1linalg_1a873da7d69d92a775ca9628c4da71e1d8: .. ref-code-block:: cpp :class: doxyrest-title-code-block int lp64Workspace(double query, const char* routine, const :ref:`DistributedState`& st) LP64 INTEGER workspace length from the ScaLAPACK workspace query result query. The largest query over the grid decides, so every process either proceeds or throws std::length_error naming routine. Collective. .. index:: pair: function; columnSquaredNormsExact .. _doxid-namespacegpr_1_1linalg_1a142ed1827d1edeaf8fc5580617b818cf: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd columnSquaredNormsExact(const std::vector& buf, const int* desc, int m, int ncols, :ref:`DistributedState`& st) Column-wise sums of squares of a block-cyclic matrix whose tiles are owned whole by one rank. Each tile column contributes a partial sum accumulated in a fixed order inside the tile; the partials enter an exact accumulator, so the replicated result is independent of the grid. .. index:: pair: function; cachedFactorSchurRelativeError .. _doxid-namespacegpr_1_1linalg_1a113ffa650f8c9938c78315141cd79c4a: .. ref-code-block:: cpp :class: doxyrest-title-code-block double cachedFactorSchurRelativeError(int m, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()) Relative forward error of a Schur complement formed from the cached distributed factor (choleskySchurRelativeError). ||L||_F is summed over the lower triangle of the local blocks. ||L^-1||_1 is upperInverseNorm1FromResidual: the 1-norm of the inverse from one cached triangular solve, corrected by the residual of that solve. A column-sum lift alone leaves out the triangular-solve error and is not a certificate. The factor itself is never gathered. Every rank receives the same value, and every rank must call it. .. index:: pair: function; requireCachedFactorSchurDiagonal .. _doxid-namespacegpr_1_1linalg_1afc97b984c91699b26fa1bbc5ee41300b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void requireCachedFactorSchurDiagonal(Eigen::VectorXd& diagonal, const Eigen::VectorXd& prior, int m, :ref:`DistributedState`& st) requireStablePosteriorVariance over a Schur diagonal formed from the cached distributed factor. The diagonal is replicated, so every rank asks for the conditioning together or none does, and every rank throws together. .. index:: pair: function; forward_solve_mat_bilinear_distributed .. _doxid-namespacegpr_1_1linalg_1ae33e1d39a1de20e5d43e2472699ea104: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EigenMatrix` forward_solve_mat_bilinear_distributed(const :ref:`EigenMatrix`& L, std::vector b_buf, const int* desc_b, int m, int ncols, :ref:`DistributedState`& st = :ref:`DistributedState::instance`(), const Eigen::VectorXd* prior = nullptr, Eigen::VectorXd* posterior_diagonal = nullptr) Distributed bilinear form M = (L^{-1} KK)^T (L^{-1} KK). Given the lower Cholesky factor L of the training kernel K (m x m, scattered into the :ref:`DistributedState ` cache on first use, reused on subsequent calls) and a distributed cross-covariance buffer KK_dist (m x ncols, block-cyclic with descriptor desc_kk), returns the small ncols x ncols matrix M = (L^{-1} KK)^T (L^{-1} KK). Used by :ref:`GaussianProcessRegression::calculateObservationPosteriorCovariance ` to compute the posterior covariance between joint query channels: K_post(i, j) = K_qq(i, j) - M(i, j), since K^{-1} = L^{-T} L^{-1} so KK^T K^{-1} KK = (L^{-1} KK)^T (L^{-1} KK). The factor, triangular solve and symmetric product stay distributed. Only the ncols x ncols result is gathered for the caller. .. index:: pair: function; cholesky_inverse_diagonal_distributed .. _doxid-namespacegpr_1_1linalg_1a7aa8f32fce74978bae6f350565a37779: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd cholesky_inverse_diagonal_distributed(const :ref:`EigenMatrix`& L, int order, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()) Diagonal of (L L^T)^-1 from distributed columns of L^-1. Triangular inversion avoids solving for the known zero upper triangle. The owned factor is immutable; only the resulting diagonal is replicated. .. index:: pair: function; factor_inverse_lower .. _doxid-namespacegpr_1_1linalg_1ac4799568131ea843de9be521875bb0e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool factor_inverse_lower(const :ref:`EigenMatrix`& L, int n, std::vector& inverse, int* desc, :ref:`DistributedState`& st) Lower triangle of C^{-1}, in the layout of the cached factor of order n (L, when not empty, replaces the cache first). The reproducible factorization forms it with the tile-ordered inverse, whose bits do not depend on the grid; the library factorization uses pdpotri. The inverse costs about 2n^3/3, against 2n^3 for substitutions on n columns. It is returned, not cached. Returns false when the library inverse fails. .. index:: pair: function; trace_lower_symmetric_local .. _doxid-namespacegpr_1_1linalg_1a46b0e19c3338ca88de24d0918dbf89e7: .. ref-code-block:: cpp :class: doxyrest-title-code-block template :ref:`ExactSum` trace_lower_symmetric_local(const double* A, int lda, int n, Entry&& b, :ref:`DistributedState`& st) This rank's exact share of tr(A B) for symmetric n x n matrices: A is read on its lower triangle in the layout of desc (leading dimension lda), and b(i, j) returns entry (i, j) of B for i >= j. Off-diagonal products count twice. Every product enters the accumulator exactly, so the merged sum does not depend on how the entries are distributed. .. index:: pair: function; trace_inverse_times_symmetric .. _doxid-namespacegpr_1_1linalg_1a9869fd2ea595b121c93b605ee956e2df: .. ref-code-block:: cpp :class: doxyrest-title-code-block double trace_inverse_times_symmetric(const :ref:`EigenMatrix`& L, const :ref:`EigenMatrix`* B, int n, :ref:`DistributedState`& st = :ref:`DistributedState::instance`()) tr(C^{-1} B) for a symmetric replicated B, or tr(C^{-1}) when B is null, from the inverse of the factor (see factor_inverse_lower). The same formula runs at every rank count. Returns NaN when the inverse fails. .. index:: pair: function; teamDivideConquerEigen .. _doxid-namespacegpr_1_1linalg_1adf2c872f0f7fea542df277cb04fc3b72: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool teamDivideConquerEigen(const Eigen::MatrixXd& sym, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs) Ascending eigenpairs of a symmetric matrix. :ref:`Eigen ` 's blocked Householder tridiagonalization, compiled without a BLAS kernel. The pairs do not follow the OpenBLAS microkernel or the thread count. Returns false when the order is not square or the solver fails. .. index:: pair: function; covarianceDsyevr .. _doxid-namespacegpr_1_1linalg_1ae82c3e1ce9d5b8c184601e12699c9096: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool covarianceDsyevr(const Eigen::MatrixXd& sym, Eigen::VectorXd& evals, Eigen::MatrixXd& evecs) Covariance eigensolve used by the stable basis. :ref:`Eigen ` 's symmetric eigensolver, range all, lower triangle. The pairs do not follow the OpenBLAS microkernel. .. index:: pair: function; teamPanelWidth .. _doxid-namespacegpr_1_1linalg_1ae1a2c71ec7b0f9686ab30544b21ceb5f: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::int64_t teamPanelWidth() Column panel of the triangular solve. The width is the largest power of two whose panel fits in one core's level-2 cache at the joint order of the scaling grid. ``TeamFactor.cpp`` states that rule. The solve bits do not follow this width: teamPanelBitsIndependent checks that. .. index:: pair: function; teamPanelBitsIndependent .. _doxid-namespacegpr_1_1linalg_1a6aac5ae19b76d4aa275ab4f9f5759fe7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool teamPanelBitsIndependent() True when a one-thread solve, a one-column panel, and the derived panel write the same bits on one lower factor. The check is the sweep behind the claim that the published solve does not depend on the panel width. .. index:: pair: function; teamSolveWallSeconds .. _doxid-namespacegpr_1_1linalg_1a4a682b23908b82f22b7af20097d30031: .. ref-code-block:: cpp :class: doxyrest-title-code-block double teamSolveWallSeconds() Wall time accumulated by dense and distributed triangular solves since the last reset. .. index:: pair: function; teamFactorWallSeconds .. _doxid-namespacegpr_1_1linalg_1a43645ebba42092b8719ee9f37c3d04ab: .. ref-code-block:: cpp :class: doxyrest-title-code-block double teamFactorWallSeconds() Wall time accumulated by dense and distributed Cholesky factors since the last reset. .. index:: pair: function; teamParallelPays .. _doxid-namespacegpr_1_1linalg_1a5dc4f61d247f1c326f569f3f76677322: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool teamParallelPays(double flops) False. Vendor BLAS already uses the affinity count, so this function does not start a second team. The flop argument is ignored. There is no cutoff and no saved clock. .. index:: pair: function; teamCholeskyLower .. _doxid-namespacegpr_1_1linalg_1a7d603d764ad6a414798eb2f55ecea5ec: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool teamCholeskyLower(double* lower, std::int64_t lda, std::int64_t n) Lower Cholesky of a column-major matrix. Only the lower triangle is read and written. The factor is :ref:`Eigen ` 's blocked Cholesky, compiled without a BLAS kernel. Returns false when a pivot is not positive; the matrix may then be partly overwritten. .. index:: pair: function; teamSolveLower .. _doxid-namespacegpr_1_1linalg_1a1b2ce571e30a0c7d05b94fc99bbf163d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void teamSolveLower(const double* lower, std::int64_t lda, bool lower_factor, double* rhs, std::int64_t ldb, std::int64_t n, std::int64_t cols) Solves L X = B (lower == true) or L^T X = B, L stored lower-triangular and column-major. The substitution is :ref:`Eigen ` 's blocked triangular solve, compiled without a BLAS kernel. .. index:: pair: function; teamSolveLowerVector .. _doxid-namespacegpr_1_1linalg_1a0c9921c89647b568fec41d95ab62aaae: .. ref-code-block:: cpp :class: doxyrest-title-code-block void teamSolveLowerVector(const double* lower, std::int64_t lda, bool lower_factor, double* rhs, std::int64_t n) The solve above for one right-hand side held as a vector. It runs :ref:`Eigen ` 's matrix-vector triangular sweep, the kernel a serial build runs on a vector, so a vector solve has the same bits in every build. A one-column matrix goes to teamSolveLower and its blocked matrix kernel. .. index:: pair: function; teamSymmetricGram .. _doxid-namespacegpr_1_1linalg_1a49f39f850aced6434a58b610f855c4d7: .. ref-code-block:: cpp :class: doxyrest-title-code-block void teamSymmetricGram(const double* b, std::int64_t ldb, double* c, std::int64_t ldc, std::int64_t n) The three kernels below run on :ref:`configuredLinalgThreads() ` workers of the tile pool. Each worker owns whole blocks of :ref:`Eigen ` 's own blocking, so the bits do not follow the thread count. C = B^T B for a column-major B. The product is :ref:`Eigen ` 's blocked product, compiled without a BLAS kernel, so the bits do not follow OPENBLAS_CORETYPE. .. index:: pair: function; tileThreadCount .. _doxid-namespacegpr_1_1linalg_1aec0ab6efdb3aa8b6573443eb78551365: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::atomic& tileThreadCount() Number of threads one rank devotes to independent tile products. .. index:: pair: function; setTileThreads .. _doxid-namespacegpr_1_1linalg_1a07715767cc4731d01ac89abe9c3a31e2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setTileThreads(int threads) Sets the tile thread count (at least one). .. index:: pair: function; parallelFor .. _doxid-namespacegpr_1_1linalg_1a72b6338c65901849a95e2a69b9c8374a: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void parallelFor(long count, F&& fn) parallelFor(count, fn): see :ref:`TilePool::run `. .. index:: pair: function; trainingCholeskySelected .. _doxid-namespacegpr_1_1linalg_1ac275e0f7b35a12eff35a1a81ca032617: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool trainingCholeskySelected(Eigen::Index order) A product library or an in-process Scheme II engine is configured and the order spans two panels. .. index:: pair: function; trainingCholeskyDistributedSelected .. _doxid-namespacegpr_1_1linalg_1af6caa0619010413ce4279907de02c368: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool trainingCholeskyDistributedSelected(Eigen::Index order) As trainingCholeskySelected, for trainingCholeskyDistributed: device libraries only. .. index:: pair: function; trainingCholeskyLower .. _doxid-namespacegpr_1_1linalg_1a4b6d9bb00e34efd4249719646e197468: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool trainingCholeskyLower(:ref:`ProductMatrix` lower) Panel boundaries are independent of the process grid. Fixed-order scalar code factors and solves panels; Scheme II updates the trailing matrix. Only the lower triangle is an input. Failure can modify that input. .. index:: pair: function; schemeIIContext .. _doxid-namespacegpr_1_1linalg_1ad9045f3f3b672a218398ade30b4b03ac: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::shared_ptr`> schemeIIContext() The in-process Scheme II engine, or null. The reproducible distributed kernels take their tile products from it. .. index:: pair: function; configureTrainingProductLibrary .. _doxid-namespacegpr_1_1linalg_1ab16f053c2c675a231f8aa8f20fea1c7c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void configureTrainingProductLibrary(const std::string& library) Select a Scheme II product. A path loads a device library through the v1 C ABI; "scheme2:fp64[...]" or "scheme2:int8[...]" selects an in-process CPU engine (see :ref:`schemeii::parseOptions `). Empty selects the native backend. Explicit library or device errors throw; they cannot masquerade as a run with the requested arithmetic. Configure before training starts. .. index:: pair: function; trainingProductConfigured .. _doxid-namespacegpr_1_1linalg_1ae5865cb6a44f49d101d97e3c8c8094ac: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool trainingProductConfigured() A device library or an in-process engine is configured. .. index:: pair: function; trainingProductLibraryLoaded .. _doxid-namespacegpr_1_1linalg_1a5d135d75a13adaf61618b09c535e8f37: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool trainingProductLibraryLoaded() A device library (not an in-process engine) is configured. .. index:: pair: function; tryTrainingProduct .. _doxid-namespacegpr_1_1linalg_1ab31464bab305daa441a4504fef201bae: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool tryTrainingProduct(:ref:`ConstProductMatrix` a, :ref:`ConstProductMatrix` b, :ref:`ProductMatrix` c, bool transpose_a = false, bool transpose_b = false, double alpha = 1.0, double beta = 0.0, bool partitioned = false) C = alpha op(A) op(B) + beta C. Returns false when the native backend should handle the product (no device library, or a small matrix). C must have the output dimensions and must not overlap either input. A partitioned call uses a size decision made for the global product, so changing the process grid cannot switch a local block's arithmetic. .. index:: pair: function; trainingProduct .. _doxid-namespacegpr_1_1linalg_1a2902e0606c9a90716198f2096311663d: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd trainingProduct(:ref:`ConstProductMatrix` a, :ref:`ConstProductMatrix` b, bool transpose_a, bool transpose_b) Allocating form with a native :ref:`Eigen ` product when no device product runs.