fn _make_supercell(builder: Builder, coords: &Coords) -> (Coords, SupercellToken)
{
    let Coords { lattice, coords } = coords;

    // construct a SupercellToken ASAP so that we know the rest of the code
    // works for general supercell matrices
    let sc = builder.into_sc_token(coords.len());

    let image_offset_carts = image_lattice_vecs(sc.periods, sc.offset, lattice);

    let mut new_carts = Vec::with_capacity(sc.num_supercell_atoms());
    for atom_cart in coords.to_carts(&lattice) {
        let old_len = new_carts.len();
        new_carts.extend_from_slice(&image_offset_carts);
        crate::util::translate_mut_n3_3(&mut new_carts[old_len..], &atom_cart);
    }

    let coords = Coords::new(
        &sc.integer_lattice * lattice,
        CoordsKind::Carts(new_carts),
    );

    (coords, sc)
}
// !!! This function affects the supercell convention !!! (SUPERCELL-CONV)
// When modifying it, you must modify all functions that have this label.
This function affects the supercell convention !!. (SUPERCELL-CONV)
When modifying it, you must modify all functions that have this label.
This function affects the supercell convention !! . ( SUPERCELL - CONV ) When modifying it you must modify all functions that have this label .
fn _make_supercell(builder: Builder, coords: &Coords) -> (Coords, SupercellToken)
{
    let Coords { lattice, coords } = coords;
    // construct a SupercellToken ASAP so that we know the rest of the code
    // works for general supercell matrices
    let sc = builder.into_sc_token(coords.len());
    let image_offset_carts = image_lattice_vecs(sc.periods, sc.offset, lattice);
    let mut new_carts = Vec::with_capacity(sc.num_supercell_atoms());
    for atom_cart in coords.to_carts(&lattice) {
        let old_len = new_carts.len();
        new_carts.extend_from_slice(&image_offset_carts);
        crate::util::translate_mut_n3_3(&mut new_carts[old_len..], &atom_cart);
    }
    let coords = Coords::new(
        &sc.integer_lattice * lattice,
        CoordsKind::Carts(new_carts),
    );
    (coords, sc)
}
fn _make_supercell ( builder : Builder , coords : & Coords ) -> ( Coords , SupercellToken ) { let Coords { lattice , coords } = coords ; // construct a SupercellToken ASAP so that we know the rest of the code // works for general supercell matrices let sc = builder . into_sc_token ( coords . len ( ) ) ; let image_offset_carts = image_lattice_vecs ( sc . periods , sc . offset , lattice ) ; let mut new_carts = Vec :: with_capacity ( sc . num_supercell_atoms ( ) ) ; for atom_cart in coords . to_carts ( & lattice ) { let old_len = new_carts . len ( ) ; new_carts . extend_from_slice ( & image_offset_carts ) ; crate :: util :: translate_mut_n3_3 ( & mut new_carts [ old_len .. ] , & atom_cart ) ; } let coords = Coords :: new ( & sc . integer_lattice * lattice , CoordsKind :: Carts ( new_carts ) , ) ; ( coords , sc ) }
This function affects the supercell convention !
This function affects the supercell convention !
builder
Builder
coords
&Coords
builder
Builder
coords
&Coords