42 std::vector<std::vector<double>> *C_) {
45 Size1 = (
unsigned int)rowSize_ - 1;
46 Size2 = (
unsigned int)colSize_ - 1;
47 if(Size1 <= 0 || Size2 <= 0) {
48 this->
printMsg(
"One or more empty diagram(s).");
51 MaxSize = Size1 + Size2;
55 for(
unsigned int i = Size1; i < MaxSize; ++i)
56 for(
unsigned int j = MaxSize + Size2; j < 2 * MaxSize; ++j) {
57 const Edge localEdge(i, j, (
double)0);
58 Edges.emplace_back(localEdge);
62 for(
unsigned int i = 0; i < Size1; ++i) {
63 unsigned int k = MaxSize;
64 for(
unsigned int j = 0; j < Size2; ++j) {
65 auto val = (*C_)[i][j];
66 const Edge localEdge(i, k++, val);
67 Edges.emplace_back(localEdge);
72 for(
unsigned int i = 0; i < Size1; ++i) {
73 auto val = (*C_)[i][Size2];
74 const Edge localEdge(i, MaxSize + Size2 + i, val);
75 Edges.emplace_back(localEdge);
78 for(
unsigned int j = 0, k = MaxSize; j < Size2; ++j, ++k) {
79 auto val = (*C_)[Size1][j];
80 const Edge localEdge(Size1 + (k - MaxSize), k, val);
81 Edges.emplace_back(localEdge);
84 std::sort(Edges.begin(), Edges.end());