Ticket #4983: trac_4983-subdivisions.patch

File trac_4983-subdivisions.patch, 24.8 KB (added by jhpalmieri, 9 years ago)
  • sage/matrix/action.pyx

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1300902580 25200
    # Node ID 6ebef75e92d8b5d2d5597acc47807596bf283989
    # Parent  6a679959b54b7975af1841df4dd77d28b0faef28
    #4983: change subdivisions to _subdivisions
    
    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/action.pyx
    a b  
    145145            else:
    146146                A = A.dense_matrix()
    147147        prod = A._matrix_times_matrix_(B)
    148         if A.subdivisions is not None or B.subdivisions is not None:
    149             Asubs = A.get_subdivisions()
    150             Bsubs = B.get_subdivisions()
     148        if A._subdivisions is not None or B._subdivisions is not None:
     149            Asubs = A.subdivisions()
     150            Bsubs = B.subdivisions()
    151151            if Asubs[1] == Bsubs[0]:
    152152                prod.subdivide(Asubs[0], Bsubs[1])
    153153        return prod
  • sage/matrix/matrix0.pxd

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix0.pxd
    a b  
    1616cdef class Matrix(sage.structure.element.Matrix):
    1717    # Properties of any matrix  (plus _parent, inherited from base class)
    1818    cdef public object _cache
    19     cdef public object subdivisions
     19    cdef public object _subdivisions
    2020    cdef public object _base_ring
    2121    cdef sage.structure.mutability.Mutability _mutability
    2222
  • sage/matrix/matrix0.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix0.pyx
    a b  
    15181518        except (AttributeError, NotImplementedError):
    15191519            M = sage.matrix.matrix_space.MatrixSpace(ring, self._nrows, self._ncols, sparse=self.is_sparse())
    15201520            mat = M(self.list(), coerce=True, copy=False)
    1521             mat.subdivide(self.get_subdivisions())
     1521            mat.subdivide(self.subdivisions())
    15221522            return mat
    15231523
    15241524    def _test_change_ring(self, **options):
     
    16731673        if nr == 0 or nc == 0:
    16741674            return "[]"
    16751675
    1676         row_divs, col_divs = self.get_subdivisions()
     1676        row_divs, col_divs = self.subdivisions()
    16771677
    16781678        # Set the mapping based on keyword arguments
    16791679        if rep_mapping is None:
     
    18331833        S = self.list()
    18341834        rows = []
    18351835       
    1836         row_divs, col_divs = self.get_subdivisions()
     1836        row_divs, col_divs = self.subdivisions()
    18371837       
    18381838        from sage.server.support import EMBEDDED_MODE
    18391839
  • sage/matrix/matrix1.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix1.pyx
    a b  
    13221322
    13231323            sage: a = matrix(ZZ, 3, range(9))
    13241324            sage: a.subdivide([1,2],2)
    1325             sage: a.get_subdivisions()
     1325            sage: a.subdivisions()
    13261326            ([1, 2], [2])
    13271327            sage: b = a.sparse_matrix().dense_matrix()
    1328             sage: b.get_subdivisions()
     1328            sage: b.subdivisions()
    13291329            ([1, 2], [2])
    13301330        """
    13311331        if self.is_dense():
     
    13351335                               copy = False, sparse=False)
    13361336        for i,j in self.nonzero_positions():
    13371337            A.set_unsafe(i,j,self.get_unsafe(i,j))
    1338         A.subdivide(self.get_subdivisions())
     1338        A.subdivide(self.subdivisions())
    13391339        return A
    13401340
    13411341    def sparse_matrix(self):
     
    13801380            return self
    13811381        A = self.new_matrix(self._nrows, self._ncols, entries = self.dict(), coerce=False,
    13821382                               copy = False, sparse=True)
    1383         A.subdivide(self.get_subdivisions())
     1383        A.subdivide(self.subdivisions())
    13841384        return A
    13851385
    13861386    def matrix_space(self, nrows=None, ncols=None, sparse=None):
     
    15011501            will be discarded, since it would be ambiguous how to interpret
    15021502            them.  If the subdivision behavior is not what you need,
    15031503            you can manage subdivisions yourself with methods like
    1504             :meth:`~sage.matrix.matrix2.Matrix.get_subdivisions`
     1504            :meth:`~sage.matrix.matrix2.Matrix.subdivisions`
    15051505            and
    15061506            :meth:`~sage.matrix.matrix2.Matrix.subdivide`.
    15071507            You might also find :func:`~sage.matrix.constructor.block_matrix`
     
    16641664                Z.set_unsafe(r, c+nc, other.get_unsafe(r,c))
    16651665
    16661666        if subdivide:
    1667             self_subs_rows, self_subs_cols = self.get_subdivisions()
    1668             other_subs_rows, other_subs_cols = other.get_subdivisions()
     1667            self_subs_rows, self_subs_cols = self.subdivisions()
     1668            other_subs_rows, other_subs_cols = other.subdivisions()
    16691669            if self_subs_rows == other_subs_rows:
    16701670                z_subs_rows = self_subs_rows
    16711671            else:
  • sage/matrix/matrix2.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix2.pyx
    a b  
    50375037            [73 79 83]
    50385038            sage: M.subdivision_entry(1,0,0,0)
    50395039            31
    5040             sage: M.get_subdivisions()
     5040            sage: M.subdivisions()
    50415041            ([2], [3])
    50425042            sage: M.subdivide(None, [1,3]); M
    50435043            [ 2| 3  5| 7 11]
     
    50965096            col_lines = [col_lines]
    50975097        row_lines = [0] + [int(ZZ(x)) for x in row_lines] + [self._nrows]
    50985098        col_lines = [0] + [int(ZZ(x)) for x in col_lines] + [self._ncols]
    5099         if self.subdivisions is not None:
     5099        if self._subdivisions is not None:
    51005100            self.clear_cache()
    5101         self.subdivisions = (row_lines, col_lines)
     5101        self._subdivisions = (row_lines, col_lines)
    51025102       
    51035103    def subdivision(self, i, j):
    51045104        """
    5105         Returns in immutable copy of the (i,j)th submatrix of self,
     5105        Returns an immutable copy of the (i,j)th submatrix of self,
    51065106        according to a previously set subdivision.
    51075107       
    51085108        Before a subdivision is set, the only valid arguments are (0,0)
     
    51475147            sage: M.subdivision(0,1)
    51485148            []
    51495149        """
    5150         if self.subdivisions is None:
    5151             self.subdivisions = ([0, self._nrows], [0, self._ncols])
     5150        if self._subdivisions is None:
     5151            self._subdivisions = ([0, self._nrows], [0, self._ncols])
    51525152        key = "subdivision %s %s"%(i,j)
    51535153        sd = self.fetch(key)
    51545154        if sd is None:
    5155             sd = self[self.subdivisions[0][i]:self.subdivisions[0][i+1], self.subdivisions[1][j]:self.subdivisions[1][j+1]]
     5155            sd = self[self._subdivisions[0][i]:self._subdivisions[0][i+1],
     5156                      self._subdivisions[1][j]:self._subdivisions[1][j+1]]
    51565157            sd.set_immutable()
    51575158            self.cache(key, sd)
    51585159        return sd
     
    51925193            ...
    51935194            IndexError: Submatrix 0,0 has no entry 4,0
    51945195        """
    5195         if self.subdivisions is None:
     5196        if self._subdivisions is None:
    51965197            if not i and not j:
    51975198                return self[x,y]
    51985199            else:
    51995200                raise IndexError, "No such submatrix %s, %s"%(i,j)
    5200         if x >= self.subdivisions[0][i+1]-self.subdivisions[0][i] or \
    5201            y >= self.subdivisions[1][j+1]-self.subdivisions[1][j]:
     5201        if x >= self._subdivisions[0][i+1]-self._subdivisions[0][i] or \
     5202           y >= self._subdivisions[1][j+1]-self._subdivisions[1][j]:
    52025203            raise IndexError, "Submatrix %s,%s has no entry %s,%s"%(i,j, x, y)
    5203         return self[self.subdivisions[0][i] + x , self.subdivisions[1][j] + y]
    5204 
    5205     def get_subdivisions(self):
     5204        return self[self._subdivisions[0][i] + x , self._subdivisions[1][j] + y]
     5205
     5206    def subdivisions(self):
    52065207        """
    52075208        Returns the current subdivision of self.
    52085209       
    52095210        EXAMPLES::
    52105211       
    52115212            sage: M = matrix(5, 5, range(25))
    5212             sage: M.get_subdivisions()
     5213            sage: M.subdivisions()
    52135214            ([], [])
    52145215            sage: M.subdivide(2,3)
    5215             sage: M.get_subdivisions()
     5216            sage: M.subdivisions()
    52165217            ([2], [3])
    52175218            sage: N = M.parent()(1)
    5218             sage: N.subdivide(M.get_subdivisions()); N
     5219            sage: N.subdivide(M.subdivisions()); N
    52195220            [1 0 0|0 0]
    52205221            [0 1 0|0 0]
    52215222            [-----+---]
     
    52235224            [0 0 0|1 0]
    52245225            [0 0 0|0 1]
    52255226        """
    5226         if self.subdivisions is None:
     5227        if self._subdivisions is None:
    52275228            return ([], [])
    52285229        else:
    5229             return (self.subdivisions[0][1:-1], self.subdivisions[1][1:-1])
     5230            return (self._subdivisions[0][1:-1], self._subdivisions[1][1:-1])
     5231
     5232    # 'get_subdivisions' is kept for backwards compatibility: see #4983.
     5233    get_subdivisions = subdivisions
    52305234           
    52315235    def tensor_product(self,Y):
    52325236        """
  • sage/matrix/matrix_dense.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_dense.pyx
    a b  
    3030        not change the entries of this matrix.
    3131        """
    3232        A = self.new_matrix(entries=self.list(), coerce=False, copy=False)
    33         if self.subdivisions is not None:
    34             A.subdivide(*self.get_subdivisions())
     33        if self._subdivisions is not None:
     34            A.subdivide(*self.subdivisions())
    3535        return A
    3636
    3737    def __hash__(self):
     
    196196            for i from 0<= i < nr:
    197197                trans.set_unsafe(j,i,self.get_unsafe(i,j))
    198198
    199         if self.subdivisions is not None:
    200             row_divs, col_divs = self.get_subdivisions()
     199        if self._subdivisions is not None:
     200            row_divs, col_divs = self.subdivisions()
    201201            trans.subdivide(col_divs, row_divs)
    202202        return trans
    203203
     
    241241                ri = ri-1
    242242                atrans.set_unsafe(j , i, self.get_unsafe(ri,rj))
    243243
    244         if self.subdivisions is not None:
    245             row_divs, col_divs = self.get_subdivisions()
     244        if self._subdivisions is not None:
     245            row_divs, col_divs = self.subdivisions()
    246246            atrans.subdivide([nc - t for t in reversed(col_divs)],
    247247                             [nr - t for t in reversed(row_divs)])
    248248        return atrans
     
    331331        M = sage.matrix.matrix_space.MatrixSpace(R, self._nrows,
    332332                   self._ncols, sparse=False)
    333333        image = M([phi(z) for z in self.list()])
    334         if self.subdivisions is not None:
    335             image.subdivide(*self.get_subdivisions())
     334        if self._subdivisions is not None:
     335            image.subdivide(*self.subdivisions())
    336336        return image
    337337
    338338    def apply_map(self, phi, R=None, sparse=False):
     
    422422        M = sage.matrix.matrix_space.MatrixSpace(R, self._nrows,
    423423                   self._ncols, sparse=sparse)
    424424        image = M(v)
    425         if self.subdivisions is not None:
    426             image.subdivide(*self.get_subdivisions())
     425        if self._subdivisions is not None:
     426            image.subdivide(*self.subdivisions())
    427427        return image
    428428
    429429    def _derivative(self, var=None):
     
    454454        M = sage.matrix.matrix_space.MatrixSpace(R, self._nrows,
    455455                   self._ncols, sparse=False)
    456456        image = M(v)
    457         if self.subdivisions is not None:
    458             image.subdivide(*self.get_subdivisions())
     457        if self._subdivisions is not None:
     458            image.subdivide(*self.subdivisions())
    459459        return image
    460460
  • sage/matrix/matrix_double_dense.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_double_dense.pyx
    a b  
    517517        cdef Matrix_double_dense A
    518518        A = self._new(self._nrows, self._ncols)
    519519        A._matrix_numpy = self._matrix_numpy.copy()
    520         if self.subdivisions is not None:
    521             A.subdivide(*self.get_subdivisions())
     520        if self._subdivisions is not None:
     521            A.subdivide(*self.subdivisions())
    522522        return A
    523523
    524524
     
    10901090        cdef Matrix_double_dense trans
    10911091        trans = self._new(self._ncols, self._nrows)
    10921092        trans._matrix_numpy = self._matrix_numpy.transpose().copy()
    1093         if self.subdivisions is not None:
    1094             row_divs, col_divs = self.get_subdivisions()
     1093        if self._subdivisions is not None:
     1094            row_divs, col_divs = self.subdivisions()
    10951095            trans.subdivide(col_divs, row_divs)
    10961096        return trans
    10971097
  • sage/matrix/matrix_generic_dense.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_generic_dense.pyx
    a b  
    225225            [3|4 5]
    226226        """
    227227        A = self.__class__(self._parent, self._entries, copy = True, coerce=False)
    228         if self.subdivisions is not None:
    229             A.subdivide(*self.get_subdivisions())
     228        if self._subdivisions is not None:
     229            A.subdivide(*self.subdivisions())
    230230        return A
    231231
    232232    def _multiply_classical(left, matrix.Matrix _right):
  • sage/matrix/matrix_generic_sparse.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_generic_sparse.pyx
    a b  
    265265   
    266266    def __copy__(self):
    267267        A = self.__class__(self._parent, self._entries, copy = True, coerce=False)
    268         if self.subdivisions is not None:
    269             A.subdivide(*self.get_subdivisions())
     268        if self._subdivisions is not None:
     269            A.subdivide(*self.subdivisions())
    270270        return A
    271271
    272272   
  • sage/matrix/matrix_integer_2x2.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_integer_2x2.pyx
    a b  
    311311        mpz_set(x.c ,self.c)
    312312        mpz_set(x.d, self.d)
    313313        x._mutability = Mutability(False)
    314         if self.subdivisions is not None:
    315             x.subdivide(*self.get_subdivisions())
     314        if self._subdivisions is not None:
     315            x.subdivide(*self.subdivisions())
    316316        return x
    317317
    318318    cpdef ModuleElement _add_(left, ModuleElement right):
  • sage/matrix/matrix_integer_dense.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_integer_dense.pyx
    a b  
    266266            mpz_init_set(A._entries[i], self._entries[i])
    267267        sig_off()
    268268        A._initialized = True
    269         if self.subdivisions is not None:
    270             A.subdivide(*self.get_subdivisions())
     269        if self._subdivisions is not None:
     270            A.subdivide(*self.subdivisions())
    271271        return A
    272272       
    273273    def __hash__(self):
     
    47434743                mpz_init_set(A._matrix[j][i], self._matrix[i][j])
    47444744        sig_off()
    47454745        A._initialized = True
    4746         if self.subdivisions is not None:
    4747             row_divs, col_divs = self.get_subdivisions()
     4746        if self._subdivisions is not None:
     4747            row_divs, col_divs = self.subdivisions()
    47484748            A.subdivide(col_divs, row_divs)
    47494749        return A
    47504750
     
    47954795        sig_off()
    47964796        A._initialized = True
    47974797
    4798         if self.subdivisions is not None:
    4799             row_divs, col_divs = self.get_subdivisions()
     4798        if self._subdivisions is not None:
     4799            row_divs, col_divs = self.subdivisions()
    48004800            A.subdivide([nc - t for t in reversed(col_divs)],
    48014801                        [nr - t for t in reversed(row_divs)])
    48024802        return A
  • sage/matrix/matrix_mod2_dense.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_mod2_dense.pyx
    a b  
    489489            return matrix_dense.Matrix_dense.str(self, rep_mapping=rep_mapping, zero=zero, plus_one=plus_one)
    490490
    491491        cdef list row_div, col_div
    492         if self.subdivisions is not None:
     492        if self._subdivisions is not None:
    493493            row_s = empty_row
    494494            div_s = row_divider = b"[%s]" % ("-" * (self._ncols*2-1))
    495             row_div, col_div = self.get_subdivisions()
     495            row_div, col_div = self.subdivisions()
    496496            last_i = 0
    497497            for i in col_div:
    498498                if i == last_i or i == self._ncols:
     
    508508                row_s[1+2*j] = c'0' + mzd_read_bit(self._entries,i,j)
    509509            s.append(row)
    510510
    511         if self.subdivisions is not None:
     511        if self._subdivisions is not None:
    512512            for i in reversed(row_div):
    513513                s.insert(i, row_divider)
    514514
     
    999999        if self._nrows and self._ncols:
    10001000            mzd_copy(A._entries, self._entries)
    10011001
    1002         if self.subdivisions is not None:
    1003             A.subdivide(*self.get_subdivisions())
     1002        if self._subdivisions is not None:
     1003            A.subdivide(*self.subdivisions())
    10041004
    10051005        return A
    10061006       
     
    14501450            return A
    14511451
    14521452        A._entries = mzd_transpose(A._entries, self._entries)
    1453         if self.subdivisions is not None:
    1454             A.subdivide(*self.get_subdivisions())
     1453        if self._subdivisions is not None:
     1454            A.subdivide(*self.subdivisions())
    14551455        return A
    14561456
    14571457    cdef int _cmp_c_impl(self, Element right) except -2:
  • sage/matrix/matrix_modn_dense.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_modn_dense.pyx
    a b  
    668668        memcpy(A._entries, self._entries, sizeof(mod_int)*self._nrows*self._ncols)
    669669        A.p = self.p
    670670        A.gather = self.gather
    671         if self.subdivisions is not None:
    672             A.subdivide(*self.get_subdivisions())
     671        if self._subdivisions is not None:
     672            A.subdivide(*self.subdivisions())
    673673        return A
    674674
    675675
     
    18541854            for j from 0 <= j < self._ncols:
    18551855                mpz_init_set_si(L_row[j], A_row[j])
    18561856        L._initialized = 1
    1857         L.subdivide(self.get_subdivisions())
     1857        L.subdivide(self.subdivisions())
    18581858        return L
    18591859
    18601860
  • sage/matrix/matrix_modn_sparse.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_modn_sparse.pyx
    a b  
    688688            row = self.rows[i]
    689689            for j from 0 <= j < row.num_nonzero:
    690690                set_entry(&B.rows[row.positions[j]], i, row.entries[j])
    691         if self.subdivisions is not None:
    692             row_divs, col_divs = self.get_subdivisions()
     691        if self._subdivisions is not None:
     692            row_divs, col_divs = self.subdivisions()
    693693            B.subdivide(col_divs, row_divs)
    694694        return B
    695695                               
     
    10111011            for j from 0 <= j < A_row.num_nonzero:
    10121012                L_row.positions[j] = A_row.positions[j]
    10131013                mpz_init_set_si(L_row.entries[j], A_row.entries[j])
    1014         L.subdivide(self.get_subdivisions())
     1014        L.subdivide(self.subdivisions())
    10151015        return L
    10161016
  • sage/matrix/matrix_rational_dense.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_rational_dense.pyx
    a b  
    524524        for i from 0 <= i < self._nrows*self._ncols:
    525525            mpq_set(M._entries[i],self._entries[i])
    526526        sig_off()
    527         if self.subdivisions is not None:
    528             M.subdivide(*self.get_subdivisions())
     527        if self._subdivisions is not None:
     528            M.subdivide(*self.subdivisions())
    529529        return M
    530530
    531531
     
    13201320            A, d = self._clear_denom()
    13211321            if d != 1:
    13221322                raise TypeError("matrix has denominators so can't change to ZZ.")
    1323             A.subdivide(self.get_subdivisions())
     1323            A.subdivide(self.subdivisions())
    13241324            return A
    13251325        elif is_IntegerModRing(R) and R.order() < MAX_MODULUS:
    13261326            b = R.order()
     
    13291329                raise TypeError("matrix denominator not coprime to modulus")
    13301330            B = A._mod_int(b)
    13311331            C = (1/(B.base_ring()(d))) * B
    1332             C.subdivide(self.get_subdivisions())
     1332            C.subdivide(self.subdivisions())
    13331333            return C
    13341334        else:
    13351335            D = matrix_dense.Matrix_dense.change_ring(self, R)
    1336             D.subdivide(self.get_subdivisions())
     1336            D.subdivide(self.subdivisions())
    13371337            return D
    13381338           
    13391339   
     
    23582358                mpq_set(A._matrix[j][i], self._matrix[i][j])
    23592359        sig_off()
    23602360
    2361         if self.subdivisions is not None:
    2362             row_divs, col_divs = self.get_subdivisions()
     2361        if self._subdivisions is not None:
     2362            row_divs, col_divs = self.subdivisions()
    23632363            A.subdivide(col_divs, row_divs)
    23642364        return A
    23652365
     
    24092409                mpq_set(A._matrix[rj][ri], self._matrix[i][j])
    24102410        sig_off()
    24112411
    2412         if self.subdivisions is not None:
    2413             row_divs, col_divs = self.get_subdivisions()
     2412        if self._subdivisions is not None:
     2413            row_divs, col_divs = self.subdivisions()
    24142414            A.subdivide([nc - t for t in reversed(col_divs)],
    24152415                        [nr - t for t in reversed(row_divs)])
    24162416        return A
  • sage/matrix/matrix_rational_sparse.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_rational_sparse.pyx
    a b  
    603603
    604604            sage: a.subdivide([1,1], [2])
    605605            sage: b = a.dense_matrix().sparse_matrix().dense_matrix()
    606             sage: b.get_subdivisions() == a.get_subdivisions()
     606            sage: b.subdivisions() == a.subdivisions()
    607607            True
    608608        """
    609609        cdef Matrix_rational_dense B
     
    614614            v = &(self._matrix[i])
    615615            for j from 0 <= j < v.num_nonzero:
    616616                mpq_set(B._matrix[i][v.positions[j]], v.entries[j])
    617         B.subdivide(self.get_subdivisions())
     617        B.subdivide(self.subdivisions())
    618618        return B
    619619
    620620##     def _set_row_to_negative_of_row_of_A_using_subset_of_columns(self, Py_ssize_t i, Matrix A,
  • sage/matrix/matrix_sparse.pyx

    diff -r 6a679959b54b -r 6ebef75e92d8 sage/matrix/matrix_sparse.pyx
    a b  
    6666       
    6767        M = sage.matrix.matrix_space.MatrixSpace(ring, self._nrows, self._ncols, sparse=self.is_sparse_c())
    6868        mat = M(self.dict(), coerce=True, copy=False)
    69         mat.subdivide(self.get_subdivisions())
     69        mat.subdivide(self.subdivisions())
    7070        return mat
    7171
    7272    def __copy__(self):
     
    9292            [ 2 -2]
    9393        """
    9494        A = self.new_matrix(entries=self.dict(), coerce=False, copy=False)
    95         if self.subdivisions is not None:
    96             A.subdivide(*self.get_subdivisions())
     95        if self._subdivisions is not None:
     96            A.subdivide(*self.subdivisions())
    9797        return A
    9898
    9999    def __hash__(self):
     
    390390            i = get_ij(nz, k, 0)
    391391            j = get_ij(nz, k, 1)
    392392            A.set_unsafe(j,i,self.get_unsafe(i,j))
    393         if self.subdivisions is not None:
    394             row_divs, col_divs = self.get_subdivisions()
     393        if self._subdivisions is not None:
     394            row_divs, col_divs = self.subdivisions()
    395395            A.subdivide(col_divs, row_divs)
    396396        return A
    397397
     
    405405            i = get_ij(nz, k, 0)
    406406            j = get_ij(nz, k, 1)
    407407            A.set_unsafe(self._ncols-j-1, self._nrows-i-1,self.get_unsafe(i,j))
    408         if self.subdivisions is not None:
    409             row_divs, col_divs = self.get_subdivisions()
     408        if self._subdivisions is not None:
     409            row_divs, col_divs = self.subdivisions()
    410410            A.subdivide(list(reversed([self._ncols - t for t in col_divs])),
    411411                            list(reversed([self._nrows - t for t in row_divs])))
    412412        return A
     
    645645            m = M([zero_res] * (self._nrows * self._ncols))
    646646            for i,n in v.items():
    647647                m[i] = n
    648             if self.subdivisions is not None:
    649                 m.subdivide(*self.get_subdivisions())
     648            if self._subdivisions is not None:
     649                m.subdivide(*self.subdivisions())
    650650            return m
    651651           
    652652        M = sage.matrix.matrix_space.MatrixSpace(R, self._nrows,
    653653                   self._ncols, sparse=sparse)
    654654        m = M(v)
    655         if self.subdivisions is not None:
    656             m.subdivide(*self.get_subdivisions())
     655        if self._subdivisions is not None:
     656            m.subdivide(*self.subdivisions())
    657657        return m
    658658
    659659    def _derivative(self, var=None):