#16083: MCQD to compute max cliques
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.3
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:  graph  |    Reviewers:
  theory                 |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  a555604888f8f5fd3ab4846a379c8719ae7a7de6
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  public/mcqd            |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by azi):

 Yes, I am quite confused by that. Following is how I used to
 (successfully) call mcqd from a *.pyx file, but I don't seem to be using
 the same convention as you say. I hope I am not bothering you with this
 I'd just like to understand what I was doing here and what you're doing in
 your code :)))

 {{{
 def clique_number_fast(G):
     n = G.order()

     cpdef bool **adj
     cpdef int clorder
     cpdef int *clverts

     adj= <bool **> malloc(sizeof(bool *)*n)
     for i in xrange(n):
         adj[i] = <bool *> calloc(n, sizeof(bool))

     # Warning we are assuming the vertices are labeled from 0...n-1
     for i,j in G.edges(labels=False):
         adj[i][j] = True
         adj[j][i] = True

     cpdef Maxclique *m = new_Maxclique(adj,n,0.025)
     m.mcqdyn(clverts, clorder);
     # Yes, I am supposed to free the entire array but the above is just an
 indication of what is causing the error
     for i in xrange(n): free(adj[i])

     free(adj)

     return clorder
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16083#comment:17>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to