@@ -984,7 +984,7 @@ pub mod arbitrary_linear_algebra {
984
984
/// The default precision.
985
985
///
986
986
/// This is thread-local.
987
- pub static DEFAULT_PRECISION : RefCell <u32 > = RefCell :: new( 256 ) ;
987
+ pub static DEFAULT_PRECISION : RefCell <u32 > = const { RefCell :: new( 256 ) } ;
988
988
}
989
989
/// Set the default precision **for this thread**.
990
990
pub fn set_default_precision ( new : u32 ) {
@@ -1022,6 +1022,24 @@ pub mod arbitrary_linear_algebra {
1022
1022
rug:: Float :: with_val ( default_precision ( ) , element) . into ( )
1023
1023
}
1024
1024
}
1025
+ impl simba:: scalar:: SupersetOf < f32 > for FloatWrapper {
1026
+ fn is_in_subset ( & self ) -> bool {
1027
+ self . 0 . prec ( ) <= 24
1028
+ }
1029
+ fn to_subset ( & self ) -> Option < f32 > {
1030
+ if simba:: scalar:: SupersetOf :: < f32 > :: is_in_subset ( self ) {
1031
+ Some ( self . 0 . to_f32 ( ) )
1032
+ } else {
1033
+ None
1034
+ }
1035
+ }
1036
+ fn to_subset_unchecked ( & self ) -> f32 {
1037
+ self . 0 . to_f32 ( )
1038
+ }
1039
+ fn from_subset ( element : & f32 ) -> Self {
1040
+ rug:: Float :: with_val ( default_precision ( ) , element) . into ( )
1041
+ }
1042
+ }
1025
1043
impl simba:: scalar:: SubsetOf < Self > for FloatWrapper {
1026
1044
fn to_superset ( & self ) -> Self {
1027
1045
self . clone ( )
@@ -1052,10 +1070,7 @@ pub mod arbitrary_linear_algebra {
1052
1070
type Element = FloatWrapper ;
1053
1071
type SimdBool = bool ;
1054
1072
1055
- #[ inline( always) ]
1056
- fn lanes ( ) -> usize {
1057
- 1
1058
- }
1073
+ const LANES : usize = 1 ;
1059
1074
1060
1075
#[ inline( always) ]
1061
1076
fn splat ( val : Self :: Element ) -> Self {
0 commit comments