[sage-support] Re: Intersection of complex Ideals

2011-02-28 Thread Simon King
Hi Robert,

On 1 Mrz., 01:00, Robert Goss  wrote:
> I have 2 ideals over the complex field and I would like to take their
> intersection. If I try and use the intersection method on one of the
> ideals i get an error message from singular stating the following type
> error:
>
> TypeError: Cannot call Singular function 'intersect' with ring
> parameter of type ' 'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain'>'

Sage uses a C-library version of Singular to do intersection
(libSingular), but...

> This was generated by the code:
> R. = PolynomialRing(CC, 2)

... unfortunately it does not use libSingular for rings with complex
coefficients:

  sage: type(R)
  
  sage: from sage.rings.polynomial.multi_polynomial_libsingular import
MPolynomialRing_libsingular
  sage: R. = MPolynomialRing_libsingular(CC,2)
  Traceback (most recent call last):
  ...
  NotImplementedError: Base ring is not supported.

> Am I doing something wrong? Would anyone suggest a better way of doing
> this computation?

I think you did nothing wrong -- it should work the way you did it.

Here is a work around:
  sage: R. = CC[]
  sage: I = x*R
  sage: J = y*R
  sage: singular(I).intersect(J)
  x*y

That uses another Singular interface (not a C-library). The result
lives there, so, you need to pull it back into your ring R:
  sage: parent(singular(I).intersect(J))
  Singular
  sage: R*list(singular(I).intersect(J))
  Ideal (x*y) of Multivariate Polynomial Ring in x, y over Complex
Field with 53 bits of precision

The second best solution is to work with a base ring that is supported
by libSingular:

  sage: R. = ZZ[]
  sage: I = x*R
  sage: J = y*R
  sage: I.intersection(J)
  Ideal (-x*y) of Multivariate Polynomial Ring in x, y over Integer
Ring
  sage: R. = QQ[]
  sage: I = x*R
  sage: J = y*R
  sage: I.intersection(J)
  Ideal (x*y) of Multivariate Polynomial Ring in x, y over Rational
Field

Of course, the best solution would be to wrap Singular's complex
coefficients in libSingular. Is there a trac ticket for it?

Kind regards,
Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Intersection of complex Ideals

2011-02-28 Thread Volker Braun
Singular supports working with floating-point complex numbers (CDF in Sage), 
so it should work. 

Having said that, floating-point computations with polynomials are often 
dangerous because of the limited precision. Its usually better to work with 
arbitrary-precision coefficients like QQ or cyclotomic numbers...

sage: R.=QQ[]
sage: R.ideal(x).intersection(R.ideal(y))
Ideal (x*y) of Multivariate Polynomial Ring in x, y over Rational Field


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Intersection of complex Ideals

2011-02-28 Thread Robert Goss
Dear all,

Firstly I am using sage 4.6 on a ubunut machine.

I have 2 ideals over the complex field and I would like to take their
intersection. If I try and use the intersection method on one of the
ideals i get an error message from singular stating the following type
error:

TypeError: Cannot call Singular function 'intersect' with ring
parameter of type ''


This was generated by the code:
R. = PolynomialRing(CC, 2)
I = x*R
J = y*R
I.intersection(J)


The documentation doesnt say anything about not being able to take
intersections over the complex field.

Am I doing something wrong? Would anyone suggest a better way of doing
this computation?

Thank you for any comments.

Robert Goss

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: New to sage: significant digits, etc.

2011-02-28 Thread Jason Grout

On 2/28/11 1:32 PM, sm123123 wrote:

Thanks for your response.

It seems that I was unable to convey the issue at hand. For
Mathematica, I can issue a Plot[] command, followed by an Export[] and
then use \includegraphics to use the generated plot (the its not good
enough section in the SageTeX manual).

I cannot do the same for matlab.



Does the saveas() command in matlab work for saving images, like the 
Export command in mathematica?


http://www.mathworks.com/help/techdoc/ref/saveas.html

I don't have matlab, so I can't test this.

Jason





Sage does have a matlab interface which (presumably) can accept
textual commands.

On Feb 28, 12:13 am, Dan Drake  wrote:

I'll skip your first question for the moment, since I'm not sure about
the answer there.

On Sun, 27 Feb 2011 at 12:59PM -0800, sm123123 wrote:

Second question:



Is there a way to embed results of a matlab calculation using SageTeX
(especially plots) ? For Mathematica, I can generate a plotfile and
use \includegraphics to include the graphic. However, any attempt to
use matlab's plot() command leads to a syntax error via sage.


