Ask Your Question

Questors's profile - activity

2019-04-22 23:33:19 -0500 received badge  Popular Question (source)
2017-10-11 02:47:04 -0500 received badge  Taxonomist
2017-09-28 10:41:14 -0500 received badge  Famous Question (source)
2017-07-28 05:00:20 -0500 received badge  Famous Question (source)
2016-11-07 11:11:58 -0500 received badge  Popular Question (source)
2015-03-05 16:09:24 -0500 received badge  Notable Question (source)
2015-03-05 16:09:24 -0500 received badge  Popular Question (source)
2015-01-29 02:25:30 -0500 received badge  Popular Question (source)
2015-01-29 02:25:30 -0500 received badge  Notable Question (source)
2014-11-24 12:57:25 -0500 received badge  Famous Question (source)
2013-10-27 03:38:58 -0500 asked a question Cython error: ambiguous overloaded method

Hello all,

I am trying to extend CGraph using C++ containers only to get a cython compile error: ambiguous overloaded method on memset, memcopy and strlen. As CGraph uses bitset which I have to manipulate, I need to include bitset.pxi and bitset.pxd.pxi, so end up with a mix of c and c++ calls for cython to deal with. I am guessing that cython can't decide which memset etc calls to use, C++ or C versions.

Does anyone know how I might to resolve this ambiguity?
Regards Martin

2013-09-25 23:46:41 -0500 asked a question cimport cython.view array as cvarray - compilation error

I get a compilation error if I try something even as simple as:

from cython.view cimport array as cvarray
cdef arraytest():
    pass

I get the same error using the notebook and on loading from the sage command line. I have installed a fresh copy of cython.spkg to no avail.

I must be missing something obvious, but what?

Sage version 5.11; gcc version 4.7.3; running on ubuntu 13.04

This is the error:

  File "/home/martin/sage-5.9/devel/sagenb/sagenb/misc/support.py", line 533, in cython_import_all
    create_local_c_file=create_local_c_file)
  File "/home/martin/sage-5.9/devel/sagenb/sagenb/misc/support.py", line 510, in cython_import
    create_local_c_file=create_local_c_file)
  File "/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/misc/cython.py", line 535, in cython
    raise RuntimeError, "Error compiling %s:\n%s\n%s"%(filename, log, err)
RuntimeError: Error compiling /home/martin/nbfiles.sagenb/home/admin/10/code/sage4.spyx:
running build
running build_ext
building '_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/martin/sage-5.9/local/include/csage -I/home/martin/sage-5.9/local/include -I/home/martin/sage-5.9/local/include/python2.7 -I/home/martin/sage-5.9/local/lib/python/site-packages/numpy/core/include -I/home/martin/sage-5.9/devel/sage/sage/ext -I/home/martin/sage-5.9/devel/sage -I/home/martin/sage-5.9/devel/sage/sage/gsl -I/home/martin/nbfiles.sagenb/home/admin/10/code -I/home/martin/sage-5.9/local/include/python2.7 -c _home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c -o build/temp.linux-x86_64-2.7/_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.o -w -O2

_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2068:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2070:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2529:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2531:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2592:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2594:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2655:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2657:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2865:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2867:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2950:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:2952:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:3533:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:3535:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:3733:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:3735:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:4915:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:4917:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:5886:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:5888:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
_home_martin_nbfiles_sagenb_home_admin_10_code_sage4_spyx_0.c:5954:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token ...
(more)
2013-09-06 00:09:20 -0500 received badge  Supporter (source)
2013-09-02 06:25:49 -0500 commented answer Problem with AbelianGroup.cayley_graph ()

Thanks for the tip Nicolas. Regards Martin

2013-08-31 10:11:06 -0500 received badge  Editor (source)
2013-08-31 10:09:18 -0500 asked a question Problem with AbelianGroup.cayley_graph ()

Am I misunderstanding something here? AbelianGroup.cayley_graph() fails with the default generators and but is ok if generators=AbelianGroup.gens(). It also fails with .gens_small().
We have:
sage: ag2=(AbelianGroup([3,3])) sage: ag2.cayley_graph(generators=ag2.gens())) Digraph on 9 vertices

While:

sage: ag2.cayley_graph() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-42-b5555c6dc56f> in <module>() ----> 1 ag2.cayley_graph()

/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/categories/semigroups.pyc in cayley_graph(self, side, simple, elements, generators, connecting_set) 283 generators = connecting_set 284 if generators is None: --> 285 generators = self.semigroup_generators() 286 if isinstance(generators, (list, tuple)): 287 generators = dict((self(g), self(g)) for g in generators)

/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6585)()

/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/structure/misc.so in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1606)()

AttributeError: 'AbelianGroup_class_with_category' object has no attribute 'semigroup_generators'

But ag2 is a semi_group:

sage: ag2.categories() [Category of groups, Category of monoids, Category of semigroups, Category of magmas, Category of sets, Category of sets with partial maps, Category of objects]

2013-08-27 10:49:48 -0500 commented answer Problem with GeneralDihedralGroup constructor

Thank you, that was careless of me; I must remember to read more closely and remember what I read a few days ago!

2013-08-27 08:57:13 -0500 asked a question Problem with GeneralDihedralGroup constructor

While exploring cayley graphs of generalized dihedral groups I get a wrong result if I use GeneralDihedralGroup([n]) to create a simple dihedral group for some values on n, 6 and 10 for instance. Sage responds that it is isomorphic to DihedralGroup(n), but the cayley graphs and group generators are not the same. Is it me or the system?
For example:

sage:  gd=GeneralDihedralGroup([10])  
sage:  CGD10=Graph(gd.cayley_graph())  
sage: CGD10.diameter()  
4  
sage:  CGD10.degree()  
[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]  
sage:  dih10=DihedralGroup(10)  
sage: sage: Cdih10=Graph(dih10.cayley_graph())  
sage: Cdih10.diameter()  
6  
sage: Cdih10.degree()  
[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]  
sage: gd.is_isomorphic(DihedralGroup(10))  
True  
sage: dih10.gens()  
[(1,2,3,4,5,6,7,8,9,10), (1,10)(2,9)(3,8)(4,7)(5,6)]  
sage: gd.gens()  
[(4,7)(5,6), (3,4,5,6,7), (1,2)]`
2012-08-23 09:53:11 -0500 received badge  Notable Question (source)
2012-01-12 08:09:05 -0500 received badge  Popular Question (source)
2011-02-13 04:45:22 -0500 commented question setting module import path in cython in the notebook

Thank you for the response. Being a bit of a linux newbie I was hoping I could stay in the notebook. OH well something else to learn I suppose.

2011-02-13 04:45:22 -0500 commented question setting module import path in cython in the notebook

Thank you for the response. Being a bit of a linux newbie I was hoping I could stay in the notebook. Oh well something else to learn I suppose.

2011-02-01 08:56:50 -0500 asked a question setting module import path in cython in the notebook

I want to break up a long chunk of cythonised code in the notebook and put the cython code in my own user directory and then cimport as needed. So I have created a directory and created the MyEi.pxd and MyEi.pyx file. In the notebook cell I have:

''%cython  
#cinclude /home/dad/MyModule/  
import cython  
cimport MyEi  
from MyEi cimport MyEiz''

On running I get:
ImportError: No module named MyEi

Where am I going wrong? I am now totally confused about search paths.

Martin

2010-11-14 08:27:58 -0500 asked a question Find .f2py_f2cmap file from notebook

Is it possible to get f2py (%fortran) to find an .f2py_f2cmap file when using the notebook?