diff --git a/codegen/src/targets/rust.rs b/codegen/src/targets/rust.rs index 13a77ac..a559041 100644 --- a/codegen/src/targets/rust.rs +++ b/codegen/src/targets/rust.rs @@ -100,6 +100,7 @@ fn module_tokens( #definition #function_docs + #[cfg_attr(feature = "inline", inline)] #[must_use] pub fn #name(#(#inputs: f64),*) -> #return_type { #(#variables)* diff --git a/targets/ptfkit-rs/Cargo.toml b/targets/ptfkit-rs/Cargo.toml index 609ebfd..5179194 100644 --- a/targets/ptfkit-rs/Cargo.toml +++ b/targets/ptfkit-rs/Cargo.toml @@ -8,5 +8,9 @@ readme = "README.md" repository = "https://github.com/AgroDT/ptfkit" documentation = "https://docs.rs/ptfkit" +[features] +default = ["inline"] +inline = [] + [dev-dependencies] assertables = "10.1.0" diff --git a/targets/ptfkit-rs/README.md b/targets/ptfkit-rs/README.md index 2256c5b..3b1f722 100644 --- a/targets/ptfkit-rs/README.md +++ b/targets/ptfkit-rs/README.md @@ -8,7 +8,7 @@ their source publications. ```toml [dependencies] -ptfkit = "0.1" +ptfkit = "0.2" ``` ## Usage @@ -19,6 +19,43 @@ use ptfkit::jabro1992::calc_ptf_jabro1992; let k_sat = calc_ptf_jabro1992(20.0, 30.0, 1.3); ``` +## Features + +The `inline` feature is enabled by default. It marks generated PTF functions +with `#[inline]`, making their bodies available to downstream optimization and +letting the compiler decide whether inlining is beneficial at each call site. +This is useful when an application evaluates several PTFs in a single pass over +a dataset while keeping control of its own data layout and iteration strategy. + +For example, two saturated hydraulic conductivity estimates can be collected +in separate arrays during the same pass over the input data: + +```rust +use ptfkit::ferrerjulia2004::{ + calc_ptf_ferrerjulia2004_campbell_shiozawa, + calc_ptf_ferrerjulia2004_saxton, +}; + +let sand = [50.0, 42.0, 61.0]; +let clay = [25.0, 31.0, 18.0]; +let mut campbell_shiozawa = Vec::with_capacity(sand.len()); +let mut saxton = Vec::with_capacity(sand.len()); + +for i in 0..sand.len() { + campbell_shiozawa.push(calc_ptf_ferrerjulia2004_campbell_shiozawa( + sand[i], clay[i], + )); + saxton.push(calc_ptf_ferrerjulia2004_saxton(sand[i], clay[i])); +} +``` + +To disable the inline hint, disable the crate's default features: + +```toml +[dependencies] +ptfkit = { version = "0.2", default-features = false } +``` + ## Documentation - [Rust API on docs.rs](https://docs.rs/ptfkit/) diff --git a/targets/ptfkit-rs/src/ahuja1984.rs b/targets/ptfkit-rs/src/ahuja1984.rs index 1e76bf4..f3df162 100644 --- a/targets/ptfkit-rs/src/ahuja1984.rs +++ b/targets/ptfkit-rs/src/ahuja1984.rs @@ -59,6 +59,7 @@ for the soil being evaluated. Callers must supply the exponent. The paper evaluates both n = 4 and n = 5 and does not select one as a unique transferable value. total_porosity must be greater than or equal to theta_33."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ahuja1984( total_porosity: f64, diff --git a/targets/ptfkit-rs/src/aimrun2009.rs b/targets/ptfkit-rs/src/aimrun2009.rs index be90306..f06086b 100644 --- a/targets/ptfkit-rs/src/aimrun2009.rs +++ b/targets/ptfkit-rs/src/aimrun2009.rs @@ -44,6 +44,7 @@ Applicability: Clayey rice soils with compacted subsoil. # Warnings The formula uses natural logarithms of all inputs."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_aimrun2009(clay: f64, bulk_density: f64, organic_matter: f64, gmd: f64) -> f64 { let ln_k_sat_m_per_day = -2.368f64 + 3.846f64 * bulk_density + 0.091f64 * organic_matter diff --git a/targets/ptfkit-rs/src/beniaich2023.rs b/targets/ptfkit-rs/src/beniaich2023.rs index 314deef..80f00fd 100644 --- a/targets/ptfkit-rs/src/beniaich2023.rs +++ b/targets/ptfkit-rs/src/beniaich2023.rs @@ -52,6 +52,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_slr1(clay: f64) -> Beniaich2023PTFResult { let water_saturation = (46.307f64 + 0.556f64 * clay) / 100.0f64; @@ -118,6 +119,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_slr2(silt: f64) -> Beniaich2023PTFResult { let water_saturation = (59.508f64 + 0.299f64 * silt) / 100.0f64; @@ -184,6 +186,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_slr3(sand: f64) -> Beniaich2023PTFResult { let water_saturation = (81.420f64 - 0.427f64 * sand) / 100.0f64; @@ -251,6 +254,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_slr4(clay: f64, silt: f64) -> Beniaich2023PTFResult { let clay_silt = clay + silt; @@ -319,6 +323,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_slr5(clay: f64, silt: f64) -> Beniaich2023PTFResult { let clay_silt_ratio = clay / silt; @@ -386,6 +391,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_slr6(soil_organic_matter: f64) -> Beniaich2023PTFResult { let water_saturation = (61.163f64 + 2.793f64 * soil_organic_matter) / 100.0f64; @@ -454,6 +460,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_mlr1( silt: f64, @@ -528,6 +535,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_mlr2(sand: f64, soil_organic_matter: f64) -> Beniaich2023PTFResult { let water_saturation = @@ -598,6 +606,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_mlr3(silt: f64, soil_organic_matter: f64) -> Beniaich2023PTFResult { let water_saturation = @@ -668,6 +677,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_mlr4(clay: f64, soil_organic_matter: f64) -> Beniaich2023PTFResult { let water_saturation = @@ -739,6 +749,7 @@ Source regressions operate in percentage points; outputs are divided by 100 to r Developed from Moroccan agricultural topsoils and not independently validated outside the source territory."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_beniaich2023_mlr5( clay: f64, diff --git a/targets/ptfkit-rs/src/chakraborty2011.rs b/targets/ptfkit-rs/src/chakraborty2011.rs index dd98926..f173cf5 100644 --- a/targets/ptfkit-rs/src/chakraborty2011.rs +++ b/targets/ptfkit-rs/src/chakraborty2011.rs @@ -56,6 +56,7 @@ respective potentials. # Warnings Use outside the source Indian-soil dataset requires independent validation."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_chakraborty2011_eq1(clay: f64, silt: f64) -> Chakraborty2011PTFResult { let water_content_33 = (0.297f64 * clay + 0.478f64 * silt + 4.600f64) / 100.0f64; @@ -133,6 +134,7 @@ respective potentials. # Warnings Use outside the source Indian-soil dataset requires independent validation."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_chakraborty2011_eq2(sand: f64, bulk_density: f64) -> Chakraborty2011PTFResult { let water_content_33 = (-0.377f64 * sand - 0.215f64 * bulk_density + 41.114f64) / 100.0f64; @@ -211,6 +213,7 @@ respective potentials. # Warnings Use outside the source Indian-soil dataset requires independent validation."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_chakraborty2011_eq3( clay: f64, @@ -297,6 +300,7 @@ respective potentials. # Warnings Use outside the source Indian-soil dataset requires independent validation."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_chakraborty2011_eq4(clay: f64, silt: f64, sand: f64) -> Chakraborty2011PTFResult { let water_content_33 = @@ -380,6 +384,7 @@ respective potentials. # Warnings Use outside the source Indian-soil dataset requires independent validation."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_chakraborty2011_eq5( clay: f64, @@ -473,6 +478,7 @@ respective potentials. # Warnings Use outside the source Indian-soil dataset requires independent validation."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_chakraborty2011_eq6( clay: f64, diff --git a/targets/ptfkit-rs/src/cosby1984.rs b/targets/ptfkit-rs/src/cosby1984.rs index a513c7d..2b55c24 100644 --- a/targets/ptfkit-rs/src/cosby1984.rs +++ b/targets/ptfkit-rs/src/cosby1984.rs @@ -63,6 +63,7 @@ Public API names are provisional for pilot testing. # Warnings Log-transformed output units use the pilot contract `reported log value`."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_cosby1984_univariate( sand: f64, diff --git a/targets/ptfkit-rs/src/dharumarajan2019.rs b/targets/ptfkit-rs/src/dharumarajan2019.rs index d83a0e1..9f57a63 100644 --- a/targets/ptfkit-rs/src/dharumarajan2019.rs +++ b/targets/ptfkit-rs/src/dharumarajan2019.rs @@ -59,6 +59,7 @@ Reported cross-validation RMSE values are 5.25% for FC and 3.71% for PWP. The paper does not state whether its water-content percentages are gravimetric or volumetric. The source gives inconsistent profile counts and district lists for the Northern dataset; see the scientific notes."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_dharumarajan2019_nkp( clay: f64, @@ -130,6 +131,7 @@ Reported cross-validation RMSE values are 7.05% for FC and 4.74% for PWP. The paper does not state whether its water-content percentages are gravimetric or volumetric. The source gives inconsistent profile counts and district lists for the Northern dataset; see the scientific notes."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_dharumarajan2019_nkp_clay(clay: f64) -> Dharumarajan2019WaterRetentionResult { let field_capacity = 4.968f64 + 0.586f64 * clay; @@ -195,6 +197,7 @@ Reported cross-validation RMSE values are 3.05% for FC and 2.17% for PWP. # Warnings The paper does not state whether its water-content percentages are gravimetric or volumetric."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_dharumarajan2019_skp( clay: f64, @@ -264,6 +267,7 @@ Reported cross-validation RMSE values are 5.39% for FC and 3.13% for PWP. # Warnings The paper does not state whether its water-content percentages are gravimetric or volumetric."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_dharumarajan2019_skp_clay(clay: f64) -> Dharumarajan2019WaterRetentionResult { let field_capacity = 3.724f64 + 0.581f64 * clay; @@ -328,6 +332,7 @@ The reported model R-squared is 41%, and the reported RMSE is 6.71%. # Warnings Predictor calibration ranges are not reported for the 100-observation dataset."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_dharumarajan2019_infiltration(sand: f64, silt: f64, clay: f64) -> f64 { 177.55f64 - 1.47f64 * sand - 1.80f64 * clay - 1.58f64 * silt diff --git a/targets/ptfkit-rs/src/ferrerjulia2004.rs b/targets/ptfkit-rs/src/ferrerjulia2004.rs index c22995f..17d56bd 100644 --- a/targets/ptfkit-rs/src/ferrerjulia2004.rs +++ b/targets/ptfkit-rs/src/ferrerjulia2004.rs @@ -37,6 +37,7 @@ regressions used 3172 horizons with sufficient data."] Prediction target: Saturated hydraulic conductivity. Reproduced in Section 4.2 for comparison with the new Spanish-soil PTFs."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_campbell_shiozawa(sand: f64, clay: f64) -> f64 { 54.0f64 * (-0.07f64 * sand - 0.167f64 * clay).exp() @@ -85,6 +86,7 @@ Reproduced in Section 4.2 for comparison with the new Spanish-soil PTFs. The denominator contains log10(clay) and the source does not state its valid domain or singularity policy."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_saxton(sand: f64, clay: f64) -> f64 { 10.0f64 @@ -131,6 +133,7 @@ mod calc_ptf_ferrerjulia2004_saxton_tests { Prediction target: Saturated hydraulic conductivity. Reproduced in Section 4.2 for comparison with the new Spanish-soil PTFs."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_dane_puckett(clay: f64) -> f64 { 303.84f64 * (-0.144f64 * clay).exp() @@ -173,6 +176,7 @@ mod calc_ptf_ferrerjulia2004_dane_puckett_tests { Prediction target: Saturated hydraulic conductivity. Reproduced in Section 4.2 for comparison with the new Spanish-soil PTFs."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_puckett(clay: f64) -> f64 { 156.96f64 * (-0.1975f64 * clay).exp() @@ -216,6 +220,7 @@ mod calc_ptf_ferrerjulia2004_puckett_tests { Prediction target: Saturated hydraulic conductivity. Reproduced in Section 4.2 for comparison with the new Spanish-soil PTFs."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_cosby(sand: f64, clay: f64) -> f64 { 25.4f64 + 10.0f64.powf(-0.6f64 + 0.012f64 * sand - 0.0064f64 * clay) @@ -258,6 +263,7 @@ mod calc_ptf_ferrerjulia2004_cosby_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Humic Acrisol. Table 3; R^2 = 0.723."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_humic_acrisol_sand(sand: f64) -> f64 { 1.5162f64 * (0.0452f64 * sand).exp() @@ -302,6 +308,7 @@ mod calc_ptf_ferrerjulia2004_humic_acrisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Humic Acrisol. Table 3; R^2 = 0.701."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_humic_acrisol_texture_organic_matter( sand: f64, @@ -344,6 +351,7 @@ mod calc_ptf_ferrerjulia2004_humic_acrisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Calcic Cambisol. Table 3; R^2 = 0.521."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_calcic_cambisol_sand(sand: f64) -> f64 { 1.043f64 * (0.0452f64 * sand).exp() @@ -388,6 +396,7 @@ mod calc_ptf_ferrerjulia2004_calcic_cambisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Calcic Cambisol. Table 3; R^2 = 0.468."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_calcic_cambisol_texture_organic_matter( sand: f64, @@ -430,6 +439,7 @@ mod calc_ptf_ferrerjulia2004_calcic_cambisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Dystric Cambisol. Table 3; R^2 = 0.750."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_dystric_cambisol_sand(sand: f64) -> f64 { 1.3182f64 * (0.0464f64 * sand).exp() @@ -474,6 +484,7 @@ mod calc_ptf_ferrerjulia2004_dystric_cambisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Dystric Cambisol. Table 3; R^2 = 0.779."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_dystric_cambisol_texture_organic_matter( sand: f64, @@ -516,6 +527,7 @@ mod calc_ptf_ferrerjulia2004_dystric_cambisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Eutric Cambisol. Table 3; R^2 = 0.734."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_eutric_cambisol_sand(sand: f64) -> f64 { 0.9356f64 * (0.0503f64 * sand).exp() @@ -560,6 +572,7 @@ mod calc_ptf_ferrerjulia2004_eutric_cambisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Eutric Cambisol. Table 3; R^2 = 0.686."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_eutric_cambisol_texture_organic_matter( sand: f64, @@ -602,6 +615,7 @@ mod calc_ptf_ferrerjulia2004_eutric_cambisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Gleyic Cambisol. Table 3; R^2 = 0.807."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_gleyic_cambisol_sand(sand: f64) -> f64 { 0.2336f64 * (0.0667f64 * sand).exp() @@ -646,6 +660,7 @@ mod calc_ptf_ferrerjulia2004_gleyic_cambisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Gleyic Cambisol. Table 3; R^2 = 0.824."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_gleyic_cambisol_texture_organic_matter( sand: f64, @@ -688,6 +703,7 @@ mod calc_ptf_ferrerjulia2004_gleyic_cambisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Humic Cambisol. Table 3; R^2 = 0.592."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_humic_cambisol_sand(sand: f64) -> f64 { 2.1622f64 * (0.0371f64 * sand).exp() @@ -732,6 +748,7 @@ mod calc_ptf_ferrerjulia2004_humic_cambisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Humic Cambisol. Table 3; R^2 = 0.632."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_humic_cambisol_texture_organic_matter( sand: f64, @@ -774,6 +791,7 @@ mod calc_ptf_ferrerjulia2004_humic_cambisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Calcaric Fluvisol. Table 3; R^2 = 0.772."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_calcaric_fluvisol_sand(sand: f64) -> f64 { 0.814f64 * (0.052f64 * sand).exp() @@ -818,6 +836,7 @@ mod calc_ptf_ferrerjulia2004_calcaric_fluvisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Calcaric Fluvisol. Table 3; R^2 = 0.792."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_calcaric_fluvisol_texture_organic_matter( sand: f64, @@ -864,6 +883,7 @@ Table 3; R^2 = 0.412. # Warnings The paper reports weak fit and suggests missing clay-mineralogy information."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_calcic_luvisol_sand(sand: f64) -> f64 { 0.671f64 * (0.0467f64 * sand).exp() @@ -912,6 +932,7 @@ Table 3; R^2 = 0.473. # Warnings The paper reports weak fit and suggests missing clay-mineralogy information."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_calcic_luvisol_texture_organic_matter( sand: f64, @@ -954,6 +975,7 @@ mod calc_ptf_ferrerjulia2004_calcic_luvisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Chromic Luvisol. Table 3; R^2 = 0.534."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_chromic_luvisol_sand(sand: f64) -> f64 { 0.898f64 * (0.0494f64 * sand).exp() @@ -998,6 +1020,7 @@ mod calc_ptf_ferrerjulia2004_chromic_luvisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Chromic Luvisol. Table 3; R^2 = 0.557."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_chromic_luvisol_texture_organic_matter( sand: f64, @@ -1040,6 +1063,7 @@ mod calc_ptf_ferrerjulia2004_chromic_luvisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Gleyic Luvisol. Table 3; R^2 = 0.876."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_gleyic_luvisol_sand(sand: f64) -> f64 { 0.5395f64 * (0.0514f64 * sand).exp() @@ -1084,6 +1108,7 @@ mod calc_ptf_ferrerjulia2004_gleyic_luvisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Gleyic Luvisol. Table 3; R^2 = 0.917."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_gleyic_luvisol_texture_organic_matter( sand: f64, @@ -1126,6 +1151,7 @@ mod calc_ptf_ferrerjulia2004_gleyic_luvisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Orthic Luvisol. Table 3; R^2 = 0.676."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_orthic_luvisol_sand(sand: f64) -> f64 { 1.3958f64 * (0.0431f64 * sand).exp() @@ -1170,6 +1196,7 @@ mod calc_ptf_ferrerjulia2004_orthic_luvisol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Orthic Luvisol. Table 3; R^2 = 0.729."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_orthic_luvisol_texture_organic_matter( sand: f64, @@ -1212,6 +1239,7 @@ mod calc_ptf_ferrerjulia2004_orthic_luvisol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Ranker. Table 3; R^2 = 0.726."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_ranker_sand(sand: f64) -> f64 { 0.9847f64 * (0.0507f64 * sand).exp() @@ -1256,6 +1284,7 @@ mod calc_ptf_ferrerjulia2004_ranker_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Ranker. Table 3; R^2 = 0.717."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_ranker_texture_organic_matter( sand: f64, @@ -1297,6 +1326,7 @@ mod calc_ptf_ferrerjulia2004_ranker_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Calcaric Regosol. Table 3; R^2 = 0.655."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_calcaric_regosol_sand(sand: f64) -> f64 { 0.8931f64 * (0.0524f64 * sand).exp() @@ -1341,6 +1371,7 @@ mod calc_ptf_ferrerjulia2004_calcaric_regosol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Calcaric Regosol. Table 3; R^2 = 0.705."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_calcaric_regosol_texture_organic_matter( sand: f64, @@ -1383,6 +1414,7 @@ mod calc_ptf_ferrerjulia2004_calcaric_regosol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Dystric Regosol. Table 3; R^2 = 0.834."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_dystric_regosol_sand(sand: f64) -> f64 { 1.096f64 * (0.048f64 * sand).exp() @@ -1427,6 +1459,7 @@ mod calc_ptf_ferrerjulia2004_dystric_regosol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Dystric Regosol. Table 3; R^2 = 0.862."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_dystric_regosol_texture_organic_matter( sand: f64, @@ -1469,6 +1502,7 @@ mod calc_ptf_ferrerjulia2004_dystric_regosol_texture_organic_matter_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Eutric Regosol. Table 3; R^2 = 0.824."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_eutric_regosol_sand(sand: f64) -> f64 { 1.0005f64 * (0.0523f64 * sand).exp() @@ -1513,6 +1547,7 @@ mod calc_ptf_ferrerjulia2004_eutric_regosol_sand_tests { Prediction target: Saturated hydraulic conductivity for FAO 1974 Eutric Regosol. Table 3; R^2 = 0.702."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_eutric_regosol_texture_organic_matter( sand: f64, @@ -1561,6 +1596,7 @@ without coefficients. The horizon-level regression has weak fit and is affected by converted qualitative conductivity values."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_rendzina_sand(sand: f64) -> f64 { 2.4645f64 * (0.0325f64 * sand).exp() @@ -1609,6 +1645,7 @@ Table 3; R^2 = 0.340. # Warnings The regression has weak fit and is affected by converted qualitative conductivity values."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_rendzina_texture_organic_matter( sand: f64, @@ -1654,6 +1691,7 @@ Table 3 prints R^2 = 0.399; the prose later states 0.435. # Warnings The source gives inconsistent R^2 values for this regression."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_gleyic_solonchak_sand(sand: f64) -> f64 { 0.7602f64 * (0.0372f64 * sand).exp() @@ -1704,6 +1742,7 @@ Human review corrected the anomalous printed intercept from -90917 to -0.90917. The implementation intentionally differs from the original published Table 3 which prints the intercept as -90917."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_gleyic_solonchak_texture_organic_matter( sand: f64, @@ -1751,6 +1790,7 @@ Section 5.1; 3172 horizons; R^2 = 0.696. The paper recommends use when data are statistically similar to its Spanish-soil calibration data."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_general_sand(sand: f64) -> f64 { 0.920f64 * (0.0491f64 * sand).exp() @@ -1800,6 +1840,7 @@ Section 5.1; 3172 horizons; R^2 = 0.715. The paper recommends use when data are statistically similar to its Spanish-soil calibration data."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_ferrerjulia2004_general_texture_organic_matter( sand: f64, diff --git a/targets/ptfkit-rs/src/hodnett2002.rs b/targets/ptfkit-rs/src/hodnett2002.rs index 3f29256..822d218 100644 --- a/targets/ptfkit-rs/src/hodnett2002.rs +++ b/targets/ptfkit-rs/src/hodnett2002.rs @@ -74,6 +74,7 @@ The PTF did not reproduce water-retention curves accurately for soils with bulk 0.8 Mg/m^3, most of which were Andosols. The PTF did not reproduce very low alpha values well because high-alpha soils dominated the calibration data; mineralogy and structure were not directly represented."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_hodnett2002( sand: f64, diff --git a/targets/ptfkit-rs/src/jabro1992.rs b/targets/ptfkit-rs/src/jabro1992.rs index ab9a9e4..342af22 100644 --- a/targets/ptfkit-rs/src/jabro1992.rs +++ b/targets/ptfkit-rs/src/jabro1992.rs @@ -41,6 +41,7 @@ Sand is not an input to the model. # Warnings The formula uses base-10 logarithms of silt and clay."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_jabro1992(silt: f64, clay: f64, bulk_density: f64) -> f64 { let log10_k_sat_cm_per_hour = diff --git a/targets/ptfkit-rs/src/li2007.rs b/targets/ptfkit-rs/src/li2007.rs index cf560d4..d70576d 100644 --- a/targets/ptfkit-rs/src/li2007.rs +++ b/targets/ptfkit-rs/src/li2007.rs @@ -57,6 +57,7 @@ conductivity. # Warnings The formulas use natural logarithms of selected inputs."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_li2007( sand: f64, diff --git a/targets/ptfkit-rs/src/mayr1999.rs b/targets/ptfkit-rs/src/mayr1999.rs index eff1be7..5053a76 100644 --- a/targets/ptfkit-rs/src/mayr1999.rs +++ b/targets/ptfkit-rs/src/mayr1999.rs @@ -63,6 +63,7 @@ Do not apply the functions to organic soils with organic carbon above 5% or soil density below 0.9 g/cm^3. Treat application outside the calibration particle-size distribution with great care; the paper provides that distribution only graphically."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_mayr1999( sand: f64, diff --git a/targets/ptfkit-rs/src/oosterveld1980.rs b/targets/ptfkit-rs/src/oosterveld1980.rs index c3b60e8..fc61368 100644 --- a/targets/ptfkit-rs/src/oosterveld1980.rs +++ b/targets/ptfkit-rs/src/oosterveld1980.rs @@ -37,6 +37,7 @@ laboratory; the field-capacity tension regression used 134 samples."] Prediction target: Tension at which pressure-plate moisture content equals field capacity determined by the cylinder method. Equation 1 reports r = 0.67 and n = 134."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_oosterveld1980_field_capacity_tension(clay: f64) -> f64 { 5.356f64 * clay.powf(0.421f64) @@ -86,6 +87,7 @@ Equation 2 reports r = 0.96 and n = 1,137. # Warnings The paper reports slight inaccuracy at very high clay content and high tension."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_oosterveld1980_retention( clay: f64, @@ -138,6 +140,7 @@ mod calc_ptf_oosterveld1980_retention_tests { Prediction target: Gravimetric soil-moisture content at field capacity. Equation 3 is obtained by substituting the Equation 1 field-capacity tension into Equation 2."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_oosterveld1980_field_capacity(clay: f64, sand: f64, mean_depth: f64) -> f64 { (25.713f64 + 0.469f64 * clay - 0.184f64 * sand - 0.0329f64 * mean_depth) * clay.powf(-0.080f64) @@ -184,6 +187,7 @@ mod calc_ptf_oosterveld1980_field_capacity_tests { Prediction target: Gravimetric soil-moisture content at 1500 kPa. Equation 4 reports r = 0.96 and n = 298. The paper takes moisture content at 1500 kPa as the wilting point."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_oosterveld1980_wilting_point(clay: f64, sand: f64, mean_depth: f64) -> f64 { 4.035f64 + 0.299f64 * clay - 0.034f64 * sand - 0.016f64 * mean_depth @@ -226,6 +230,7 @@ mod calc_ptf_oosterveld1980_wilting_point_tests { Prediction target: Difference between gravimetric moisture content at field capacity and at the 1500 kPa wilting point. The paper defines available soil water by subtracting Equation 4 from Equation 3."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_oosterveld1980_available_water(clay: f64, sand: f64, mean_depth: f64) -> f64 { let field_capacity_moisture = diff --git a/targets/ptfkit-rs/src/pidgeon1972.rs b/targets/ptfkit-rs/src/pidgeon1972.rs index 6aa969f..f480124 100644 --- a/targets/ptfkit-rs/src/pidgeon1972.rs +++ b/targets/ptfkit-rs/src/pidgeon1972.rs @@ -36,6 +36,7 @@ the adopted regressions."] Prediction target: Gravimetric field capacity The reviewed organic-matter coefficient is 1.54."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_fc(silt: f64, clay: f64, organic_matter: f64) -> f64 { 7.38f64 + 0.16f64 * silt + 0.30f64 * clay + 1.54f64 * organic_matter @@ -72,6 +73,7 @@ mod calc_ptf_pidgeon1972_fc_tests { # Notes Prediction target: Gravimetric field capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_fc_sand(sand: f64) -> f64 { 36.16f64 - 0.25f64 * sand @@ -109,6 +111,7 @@ mod calc_ptf_pidgeon1972_fc_sand_tests { # Notes Prediction target: Gravimetric field capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_fc_sand_organic_matter(sand: f64, organic_matter: f64) -> f64 { 34.27f64 - 0.27f64 * sand + 1.25f64 * organic_matter @@ -146,6 +149,7 @@ mod calc_ptf_pidgeon1972_fc_sand_organic_matter_tests { # Notes Prediction target: Volumetric field capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_fc_vol_sand_organic_matter(sand: f64, organic_matter: f64) -> f64 { 38.15f64 - 0.17f64 * sand + 0.77f64 * organic_matter @@ -184,6 +188,7 @@ mod calc_ptf_pidgeon1972_fc_vol_sand_organic_matter_tests { # Notes Prediction target: Gravimetric permanent wilting point"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_pwp(silt: f64, clay: f64, organic_matter: f64) -> f64 { -4.19f64 + 0.19f64 * silt + 0.39f64 * clay + 0.90f64 * organic_matter @@ -220,6 +225,7 @@ mod calc_ptf_pidgeon1972_pwp_tests { # Notes Prediction target: Gravimetric permanent wilting point"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_pwp_sand(sand: f64) -> f64 { 28.41f64 - 0.29f64 * sand @@ -257,6 +263,7 @@ mod calc_ptf_pidgeon1972_pwp_sand_tests { # Notes Prediction target: Gravimetric permanent wilting point"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_pwp_sand_organic_matter(sand: f64, organic_matter: f64) -> f64 { 32.90f64 - 0.37f64 * sand + 0.44f64 * organic_matter @@ -294,6 +301,7 @@ mod calc_ptf_pidgeon1972_pwp_sand_organic_matter_tests { # Notes Prediction target: Available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_awc(clay: f64, organic_matter: f64) -> f64 { 169.3f64 - 1.50f64 * clay + 6.09f64 * organic_matter @@ -331,6 +339,7 @@ mod calc_ptf_pidgeon1972_awc_tests { # Notes Prediction target: Available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_awc_sand_organic_matter(sand: f64, organic_matter: f64) -> f64 { 1.0f64 + 1.84f64 * sand + 8.12f64 * organic_matter @@ -367,6 +376,7 @@ mod calc_ptf_pidgeon1972_awc_sand_organic_matter_tests { # Notes Prediction target: Available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_awc_coarse_sand(coarse_sand: f64) -> f64 { 68.5f64 + 2.33f64 * coarse_sand @@ -403,6 +413,7 @@ mod calc_ptf_pidgeon1972_awc_coarse_sand_tests { # Notes Prediction target: Available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_awc_fine_sand(fine_sand: f64) -> f64 { 66.7f64 + 2.66f64 * fine_sand @@ -439,6 +450,7 @@ mod calc_ptf_pidgeon1972_awc_fine_sand_tests { # Notes Prediction target: Available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_awc_very_fine_sand(very_fine_sand: f64) -> f64 { 66.9f64 + 4.58f64 * very_fine_sand @@ -477,6 +489,7 @@ mod calc_ptf_pidgeon1972_awc_very_fine_sand_tests { # Notes Prediction target: Extended available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_eawc(silt: f64, clay: f64, organic_matter: f64) -> f64 { 121.1f64 - 3.03f64 * silt - 1.38f64 * clay + 6.76f64 * organic_matter @@ -513,6 +526,7 @@ mod calc_ptf_pidgeon1972_eawc_tests { # Notes Prediction target: Extended available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_eawc_sand(sand: f64) -> f64 { -25.8f64 + 1.55f64 * sand @@ -550,6 +564,7 @@ mod calc_ptf_pidgeon1972_eawc_sand_tests { # Notes Prediction target: Extended available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_eawc_sand_organic_matter(sand: f64, organic_matter: f64) -> f64 { -10.8f64 + 1.15f64 * sand + 4.78f64 * organic_matter @@ -587,6 +602,7 @@ mod calc_ptf_pidgeon1972_eawc_sand_organic_matter_tests { # Notes Prediction target: Extended available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_eawc_coarse_sand_organic_matter( coarse_sand: f64, @@ -627,6 +643,7 @@ mod calc_ptf_pidgeon1972_eawc_coarse_sand_organic_matter_tests { # Notes Prediction target: Extended available water capacity"] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_pidgeon1972_eawc_fine_sand_organic_matter( fine_sand: f64, diff --git a/targets/ptfkit-rs/src/puckett1985.rs b/targets/ptfkit-rs/src/puckett1985.rs index f468161..2d26d7d 100644 --- a/targets/ptfkit-rs/src/puckett1985.rs +++ b/targets/ptfkit-rs/src/puckett1985.rs @@ -70,6 +70,7 @@ The regressions were developed for soils with similar genesis and clay mineralog # Warnings Use outside Lower Coastal Plain Ultisols requires independent validation."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_puckett1985( sand: f64, diff --git a/targets/ptfkit-rs/src/rawls1982.rs b/targets/ptfkit-rs/src/rawls1982.rs index 95899a2..9be9392 100644 --- a/targets/ptfkit-rs/src/rawls1982.rs +++ b/targets/ptfkit-rs/src/rawls1982.rs @@ -33,6 +33,7 @@ Agricultural soils from 32 states of the USA # Notes Prediction target: Volumetric soil water content at -1500 kPa."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_rawls1982_theta_1500(clay: f64, organic_matter: f64) -> f64 { 0.0260f64 + 0.0050f64 * clay + 0.0158f64 * organic_matter @@ -71,6 +72,7 @@ mod calc_ptf_rawls1982_theta_1500_tests { # Notes Prediction target: Volumetric soil water content at -33 kPa."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_rawls1982_theta_33(sand: f64, organic_matter: f64, theta_1500: f64) -> f64 { 0.2391f64 - 0.0019f64 * sand + 0.0210f64 * organic_matter + 0.72f64 * theta_1500 @@ -145,6 +147,7 @@ for the intermediate points. # Warnings The source value 0.8888 is retained literally for the theta_7 intercept."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_rawls1982_full_wrc( sand: f64, diff --git a/targets/ptfkit-rs/src/saxton2006.rs b/targets/ptfkit-rs/src/saxton2006.rs index 73c4e4e..f1371ba 100644 --- a/targets/ptfkit-rs/src/saxton2006.rs +++ b/targets/ptfkit-rs/src/saxton2006.rs @@ -70,6 +70,7 @@ The 1500 and 33 kPa values are also termed wilting point and field capacity. Do not apply the regression above 8% organic matter or 60% clay. Sand and clay fractions must describe one soil and therefore must sum to at most 1. These statistical-average estimates should be calibrated to local measurements when available."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_saxton2006(sand: f64, clay: f64, organic_matter: f64) -> Saxton2006PTFResult { let theta_1500_preliminary = -0.024f64 * sand @@ -239,6 +240,7 @@ The source limits the saturation-minus-33 kPa difference to at least 0.005 m^3/m # Warnings The source recommends density factors only from 0.9 to 1.3."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_saxton2006_density( normal_density: f64, @@ -323,6 +325,7 @@ Prediction target: Matric tension for water content between theta_1500 and theta # Warnings Use only for the 1500 to 33 kPa segment defined by the source."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_saxton2006_tension_dry(theta: f64, theta_1500: f64, theta_33: f64) -> f64 { let retention_b = (1500.0f64.ln() - 33.0f64.ln()) / (theta_33.ln() - theta_1500.ln()); @@ -378,6 +381,7 @@ At tensions below air entry, Equation 13 fixes water content at theta_s. # Warnings Use only for the 33 kPa to air-entry segment defined by the source."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_saxton2006_tension_wet( theta: f64, @@ -436,6 +440,7 @@ Prediction target: Unsaturated hydraulic conductivity of the matric soil. # Warnings The equation does not include residual water content."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_saxton2006_conductivity( theta: f64, @@ -510,6 +515,7 @@ Gravel density is fixed at 2.65 g/cm^3 in the source equations. The conductivity correction does not represent extra macropores sometimes found in gravelly soils."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_saxton2006_gravel( gravel_weight_fraction: f64, @@ -608,6 +614,7 @@ falls. # Warnings Precipitation, bonding, ionic nutrition, and toxicity can modify actual salinity effects."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_saxton2006_salinity( electrical_conductivity: f64, diff --git a/targets/ptfkit-rs/src/tiwary2014.rs b/targets/ptfkit-rs/src/tiwary2014.rs index 6a78ff5..5582a8a 100644 --- a/targets/ptfkit-rs/src/tiwary2014.rs +++ b/targets/ptfkit-rs/src/tiwary2014.rs @@ -42,6 +42,7 @@ Equation 11 was calibrated on 100 layers from 20 Indo-Gangetic Plains profiles. The legacy API's three water-retention outputs are intentionally excluded because the source defines them only for BSR soils."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_tiwary2014_igp(sand: f64, bulk_density: f64, esp: f64) -> f64 { let k_sat_mm_per_hour = 4.079f64 + 0.047f64 * sand - 0.054f64 * esp - 2.238f64 * bulk_density; @@ -105,6 +106,7 @@ Prediction target: Gravimetric water contents at 33, 100, and 1500 kPa and satur conductivity. Water-retention equations used 75 layers from 14 profiles; equation 10 used 200 layers from 46 profiles."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_tiwary2014_bsr( clay: f64, diff --git a/targets/ptfkit-rs/src/varallyai1982.rs b/targets/ptfkit-rs/src/varallyai1982.rs index e02e99c..da3bdf9 100644 --- a/targets/ptfkit-rs/src/varallyai1982.rs +++ b/targets/ptfkit-rs/src/varallyai1982.rs @@ -61,6 +61,7 @@ The source reports 95% relative errors of 14% for theta_0, 34% for m, and 25% fo Use is described as approximate by the source. The source does not report exact calibration ranges; avoid extrapolation beyond comparable Hungarian meadow-series soils."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_varallyai1982_meadow( bulk_density: f64, @@ -137,6 +138,7 @@ The source reports 95% relative errors of 10% for theta_0, 29% for m, and 18% fo Use is described as approximate by the source. The source does not report exact calibration ranges; avoid extrapolation beyond comparable Hungarian chernozem A horizons."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_varallyai1982_chernozem_a( bulk_density: f64, @@ -210,6 +212,7 @@ The source reports 95% relative errors of 11% for theta_0, 34% for m, and 18% fo Use is described as approximate by the source. The source does not report exact calibration ranges; avoid extrapolation beyond comparable Hungarian chernozem B horizons."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_varallyai1982_chernozem_b( bulk_density: f64, @@ -283,6 +286,7 @@ The source reports 95% relative errors of 7% for theta_0, 22% for m, and 11% for Use is described as approximate by the source. The source does not report exact calibration ranges; avoid extrapolation beyond comparable Hungarian chernozem C horizons."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_varallyai1982_chernozem_c( bulk_density: f64, diff --git a/targets/ptfkit-rs/src/vereecken1989.rs b/targets/ptfkit-rs/src/vereecken1989.rs index f9e93b8..72cb70a 100644 --- a/targets/ptfkit-rs/src/vereecken1989.rs +++ b/targets/ptfkit-rs/src/vereecken1989.rs @@ -61,6 +61,7 @@ descriptions for many of the measured curves. The bulk-density maximum is reviewed as 1.730 g/cm^3 because the supplied transcription's 1.230 value is inconsistent with the reported mean."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_vereecken1989( sand: f64, @@ -177,6 +178,7 @@ The detailed log(alpha) formula restores the carbon and bulk-density terms shown omitted from the supplied Table 8 transcription. The bulk-density maximum is reviewed as 1.730 g/cm^3 because the supplied transcription's 1.230 value is inconsistent with the reported mean."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_vereecken1989_detailed( particle_2000_1000: f64, diff --git a/targets/ptfkit-rs/src/wang2012.rs b/targets/ptfkit-rs/src/wang2012.rs index c585386..b0c348c 100644 --- a/targets/ptfkit-rs/src/wang2012.rs +++ b/targets/ptfkit-rs/src/wang2012.rs @@ -60,6 +60,7 @@ volumetric fractions. # Warnings This normalization intentionally changes the legacy water-content outputs by a factor of 100."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_wang2012( sand: f64, diff --git a/targets/ptfkit-rs/src/weber2020.rs b/targets/ptfkit-rs/src/weber2020.rs index b7ac6f9..35babab 100644 --- a/targets/ptfkit-rs/src/weber2020.rs +++ b/targets/ptfkit-rs/src/weber2020.rs @@ -71,6 +71,7 @@ further research. The DS2 inequality is treated as a source typographical error; the tau regression is interpreted as being based on nonpositive tau_vgm values."] +#[cfg_attr(feature = "inline", inline)] #[must_use] pub fn calc_ptf_weber2020( theta_r_vgm: f64,