feat(components): add ThermoState generators and Eurovent backend demo

This commit is contained in:
Sepehr
2026-02-20 22:01:38 +01:00
parent 375d288950
commit 4a40fddfe3
271 changed files with 28614 additions and 447 deletions

View File

@@ -67,6 +67,26 @@ impl JacobianMatrix {
JacobianMatrix(matrix)
}
/// Updates an existing Jacobian matrix from sparse entries in-place.
///
/// The matrix is first zeroed out, then filled with the new entries.
/// This avoids re-allocating memory during iterations, satisfying the
/// zero-allocation architecture constraint.
///
/// # Arguments
///
/// * `entries` - Slice of `(row, col, value)` tuples
pub fn update_from_builder(&mut self, entries: &[(usize, usize, f64)]) {
self.0.fill(0.0);
let n_rows = self.0.nrows();
let n_cols = self.0.ncols();
for &(row, col, value) in entries {
if row < n_rows && col < n_cols {
self.0[(row, col)] += value;
}
}
}
/// Creates a zero Jacobian matrix with the given dimensions.
pub fn zeros(n_rows: usize, n_cols: usize) -> Self {
JacobianMatrix(DMatrix::zeros(n_rows, n_cols))