mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-12-23 12:56:53 +01:00
Improved usize
This commit is contained in:
parent
b0dc33d97b
commit
7e9a3077d3
@ -129,8 +129,7 @@ pub fn read_{group_l}_{element_l}(trex_file: File) -> Result<{type_r}, ExitCode>
|
|||||||
rc_return(rc, data)
|
rc_return(rc, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_{group_l}_{element_l}<T>(trex_file: File, data: T) -> Result<(), ExitCode>
|
pub fn write_{group_l}_{element_l}(trex_file: File, data: {type_r}) -> Result<(), ExitCode> {
|
||||||
where {type_c}: From<T> {
|
|
||||||
let data: {type_c} = data.try_into().unwrap();
|
let data: {type_c} = data.try_into().unwrap();
|
||||||
let rc = unsafe { c::trexio_write_{group}_{element}_64(trex_file, data) };
|
let rc = unsafe { c::trexio_write_{group}_{element}_64(trex_file, data) };
|
||||||
rc_return(rc, ())
|
rc_return(rc, ())
|
||||||
|
@ -22,7 +22,7 @@ pub fn test_write(file_name: &str, back_end: BackEnd) {
|
|||||||
let nucleus_num = 12;
|
let nucleus_num = 12;
|
||||||
let state_id = 2;
|
let state_id = 2;
|
||||||
let charge = vec![6., 6., 6., 6., 6., 6., 1., 1., 1., 1., 1., 1.0f64];
|
let charge = vec![6., 6., 6., 6., 6., 6., 1., 1., 1., 1., 1., 1.0f64];
|
||||||
let coord = vec![ 0.00000000, 1.39250319 , 0.00 ,
|
let coord = vec![ 0.00000000f64, 1.39250319 , 0.00 ,
|
||||||
-1.20594314, 0.69625160 , 0.00 ,
|
-1.20594314, 0.69625160 , 0.00 ,
|
||||||
-1.20594314, -0.69625160 , 0.00 ,
|
-1.20594314, -0.69625160 , 0.00 ,
|
||||||
0.00000000, -1.39250319 , 0.00 ,
|
0.00000000, -1.39250319 , 0.00 ,
|
||||||
@ -84,6 +84,13 @@ pub fn test_write(file_name: &str, back_end: BackEnd) {
|
|||||||
trexio::write_mo_num(trex_file, mo_num).unwrap();
|
trexio::write_mo_num(trex_file, mo_num).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut energy = Vec::with_capacity(mo_num);
|
||||||
|
for i in 0..mo_num {
|
||||||
|
let e: f64 = i as f64 -100.0f64;
|
||||||
|
energy.push(e);
|
||||||
|
}
|
||||||
|
println!("{:#?}", energy);
|
||||||
|
|
||||||
trexio::close(trex_file).expect("Unable to close File");
|
trexio::close(trex_file).expect("Unable to close File");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user