Ask Your Question

Cyrille's profile - activity

2024-05-02 14:17:45 +0200 received badge  Famous Question (source)
2024-05-02 02:39:48 +0200 received badge  Famous Question (source)
2024-05-02 02:36:38 +0200 received badge  Famous Question (source)
2024-05-01 08:36:26 +0200 received badge  Popular Question (source)
2024-04-22 20:18:38 +0200 received badge  Popular Question (source)
2024-04-18 10:49:24 +0200 commented answer Grid on a Matrixplot

All is fine. Thanks Dsejas

2024-04-18 10:48:59 +0200 marked best answer Grid on a Matrixplot

The following code works perfectly up to a little problem. On the result the dotted grid lines are on integer ticks. I would like them to clearly separate the tiles (in greater dimension for the program it becomes unreadable. Is there a way to correct this problem (if not we can display a $(0,1)$ matrix but it is less elegant)

p = MixedIntegerLinearProgram(maximization=False, solver="GLPK")
x = p.new_variable(integer=True, nonnegative=True)
y = p.new_variable(integer=True, nonnegative=True)
p.add_constraint(x[0]+x[1]+x[3]-2*y[0]==1);
p.add_constraint(x[1]+x[0]+x[2]+x[4]-2*y[1]==1);
p.add_constraint(x[2]+x[1]+x[5]-2*y[2]==1);
p.add_constraint(x[3]+x[4]+x[0]+x[6]-2*y[3]==1);
p.add_constraint(x[4]+x[3]+x[5]+x[1]+x[7]-2*y[4]==1);
p.add_constraint(x[5]+x[4]+x[2]+x[8]-2*y[5]==1);
p.add_constraint(x[6]+x[7]+x[3]-2*y[6]==1);
p.add_constraint(x[7]+x[6]+x[8]+x[4]-2*y[7]==1);
p.add_constraint(x[8]+x[7]+x[5]-2*y[8]==1);
p.set_objective(x[0]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]);
p.add_constraint(x[0]>=0);
p.add_constraint(x[0]<=1);
p.add_constraint(y[0]>=0);
p.add_constraint(y[0]<=2);
p.add_constraint(x[1]>=0);
p.add_constraint(x[1]<=1);
p.add_constraint(y[1]>=0);
p.add_constraint(y[1]<=2);
p.add_constraint(x[2]>=0);
p.add_constraint(x[2]<=1);
p.add_constraint(y[2]>=0);
p.add_constraint(y[2]<=2);
p.add_constraint(x[3]>=0);
p.add_constraint(x[3]<=1);
p.add_constraint(y[3]>=0);
p.add_constraint(y[3]<=2);
p.add_constraint(x[4]>=0);
p.add_constraint(x[4]<=1);
p.add_constraint(y[4]>=0);
p.add_constraint(y[4]<=2);
p.add_constraint(x[5]>=0);
p.add_constraint(x[5]<=1);
p.add_constraint(y[5]>=0);
p.add_constraint(y[5]<=2);
p.add_constraint(x[6]>=0);
p.add_constraint(x[6]<=1);
p.add_constraint(y[6]>=0);
p.add_constraint(y[6]<=2);
p.add_constraint(x[7]>=0);
p.add_constraint(x[7]<=1);
p.add_constraint(y[7]>=0);
p.add_constraint(y[7]<=2);
p.add_constraint(x[8]>=0);
p.add_constraint(x[8]<=1);
p.add_constraint(y[8]>=0);
p.add_constraint(y[8]<=2);
p.solve()
X=[v[1] for v in sorted(p.get_values(x, convert=ZZ, tolerance=1e-3).items())] 
m=3;
n=3;
X1=list(matrix(m,n,X))
X2 = [list(v) for v in X1]

table(X2)
matrix_plot(X1,cmap=["white","black"]).show(gridlines=True,gridlinesstyle={"linestyle": ":", "linewidth": 2, "color": "red"})
2024-04-18 10:45:24 +0200 commented question Underdertermined system of equations

In fact it's not $E$ which should be minimized but $|E|$. So the problem should receive a special formalization which ca

2024-04-09 11:44:52 +0200 asked a question Grid on a Matrixplot

Grid on a Matrixplot The following code works perfectly up to a little problem. On the result the dotted grid lines are

2024-03-20 16:23:06 +0200 received badge  Popular Question (source)
2024-03-19 19:16:41 +0200 commented answer Resizing the table font to fit into the page

When I compute $T$ in the code, it display a table. This is this table.

2024-03-18 15:43:36 +0200 commented answer Resizing the table font to fit into the page

Emmanuel I used Latex since 1984. I want an ipyn readable easily not a LateX output

2024-03-18 15:15:38 +0200 commented question How to specify dashed edges in SageMath?

Have look here https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/. I rember al

2024-03-18 15:14:05 +0200 commented question How to specify dashed edges in SageMath?

Have look here https://ask.sagemath.org/question/35638/drawing-auslander-reiten-quivers-with-sage-possible/

2024-03-17 11:54:44 +0200 asked a question Resizing the table font to fit into the page

