Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

""" 

Generic matrices 

""" 

  

#***************************************************************************** 

# Copyright (C) 2006 William Stein <wstein@gmail.com> 

# 

# This program is free software: you can redistribute it and/or modify 

# it under the terms of the GNU General Public License as published by 

# the Free Software Foundation, either version 2 of the License, or 

# (at your option) any later version. 

# http://www.gnu.org/licenses/ 

#***************************************************************************** 

  

cimport sage.structure.element 

cimport sage.structure.mutability 

  

cdef class Matrix(sage.structure.element.Matrix): 

# Properties of any matrix (plus _parent, inherited from base class) 

cdef public object _subdivisions 

cdef public object _base_ring 

cdef bint _is_immutable 

  

cpdef _add_(self, other) 

cpdef _sub_(self, other) 

  

cdef bint _will_use_strassen(self, Matrix right) except -2 

cdef bint _will_use_strassen_echelon(self) except -2 

cdef int _strassen_default_cutoff(self, Matrix right) except -2 

cdef int _strassen_default_echelon_cutoff(self) except -2 

  

# Implementation of hash function 

cdef long _hash_(self) except -1 

cdef void get_hash_constants(self, long C[5]) 

  

# Cache 

cdef public object _cache 

cdef long hash # cached hash value 

cdef void clear_cache(self) 

cdef fetch(self, key) 

cdef cache(self, key, x) 

  

# Mutability and bounds checking 

cdef check_bounds(self, Py_ssize_t i, Py_ssize_t j) 

cdef check_mutability(self) 

cdef check_bounds_and_mutability(self, Py_ssize_t i, Py_ssize_t j) 

  

# Unsafe entry access 

cdef set_unsafe(self, Py_ssize_t i, Py_ssize_t j, object x) 

cdef get_unsafe(self, Py_ssize_t i, Py_ssize_t j) 

cdef _coerce_element(self, x) 

  

# Row and column operations 

cdef check_row_bounds(self, Py_ssize_t r1, Py_ssize_t r2) 

cdef check_column_bounds(self, Py_ssize_t c1, Py_ssize_t c2) 

cdef check_row_bounds_and_mutability(self, Py_ssize_t r1, Py_ssize_t r2) 

cdef check_column_bounds_and_mutability(self, Py_ssize_t c1, Py_ssize_t c2) 

cdef swap_rows_c(self, Py_ssize_t r1, Py_ssize_t r2) 

cdef swap_columns_c(self, Py_ssize_t c1, Py_ssize_t c2) 

cdef add_multiple_of_row_c(self, Py_ssize_t i, Py_ssize_t j, s, Py_ssize_t col_start) 

cdef add_multiple_of_column_c(self, Py_ssize_t i, Py_ssize_t j, s, Py_ssize_t row_start) 

cdef rescale_row_c(self, Py_ssize_t i, s, Py_ssize_t start_col) 

cdef rescale_col_c(self, Py_ssize_t i, s, Py_ssize_t start_row) 

  

# Helper function for inverse of sparse matrices 

cdef build_inverse_from_augmented_sparse(self, A)