Expand description
Choose what you want.
§Philosophy
Numerical algorithms are neglected in many codes.
However, it is very important which algorithm is used for precise research and important numerical computation.
fuga
is the best for you.
§Usage
ⓘ
#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;
// Then you can use everything in peroxide.
§Compare with prelude
- Norm
#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;
fn main() {
let a = c!(1, 2, 3);
let l1 = a.norm(Norm::L1);
let l2 = a.norm(Norm::L2);
let l_inf = a.norm(Norm::LInf);
assert_eq!(l1, 6f64);
assert_eq!(l2, 14f64.sqrt());
assert_eq!(l_inf, 3f64);
}
#[macro_use]
extern crate peroxide;
use peroxide::prelude::*;
fn main() {
let a = c!(1, 2, 3);
let l2 = a.norm(); // L2 is default vector norm
// prelude can't compute l1 norm, l_inf norm
assert_eq!(l2, 14f64.sqrt());
}
- Numerical integration
#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;
use std::f64::consts::PI;
fn main() {
let sin = |x: f64| x.sin();
integrate(sin, (0f64, PI), GaussLegendre(15)).print();
}
#[macro_use]
extern crate peroxide;
use peroxide::prelude::*;
use std::f64::consts::PI;
fn main() {
let sin = |x: f64| x.sin();
integrate(sin, (0f64, PI)).print();
// Default integration = GaussLegendre(15)
}
- Solve
#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;
fn main() {
let a = ml_matrix("1 2;3 4");
let b = c!(3, 7);
a.solve(&b, LU).print(); // [1, 1]
a.solve(&b, WAZ).print(); // [1, 1]
}
#[macro_use]
extern crate peroxide;
use peroxide::prelude::*;
fn main() {
let a = ml_matrix("1 2;3 4");
let b = c!(3, 7);
// Prelude can only solve with LU
a.solve(&b).print(); // [1, 1]
}
- DataFrame with Parquet
extern crate peroxide;
use peroxide::fuga::*;
fn main() {
let x = seq(0, 1, 0.1);
let y = x.fmap(|t| t.powi(2));
let mut df = DataFrame::new(vec![]);
df.push("x", Series::new(x));
df.push("y", Series::new(y));
df.print();
df.write_parquet("example_data/test.parquet", CompressionOptions::Uncompressed).unwrap();
}
extern crate peroxide;
use peroxide::prelude::*;
fn main() {
let x = seq(0, 1, 0.1);
let y = x.fmap(|t| t.powi(2));
let mut df = DataFrame::new(vec![]);
df.push("x", Series::new(x));
df.push("y", Series::new(y));
df.print();
df.write_parquet("example_data/test.parquet").unwrap();
}
Re-exports§
pub use crate::traits::fp::FPMatrix;
pub use crate::traits::fp::FPVector;
pub use crate::traits::general::Algorithm;
pub use crate::traits::math::InnerProduct;
pub use crate::traits::math::LinearOp;
pub use crate::traits::math::MatrixProduct;
pub use crate::traits::math::Norm;
pub use crate::traits::math::Normed;
pub use crate::traits::math::Vector;
pub use crate::traits::math::VectorProduct;
pub use crate::traits::matrix::LinearAlgebra;
pub use crate::traits::matrix::MatrixTrait;
pub use crate::traits::mutable::MutFP;
pub use crate::traits::mutable::MutMatrix;
pub use crate::traits::num::Real;
pub use crate::traits::pointer::MatrixPtr;
pub use crate::traits::pointer::Oxide;
pub use crate::traits::pointer::Redox;
pub use crate::traits::pointer::RedoxCommon;
pub use crate::traits::stable::StableFn;
pub use crate::traits::sugar::ConvToMat;
pub use crate::traits::sugar::Scalable;
pub use crate::traits::sugar::ScalableMut;
pub use crate::traits::sugar::VecOps;
pub use crate::traits::fp::ParallelFPMatrix;
pub use crate::traits::fp::ParallelFPVector;
pub use crate::traits::math::ParallelInnerProduct;
pub use crate::traits::math::ParallelMatrixProduct;
pub use crate::traits::math::ParallelNormed;
pub use crate::traits::math::ParallelVector;
pub use crate::traits::math::ParallelVectorProduct;
pub use crate::traits::mutable::ParallelMutFP;
pub use crate::complex::C64;
pub use crate::numerical::integral::Integral::GaussLegendre;
pub use crate::numerical::integral::Integral::NewtonCotes;
pub use crate::numerical::integral::Integral::G10K21;
pub use crate::numerical::integral::Integral::G10K21R;
pub use crate::numerical::integral::Integral::G15K31;
pub use crate::numerical::integral::Integral::G15K31R;
pub use crate::numerical::integral::Integral::G20K41;
pub use crate::numerical::integral::Integral::G20K41R;
pub use crate::numerical::integral::Integral::G25K51;
pub use crate::numerical::integral::Integral::G25K51R;
pub use crate::numerical::integral::Integral::G30K61;
pub use crate::numerical::integral::Integral::G30K61R;
pub use crate::numerical::integral::Integral::G7K15;
pub use crate::numerical::integral::Integral::G7K15R;
pub use crate::numerical::spline::SlopeMethod::Akima;
pub use crate::numerical::spline::SlopeMethod::Quadratic;
pub use crate::statistics::stat::QType::Type1;
pub use crate::statistics::stat::QType::Type2;
pub use crate::statistics::stat::QType::Type3;
pub use crate::statistics::stat::QType::Type4;
pub use crate::statistics::stat::QType::Type5;
pub use crate::statistics::stat::QType::Type6;
pub use crate::statistics::stat::QType::Type7;
pub use crate::statistics::stat::QType::Type8;
pub use crate::statistics::stat::QType::Type9;
pub use crate::traits::matrix::UPLO::Lower;
pub use crate::traits::matrix::UPLO::Upper;
pub use crate::traits::matrix::Form::Diagonal;
pub use crate::traits::matrix::Form::Identity;
pub use crate::traits::matrix::SolveKind::LU;
pub use crate::traits::matrix::SolveKind::WAZ;
pub use anyhow;
pub use paste;
pub use crate::macros::julia_macro::*;
pub use crate::macros::matlab_macro::*;
pub use crate::macros::r_macro::*;
pub use crate::complex::integral::*;
pub use crate::complex::matrix::*;
pub use crate::complex::vector::*;
pub use crate::structure::ad::*;
pub use crate::structure::dataframe::*;
pub use crate::structure::matrix::*;
pub use crate::structure::polynomial::*;
pub use crate::structure::vector::*;
pub use crate::util::api::*;
pub use crate::util::low_level::*;
pub use crate::util::non_macro::*;
pub use crate::util::print::*;
pub use crate::util::useful::*;
pub use crate::util::wrapper::*;
pub use crate::statistics::dist::*;
pub use crate::statistics::ops::*;
pub use crate::statistics::rand::*;
pub use crate::statistics::stat::*;
pub use crate::special::function::*;
pub use crate::numerical::eigen::*;
pub use crate::numerical::integral::*;
pub use crate::numerical::interp::*;
pub use crate::numerical::ode::*;
pub use crate::numerical::optimize::*;
pub use crate::numerical::root::*;
pub use crate::numerical::spline::*;
pub use crate::numerical::utils::*;
pub use crate::ml::reg::*;
pub use crate::util::plot::*;
pub use crate::statistics::stat::Metric::*;
pub use crate::structure::ad::AD::*;
pub use crate::structure::dataframe::DType::*;
Macros§
Enums§
- Defines the compression settings for writing a parquet file.