anpcpp 0.4.0
Analytic Network Process computational library
Loading...
Searching...
No Matches
limit_matrix.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <cstddef>
9#include <vector>
10
11#include "anpcpp/matrix.hpp"
12
13namespace anpcpp {
14
24 Sinks,
25};
26
34 double error = 1e-10;
36 std::size_t max_iters = 5000;
40 std::size_t start_pow = 0;
45 bool with_limit = false;
47 std::size_t max_count = 1000;
53};
54
59[[nodiscard]] Matrix column_normalize(const Matrix& mat);
60
63
68[[nodiscard]] Matrix hierarchy_formula(const Matrix& mat);
69
73[[nodiscard]] std::vector<std::size_t> hierarchy_nodes(const Matrix& mat);
74
80[[nodiscard]] Matrix calculus_limit(const Matrix& mat,
81 const LimitMatrixOptions& options = {});
82
89[[nodiscard]] Matrix limit_sinks(const Matrix& mat,
90 const LimitMatrixOptions& options = {});
91
97[[nodiscard]] Matrix limit_newhierarchy(const Matrix& mat,
98 const LimitMatrixOptions& options = {});
99
104 const Matrix& mat, const LimitMatrixOptions& options = {});
105
109[[nodiscard]] Vector priority_from_limit(const Matrix& limit_matrix);
110
111} // namespace anpcpp
Dense row-major matrix stored in a flat buffer.
Definition matrix.hpp:136
One-dimensional array of doubles with element-wise arithmetic.
Definition matrix.hpp:34
Dense row-major vectors and matrices.
Analytic Network Process computational library.
Definition eigen.hpp:14
Matrix calculus_limit(const Matrix &mat, const LimitMatrixOptions &options={})
SuperDecisions / pyanp calculus limit matrix.
Matrix compute_limit_matrix(const Matrix &mat, const LimitMatrixOptions &options={})
Dispatch to the algorithm selected by options.method.
Matrix hierarchy_formula(const Matrix &mat)
Hierarchy limit formula: normalize(sum of W^k for k=1..n-1).
Matrix limit_newhierarchy(const Matrix &mat, const LimitMatrixOptions &options={})
New Hierarchy limit calculation (pyanp limit_newhierarchy).
std::vector< std::size_t > hierarchy_nodes(const Matrix &mat)
Indices of hierarchical nodes (zero columns of W^n); pyanp hierarchy_nodes.
Matrix limit_sinks(const Matrix &mat, const LimitMatrixOptions &options={})
Limit-with-sinks calculation (pyanp limit_sinks).
void column_normalize_inplace(Matrix &mat)
In-place column_normalize.
LimitMatrixMethod
SuperDecisions / pyanp limit-matrix algorithm.
Definition limit_matrix.hpp:18
@ Calculus
Calculus Type (default SuperDecisions / pyanp).
@ NewHierarchy
New Hierarchy decomposition (pyanp limit_newhierarchy).
@ Sinks
Limit with sinks decomposition (pyanp limit_sinks).
Vector priority_from_limit(const Matrix &limit_matrix)
Row sums of the limit matrix, L1-normalized (pyanp priority_from_limit).
Matrix column_normalize(const Matrix &mat)
Column-normalizes each column by its sum (pyanp normalize).
Options for limit-matrix calculation.
Definition limit_matrix.hpp:30
std::size_t start_pow
Starting power; 0 means auto-detect (pyanp default).
Definition limit_matrix.hpp:40
bool straight_normalizer
Sinks only: if true, column-normalize the assembled result; if false, normalize the nonsink block onl...
Definition limit_matrix.hpp:52
double error
Convergence tolerance for calculus / new-hierarchy iteration.
Definition limit_matrix.hpp:34
LimitMatrixMethod method
Which limit-matrix algorithm to use.
Definition limit_matrix.hpp:32
bool use_hierarchy_formula
Use hierarchy shortcut when the matrix is a strict hierarchy.
Definition limit_matrix.hpp:38
bool with_limit
New Hierarchy only: if true, replace the lower-left corner with A·limit(B) + limit(C)·A (pyanp with_l...
Definition limit_matrix.hpp:45
std::size_t max_iters
Maximum calculus iterations.
Definition limit_matrix.hpp:36
std::size_t max_count
New Hierarchy only: max iterations for the with_limit refinement.
Definition limit_matrix.hpp:47