Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DOC: sparse: document diags() and block_diag() more, add them to rele…

…ase notes.
  • Loading branch information...
commit a99fe8c11dffc5a107481c77aebb9c1fbeac95ca 1 parent afcbe2a
@rgommers rgommers authored
Showing with 35 additions and 6 deletions.
  1. +7 −0 doc/release/0.11.0-notes.rst
  2. +28 −6 scipy/sparse/construct.py
View
7 doc/release/0.11.0-notes.rst
@@ -21,6 +21,13 @@ This release requires Python 2.4-2.7 or 3.1- and NumPy 1.X.X or greater.
New features
============
+Constructing sparse matrices
+----------------------------
+
+Two new functions, ``scipy.sparse.diags`` and ``scipy.sparse.block_diag``, were
+added to easily construct diagonal and block-diagonal sparse matrices
+respectively.
+
Deprecated features
===================
View
34 scipy/sparse/construct.py
@@ -406,9 +406,20 @@ def bmat(blocks, format=None, dtype=None):
blocks
grid of sparse matrices with compatible shapes
an entry of None implies an all-zero matrix
- format : sparse format of the result (e.g. "csr")
- by default an appropriate sparse matrix format is returned.
- This choice is subject to change.
+ format : str, optional
+ The sparse format of the result (e.g. "csr"). If not given, the matrix
+ is returned in "coo" format.
+ dtype : dtype specifier, optional
+ The data-type of the output matrix. If not given, the dtype is
+ determined from that of `blocks`.
+
+ Returns
+ -------
+ res : sparse matrix
+
+ See Also
+ --------
+ block_diag, diags
Examples
--------
@@ -502,9 +513,20 @@ def block_diag(mats, format=None, dtype=None):
----------
A, B, ... : sequence of matrices
Input matrices.
- format : sparse format of the result (e.g. "csr")
- by default an appropriate sparse matrix format is returned.
- This choice is subject to change.
+ format : str, optional
+ The sparse format of the result (e.g. "csr"). If not given, the matrix
+ is returned in "coo" format.
+ dtype : dtype specifier, optional
+ The data-type of the output matrix. If not given, the dtype is
+ determined from that of `blocks`.
+
+ Returns
+ -------
+ res : sparse matrix
+
+ See Also
+ --------
+ bmat, diags
Examples
--------
Please sign in to comment.
Something went wrong with that request. Please try again.