dimforge / dimforge/nalgebra

Leftover debug println! in Eigen::new() pollutes stdout

Open Beginner friendly
#1,593 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

## Description

`Eigen::new()` contains a debug `println!` that was accidentally left in production code. Every call to `Eigen::new()` prints to stdout:

```rust
// src/linalg/eigen.rs, line 74
println!("Schur eigenvalues: {}", eigenvalues);
```

The surrounding code even has a `// XXX: for debug` comment (line 60) making it clear this was never intended to ship.

## Impact

- **Stdout pollution**: Any application using `Eigen::new()` gets unexpected output.
- **Unnecessary trait bound**: The `OMatrix: Display` constraint on `Eigen` exists solely to support this `println!`. Removing the print also lets us drop that bound, which currently forces callers to use matrix types that implement `Display`.

## Reproduction

```rust
use nalgebra::{DMatrix, Eigen};
use num_complex::Complex;

let m = DMatrix::>::identity(3, 3);
let _ = Eigen::new(m); // prints "Schur eigenvalues: ..." to stdout
```

## Fix

Remove line 74 (`println!(...)`) and the now-unnecessary `OMatrix: Display` trait bound.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open src/linalg/eigen.rs and inspect Eigen::new(), especially the debug comment around line 60 and println! at line 74. Remove the debug output and the unnecessary OMatrix: Display bound; done means Eigen::new() no longer writes to stdout and callers are not forced to provide that bound.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.