MCPcopy Create free account
hub / github.com/SingleRust/SingleRust / normalize_expression

Function normalize_expression

src/memory/processing/transformation/mod.rs:11–26  ·  view source on GitHub ↗
(
    matrix: &IMArrayElement,
    expression_target: u32,
    direction: &Direction,
    precision: Option<Precision>,
)

Source from the content-addressed store, hash-verified

9use single_utilities::types::Direction;
10
11pub fn normalize_expression(
12 matrix: &IMArrayElement,
13 expression_target: u32,
14 direction: &Direction,
15 precision: Option<Precision>,
16) -> anyhow::Result<()> {
17 let precision = precision.unwrap_or_default();
18
19 crate::memory::utils::convert_to_float_if_non_float_type(matrix, Some(precision))?;
20 // guarantees that the data is in f32 or f64 format!
21
22 match precision {
23 Precision::Single => normalize_with_type::<f32>(matrix, expression_target, direction),
24 Precision::Double => normalize_with_type::<f64>(matrix, expression_target, direction),
25 }
26}
27
28pub fn log1p_expression(
29 matrix: &IMArrayElement,

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected