[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] Documentation: gsl_spmatrix_alloc_nzmax does not necessarily i
From: |
Schmitz Manuel (LBC) |
Subject: |
[Bug-gsl] Documentation: gsl_spmatrix_alloc_nzmax does not necessarily initialize to all-zeros |
Date: |
Thu, 19 Jan 2017 16:39:18 +0000 |
The GSL documentation says in chapter 41.2 about function
"gsl_spmatrix_alloc_nzmax":
"This function allocates a sparse matrix of size n1-by-n2 and initializes it to
all zeros."
However, in the case of the CCS or the CRS storage format, the member "p" is
not initialized. Calling "gsl_spmatrix_get" on a freshly allocated matrix may
yield a nonzero value, because its "p" member may contain offsets to an
unspecified location in memory.
(Remark: The function gsl_spmatrix_get does not check against the "nz" property
of the matrix.)
I have attached a modified version of the spmatrix.c file, which does
initialize the "p" vector when creating a matrix in CCS or CRS storage format.
But, I would prefer to adjust the documentation rather than the code, because a
zero-initialized matrix is not always necessary.
Best regards
i.A. Manuel Schmitz
TB-Berechnung
Liebherr-Werk Biberach GmbH
PO Box 16 63
88396 Biberach an der Riss
Germany
Phone: +49 (7351) 414639
address@hidden<mailto:address@hidden>
www.liebherr.com<http://www.liebherr.com>
Chairman of the supervisory board: Stefan Heissler
Managing directors: Dipl.-Betriebsw.(BA) Hubert Deutsch, Dipl.-Ing. Marco
Guariglia, Dipl.-Ing. Günther Hardock, Dipl.-Ing. Dominique Tasch
Registered business address: 88400 Biberach an der Riss, Memminger Straße 120
Court of jurisdiction: Amtsgericht Ulm HRB 640075, USt-Id Nr. DE811120028
This email may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this email in error) please notify
the sender immediately and destroy this email. Any unauthorized copying,
disclosure or distribution of the material in this email is strictly forbidden.
spmatrix.c
Description: spmatrix.c
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gsl] Documentation: gsl_spmatrix_alloc_nzmax does not necessarily initialize to all-zeros,
Schmitz Manuel (LBC) <=