In order to use SageTeX to get a Matlab plot into your document, you
need to somehow get Sage to use Matlab to make the plot. I don't think
we have any kind of interface for that, so you would need to save the
plot from Matlab directly, just as you do with Mathematica.

Dan

--
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---

  signature.asc
<  1KViewDownload





--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: New to sage: significant digits, etc.

2011-02-28 Thread sm123123
Thanks for your response.

It seems that I was unable to convey the issue at hand. For
Mathematica, I can issue a Plot[] command, followed by an Export[] and
then use \includegraphics to use the generated plot (the its not good
enough section in the SageTeX manual).

I cannot do the same for matlab.

Sage does have a matlab interface which (presumably) can accept
textual commands.

On Feb 28, 12:13 am, Dan Drake  wrote:
> I'll skip your first question for the moment, since I'm not sure about
> the answer there.
>
> On Sun, 27 Feb 2011 at 12:59PM -0800, sm123123 wrote:
> > Second question:
>
> > Is there a way to embed results of a matlab calculation using SageTeX
> > (especially plots) ? For Mathematica, I can generate a plotfile and
> > use \includegraphics to include the graphic. However, any attempt to
> > use matlab's plot() command leads to a syntax error via sage.
>
> In order to use SageTeX to get a Matlab plot into your document, you
> need to somehow get Sage to use Matlab to make the plot. I don't think
> we have any kind of interface for that, so you would need to save the
> plot from Matlab directly, just as you do with Mathematica.
>
> Dan
>
> --
> ---  Dan Drake
> -  http://mathsci.kaist.ac.kr/~drake
> ---
>
>  signature.asc
> < 1KViewDownload

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Accessing R documentation trough notebook broken with 4.6.1?

2011-02-28 Thread kcrisman


On Feb 28, 1:59 pm, Andrzej Giniewicz  wrote:
> I made ticket for this
>
> http://trac.sagemath.org/sage_trac/ticket/10860
>
> also, attached patch that fixes it for me. Sorry if I made something
> not along the rules or did not found best solution, it is some time
> since I last made some patches for Sage or coding in Python at all,
> and I got a little rusty here and there.
>
> A

No one will ever get mad about someone contributing a fix, especially
not the original reporter!  Since this is in sagenb, that would take a
little while to get in - someone has to make a new sagenb package.
(I'm forwarding this to sage-notebook since there might be other
places this is broken, and they will know also probably when it got
broken.)  Thanks.

- kcrisman

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] 3DPlot error

2011-02-28 Thread Thomas Rike

On Feb 28, 2011, at 2:27 AM, Dr. David Kirkby wrote:

> On 02/28/11 05:00 AM, Thomas Rike wrote:
>> I'm not sure if this is the right place to ask a question.
> 
> Yes it is.
> 
> I just downloaded the Sage-4.6.1-OSX-64bit-10.6 app to my 27" iMac and my 
> MacBookPro. On my iMac I cannot use parametric_plot3d. The Java applet does 
> not run. I get a black screen that shows a small "Error Click for details" in 
> the upper left corner. Upon clicking I get a small pop up window: "The 
> application failed to run. There was an error while executing the 
> application. Click "Details" for more information. Clicking "Details" results 
> in  Java Console opening showing:
> 
>> Java Plug-in 1.6.0_22
>> Using JRE version 1.6.0_22-b04-307-10M3261 Java HotSpot(TM) 64-Bit Server VM
>> User home directory = /Users/trike
>> 
>> c:   clear console window
>> f:   finalize objects on finalization queue
>> g:   garbage collect
>> h:   display this help message
>> l:   dump classloader list
>> m:   print memory usage
>> o:   trigger logging
>> p:   reload proxy configuration
>> q:   hide console
>> r:   reload policy configuration
>> s:   dump system and deployment properties
>> t:   dump thread list
>> v:   dump thread stack
>> x:   clear classloader cache
>> 0-5: set trace level to
>> 
>> Anyone have any idea what is wrong?
> 
> I have seen reports of issues with jmol, which would be used for the 3D plot 
> causing problems on some Macs. I think a temporary fix will be to use Firefox 
> as a browser, but people are looking at this issue.
> 
> I don't use a Mac myself, so have not experienced this.
> -- 
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
> 
> Dave
> 
Thanks for the reply. I do use Safari as my browser, but when I switch to 
Firefox the result is exactly the same. The most confusing thing is that I have 
no trouble at all on my MacBookPro which is configured the same way my iMac is 
since I migrated my MacBookPro to the iMac. One other thing is that I have no 
trouble at all on the iMac if I run Sage in the terminal; the JMol window opens 
fine and the graphics is as expected and can be manipulated with the mouse. 
Still looking for ideas.

