Home
last modified time | relevance | path

Searched refs:cost_matrix (Results 1 – 25 of 76) sorted by relevance

1234

/dports/science/py-scipy/scipy-1.7.1/scipy/optimize/
H A D_lsap.py16 def linear_sum_assignment(cost_matrix, maximize=False): argument
87 cost_matrix = np.asarray(cost_matrix)
88 if cost_matrix.ndim != 2:
90 % (cost_matrix.shape,))
92 if not (np.issubdtype(cost_matrix.dtype, np.number) or
93 cost_matrix.dtype == np.dtype(np.bool_)):
95 % (cost_matrix.dtype,))
98 cost_matrix = -cost_matrix
100 return _lsap_module.calculate_assignment(cost_matrix)
H A D_lsap_module.c52 double* cost_matrix = (double*)PyArray_DATA(obj_cont); in calculate_assignment() local
53 if (cost_matrix == NULL) { in calculate_assignment()
70 num_rows, num_cols, cost_matrix, in calculate_assignment()
/dports/math/py-or-tools/or-tools-9.2/examples/flatzinc/
H A Dglobal_cardinality_with_costs.fzn54 constraint int_eq(0, cost_matrix[5]);
55 constraint int_eq(0, cost_matrix[10]);
56 constraint int_eq(0, cost_matrix[11]);
58 constraint int_eq(1, cost_matrix[2]);
59 constraint int_eq(1, cost_matrix[4]);
60 constraint int_eq(1, cost_matrix[9]);
62 constraint int_eq(2, cost_matrix[8]);
63 constraint int_eq(3, cost_matrix[7]);
66 constraint int_eq(4, cost_matrix[1]);
70 constraint int_eq(7, cost_matrix[3]);
[all …]
H A Dwarehouses.fzn7 array [1..50] of int: cost_matrix = [20, 24, 11, 25, 30, 28, 27, 82, 83, 74, 74, 97, 71, 96, 70, 2,…
87 constraint array_int_element(INT____00057, cost_matrix, cost[2]);
88 constraint array_int_element(INT____00059, cost_matrix, cost[3]);
89 constraint array_int_element(INT____00061, cost_matrix, cost[4]);
90 constraint array_int_element(INT____00063, cost_matrix, cost[5]);
91 constraint array_int_element(INT____00065, cost_matrix, cost[6]);
92 constraint array_int_element(INT____00067, cost_matrix, cost[7]);
93 constraint array_int_element(INT____00069, cost_matrix, cost[8]);
94 constraint array_int_element(INT____00071, cost_matrix, cost[9]);
95 constraint array_int_element(INT____00073, cost_matrix, cost[10]);
[all …]
/dports/science/py-qcelemental/qcelemental-0.24.0/qcelemental/util/
H A Dscipy_hungarian.py93 cost_matrix = np.asarray(cost_matrix)
94 if len(cost_matrix.shape) != 2:
97 if not (np.issubdtype(cost_matrix.dtype, np.number) or cost_matrix.dtype == np.dtype(bool)):
100 if np.any(np.isinf(cost_matrix) | np.isnan(cost_matrix)):
103 if cost_matrix.dtype == np.dtype(bool):
104 cost_matrix = cost_matrix.astype(int)
107 if cost_matrix.shape[1] < cost_matrix.shape[0]:
108 cost_matrix = cost_matrix.T
113 state = _Hungary(cost_matrix)
144 def __init__(self, cost_matrix): argument
[all …]
H A Dtest_scipy_hungarian.py68 for cost_matrix, expected_cost, expected_reduced_cost_matrix in data:
70 cost_matrix = np.array(cost_matrix)
71 … (row_ind, col_ind), reduced_cost_matrix = linear_sum_assignment(cost_matrix, return_cost=True)
73 assert_array_equal(expected_cost, cost_matrix[row_ind, col_ind])
76 cost_matrix = cost_matrix.T
77 row_ind, col_ind = linear_sum_assignment(cost_matrix)
79 assert_array_equal(np.sort(expected_cost), np.sort(cost_matrix[row_ind, col_ind]))
/dports/www/tikiwiki/tiki-21.2/lib/test/core/Multilingual/Aligner/
H A DShortestPathFinderTest.php123 $cost_matrix['ottawa']['montreal'] = 50;
124 $cost_matrix['ottawa']['chicago'] = 100;
125 $cost_matrix['ottawa']['detroit'] = 150;
126 $cost_matrix['montreal']['detroit'] = 90;
127 $cost_matrix['montreal']['vancouver'] = 300;
129 $cost_matrix['detroit']['vancouver'] = 110;
130 $cost_matrix['chicago']['vancouver'] = 170;
131 $cost_matrix['ottawa']['toronto'] = 90;
132 $cost_matrix['toronto']['vancouver'] = 280;
135 $this->pfinder = new Multilingual_Aligner_ShortestPathFinder($cost_matrix, $INFINITY);
/dports/cad/graywolf/graywolf-0.1.6-4-gf47937b/src/Ylib/
H A Dassign.c73 INT *Yassign( cost_matrix, m, n ) in Yassign() argument
74 INT **cost_matrix ; in Yassign()
120 costS = cost_matrix ;
145 colS[0] += cost_matrix[i][colS[i]] ;
385 INT **cost_matrix ; local
409 return( cost_matrix );
414 INT **cost_matrix ;
425 cost_matrix[i][j] = 0;
481 INT **cost_matrix ;
517 INT **cost_matrix ; in Yassign_free()
[all …]
/dports/math/py-spopt/spopt-0.2.1/spopt/locate/
H A Dcoverage.py47 cls, cost_matrix: np.array, max_coverage: float, name: str = "LSCP"
111 r_fac = range(cost_matrix.shape[1])
112 r_cli = range(cost_matrix.shape[0])
119 lscp.aij = np.zeros(cost_matrix.shape)
120 lscp.aij[cost_matrix <= max_coverage] = 1
315 cost_matrix: np.array,
391 r_fac = range(cost_matrix.shape[1])
392 r_cli = range(cost_matrix.shape[0])
400 mclp.aij = np.zeros(cost_matrix.shape)
401 mclp.aij[cost_matrix <= max_coverage] = 1
[all …]
H A Dp_center.py48 cost_matrix: np.array,
115 r_cli = range(cost_matrix.shape[0])
116 r_fac = range(cost_matrix.shape[1])
120 p_center = PCenter(name, model, cost_matrix)
140 p_center, p_center.problem, cost_matrix, r_fac, r_cli
H A Dp_median.py69 cost_matrix: np.array,
142 r_cli = range(cost_matrix.shape[0])
143 r_fac = range(cost_matrix.shape[1])
147 weights = np.reshape(weights, (cost_matrix.shape[0], 1))
148 aij = weights * cost_matrix
/dports/math/py-spopt/spopt-0.2.1/spopt/tests/
H A Dtest_locate.py58 self.cost_matrix = ntw.allneighbordistances(
68 lscp = LSCP.from_cost_matrix(self.cost_matrix, 10)
76 lscp = LSCP.from_cost_matrix(self.cost_matrix, 8)
86 lscp = LSCP.from_cost_matrix(self.cost_matrix, 8)
145 self.cost_matrix,
160 self.cost_matrix,
378 self.cost_matrix = ntw_dist_piv.to_numpy()
448 self.cost_matrix,
458 self.cost_matrix,
469 self.cost_matrix,
[all …]
/dports/science/py-scipy/scipy-1.7.1/scipy/sparse/csgraph/tests/
H A Dtest_matching.py184 cost_matrix, expected_cost = test_case
186 cost_matrix = sign * array_type(cost_matrix)
189 row_ind, col_ind = solver(cost_matrix, maximize=maximize)
192 np.array(cost_matrix[row_ind, col_ind]).flatten())
194 cost_matrix = cost_matrix.T
195 row_ind, col_ind = solver(cost_matrix, maximize=maximize)
199 cost_matrix[row_ind, col_ind])).flatten())
/dports/cad/graywolf/graywolf-0.1.6-4-gf47937b/include/yalecad/
H A Dassign.h46 extern INT *Yassign( P3( INT **cost_matrix, INT m, INT n ) ) ;
64 extern void Yassign_reset( P3(INT **cost_matrix, INT m, INT n ) ) ;
73 extern void Yassign_print( P3(INT **cost_matrix, INT m, INT n ) ) ;
82 extern void Yassign_free( P3(INT **cost_matrix, INT m, INT n ) ) ;
/dports/audio/lenticular-lv2/lenticular_lv2-0.5.0-14-g14d8075/eurorack/tools/optimization/
H A Dmunkres.py366 def compute(self, cost_matrix): argument
387 self.C = self.pad_matrix(cost_matrix)
389 self.original_length = len(cost_matrix)
390 self.original_width = len(cost_matrix[0])
705 cost_matrix = []
707 cost_matrix.append([inversion_function(value) for value in row])
708 return cost_matrix
781 for cost_matrix, expected_total in matrices:
782 print_matrix(cost_matrix, msg='cost matrix')
783 indexes = m.compute(cost_matrix)
[all …]
/dports/audio/lenticular-lv2/lenticular_lv2-0.5.0-14-g14d8075/parasites/tools/optimization/
H A Dmunkres.py366 def compute(self, cost_matrix): argument
387 self.C = self.pad_matrix(cost_matrix)
389 self.original_length = len(cost_matrix)
390 self.original_width = len(cost_matrix[0])
705 cost_matrix = []
707 cost_matrix.append([inversion_function(value) for value in row])
708 return cost_matrix
781 for cost_matrix, expected_total in matrices:
782 print_matrix(cost_matrix, msg='cost matrix')
783 indexes = m.compute(cost_matrix)
[all …]
/dports/math/py-munkres10/munkres-release-1.0.12/
H A Dmunkres.py403 def compute(self, cost_matrix): argument
424 self.C = self.pad_matrix(cost_matrix)
426 self.original_length = len(cost_matrix)
427 self.original_width = len(cost_matrix[0])
766 cost_matrix = []
768 cost_matrix.append([inversion_function(value) for value in row])
769 return cost_matrix
856 for cost_matrix, expected_total in matrices:
857 print_matrix(cost_matrix, msg='cost matrix')
858 indexes = m.compute(cost_matrix)
[all …]
/dports/math/cgal/CGAL-5.3/include/CGAL/boost/graph/
H A Dalpha_expansion_graphcut.h70 const std::vector<std::vector<double> >* cost_matrix; member
72 Vertex_label_cost_map (const std::vector<std::vector<double> >* cost_matrix) in Vertex_label_cost_map()
73 : cost_matrix (cost_matrix) in Vertex_label_cost_map()
79 out.reserve (pmap.cost_matrix->size()); in get()
80 for (std::size_t i = 0; i < pmap.cost_matrix->size(); ++ i) in get()
81 out.push_back ((*pmap.cost_matrix)[i][idx]); in get()
91 const std::vector<std::vector<double> >& cost_matrix; member
96 const std::vector<std::vector<double> >& cost_matrix, in Alpha_expansion_old_API_wrapper_graph()
98 : edges (edges), edge_costs (edge_costs), cost_matrix (cost_matrix), labels (labels) in Alpha_expansion_old_API_wrapper_graph()
123 { return Vertex_label_cost_map(&cost_matrix); } in vertex_label_cost_map()
[all …]
/dports/math/py-munkres/munkres-1.1.4/
H A Dmunkres.py114 def compute(self, cost_matrix: Matrix) -> Sequence[Tuple[int, int]]:
136 self.C = self.pad_matrix(cost_matrix)
138 self.original_length = len(cost_matrix)
139 self.original_width = len(cost_matrix[0])
481 cost_matrix = []
483 cost_matrix.append([inversion_function(value) for value in row])
484 return cost_matrix
595 for cost_matrix, expected_total in matrices:
596 print_matrix(cost_matrix, msg='cost matrix')
597 indexes = m.compute(cost_matrix)
[all …]
/dports/biology/iqtree/IQ-TREE-2.0.6/tree/
H A Dphylotreepars.cpp471 if(cost_matrix){ in initCostMatrix()
472 aligned_free(cost_matrix); in initCostMatrix()
473 cost_matrix = NULL; in initCostMatrix()
498 if(cost_matrix){ in loadCostMatrixFile()
499 aligned_free(cost_matrix); in loadCostMatrixFile()
500 cost_matrix = NULL; in loadCostMatrixFile()
545 …if (cost_matrix[i*cost_nstates+j] > cost_matrix[i*cost_nstates+k] + cost_matrix[k*cost_nstates+j])… in loadCostMatrixFile()
547cost_matrix[i*cost_nstates+j] = cost_matrix[i*cost_nstates+k] + cost_matrix[k*cost_nstates+j]; in loadCostMatrixFile()
742 UINT *cost_matrix_ptr = cost_matrix; in computePartialParsimonySankoff()
765 UINT *cost_matrix_ptr = cost_matrix; in computePartialParsimonySankoff()
[all …]
/dports/www/tikiwiki/tiki-21.2/lib/core/Multilingual/Aligner/
H A DBilingualAligner.php15 var $cost_matrix = []; variable in Multilingual_Aligner_BilingualAligner
116 $this->cost_matrix[$node_to_extend][$new_node] = 'match_cost';
119 $this->cost_matrix[$node_to_extend]['END'] = 'goto_end_cost';
148 $this->cost_matrix[$node_to_extend][$new_node] = 'match_cost';
150 $this->cost_matrix[$node_to_extend]['END'] = 'goto_end_cost';
/dports/math/minizinc/libminizinc-2.5.5/tests/spec/examples/
H A Dwarehouses.mzn45 cost_matrix =
64 array[1..n_stores,1..n_suppliers] of int: cost_matrix;
66 int: MaxCost = max(i in 1..n_stores, j in 1..n_suppliers)(cost_matrix[i,j]);
68 + sum(i in 1..n_stores, j in 1..n_suppliers)(cost_matrix[i,j]);
82 cost_matrix[i,supplier[i]] = cost[i]
/dports/math/py-munkres/munkres-1.1.4/test/
H A Dtest_munkres.py152 cost_matrix = munkres.make_cost_matrix(
155 indices = m.compute(cost_matrix)
166 cost_matrix = munkres.make_cost_matrix(
169 indices = m.compute(cost_matrix)
/dports/audio/festival/speech_tools/main/
H A Ddp_main.cc91 EST_FMatrix cost_matrix; variable
206 cost_matrix.load(al.val("-cost_matrix")); in main()
218 if(cost_matrix.num_columns() != vocab.length()) in main()
223 if(cost_matrix.num_rows() != vocab.length()) in main()
350 return cost_matrix(StrVector_index(vocab,s1->name()), in local_cost()
/dports/science/py-scipy/scipy-1.7.1/benchmarks/benchmarks/
H A Doptimize_lap.py49 self.cost_matrix = cost_func(shape)
52 linear_sum_assignment(self.cost_matrix)

1234