Condition number for a sparse matrix


I am trying to solve a big sparse linear system using the direct solver. I get accurate results most of the times. However, sometimes the matrix is ill-conditioned and I get unreasonable solution. In this context, I have two questions,

  1. I need a way to calculate the condition number of my matrix which is sparse .
  2. Is it possible to precondition the linear system and yet solving it using the direct solver? how?