 edited description
bug in mzd_from_jcf()
in the documentation for mzd_from_jcf() it says
"where a negative column_index indicates a row increase by one."
but in the code a negative column_index gets just multiplied by 1 ... so if i got a 1000x1000 matrix i would need to use 1001 as a newrowindicator.
i guess in io.c it should read
while(fscanf(fh,"%ld\n",&j)==1){ if(j<0){ i++; }
or
while(fscanf(fh,"%ld\n",&j)==1){ if(j<0){ i++; }else{ mzd_write_bit(A, i, j, 1); } };
instead of
while(fscanf(fh,"%ld\n",&j)==1){ if(j<0){ i++, j = j; }
Comments (10)


clarifies documentation for JCF format reader and fixes bug in indexing (see
#49)→ <<cset c6298bb9c699>>

I updated the documentation to clarify how the format works. In the process I discovered another bug in the reader which I also fixed in the process.

 changed status to wontfix
I marked it as wontfix because I didn't accept you changes. Feel free to reopen this ticket if you are not satisfied.

in order to produce a purezero row in a 65000by65000 matrix you would still need to use "65001" as a newline indicator? because just using 1 would create an entry at index +1 ... seems weird to me :) either i still got it wrong or ill stick with my change :P

As far as I know this format does not support purezero rows. The format is optimised for matrices destined for Gaussian elimination (from GB computations) and hence zero rows are redundant.

in the amatrix zero rows make little sense, true ... but most solvers just ignore them and sometimes the input contains nodes that do not relate to other nodes which you would need to filter out before using m4ri.
but what about a lefthandside matrix/bmatrix with a width of 1? clearly it can have rows with just a zero. so you would need 2 as a row seperator/new row sign?

As far as I know this input format does not support all zero rows. The function is for reading matrices provided by JeanCharles Faugère, hence the name, and as far as I can tell he does not consider all zero rows. The general purpose I/O format for M4RI are 1bit PNG images.

sorry i mean righthandside in the previous post. how would the JCF file for the right hand side of the following problem look like? currently you would need something like
5 1 2
5
99
99
0
99
0
99
99
1 0 0 0 0  0
0 1 0 0 1  0
0 0 1 1 0  1
0 0 0 1 1  1
0 0 0 0 1  0
even "0" as a newrowindicator makes little sense so a row with a 1 just at index 0 gives problems? i understand why the format would not need all zero rows for the left matrix but in the right matrix/vector there are zero rows most time.
but ill stick with PNG ;)

My understanding is that the righthand side simply isn't supported. I might be wrong though, it is documented nowhere.
 Log in to comment