Click on proj4hint.cpp to get source.
template <class Field>
void sparsemat<Field>::put_value (const pair<int, int>& 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<Field>::row_type& row_i = A[i];
 sparsemat<Field>::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<Field>::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<Field>::put_value