man, 27 12 2010 kl. 15:37 +0100, skrev w4nderlust: > Hello everyone. > Compiling an octfile i'm experiencing a compile error. > spmaxmin_ST.cc:62: error: lvalue required as left operand of assignment > > that's how my code works: > //i create a sparse matrix > SparseMatrix c = SparseMatrix(rowsA, colsB, rowsA*colsB); > > //i create a constart temp matrix as suggested in the documentation > const SparseMatrix tmp(c); > > //somewhere in my code i do > if (mx != 0) > > tmp(i, j) = mx; > //mx is a double and it is initialized > > the problem is: > tmp(i, j) = mx; > > i don't know what's wrong because in the documentation there are a lot > of examples with this way of accessing the matrix... > Can someone please help me?
I don't know the sparse matrix API that well, but it looks like you have declared a constant matrix tmp (constant means that it will not be changed during the rest of the program). You then alter this matrix (by 'tmp(i, j) = mx'), which is not possible if the matrix is constant. I don't know this trick with the constant temp matrix, but it seems like that is the source of your troubles. Søren ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev