68 double original = 0.0;
69 double up_score = 0.0;
71 double down_score = 0.0;
72 double down_diff = 0.0;
80 double original = 0.0;
81 double rank_influence = 0.0;
89 double marginal = 0.0;
90 double smart_p0 = 0.5;
98 double total_influence = 0.0;
99 double max_alt_change = 0.0;
116 const std::vector<std::size_t>& cluster_nodes = {});
129 std::size_t cont_alt,
130 const std::vector<std::size_t>& cluster_nodes = {},
131 const LimitMatrixOptions& options = {});
148 const std::vector<std::size_t>& cluster_nodes = {},
149 const LimitMatrixOptions& options = {},
150 bool normalize_to_orig =
true);
167 int left_or_right = 0,
169 const std::vector<std::size_t>& influence_nodes = {},
170 const std::vector<std::size_t>& cluster_nodes = {},
171 const LimitMatrixOptions& options = {});
186 const std::vector<std::size_t>& influence_nodes,
187 const std::vector<std::string>& names,
188 const std::vector<std::size_t>& cluster_nodes = {},
190 const LimitMatrixOptions& options = {});
207 const std::vector<std::size_t>& influence_nodes,
208 const std::vector<std::string>& names,
209 double delta_up = 0.1,
210 double delta_down = 0.1,
212 const std::vector<std::size_t>& cluster_nodes = {},
213 const LimitMatrixOptions& options = {});
229 const std::vector<std::size_t>& influence_nodes,
230 const std::vector<std::string>& names,
231 const std::vector<std::size_t>& cluster_nodes = {},
233 int round_to_decimal = 5,
234 const LimitMatrixOptions& options = {});
253 const std::vector<std::size_t>& influence_nodes,
256 const std::vector<std::size_t>& cluster_nodes = {},
257 const LimitMatrixOptions& options = {});
272 const std::vector<std::size_t>& rows,
273 const std::vector<std::string>& row_names,
274 const std::vector<std::size_t>& influence_nodes,
277 const std::vector<std::size_t>& cluster_nodes = {},
278 const LimitMatrixOptions& options = {});
298 const std::vector<std::size_t>& cluster_nodes = {},
299 const LimitMatrixOptions& options = {},
300 bool normalize_to_orig =
true);
316 const std::vector<std::size_t>& rows = {},
318 const std::vector<std::size_t>& cluster_nodes = {},
319 const LimitMatrixOptions& options = {},
320 bool normalize_to_orig =
true);
324inline constexpr double kPerspectivePFine = 1.0 - 1e-7;
325inline constexpr double kPerspectivePRefine = 1.0 - 1e-9;
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
Limit matrix and priority extraction from supermatrices.
Dense row-major vectors and matrices.
Analytic Network Process computational library.
Definition eigen.hpp:14
std::vector< InfluenceRawEntry > influence_raw(const Matrix &mat, std::size_t row, const std::vector< std::size_t > &influence_nodes, const std::vector< std::string > &names, double delta_up=0.1, double delta_down=0.1, double p0=0.5, const std::vector< std::size_t > &cluster_nodes={}, const LimitMatrixOptions &options={})
Raw fixed-distance influence table (original / up / down scores).
Vector influence_marginal(const Matrix &mat, std::size_t row, double p0, int left_or_right=0, double delta=1e-6, const std::vector< std::size_t > &influence_nodes={}, const std::vector< std::size_t > &cluster_nodes={}, const LimitMatrixOptions &options={})
Marginal influence (finite difference) at a direct (p_0).
constexpr double kPerspectiveAgreeTol
Max L-inf gap between coarse/fine before refining further.
Definition rowsens.hpp:327
std::vector< InfluenceRankEntry > influence_rank(const Matrix &mat, std::size_t row, const std::vector< std::size_t > &influence_nodes, const std::vector< std::string > &names, const std::vector< std::size_t > &cluster_nodes={}, double error=1e-5, int round_to_decimal=5, const LimitMatrixOptions &options={})
Rank influence score per alternative (max of upper/lower searches).
Matrix perspective_matrix(const Matrix &mat, const std::vector< std::size_t > &rows={}, const P0Mode &p0mode=P0Mode::Direct(0.5), const std::vector< std::size_t > &cluster_nodes={}, const LimitMatrixOptions &options={}, bool normalize_to_orig=true)
Perspective matrix: column j is perspective for rows[j].
Vector perspective(const Matrix &mat, std::size_t row, const P0Mode &p0mode=P0Mode::Direct(0.5), const std::vector< std::size_t > &cluster_nodes={}, const LimitMatrixOptions &options={}, bool normalize_to_orig=true)
Perspective of one row: limit as p approaches 1 of row sensitivity.
double smart_p0(const Matrix &mat, std::size_t row, std::size_t cont_alt, const std::vector< std::size_t > &cluster_nodes={}, const LimitMatrixOptions &options={})
Smart resting (p_0) making score of cont_alt continuous at (p_0).
std::vector< InfluenceTotalEntry > influence_total(const Matrix &mat, const std::vector< std::size_t > &rows, const std::vector< std::string > &row_names, const std::vector< std::size_t > &influence_nodes, double delta=0.25, double p0=0.5, const std::vector< std::size_t > &cluster_nodes={}, const LimitMatrixOptions &options={})
Per-row total influence (pyanp multi-row influence_fixed Totals).
constexpr double kPerspectivePCoarse
Near-1 p values for limit-as-p-approaches-1 perspective (never exactly 1).
Definition rowsens.hpp:323
P0ModeKind
How resting parameter (p_0) is chosen for row sensitivity.
Definition rowsens.hpp:22
@ Smart
Smart (p_0) making scores continuous for one alternative index.
@ OriginalWeight
Use each column's original row weight as (p_0).
@ Direct
Fixed (p_0) (typically 0.5).
Matrix row_adjust(const Matrix &mat, std::size_t row, double p, const P0Mode &p0mode=P0Mode::Direct(0.5), const std::vector< std::size_t > &cluster_nodes={})
Adjusts row row of scaled supermatrix mat to parameter p.
Vector priority_after_row_adjust(const Matrix &mat, std::size_t row, double p, const P0Mode &p0mode=P0Mode::Direct(0.5), const std::vector< std::size_t > &cluster_nodes={}, const LimitMatrixOptions &options={}, bool normalize_to_orig=true)
Priorities after row adjust (pyanp row_adjust_priority, normalize_to_orig).
std::vector< InfluenceMarginalEntry > influence_marginal_smart(const Matrix &mat, std::size_t row, const std::vector< std::size_t > &influence_nodes, const std::vector< std::string > &names, const std::vector< std::size_t > &cluster_nodes={}, double delta=1e-6, const LimitMatrixOptions &options={})
Per-alternative smart-(p_0) marginal influence (single value each).
InfluenceTotalEntry influence_total_row(const Matrix &mat, std::size_t row, const std::vector< std::size_t > &influence_nodes, double delta=0.25, double p0=0.5, const std::vector< std::size_t > &cluster_nodes={}, const LimitMatrixOptions &options={})
Fixed-distance total influence for one row (L1 and max of abs diffs).
Smart-(p_0) marginal influence for one row or alternative.
Definition rowsens.hpp:87
Rank-influence result for one row (or one alternative under a fixed Wrt).
Definition rowsens.hpp:78
One alternative's raw (fixed-distance) influence result.
Definition rowsens.hpp:66
Fixed-distance total influence for one row (pyanp influence_fixed Total).
Definition rowsens.hpp:96
(p_0) selection for row_adjust.
Definition rowsens.hpp:34
static P0Mode Smart(std::size_t alt_index)
Definition rowsens.hpp:49
double direct
Used when kind is Direct.
Definition rowsens.hpp:37
std::size_t smart_alt
Alternative/node index made continuous when kind is Smart.
Definition rowsens.hpp:39
static P0Mode Original()
Definition rowsens.hpp:56
static P0Mode Direct(double p0)
Definition rowsens.hpp:42