Square pairwise comparison table over a named list of alternatives.
More...
#include <pairwise.hpp>
Square pairwise comparison table over a named list of alternatives.
◆ PairwiseJudgments()
| anpcpp::PairwiseJudgments::PairwiseJudgments |
( |
std::vector< std::string > |
alternatives | ) |
|
|
explicit |
Constructs a table with the given alternative names.
- Parameters
-
| alternatives | Ordered list of names (diagonal initialized to 1). |
◆ add_alternative()
| void anpcpp::PairwiseJudgments::add_alternative |
( |
const std::string & |
name, |
|
|
bool |
ignore_existing = false |
|
) |
| |
Appends an alternative (diagonal 1).
- Parameters
-
| name | Alternative name. |
| ignore_existing | If true, no-op when already present; else throws. |
◆ alternatives()
| const std::vector< std::string > & anpcpp::PairwiseJudgments::alternatives |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- Ordered alternative names.
◆ comparison() [1/2]
| double anpcpp::PairwiseJudgments::comparison |
( |
const std::string & |
a, |
|
|
const std::string & |
b |
|
) |
| const |
- Returns
- Comparison value for alternatives
a and b.
◆ comparison() [2/2]
| double anpcpp::PairwiseJudgments::comparison |
( |
std::size_t |
i, |
|
|
std::size_t |
j |
|
) |
| const |
- Returns
- Comparison value at (
i, j).
◆ consistency_ratio()
| double anpcpp::PairwiseJudgments::consistency_ratio |
( |
ConsistencyOptions |
options = {} | ) |
const |
- Returns
- Saaty consistency ratio.
◆ empty()
| bool anpcpp::PairwiseJudgments::empty |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- True if there are no alternatives.
◆ has_alternative()
| bool anpcpp::PairwiseJudgments::has_alternative |
( |
const std::string & |
name | ) |
const |
- Returns
- True if
name is in the alternative list.
◆ index_of()
| std::size_t anpcpp::PairwiseJudgments::index_of |
( |
const std::string & |
name | ) |
const |
- Returns
- Index of
name.
- Exceptions
-
| std::out_of_range | if not found. |
◆ matrix()
| const Matrix & anpcpp::PairwiseJudgments::matrix |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- Underlying comparison matrix.
◆ priorities()
- Returns
- Normalized priority vector from the comparison matrix.
◆ remove_alternative()
| void anpcpp::PairwiseJudgments::remove_alternative |
( |
const std::string & |
name, |
|
|
bool |
ignore_missing = false |
|
) |
| |
Removes an alternative and its row/column.
- Parameters
-
| name | Alternative to remove. |
| ignore_missing | If true, no-op when absent; else throws. |
◆ set_comparison() [1/2]
| void anpcpp::PairwiseJudgments::set_comparison |
( |
const std::string & |
a, |
|
|
const std::string & |
b, |
|
|
double |
value |
|
) |
| |
Sets comparison by alternative name.
- Parameters
-
| a | First alternative. |
| b | Second alternative. |
| value | Comparison value (reciprocal applied automatically). |
◆ set_comparison() [2/2]
| void anpcpp::PairwiseJudgments::set_comparison |
( |
std::size_t |
i, |
|
|
std::size_t |
j, |
|
|
double |
value |
|
) |
| |
Sets comparison by index.
- Parameters
-
| i | Row index. |
| j | Column index. |
| value | a_ij; reciprocal set for a_ji unless 0 (incomplete). |
◆ size()
| std::size_t anpcpp::PairwiseJudgments::size |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- Number of alternatives (matrix order).
The documentation for this class was generated from the following file: