Révision 118

pobysoPythonSage/src/pobyso.py (revision 118)
499 499
 
500 500
def pobyso_get_list_elements_so_so(objectListSo):
501 501
    """
502
    Get the list elements as a Sage/Python array of Sollya objects.
503
    The other data returned are Sage/Python objects.
502
    Get the Sollya list elements as a Sage/Python array of Sollya objects.
503
    
504
    INPUT:
505
    - objectListSo: a Sollya list of Sollya objects.
506
    
507
    OUTPUT:
508
    - a Sage/Python tuple made of:
509
      - a Sage/Python list of Sollya objects,
510
      - a Sage/Python int holding the number of elements,
511
      - a Sage/Python int stating (!= 0) that the list is end-elliptic.
512
    NOTE::
513
        We recover the addresses of the Sollya object from the list of pointers
514
        returned by sollya_lib_get_list_elements. The list itself is freed.
515
    TODO::
516
        Figure out what to do with numElements since the number of elements
517
        can easily be recovered from the list itself. 
518
        Ditto for isEndElliptic.
504 519
    """
505 520
    listAddress = POINTER(c_longlong)()
506 521
    numElements = c_int(0)
......
513 528
    if result == 0 :
514 529
        return None
515 530
    for i in xrange(0, numElements.value, 1):
516
       listAsSageList.append(sollya_lib_copy_obj(listAddress[i]))
531
       #listAsSageList.append(sollya_lib_copy_obj(listAddress[i]))
532
       listAsSageList.append(listAddress[i])
517 533
       # Clear each of the elements returned by Sollya.
518
       sollya_lib_clear_obj(listAddress[i])
534
       #sollya_lib_clear_obj(listAddress[i])
519 535
    # Free the list itself.   
520 536
    sollya_lib_free(listAddress)
521 537
    return(listAsSageList, numElements.value, isEndElliptic.value)

Formats disponibles : Unified diff