Ask Your Question
0

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

asked 2013-11-17 20:46:09 +0100

Behzad gravatar image

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

http://sagecell.sagemath.org/?q=ypqhgw

and let me know why I get the error message.

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2013-11-17 21:32:30 +0100

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(x)
<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

Comments

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-07 04:23:14 +0100 )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

Stats

Asked: 2013-11-17 20:46:09 +0100

Seen: 2,080 times

Last updated: Nov 17 '13