Trait malachite_base::num::conversion::traits::VecFromOtherTypeSlice
source · [−]pub trait VecFromOtherTypeSlice<T: Sized>: Sized {
fn vec_from_other_type_slice(slice: &[T]) -> Vec<Self>;
}
Expand description
Converts a slice of one type of value to a Vec
of another type.
Required Methods
fn vec_from_other_type_slice(slice: &[T]) -> Vec<Self>
Implementations on Foreign Types
sourceimpl VecFromOtherTypeSlice<u8> for u8
impl VecFromOtherTypeSlice<u8> for u8
sourcefn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
Converts a slice of one type of value to a Vec
of the same type.
In this case, it just converts the slice to a Vec
the usual way.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u16> for u16
impl VecFromOtherTypeSlice<u16> for u16
sourcefn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
Converts a slice of one type of value to a Vec
of the same type.
In this case, it just converts the slice to a Vec
the usual way.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u32> for u32
impl VecFromOtherTypeSlice<u32> for u32
sourcefn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
Converts a slice of one type of value to a Vec
of the same type.
In this case, it just converts the slice to a Vec
the usual way.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u64> for u64
impl VecFromOtherTypeSlice<u64> for u64
sourcefn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
Converts a slice of one type of value to a Vec
of the same type.
In this case, it just converts the slice to a Vec
the usual way.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u128> for u128
impl VecFromOtherTypeSlice<u128> for u128
sourcefn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
Converts a slice of one type of value to a Vec
of the same type.
In this case, it just converts the slice to a Vec
the usual way.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<usize> for usize
impl VecFromOtherTypeSlice<usize> for usize
sourcefn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
Converts a slice of one type of value to a Vec
of the same type.
In this case, it just converts the slice to a Vec
the usual way.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u16> for u8
impl VecFromOtherTypeSlice<u16> for u8
sourcefn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u32> for u8
impl VecFromOtherTypeSlice<u32> for u8
sourcefn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u32> for u16
impl VecFromOtherTypeSlice<u32> for u16
sourcefn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u64> for u8
impl VecFromOtherTypeSlice<u64> for u8
sourcefn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u64> for u16
impl VecFromOtherTypeSlice<u64> for u16
sourcefn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u64> for u32
impl VecFromOtherTypeSlice<u64> for u32
sourcefn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u128> for u8
impl VecFromOtherTypeSlice<u128> for u8
sourcefn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u128> for u16
impl VecFromOtherTypeSlice<u128> for u16
sourcefn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u128> for u32
impl VecFromOtherTypeSlice<u128> for u32
sourcefn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u128> for u64
impl VecFromOtherTypeSlice<u128> for u64
sourcefn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u128> for usize
impl VecFromOtherTypeSlice<u128> for usize
sourcefn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u128]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<usize> for u8
impl VecFromOtherTypeSlice<usize> for u8
sourcefn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<usize> for u16
impl VecFromOtherTypeSlice<usize> for u16
sourcefn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a smaller unsigned
type.
Each value of the input slice will be broken up into several values in the output
Vec
.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = 2^{V-W}n$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u8> for u16
impl VecFromOtherTypeSlice<u8> for u16
sourcefn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u8> for u32
impl VecFromOtherTypeSlice<u8> for u32
sourcefn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u8> for u64
impl VecFromOtherTypeSlice<u8> for u64
sourcefn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u8> for u128
impl VecFromOtherTypeSlice<u8> for u128
sourcefn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u8> for usize
impl VecFromOtherTypeSlice<u8> for usize
sourcefn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u8]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u16> for u32
impl VecFromOtherTypeSlice<u16> for u32
sourcefn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u16> for u64
impl VecFromOtherTypeSlice<u16> for u64
sourcefn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u16> for u128
impl VecFromOtherTypeSlice<u16> for u128
sourcefn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u16> for usize
impl VecFromOtherTypeSlice<u16> for usize
sourcefn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u16]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u32> for u64
impl VecFromOtherTypeSlice<u32> for u64
sourcefn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u32> for u128
impl VecFromOtherTypeSlice<u32> for u128
sourcefn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u64> for u128
impl VecFromOtherTypeSlice<u64> for u128
sourcefn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<usize> for u128
impl VecFromOtherTypeSlice<usize> for u128
sourcefn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
Converts a slice of one type of unsigned integer to a Vec
of a larger unsigned
type.
Adjacent chunks of values in the input slice will be joined into values of the
output Vec
. If the last few elements of the input slice don’t make up a full
chunk, the most-significant bits of the last output value are set to 0.
Let $V$ be the the width of the input type and $W$ the width of the output type.
$f((x_k)_ {k=0}^{n-1}) = (y_k)_ {k=0}^{m-1}$, where
$$ \sum_{j=0}^{n-1}2^{jV}x_j = \sum_{j=0}^{m-1}2^{jW}y_j, $$
$y_j < 2^W$ for all $j$, and $m = \lceil n / 2^{W-V} \rceil$.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
Examples
See here.
sourceimpl VecFromOtherTypeSlice<u32> for usize
impl VecFromOtherTypeSlice<u32> for usize
sourcefn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u32]) -> Vec<Self>
Converts a slice of u32
s to a Vec
of usize
s.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
See here.
sourceimpl VecFromOtherTypeSlice<u64> for usize
impl VecFromOtherTypeSlice<u64> for usize
sourcefn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[u64]) -> Vec<Self>
Converts a slice of u64
s to a Vec
of usize
s.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
See here.
sourceimpl VecFromOtherTypeSlice<usize> for u32
impl VecFromOtherTypeSlice<usize> for u32
sourcefn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
Converts a slice of usize
s to a Vec
of u32
s.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
See here.
sourceimpl VecFromOtherTypeSlice<usize> for u64
impl VecFromOtherTypeSlice<usize> for u64
sourcefn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
fn vec_from_other_type_slice(xs: &[usize]) -> Vec<Self>
Converts a slice of usize
s to a Vec
of u64
s.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is xs.len()
.
See here.