Hello, Carl. You wrote 29 июля 2010 г., 2:40:14: > Sure, I can help. I have some API questions first.
Thanks a lot! > What are the bool and int vectors and matrices used for? (Sage > doesn't really have vectors or matrices of booleans or of machine > ints. It has vectors and matrices over GF(2) (integers mod 2, so > 1+1=0), which could be used as booleans. There are also numpy arrays > and matrices of these types.) I've made quick check and, to my surprise, there is no ALGLIB function which is accessible from Sage and accepts/returns boolean vector or matrix :) But I think that this feature should be supported in case such function will appear in future. Integer vectors are used to store permutation tables (LU decomposition and related functions), by fitting functions (to specify derivative information) and by several other functions. Integer matrices are not used by functions accessible from Sage, but again I recommend to support them. > My suggestion would be to support Sage vectors and matrices over > GF(2), RDF, and CDF (machine floats and complex numbers), as well as > numpy arrays and matrices of appropriate types. +1 My proposal is to make * boolean vector/matrix = GF(2), RDF (non-zero = True) * integer vector/matrix = RDF * real = RDF * complex = CDF >> because ALGLIB uses Python's list-of-lists to store matrices, and Sage >> uses its own matrix class. But only several functions from _alglib.py >> have to be fixed to work with Sage matrices/vectors: >> * safe_len/safe_cols/safe_rows >> * is_bool_vector/is_int_vector/is_real_vector/is_complex_vector >> * is_bool_matrix/is_int_matrix/is_real_matrix/is_complex_matrix >> * x_from_list/x_from_listlist Sorry, I've forgot to add several functions to this list: * bool_vector_from_x/bool_matrix_from_x * int_vector_from_x/int_matrix_from_x * real_vector_from_x/real_matrix_from_x * complex_vector_from_x/complex_matrix_from_x x_from_list/x_from_listlist are used to convert from Python to ALGLIB, and this functions are used to convert in backward direction. Within 8 hours I'll write in more details about these functions. -- With best regards, Sergey mailto:sergey.bochka...@alglib.net -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org