| 1 | initial version |
Matrix -> type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'
from sage.matrix.all import Matrix
or
from sage.matrix.constructor import Matrix.
vector -> type 'sage.modules.vector_integer_dense.Vector_integer_dense'
from sage.modules.free_module_element import vector
ZZ -> type 'sage.rings.integer_ring.IntegerRing_class'
from sage.rings.integer_ring import ZZ
MixedIntegerLinearProgram -> type 'sage.numerical.mip.MixedIntegerLinearProgram'
from sage.numerical.mip import MixedIntegerLinearProgram
Once you know roughly where the class is defined, for example Matrix is defined somewhere in SAGE_ROOT/devel/sage/sage/matrix/, take a look at the file all.py in that directory. In this case you'll find a line
from constructor import matrix, Matrix, column_matrix, random_matrix, diagonal_matrix, identity_matrix, block_matrix, block_diagonal_matrix, jordan_block, zero_matrix, ones_matrix, elementary_matrix, companion_matrix
So that tells you that you can import Matrix from sage.matrix.all or from sage.matrix.constructor. Your other examples can be dealt with similarly.
| 2 | No.2 Revision |
Matrix -> type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'
from sage.matrix.all import Matrix
or
from sage.matrix.constructor import Matrix.
vector -> type 'sage.modules.vector_integer_dense.Vector_integer_dense'
from sage.modules.free_module_element import vector
ZZ -> type 'sage.rings.integer_ring.IntegerRing_class'
from sage.rings.integer_ring import ZZ
MixedIntegerLinearProgram -> type 'sage.numerical.mip.MixedIntegerLinearProgram'
from sage.numerical.mip import MixedIntegerLinearProgram
Once you know roughly where the class is defined, for example Matrix is defined somewhere in SAGE_ROOT/devel/sage/sage/matrix/, take a look at the file all.py in that directory. In this case you'll find a line
from constructor import matrix, Matrix, column_matrix, random_matrix, diagonal_matrix, identity_matrix, block_matrix, block_diagonal_matrix, jordan_block, zero_matrix, ones_matrix, elementary_matrix, companion_matrix
So that tells you that you can import Matrix from sage.matrix.all or from sage.matrix.constructor. Your other examples can be dealt with similarly.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.