pub fn new(n: usize,
               mut indices: Vec<I>,
               mut data: Vec<N>
              ) -> CsVecI<N, I>
    where N: Copy
    {
        let mut buf = Vec::with_capacity(indices.len());
        utils::sort_indices_data_slices(&mut indices[..],
                                        &mut data[..],
                                        &mut buf);
        let v = CsVecI {
            dim: n,
            indices: indices,
            data: data
        };
        v.check_structure().and(Ok(v)).unwrap()
    }
/// Create an owning CsVec from vector data.
///
/// # Panics
///
/// - if `indices` and `data` lengths differ
/// - if the vector contains out of bounds indices
Create an owning CsVec from vector data.
Create an owning CsVec from vector data .
pub fn new(n: usize,
               mut indices: Vec<I>,
               mut data: Vec<N>
              ) -> CsVecI<N, I>
    where N: Copy
    {
        let mut buf = Vec::with_capacity(indices.len());
        utils::sort_indices_data_slices(&mut indices[..],
                                        &mut data[..],
                                        &mut buf);
        let v = CsVecI {
            dim: n,
            indices: indices,
            data: data
        };
        v.check_structure().and(Ok(v)).unwrap()
    }
pub fn new ( n : usize , mut indices : Vec < I > , mut data : Vec < N > ) -> CsVecI < N , I > where N : Copy { let mut buf = Vec :: with_capacity ( indices . len ( ) ) ; utils :: sort_indices_data_slices ( & mut indices [ .. ] , & mut data [ .. ] , & mut buf ) ; let v = CsVecI { dim : n , indices : indices , data : data } ; v . check_structure ( ) . and ( Ok ( v ) ) . unwrap ( ) }
Create an owning CsVec from vector data.
Create an owning CsVec from vector data .
n
usize
indices
Vec<I>
data
Vec<N>
n
usize
indices
Vec<I>
data
Vec<N>
panics
if `indices` and `data` lengths differ
if the vector contains out of bounds indices
if ` indices ` and ` data ` lengths differ if the vector contains out of bounds indices