chore: sync project state and current artifacts

This commit is contained in:
Sepehr
2026-02-22 23:27:31 +01:00
parent 1b6415776e
commit dd77089b22
232 changed files with 37056 additions and 4296 deletions

View File

@@ -9,7 +9,7 @@
//! - No heap allocation during switches
use entropyk_components::{
Component, ComponentError, JacobianBuilder, ResidualVector, SystemState,
Component, ComponentError, JacobianBuilder, ResidualVector, StateSlice,
};
use entropyk_solver::solver::{
ConvergenceStatus, FallbackConfig, FallbackSolver, NewtonConfig, PicardConfig, Solver,
@@ -50,7 +50,7 @@ impl LinearSystem {
impl Component for LinearSystem {
fn compute_residuals(
&self,
state: &SystemState,
state: &StateSlice,
residuals: &mut ResidualVector,
) -> Result<(), ComponentError> {
// r = A * x - b
@@ -66,7 +66,7 @@ impl Component for LinearSystem {
fn jacobian_entries(
&self,
_state: &SystemState,
_state: &StateSlice,
jacobian: &mut JacobianBuilder,
) -> Result<(), ComponentError> {
// J = A (constant Jacobian)
@@ -105,7 +105,7 @@ impl StiffNonlinearSystem {
impl Component for StiffNonlinearSystem {
fn compute_residuals(
&self,
state: &SystemState,
state: &StateSlice,
residuals: &mut ResidualVector,
) -> Result<(), ComponentError> {
// Non-linear residual: r_i = x_i^3 - alpha * x_i - 1
@@ -119,7 +119,7 @@ impl Component for StiffNonlinearSystem {
fn jacobian_entries(
&self,
state: &SystemState,
state: &StateSlice,
jacobian: &mut JacobianBuilder,
) -> Result<(), ComponentError> {
// J_ii = 3 * x_i^2 - alpha
@@ -157,7 +157,7 @@ impl SlowConvergingSystem {
impl Component for SlowConvergingSystem {
fn compute_residuals(
&self,
state: &SystemState,
state: &StateSlice,
residuals: &mut ResidualVector,
) -> Result<(), ComponentError> {
// r = x - target (simple, but Newton can overshoot)
@@ -167,7 +167,7 @@ impl Component for SlowConvergingSystem {
fn jacobian_entries(
&self,
_state: &SystemState,
_state: &StateSlice,
jacobian: &mut JacobianBuilder,
) -> Result<(), ComponentError> {
jacobian.add_entry(0, 0, 1.0);
@@ -635,7 +635,7 @@ fn test_fallback_already_converged() {
impl Component for ZeroResidualComponent {
fn compute_residuals(
&self,
_state: &SystemState,
_state: &StateSlice,
residuals: &mut ResidualVector,
) -> Result<(), ComponentError> {
residuals[0] = 0.0; // Already zero
@@ -644,7 +644,7 @@ fn test_fallback_already_converged() {
fn jacobian_entries(
&self,
_state: &SystemState,
_state: &StateSlice,
jacobian: &mut JacobianBuilder,
) -> Result<(), ComponentError> {
jacobian.add_entry(0, 0, 1.0);