Resizing the table font to fit into the page This table h_r=["Environnement","Transports","Sécurité","Santé","Sports-et

2024-03-15 16:50:53 +0200 edited answer Simple ReLU plot

You can try f(x) = max_symbolic(x,0); plot(f(x), -2, 2)

2024-03-15 16:50:43 +0200 edited answer Simple ReLU plot

You can try f(x) = max_symbolic(x,0); plot(f(x), -2, 2)

2024-03-15 16:50:24 +0200 edited answer Simple ReLU plot

f(x) = max_symbolic(x,0); plot(f(x), -2, 2)

2024-03-15 16:50:14 +0200 edited answer Simple ReLU plot

f(x) = max_symbolic(x,0); plot(f(x), -2, 2)

2024-03-15 16:49:58 +0200 edited answer Simple ReLU plot

f(x) = max_symbolic(x,0); plot(f(x), -2, 2)

2024-03-15 16:49:32 +0200 answered a question Simple ReLU plot

f(x) = max_symbolic(x,0); plot(f(x), -2, 2)

2024-03-15 16:46:43 +0200 commented answer Is it possible to color a string in a list ?

I have tried to adapt your solution to a list of list but I certainly make an error M=[[1, 0],[0,1]] show([[LatexExpr(r"

2024-03-15 16:26:23 +0200 edited question MixedIntegerProgramming with more than 2 indexes

MixedIntegerProgramming with more than 2 indexes Some integer linear programming needs more indexes than two. But this w

2024-03-15 16:26:09 +0200 edited question MixedIntegerProgramming with more than 2 indexes

MixedIntegerProgramming with more tha 2 indexes Some integer linear programming needs more indexes than two. But this wo

2024-03-15 15:47:13 +0200 edited question MixedIntegerProgramming with more than 2 indexes

MixedIntegerProgramming with more tha 2 indexes Some integer linear programming needs more indexes than two. But this wo

2024-03-15 15:45:34 +0200 asked a question MixedIntegerProgramming with more than 2 indexes

MixedIntegerProgramming with more tha 2 indexes Some integer linear programming needs more indexes than two. But this wo

2024-03-15 10:20:50 +0200 asked a question Is it possible to color a string in a list ?

Is it possible to color a string in a list ? is there a way to color a string inside a list say L = ["1","2","3"] and

2024-03-10 10:32:43 +0200 received badge  Notable Question (source)
2024-03-10 10:32:43 +0200 received badge  Popular Question (source)
2024-03-07 18:08:34 +0200 received badge  Notable Question (source)
2024-03-07 18:08:34 +0200 received badge  Popular Question (source)
2024-03-07 10:46:51 +0200 edited question How to display some elements in a matrix with distinct colors

How to display some elements in a matrix with distinct colors Given the matrix A=[[1,0,1],[0,0,1],[1,1,0]] show(A)

2024-03-07 10:46:17 +0200 edited question How to display some elements in a matrix with distinct colors

How to display some elements in a matrix with distinct colors Given the matrix A=[[1,0,1],[0,0,1],[1,1,0]] show(A)

2024-03-07 10:45:38 +0200 edited question How to display some elements in a matrix with distinct colors

How to display some element in a matrix with distinct colors Given the matrix A=[[1,0,1],[0,0,1],[1,1,0]] I would li

2024-03-07 10:45:28 +0200 edited question How to display some elements in a matrix with distinct colors

How to displayed some element in a matrix with distinct colors Given the matrix A=[[1,0,1],[0,0,1],[1,1,0]] I would

2024-03-07 10:20:46 +0200 asked a question How to display some elements in a matrix with distinct colors

How to displayed some element in a matrix with distinct colors Given the matrix A=[[1,0,1],[0,0,1],[1,1,0]] I would

2024-03-07 10:15:44 +0200 marked best answer Functions of the elements of a matrix

I have a matrix say

M=[[10,12],[25,2]]

And I would like to create a function of the type

$f_1(M,i)=2M[i][0]+3M[i][1]$

I perfectly understand that neither M[i][0]nor M[i][1]are declared variable. Is there a solution to my problem ? Or should I explore an other way ?

2024-03-05 21:35:28 +0200 received badge  Popular Question (source)
2024-03-05 21:29:17 +0200 received badge  Famous Question (source)
2024-03-03 18:25:45 +0200 commented question Functions of the elements of a matrix

Thanks Max

2024-03-03 16:38:08 +0200 asked a question Functions of the elements of a matrix

Functions of the elements of a matrix I have a matrix say M=[[10,12],[25,2]] And I would like to create a functio

2024-02-26 15:25:29 +0200 received badge  Famous Question (source)
2024-02-26 10:24:50 +0200 received badge  Popular Question (source)
2024-02-25 00:33:50 +0200 received badge  Popular Question (source)
2024-02-24 22:07:53 +0200 received badge  Popular Question (source)
2024-02-17 14:59:14 +0200 received badge  Enlightened (source)
2024-02-12 10:26:00 +0200 received badge  Famous Question (source)
2024-02-11 19:52:14 +0200 received badge  Notable Question (source)