# Odd error message when reading a certain Matrix Market-formatted file

**URL:** <https://scilab.discourse.group/t/odd-error-message-when-reading-a-certain-matrix-market-formatted-file/149>\
**Category:** General usage\
**Created:** [August 30, 2023, 7:05pm UTC](https://scilab.discourse.group/t/odd-error-message-when-reading-a-certain-matrix-market-formatted-file/149 "2023-08-30T19:05:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martrant](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@martrant](https://scilab.discourse.group/u/martrant)\
**Post date:** [August 30, 2023, 7:05pm UTC](https://scilab.discourse.group/t/odd-error-message-when-reading-a-certain-matrix-market-formatted-file/149/1 "2023-08-30T19:05:49Z")

</div>

When attempting to MMREAD the Matrix Market format file “epb3.mtx” (details here: [http://www.cise.ufl.edu/research/sparse/matrices/Averous/epb3](http://www.cise.ufl.edu/research/sparse/matrices/Averous/epb3)), I get an odd-looking error:

“sparse: Warning: You have created a Sparse of size \> 2147483647.  
Due to a Scilab limitation, reading or writing values from/to  
this sparse using a unique index could lead to unexpected behavior.”

Now, said matrix is just a sparse general real matrix in “coordinate” format, of only 84,617 equations and with only 463,625 non-zero entries. The required memory to hold the matrix non-zeros and their (I,J) coordinates, is just a rather meagre 463.265 \* (8 + 2 \* 4) = 7,07 megabytes, hardly noticeable. As per common knowledge, the number 2,147,483,647 is the max. positive value of a signed 4-byte integer, which probably is what Scilab uses for matrix indexing. Can anyone explain what gives and I get the above error? TIA.

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [August 31, 2023, 7:09am UTC](https://scilab.discourse.group/t/odd-error-message-when-reading-a-certain-matrix-market-formatted-file/149/2 "2023-08-31T07:09:45Z")

</div>

Hello,

Showing this warning as been decided 2 years ago but won’t harm for usual matrix algebra with such sparse matrices. As stated by the warning, any algebra using this matrix with a single index (i.e. treating it as a sparse vector) is prone to errors or crashes, because the overall size of Scilab objects (product of the number or rows and cols for a sparse matrix) is coded in a signed 4-bytes integer. This is a limitation that will be removed in a major release of Scilab (probably Scilab 2025.0).  
As I said above, until this evolution, Scilab can handle such matrices without any problem, provided that you don’t rely on the “vector view” of these, namely, if `A` is such a matrix, don’t write or rely on the result of:

1. `size(A,"*")` or `length(A)`
2. `A(i)` or any other vector indexing

---

<div class="post-metadata">

**Author:** ![martrant](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@martrant](https://scilab.discourse.group/u/martrant)\
**Post date:** [September 1, 2023, 2:30pm UTC](https://scilab.discourse.group/t/odd-error-message-when-reading-a-certain-matrix-market-formatted-file/149/3 "2023-09-01T14:30:43Z")

</div>

Thank you for your elucidating reply.