-Tom
-- 
> 
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: New to sage: significant digits, etc.

2011-02-28 Thread sm123123
Thanks.

Looks needlessly complicated. I did see significant errors crop up
when I tried use .n(4) etc. So, your warning is pretty wise.

Is there a way to extract the mantissa from a number (in base 10 - I
do know that sign_mantissa_exponent() does it in base 2, which is not
terribly useful).

Alternatively, is there support for printf formats (C) ?

On Feb 28, 4:46 am, Volker Braun  wrote:
> On Sunday, February 27, 2011 8:59:25 PM UTC, sm123123 wrote:
>
> > I have numerical calculations that need to adhere to significant
> > digits of the input.
>
> Sage has at least three different "real" numbers, see
>
> http://www.sagemath.org/doc/reference/rings_numerical.html
>
> Each implementation is a different tradeoff between accuracy and speed. If
> you want to be assured that each digit is correct then you probably want to
> use the real interval field (RIF).

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Accessing R documentation trough notebook broken with 4.6.1?

2011-02-28 Thread Andrzej Giniewicz
I made ticket for this

http://trac.sagemath.org/sage_trac/ticket/10860

also, attached patch that fixes it for me. Sorry if I made something
not along the rules or did not found best solution, it is some time
since I last made some patches for Sage or coding in Python at all,
and I got a little rusty here and there.

Andrzej.

On Mon, Feb 28, 2011 at 5:50 PM, Dr. David Kirkby
 wrote:
> On 02/28/11 04:08 PM, kcrisman wrote:
>>
>>
>> On Feb 28, 3:21 am, Andrzej Giniewicz  wrote:
>>>
>>> Hello,
>>>
>>> today I noticed that I cannot access R docs trough notebook, while it
>>> still works like usual from command line. This is what is inside
>>> notebook when viewed as text:
>>>
>>> sage: r.lm?
>>> 
>>> Traceback (most recent call last):
>>>   File "", line 1, in
>>>   File "_sage_input_3.py", line 10, in
>>>     exec compile(u'print _support_.docstring("r.lm", globals(),
>>> system="sage")' + '\n', '', 'single')
>>>   File "", line 1, in
>>>
>>>   File "/opt/sage/devel/sagenb/sagenb/misc/support.py", line 263, in
>>> docstring
>>>     return html_markup(s)
>>>   File "/opt/sage/devel/sagenb/sagenb/misc/support.py", line 288, in
>>> html_markup
>>>     return '' + preamble +'' + s
>>> +''
>>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
>>> 116: ordinal not in range(128)
>>> 
>>>
>>> Currently I don't have alpha of newer version, so I wanted to ask if
>>> this is still visible with 4.6.2 versions and/or known issue. I've
>>> looked trough track and found few similar issues related to for
>>> example unicode handling in %latex, but not this particular.
>>
>> I can confirm this in 4.6.2.rc0.
>>
> Same here, with 4.6.2.rc1 on OpenSolaris.
>
> Dave
>
> --
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
>
> Dave
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: factoring polynomials

2011-02-28 Thread David
What I want is for a calculus student to be able to say "factor(x^2+x
+1)" or "factor(x^2-x-1)" and get something useful. It would be nice
to be able to specify R or C as the relevant field. Using "solve"
instead of "factor" gives exactly what I would expect, namely the
result of applying the quadratic formula.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] cython and wiki.sagemath.org/SageServer: Permission denied

2011-02-28 Thread Pedro Cruz
I have followed instructions on

  http://wiki.sagemath.org/SageServer

and it seems that everything is ok: creating new user, doing cell
computations.

For cython I'm getting

  IOError: [Errno 13] Permission denied

in a cell, of notebook sage 4.6.1, with:
-
%cython
def f(double x):
return x**2
 

The error is below.
I have noticed that compilation is done (there exists file
sage3.spyx).

Any ideias for helping a non linux expert ?

Thank you,
Pedro


Traceback (most recent call last):
  File "", line 1, in 

  File "/home/sageserver/sage/devel/sagenb/sagenb/misc/support.py",
line 519, in cython_import_all
create_local_c_file=create_local_c_file)
  File "/home/sageserver/sage/devel/sagenb/sagenb/misc/support.py",
line 496, in cython_import
create_local_c_file=create_local_c_file)
  File "/home/sageserver/sage/local/lib/python2.6/site-packages/sage/
misc/cython.py", line 288, in cython
F = open(filename).read()
IOError: [Errno 13] Permission denied: '/home/sageserver/.sage/
sage_notebook.sagenb/home/jpedroan/0/code/sage3.spyx'

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: multivariate polynomial division

