Ask Your Question

Why do I get the "unable to find a common ring for all elements" error message?

asked 2013-11-17 13:46:09 -0600

Behzad gravatar image

I was wondering if you can take a look at this cell:

and let me know why I get the error message.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-11-17 14:32:30 -0600

ppurka gravatar image

The variables in the MILP are not symbolic variables, i.e., not from the Symbolic Ring. The vector() command is failing in that step.

<type 'sage.numerical.linear_functions.LinearFunction'>

You can rewrite your constraints like this

p.add_constraint(sum(_a*_x for _a,_x in zip(a1, [x,y])) + r*a1.norm(2) <= b1)
edit flag offensive delete link more


Basically, you are reimplementing the dot product. That seems like a "bad thing". Obviously linear algebra and linear programming should play well together - can this actually be done?

Saul Schleimer gravatar imageSaul Schleimer ( 2015-09-06 21:23:14 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-11-17 13:46:09 -0600

Seen: 1,430 times

Last updated: Nov 17 '13