# Condition number for a sparse matrix

**URL:** https://discourse.julialang.org/t/condition-number-for-a-sparse-matrix/35049
**Category:** General Usage
**Created:** [February 23, 2020, 3:27pm UTC](https://discourse.julialang.org/t/condition-number-for-a-sparse-matrix/35049 "2020-02-23T15:27:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![AhmedAlreweny](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@AhmedAlreweny](https://discourse.julialang.org/u/AhmedAlreweny)
#### Post date: [February 23, 2020, 3:27pm UTC](https://discourse.julialang.org/t/condition-number-for-a-sparse-matrix/35049/1 "2020-02-23T15:27:24Z")

</div>

Hello,

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?
