Module xcsp3_utils

Source

Functions§

get_all_variables_between_lower_and_upper
([2,3,4],[2,4,8]) -> [[2,3,4],[2,3,5],[2,3,6],[2,3,7],[2,3,8],[2,4,4],[2,4,5],[2,4,6],[2,4,7],[2,4,8]]
get_nth_square_of_name
return the nth of the [] in id(str) eg x[2][5][] -> 2, y[] -> 0, z[3][] ->1, zzz[4][][4] ->1
list_to_matrix_ids
return the matrix, eg str“(x1,x2,x3,x4,x5)(y1,y2,y3,y4,y5)(z1,z2,z3,z4,z5)“ - > vec[[x1,x2,x3,x4,x5][y1,y2,y3,y4,y5][z1,z2,z3,z4,z5]]
list_to_scope_ids
return the list of scopes, eg str“x[1] x[3] x[5]“ - > vec[x[1], x[3], x[5]]
list_to_transitions
return the transitions, eg “(a,0,a)(a,1,b)(b,1,c)(c,0,d)(d,0,d)(d,1,e)(e,0,e)” -> vec[ (a,0,a),(a,1,b),(b,1,c),(c,0,d),(d,0,d),(d,1,e),(e,0,e)]
list_to_values
return the list of values, eg str“1 3 5 76“ -> vec[1,3,5,76],
list_to_vec_var_val
list_with_bracket_comma_to_values
return the list of values, eg str“(1, 3, 5, 76)“ -> vec[1,3,5,76],
size_to_string
sizes_to_double_vec
transform the string size to vector sizes eg: [2][3..4][4..8] -> ([2,3,4],[2,4,8])
sizes_to_vec
transform the string size to vector sizes eg: [2][3][4] -> ([2,3,4], 24)
tuple_to_vector
return the tuples by given string, eg (0,0,1)(0,1,0)(1,0,0)(1,1,1) -> [[0,0,1],[0,1,0],[1,0,0],[1,1,1]]