Skip to content

Commit 2e34ce8

Browse files
author
counterclocker
committed
bug #23 fixed
1 parent 793f957 commit 2e34ce8

18 files changed

Lines changed: 3108 additions & 1621 deletions

doc/source/contents.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CySparse documentation
1212
:maxdepth: 2
1313

1414
introduction
15+
installation
1516
sparse_matrix_formats
1617
sparse_mat_hierarchy
1718
ll_mat

doc/source/cysparse_cython_users.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
:program:`CySparse` for :program:`Cython` users
55
=========================================================
66

7+
I efficiency is a major concern to you, we strongly encourage you to use :program:`Cython` to
8+
compile your own Python extension.
9+
710
Accessing matrix elements
811
==========================

doc/source/installation.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. cysparse_intallation:
2+
3+
===================================
4+
:program:`CySparse` installation
5+
===================================
6+
7+
Depencies
8+
============

doc/source/introduction.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
.. introduction_to_cy_sparse:
22
3-
==========================
4-
Introduction to CySparse
5-
==========================
3+
====================================
4+
Introduction to :program:`CySparse`
5+
====================================
6+
7+
What is :program:`CySparse`?
8+
=============================
9+
10+
Content
11+
========
12+
613

714
:program:`PySparse` legacy
815
============================
916

17+
18+
1019
License
1120
========
1221

doc/source/ll_mat.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ The :class:`LLSparseMatrixView` class
3737
Views of views
3838
--------------
3939

40+
It is possible to have views of... views as the following code illustrates:
41+
42+
.. code-block:: python
43+
44+
A = MakeLLSparseMatrix(...)
45+
A_view1 = A[..., ...]
46+
A_view2 = A_view1[..., ...]
47+
48+
The second :class:`LLSparseMatrixView` is **not** a view on a view but a direct view on the original matrix ``A``. The only difference between the two objects ``A_view1`` and ``A_view2`` is that
49+
the indices given in the ``[..., ...]`` in ``A_view1[..., ...]`` refer to indices of ``A_view1`` **not** the original matrix ``A``.
50+
51+
An example will clarify this:
52+
53+
.. code-block:: python
54+
55+
pass
4056
4157
References to the base :class:`LLSparseMatrix`
4258
----------------------------------------------

examples/ll_mat_view.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from sparse_lib.sparse.ll_mat import LLSparseMatrix, MakeLLSparseMatrix
2+
import sys
3+
4+
A = MakeLLSparseMatrix(nrow=2, ncol=4, size_hint=10)
5+
A.put_triplet([0,1, 2, 3, 4, 5, 6, 7], [0, 0, 0, 0, 1, 1, 1 ,1], [0, 1, 2, 3, 0 , 1, 2 , 3])
6+
7+
A.print_to(sys.stdout)
8+
9+
A_view = A[0:2, 0:4:2]
10+
A_view_copy = A_view.copy()
11+
A_view_copy.print_to(sys.stdout)
12+
13+
A_view2 = A_view[1, 0:2]
14+
print "$" * 50
15+
print A_view2.nnz
16+
print "/" * 50
17+
A_view2_copy = A_view2.copy()
18+
A_view2_copy.print_to(sys.stdout)
19+
print "!" * 50
20+
A_view3 = A_view[::-1, ::-1]
21+
A_view3_copy = A_view3.copy()
22+
A_view3_copy.print_to(sys.stdout)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def get_path_option(config, section, option):
5858
Extension("sparse_lib.sparse.sparse_mat", ["sparse_lib/sparse/sparse_mat.pxd", "sparse_lib/sparse/sparse_mat.pyx"], **sparse_ext_params),
5959
Extension("sparse_lib.sparse.csr_mat", ["sparse_lib/sparse/csr_mat.pxd", "sparse_lib/sparse/csr_mat.pyx"], **sparse_ext_params),
6060
Extension("sparse_lib.sparse.csc_mat", ["sparse_lib/sparse/csc_mat.pxd", "sparse_lib/sparse/csc_mat.pyx"], **sparse_ext_params),
61-
Extension("sparse_lib.sparse.ll_mat_view", ["sparse_lib/sparse/ll_mat_view.pxd", "sparse_lib/sparse/ll_mat_view.pyx"], **sparse_ext_params),
61+
Extension("sparse_lib.sparse.ll_mat_view", ["sparse_lib.sparse.object_index.pxi","sparse_lib/sparse/ll_mat_view.pxd", "sparse_lib/sparse/ll_mat_view.pyx"], **sparse_ext_params),
6262
Extension("sparse_lib.sparse.IO.mm", ["sparse_lib/sparse/IO/mm_read_file.pxi", "sparse_lib/sparse/IO/mm.pxd", "sparse_lib/sparse/IO/mm.pyx"], **sparse_ext_params),
6363
#Extension("sparse.ll_vec", ["sparse_lib/sparse/ll_vec.pyx"], **sparse_ext_params)
6464
]

sparse_lib/solvers/suitesparse/umfpack.c

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sparse_lib/sparse/IO/mm.c

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sparse_lib/sparse/csr_mat.c

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)