---
title: "Comment by Kartik N V J K on \"Singular Value Decomposition: From the Math to C++ with Eigen\" | Hashnode"
description: "The ticket-sales matrix is a clean way into this. One thing I would flag for anyone taking it to larger matrices: forming AᵀA explicitly squares the condition n"
url: "https://hashnode.com/posts/singular-value-decomposition-cpp-eigen/6abcbbfcb50bc14631e37193/comment/6abead42fdb064aa091862c5"
---

[Discussion](https://hashnode.com/posts/singular-value-decomposition-cpp-eigen/6abcbbfcb50bc14631e37193)

Comment [Singular Value Decomposition: From the Math to C++ with Eigen](https://hashnode.com/posts/singular-value-decomposition-cpp-eigen/6abcbbfcb50bc14631e37193)

[Kartik N V J K](https://hashnode.com/@kartik-nvj)

[Oct 1](https://hashnode.com/posts/singular-value-decomposition-cpp-eigen/6abcbbfcb50bc14631e37193/comment/6abead42fdb064aa091862c5)

The ticket-sales matrix is a clean way into this. One thing I would flag for anyone taking it to larger matrices: forming AᵀA explicitly squares the condition number, so for anything ill-conditioned, running Eigen's JacobiSVD or BDCSVD on A directly is more numerically stable than going through the eigen-decomposition of AᵀA. Did you stay with the AᵀA route mainly for the clarity of the derivation?

[AbulAsar S.](https://hashnode.com/@abulasar)

[Oct 1](https://hashnode.com/posts/singular-value-decomposition-cpp-eigen/6abcbbfcb50bc14631e37193/comment/6abead42fdb064aa091862c5#reply-6abec606d3e48dda9f767991)

Yes, exactly. I used the AᵀA route mainly to make the mathematical derivation easier to understand and connect SVD with eigenvalues and eigenvectors. For practical applications, I would use Eigen’s `JacobiSVD` or `BDCSVD` directly on A. Thanks for highlighting it!