2011-02-28 Thread Martin Albrecht
On Monday 28 February 2011, dmharvey wrote:
> On Feb 27, 5:29 pm, Martin Albrecht 
> 
> wrote:
> > sage: R. = PolynomialRing(QQ)
> > sage: f = x0^2*x1 + x1^2*x2 + x2^2*x3 + x3^2*x0
> > sage: (f0, f1, f2, f3) = [f.derivative(v) for v in [x0, x1, x2, x3]]
> > sage: I = R.ideal(f0, f1, f2, f3)
> > sage: h = x0^5
> > sage: h.lift(I)
> > [-x0^2*x2 - 4/15*x0*x1*x3, x0^3 + 8/15*x1^2*x3 + x2*x3^2,
> > -16/15*x1*x2*x3, 2/15*x1*x3^2]
> 
> excellent, thanks Martin!
> 
> but what a funny name, "lift"...? I stared at the auto-complete lists
> for a while and never noticed that one.

AFAIK it's a standard name for this operation in commutative algebra. What 
name would have allowed you to spot it?

Cheers,
Martin

--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_jab: martinralbre...@jabber.ccc.de

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: multivariate polynomial division

2011-02-28 Thread dmharvey

On Feb 27, 5:29 pm, Martin Albrecht 
wrote:

> sage: R. = PolynomialRing(QQ)
> sage: f = x0^2*x1 + x1^2*x2 + x2^2*x3 + x3^2*x0
> sage: (f0, f1, f2, f3) = [f.derivative(v) for v in [x0, x1, x2, x3]]
> sage: I = R.ideal(f0, f1, f2, f3)
> sage: h = x0^5
> sage: h.lift(I)
> [-x0^2*x2 - 4/15*x0*x1*x3, x0^3 + 8/15*x1^2*x3 + x2*x3^2, -16/15*x1*x2*x3,
> 2/15*x1*x3^2]

excellent, thanks Martin!

but what a funny name, "lift"...? I stared at the auto-complete lists
for a while and never noticed that one.

david

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Accessing R documentation trough notebook broken with 4.6.1?

2011-02-28 Thread Dr. David Kirkby

On 02/28/11 04:08 PM, kcrisman wrote:



On Feb 28, 3:21 am, Andrzej Giniewicz  wrote:

Hello,

today I noticed that I cannot access R docs trough notebook, while it
still works like usual from command line. This is what is inside
notebook when viewed as text:

sage: r.lm?

Traceback (most recent call last):
   File "", line 1, in
   File "_sage_input_3.py", line 10, in
 exec compile(u'print _support_.docstring("r.lm", globals(),
system="sage")' + '\n', '', 'single')
   File "", line 1, in

   File "/opt/sage/devel/sagenb/sagenb/misc/support.py", line 263, in docstring
 return html_markup(s)
   File "/opt/sage/devel/sagenb/sagenb/misc/support.py", line 288, in 
html_markup
 return '' + preamble +'' + s +''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
116: ordinal not in range(128)


Currently I don't have alpha of newer version, so I wanted to ask if
this is still visible with 4.6.2 versions and/or known issue. I've
looked trough track and found few similar issues related to for
example unicode handling in %latex, but not this particular.


I can confirm this in 4.6.2.rc0.


Same here, with 4.6.2.rc1 on OpenSolaris.

Dave

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Dave

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Accessing R documentation trough notebook broken with 4.6.1?

2011-02-28 Thread kcrisman


On Feb 28, 3:21 am, Andrzej Giniewicz  wrote:
> Hello,
>
> today I noticed that I cannot access R docs trough notebook, while it
> still works like usual from command line. This is what is inside
> notebook when viewed as text:
>
> sage: r.lm?
> 
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "_sage_input_3.py", line 10, in 
>     exec compile(u'print _support_.docstring("r.lm", globals(),
> system="sage")' + '\n', '', 'single')
>   File "", line 1, in 
>
>   File "/opt/sage/devel/sagenb/sagenb/misc/support.py", line 263, in docstring
>     return html_markup(s)
>   File "/opt/sage/devel/sagenb/sagenb/misc/support.py", line 288, in 
> html_markup
>     return '' + preamble + '' + s + ''
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
> 116: ordinal not in range(128)
> 
>
> Currently I don't have alpha of newer version, so I wanted to ask if
> this is still visible with 4.6.2 versions and/or known issue. I've
> looked trough track and found few similar issues related to for
> example unicode handling in %latex, but not this particular.

I can confirm this in 4.6.2.rc0.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Counting lattice points inside convex polyhedra

