template void sparsemat::put_value (const pair& ind, const Field& a) // sets A[ind.first, ind.second] = a // E.g., A.put_value(make_pair(3, 5), Field(-4)) // If the indices are out of range, and error should be printed {int i = ind.first; int j = ind.second; sparsemat::row_type& row_i = A[i]; sparsemat::row_iter p; bool found = true; if(row_i.begin() == row_i.end()) p = row_i.end(); else p = lower_bound(row_i.begin(), row_i.end(), j, sparsemat::comp_w_col_ind() ); if(row_i.end() == p) found = false; else {if( (*p).first != j ) found = false;} if(!found) {if(a != Field(0)) row_i.insert(p, make_pair(j, a)); } else // found {if(a == Field(0)) row_i.erase(p); // set to zero else (*p).second = a; // replace current value }; }// end sparsemat::put_value