Skip to content

Commit d0c2cde

Browse files
Propagate 4D and 5D LogChebyshev into interpolator.rs
1 parent 5f9f2b3 commit d0c2cde

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

‎neopdf/src/interpolator.rs‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,24 @@ impl InterpolatorFactory {
513513
InterpND::new(coords, reshaped_data.into_dyn(), Linear, Extrapolate::Clamp)
514514
.expect("Failed to create 4D interpolator"),
515515
),
516+
InterpolatorType::LogFourCubic => Box::new(
517+
InterpND::new(
518+
coords,
519+
reshaped_data.into_dyn(),
520+
LogFourCubicInterpolation,
521+
Extrapolate::Clamp,
522+
)
523+
.expect("Failed to create 4D LogFourCubic interpolator"),
524+
),
525+
InterpolatorType::LogChebyshev => Box::new(
526+
InterpND::new(
527+
coords,
528+
reshaped_data.into_dyn(),
529+
LogChebyshevInterpolation::<4>::default(),
530+
Extrapolate::Clamp,
531+
)
532+
.expect("Failed to create 4D LogChebyshev interpolator"),
533+
),
516534
_ => panic!("Unsupported 4D interpolator: {:?}", interp_type),
517535
}
518536
}
@@ -544,6 +562,24 @@ impl InterpolatorFactory {
544562
InterpND::new(coords, reshaped_data.into_dyn(), Linear, Extrapolate::Clamp)
545563
.expect("Failed to create 4D interpolator"),
546564
),
565+
InterpolatorType::LogFourCubic => Box::new(
566+
InterpND::new(
567+
coords,
568+
reshaped_data.into_dyn(),
569+
LogFourCubicInterpolation,
570+
Extrapolate::Clamp,
571+
)
572+
.expect("Failed to create 4D LogFourCubic interpolator"),
573+
),
574+
InterpolatorType::LogChebyshev => Box::new(
575+
InterpND::new(
576+
coords,
577+
reshaped_data.into_dyn(),
578+
LogChebyshevInterpolation::<4>::default(),
579+
Extrapolate::Clamp,
580+
)
581+
.expect("Failed to create 4D LogChebyshev interpolator"),
582+
),
547583
_ => panic!("Unsupported 4D interpolator: {:?}", interp_type),
548584
}
549585
}
@@ -575,6 +611,24 @@ impl InterpolatorFactory {
575611
InterpND::new(coords, reshaped_data.into_dyn(), Linear, Extrapolate::Clamp)
576612
.expect("Failed to create 4D interpolator"),
577613
),
614+
InterpolatorType::LogFourCubic => Box::new(
615+
InterpND::new(
616+
coords,
617+
reshaped_data.into_dyn(),
618+
LogFourCubicInterpolation,
619+
Extrapolate::Clamp,
620+
)
621+
.expect("Failed to create 4D LogFourCubic interpolator"),
622+
),
623+
InterpolatorType::LogChebyshev => Box::new(
624+
InterpND::new(
625+
coords,
626+
reshaped_data.into_dyn(),
627+
LogChebyshevInterpolation::<4>::default(),
628+
Extrapolate::Clamp,
629+
)
630+
.expect("Failed to create 4D LogChebyshev interpolator"),
631+
),
578632
_ => panic!("Unsupported 4D interpolator: {:?}", interp_type),
579633
}
580634
}
@@ -617,6 +671,15 @@ impl InterpolatorFactory {
617671
)
618672
.expect("Failed to create 4D LogFourCubic interpolator"),
619673
),
674+
InterpolatorType::LogChebyshev => Box::new(
675+
InterpND::new(
676+
coords,
677+
reshaped_data.into_dyn(),
678+
LogChebyshevInterpolation::<4>::default(),
679+
Extrapolate::Clamp,
680+
)
681+
.expect("Failed to create 4D LogChebyshev interpolator"),
682+
),
620683
_ => panic!("Unsupported 4D xi/delta interpolator: {:?}", interp_type),
621684
}
622685
}
@@ -666,6 +729,15 @@ impl InterpolatorFactory {
666729
)
667730
.expect("Failed to create 5D LogFiveCubic interpolator"),
668731
),
732+
InterpolatorType::LogChebyshev => Box::new(
733+
InterpND::new(
734+
coords,
735+
reshaped_data.into_dyn(),
736+
LogChebyshevInterpolation::<5>::default(),
737+
Extrapolate::Clamp,
738+
)
739+
.expect("Failed to create 5D LogChebyshev interpolator"),
740+
),
669741
_ => panic!("Unsupported 5D interpolator: {:?}", interp_type),
670742
}
671743
}

0 commit comments

Comments
 (0)