2011-02-28 Thread Alastair Irving

On 28/02/2011 13:19, D. S. McNeil wrote:

I was wondering if sage implements any algorithm for counting the number of
points with integer coordinates inside polyhedra with rational coordinates.
  even such an algorithm for polygons would be useful for me.


Have a look at the integral_points method of Polyhedron objects, which
might do what you're looking for:

Yes it does.  Thank you.

Alastair

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Counting lattice points inside convex polyhedra

2011-02-28 Thread Volker Braun
The integral_points method (which I wrote :-) uses PALP to enumerate the 
points. Eventually we should implement Barvinok's *algorithm* for counting 
*lattice 
points. I think that this could be done in a few days, but I haven't 
actually done anything for it. But feel free to send a patch :-)*
*
*
*
*

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Counting lattice points inside convex polyhedra

2011-02-28 Thread D. S. McNeil
> I was wondering if sage implements any algorithm for counting the number of
> points with integer coordinates inside polyhedra with rational coordinates.
>  even such an algorithm for polygons would be useful for me.

Have a look at the integral_points method of Polyhedron objects, which
might do what you're looking for:

sage: P = Polyhedron([[1/2, 1/2], [1/2, 7/2], [7/2, 1/2], [7/2, 7/2]])
sage: P
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 4 vertices.

sage: P.integral_points()
[(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)]
sage: len(P.integral_points())
9

Note that this constructs the integral points rather than counts them,
so if there are lots of points in the enveloping lattice polytope it
won't be that fast, but maybe it'll work for your purposes.


Doug

--
Department of Earth Sciences
University of Hong Kong

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Counting lattice points inside convex polyhedra

2011-02-28 Thread Alastair Irving

Hi All

I was wondering if sage implements any algorithm for counting the number 
of points with integer coordinates inside polyhedra with rational 
coordinates.  even such an algorithm for polygons would be useful for me.


Best wishes

Alastair

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: New to sage: significant digits, etc.

2011-02-28 Thread Volker Braun
On Sunday, February 27, 2011 8:59:25 PM UTC, sm123123 wrote:
>
> I have numerical calculations that need to adhere to significant 
> digits of the input.


Sage has at least three different "real" numbers, see

http://www.sagemath.org/doc/reference/rings_numerical.html

Each implementation is a different tradeoff between accuracy and speed. If 
you want to be assured that each digit is correct then you probably want to 
use the real interval field (RIF).


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] 3DPlot error

2011-02-28 Thread Dr. David Kirkby

On 02/28/11 05:00 AM, Thomas Rike wrote:

I'm not sure if this is the right place to ask a question.


Yes it is.

I just downloaded the Sage-4.6.1-OSX-64bit-10.6 app to my 27" iMac and my 
MacBookPro. On my iMac I cannot use parametric_plot3d. The Java applet does not 
run. I get a black screen that shows a small "Error Click for details" in the 
upper left corner. Upon clicking I get a small pop up window: "The application 
failed to run. There was an error while executing the application. Click 
"Details" for more information. Clicking "Details" results in  Java Console 
opening showing:



Java Plug-in 1.6.0_22
Using JRE version 1.6.0_22-b04-307-10M3261 Java HotSpot(TM) 64-Bit Server VM
User home directory = /Users/trike

c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to

Anyone have any idea what is wrong?


I have seen reports of issues with jmol, which would be used for the 3D plot 
causing problems on some Macs. I think a temporary fix will be to use Firefox as 
a browser, but people are looking at this issue.


I don't use a Mac myself, so have not experienced this.
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Dave

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Accessing R documentation trough notebook broken with 4.6.1?

2011-02-28 Thread Andrzej Giniewicz
Hello,

today I noticed that I cannot access R docs trough notebook, while it
still works like usual from command line. This is what is inside
notebook when viewed as text:

sage: r.lm?

Traceback (most recent call last):
  File "", line 1, in 
  File "_sage_input_3.py", line 10, in 
exec compile(u'print _support_.docstring("r.lm", globals(),
system="sage")' + '\n', '', 'single')
  File "", line 1, in 

  File "/opt/sage/devel/sagenb/sagenb/misc/support.py", line 263, in docstring
return html_markup(s)
  File "/opt/sage/devel/sagenb/sagenb/misc/support.py", line 288, in html_markup
return '' + preamble + '' + s + ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
116: ordinal not in range(128)


Currently I don't have alpha of newer version, so I wanted to ask if
this is still visible with 4.6.2 versions and/or known issue. I've
looked trough track and found few similar issues related to for
example unicode handling in %latex, but not this particular.

Andrzej.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org