-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic during Matrix.solve()
#2
Comments
A few things that could help ya here:
Noting: the most recent (although no longer all that recent) edits to |
I had to look up what that was - yeah its a pretty weird matrix as far as whats normally fed into a solver in a circuit simulator. I was under the impression I could feed any linear equation in - perhaps thats very much not the case? I'm sorry for my noob'ness, I'm still very much learning.
Oops, apologies for not attaching that. Its in
|
I'm also able to get a different panic with a different test I was working on, which I believe is just as singular / bad as the one in this issue: The matrix is the same except the coefficient for the [2] variable is explicitly set to zero:
|
Here's what I'm using as a debug printer (produced the above output). Unfortunately I have to use my own datastructures for iteration because there doesnt seem to be a getter for the number of rows / cols: fn print_debug(&self) {
for row in 0..self.eqs.len() {
print!("{:02} ({:?}):\t", row, self.eqs[row]);
for col in 0..self.eqs.len() {
if let Some(v) = self.mat.get(row, col) {
print!("{:02}", v);
} else {
print!(" ");
}
print!("\t");
}
if let Some(rhs) = self.rhs.get(&row) {
print!(" = {:2.1}", rhs);
}
println!();
}
}
Should I PR them over? At least thats something I can do 😀 |
OK so the solver is indeed panicking. And PRs totally welcome! I would prefer to do it like this: |
The matrix is:
Am I holding it wrong? must the number of rows in the matrix equal the number of variables?
The text was updated successfully, but these errors were encountered: