A library for computing quantities in cosmology in the Rust programming language
```rust let cosmology = FLRWCosmology::two_component(0.286, 0.714, 69.6);
z = Redshift::new(2.0);
let dc = cosmology.radialcomovingdistance(z); let dm = cosmology.transversecomovingdistance(z); let da = cosmology.angulardiameterdistance(z); let dl = cosmology.luminositydistance(z); let v = cosmology.comovingvolume(z); ```
```rust let omegam = 0.299; let omegade = 0.7; let omegabaryon = 0.05; let H0 = 69.6; let TCMB0 = 2.7255; let omegas = OmegaFactors::new(omegam, omegade, omegabaryon).unwrap(); let cosmology = FLRWCosmology::new( None, None, H0, omegas, Some(TCMB0), Some(PositiveFloat(0.)), Some(vec![]), ) .unwrap();
z = Redshift::new(2.0);
let t = cosmology.lookbacktime(z); let omegaatz = cosmology.omegatot(z); let omegadeatz = cosmology.omegade(z); let criticaldensityatz = cosmology.criticaldensity(z); let TCMBatz = cosmology.TCMB(z); let Tnuatz = cosmology.Tnu(z); let dH = cosmology.hubbledistance(); let tH = cosmology.hubbletime(); let expansionrateatz = cosmology.H(z); let az = cosmology.scale_factor(z); ```
This project requires Rust
. Once installed:
cargo build
cargo test
Run criterion
benchmarks using:
cargo bench
This will generate a report at target/criterion/report/index.html
.