- Fix error in
O3
feature
-
complex
feature- Implement complex vector, matrix and integral #35 (Thanks to @GComitini and @soumyasen1809)
-
parallel
feature- Implement some parallel functions #72 (Thanks to @soumyasen1809)
- Implement
MatrixTrait
for Matrix (Scalar = f64) - Implement
MatrixTrait
for ComplexMatrix (Scalar = C64) LinearAlgebra
andsolve
depend onMatrixTrait
-
Update
puruspe
dependency to0.3.0
, removelambert_w
dependency #79 (Thanks to @JSorngard) -
Add
hermite_polynomial
andbessel_polynomial
#80 (Thanks to @jgrage)
- Fix inconsistent lambert w function name #65 (Thanks to @JSorngard)
- Integrate with lambert_w crate (#63) (Thanks to @JSorngard)
-
Write flexible wrapper for lambert_w
pub enum LambertWAccuracyMode { Simple, // Faster, 24 bits of accuracy Precise, // Slower, 50 bits of accuracy } pub fn lambert_w0(z: f64, mode: LambertWAccuracyMode) -> f64; pub fn lambert_wm1(z: f64, mode: LambertWAccuracyMode) -> f64;
-
Write default Lambert W function for
prelude
(Precise as default)use peroxide::prelude::*; fn main() { lambert_w0(1.0).print(); // Same as fuga::lambert_w0(1.0, LambertWAccuracyMode::Simple) }
-
- Bump
pyo3
dependency to0.22
- Fix plot functions to be compatible with
pyo3
- Add B-Spline to README
- Generic Spline trait
Spline<T>
: desired output type isT
- Split
PolynomialSpline
fromSpline
CubicSpline
&CubicHermiteSpline
are nowPolynomialSpline
- Implement
Spline<f64>
forPolynomialSpline
- Implement B-Spline
BSpline { degree: usize, knots: Vec<f64>, control_points: Vec<Vec<f64>> }
BSpline::open(degree, knots, control_points)
: Open B-SplineBSpline::clamped(degree, knots, control_points)
: Clamped B-Spline
- Implement
Spline<(f64, f64)>
forBSpline
- More generic & stable root finding macros (except
Newton
)
- Public ODE Integrator fields
- Add Nan/infinite guard to
gauss_kronrod_quadrature
(early exit) (#59) (Thanks to @GComitini) - Add complex feature & complex module (#35)
- Implement Cubic B-Spline basis functions
UnitCubicBasis
CubicBSplineBases
- Do not include legend box if there is no legend (#58) (Thanks to @GComitini)
- Add
rtol
field toBroydenMethod
- Implement high-level macros for root finding
bisection!(f, (a,b), max_iter, tol)
newton!(f, x0, max_iter, tol)
(require#[ad_function]
attribute)secant!(f, (a,b), max_iter, tol)
false_position!(f, (a,b), max_iter, tol)
- Implement
BrodenMethod
: Broyden's method (I>=1, O>=1, T=([f64; I], [f64; I])
) - Restore citation file
- Remove all boilerplates
- Now,
RootFinding
is composed of traitsRootFindingProblem<const I: usize, const O: usize, T>
: Trait for defining and root finding problemI
: Input dimensionO
: Output dimensionT
: Type of state
RootFinder
: Trait for finding rootBisectionMethod
: Bisection Method (I=1, O=1, T=(f64, f64)
)FalsePositionMethod
: False Position Method (I=1, O=1, T=(f64, f64)
)NewtonMethod
: Newton Method (I=1, O=1, T=f64
)SecantMethod
: Secant Method (I=1, O=1, T=(f64, f64)
)
- Remove
thiserror
dependency - Add
anyhow
for error handling - Change error handling in
ODE
,Spline
,WeightedUniform
- More generic Butcher tableau
- Now, you can use
ButcherTableau
for non-embedded methods too
- Now, you can use
- More ODE integrators
RALS3, RALS4, RK5, BS23
- Hotfix : Fix
GL4
algorithm
- Now, you can report current states if your constraints are violated.
ODEError::ConstraintViolation
->ODEError::ConstraintViolation(f64, Vec<f64>, Vec<f64>)
- for detailed information, see docs for ODEError
- Add docs for
ODEError
-
Fix all warnings in peroxide
-
Change redundant method
Vec<f64>::resize
->Vec<f64>::reshape
-
Error handling for concatenation
cbind
&rbind
now returnsResult<Matrix, ConcatenateError>
-
New non-macro utils
column_stack(&[Vec<f64>]) -> Result<Matrix, ConcatenateError>
row_stack(&[Vec<f64>]) -> Result<Matrix, ConcatenateError>
rand_with_rng(usize, usize, &mut Rng) -> Matrix
-
Generic Butcher tableau trait (now for embedded Runge-Kutta methods)
pub trait ButcherTableau { const C: &'static [f64]; const A: &'static [&'static [f64]]; const BH: &'static [f64]; const BL: &'static [f64]; fn tol(&self) -> f64; fn safety_factor(&self) -> f64; fn max_step_size(&self) -> f64; fn min_step_size(&self) -> f64; fn max_step_iter(&self) -> usize; }
-
Implement
ODEIntegrator
forButcherTableau
- Just declare
ButcherTableau
thenstep
is free
- Just declare
-
Three available embedded Runge-Kutta methods
RKF45
: Runge-Kutta-Fehlberg 4/5th orderDP45
: Dormand-Prince 4/5th orderTSIT45
: Tsitouras 4/5th order
-
- Add
thiserror
for error handling - Implement errors for cubic spline & cubic hermite spline.
- Implement errors for weighted uniform distribution & PRS.
- Now, all distribution has
sample_with_rng
method. - There are two wrappers for
SeedableRng
smallrng_from_seed
: Performant but not securestdrng_from_seed
: Performant enough and secure enough
- Remove all boilerplates.
- Now,
ODE
is composed of traits.ODEProblem
: Trait for defining and ODE problem.ODEIntegrator
: Trait for integrating ODE.RK4
: Runge-Kutta 4th orderRKF45
: Runge-Kutta-Fehlberg 4/5th orderGL4
: Gauss-Legendre 4th order- You can implement your own integrator.
ODESolver
: Trait for solving ODE.BasicODESolver
: Basic ODE solver - define range of t, initial step size and integrate it.- You can implement your own solver.
- For more information, see docs for ode.
- Add
PlotType
forPlot2D
PlotType::Scatter
PlotType::Line
(default)PlotType::Bar
- Now you can set marker, line style, color, alpha option for specific element.
set_marker(vec![(usize, Marker)])
:usize
is index of element (image or pair)set_line_style(vec![(usize, LineStyle)])
set_color(vec![(usize, String)])
set_alpha(vec![(usize, f64)])
- Make legend optional (Now, no legend is available)
- Implement
set_line_style
. Here are available line styles.LineStyle::Solid
LineStyle::Dashed
LineStyle::Dotted
LineStyle::DashDot
- Implement
set_color
- Implement
set_alpha
- More markers.
- Add explicit getter for
ExplicitODE
andImplicitODE
for various fields.
- Add
auto-initialize
flag forpyo3
- Add
scienceplots
support. Here are available styles.PlotStyle::Default
: default matplotlib style - no scienceplots requiredPlotStyle::Science
: scienceplots default style - scienceplots requiredPlotStyle::Nature
: nature style - scienceplots requiredPlotStyle::IEEE
: IEEE style - scienceplots required
- Implement
xscale, yscale, xlim, ylim
forPlot2D
- You can check these features in Peroxide Gallery
- Derive
Serialize
andDeserialize
forCubicHermiteSpline
- Derive
Serialize
andDeserialize
forMatrix
- Remove explicit implementation for
Default
forShape
- Update
peroxide-num
tov0.1.4
- Implement
ExpLogOps, PowOps, TrigOps
andNumeric<f64>
forMatrix
- Add new sub-crate :
peroxide-num
- Change all dependencies of
ExpLogOps, PowOps, TrigOps
toperoxide-num
- R example in
structure/matrix
(#56) (Thanks to @rdavis120)
- Fix old syntax - e.g. explicit
into_iter
,Vec::with_capacity
&set_len
- Modify
self.sum
to compatible with definition Weighted Uniform Distribution - Modify
mean
&var
to compatible with definition
- Implement
arg_min
,max
,min
-
Adapt max iteration number to Gauss-Kronrod quadrature
- Arguments of all methods related with Gauss-Kronrod quadrature are changed.
- e.g.
G7K15(1e-15)
->G7K15(1e-15, 20)
(20 is maximum iteration)
-
Example
use peroxide::fuga::*; fn main() { let f_integral = integrate(f, (0f64, 1f64), G7K15R(1e-4, 20)); f_integral.print(); } fn f(x: f64) -> f64 { x.powi(2) }
- Implement Gauss-Kronrod quarature with relative error
G7K15R
,G10K21R
,G15K31R
,G20K41R
,G25K51R
,G30K61R
can be used.
- Reduce warning messages
- Implement
Statistics
forWeightedUniform
(#55) (Thanks to @samnaughtonb) - New trait:
FloatWithPrecision
fn round_with_precision(&self, precision: usize) -> Self
fn floor_with_precision(&self, precision: usize) -> Self
fn ceil_with_precision(&self, precision: usize) -> Self
- New utils:
fn seq_with_precision(start, end, step, precision: usize) -> Vec<f64>
fn linspace_with_precision(start, end, length, precision: usize) -> Vec<f64>
- Implement necessary traits for
ConfusionMatrix
#[derive(Debug, Clone, PartialEq)]
- Bump up dependencies version
netcdf
:0.7.0
->0.8.1
arrow
:0.14
->0.17.0
pyo3
:0.17
->0.18
- Implement
ConfusionMatrix
instatistics::stat
- Implement all metrics in wikipedia
- Delete
build.rs
to remove any explicit linkages to specific BLAS implementations (#54) (Thanks to @gfaster)
- Make an option for choosing compression method for parquet
- At
fuga
:fn write_parquet(&self, path: &str, compression: CompressionOptions)
- At
prelude
:fn write_parquet(&self, path:&str)
(Default:CompressionOptions::Uncompressed
)
- At
- Add
parquet
feature - Add
WithParquet
trait and implement it forDataFrame
fn write_parquet(&self, path: &str) -> Result<(), Box<dyn Error>>
fn read_parquet(path: &str) -> Result<Self, Box<dyn Error>>
- Update
DataFrame
docs
- Change debug procedure for stop condition of
ODE
(#52) (Thanks to @tchamelot)- Add
fn has_stopped(&self) -> bool
forODE
struct
- Add
- Fix bug in
linspace
(#51) - Change print scheme of
Vec<float>
- Now, floating number in
Vec
is printed byfmt_lower_exp(2)
- Now, floating number in
- Add
*_with_cond
forSpline
trait (See Truncated Cubic - Peroxide Gallery for an example)eval_with_cond<F: Fn(f64) -> f64>(&self, x: f64, cond: F) -> f64
: Evaluate with custom conditioneval_vec_with_cond<F: Fn(f64) -> f64 + Copy>(&self, v: [&f64], cond: F) -> f64
: Evaluate vector with custom condition
- New trait -
LowerExpWithPlus
,UpperExpWithPlus
- Now, we can print
132.45
as1.3245e+2
via132.45.fmt_lower_exp(4)
- Now, we can print
132.45
as1.3245E+2
via132.45.fmt_upper_exp(4)
- Now, we can print
- Change print scheme of
DataFrame
- Now, floating number in DataFrame is printed by
fmt_lower_exp(2)
- Now, floating number in DataFrame is printed by
- Fix bug in
rref
(#50)
- Fix bug in
linspace
andlogspace
- Now
linspace(0, 0, 1)
returns[0f64]
instead of[NaN]
- Now
logspace(0, 0, 1, 10)
returns[1f64]
instead of[NaN]
- Now
- Fix assertion of
util::non_macro::seq
- Implement numpy like
logspace
- Fix a bug in
spread
of DataFrame
- New trait
Spline
- Move
CubicSpline::eval
toSpline::eval
- Move
CubicSpline::polynomial
toSpline::polynomial_at
- Move
CubicSpline::number_of_polynomials
toSpline::number_of_polynomials
- Add
Spline::eval_vec
- Add
Spline::get_ranged_polynomials
- Move
- Implement Cubic Hermite spline
- Add struct
CubicHermiteSpline
- Implement slope estimation algorithms
SlopeMethod::Akima
SlopeMethod::Quadratic
- Add struct
- Modify
CubicSpline
(Important!)- Change argument type
from_nodes(node_x: &[f64], node_y: &[f64]) -> Self
- (For developer) Remove
CubicSpline::ranged
(useutil::useful::zip_range
instead)
- Change argument type
- Add docs for
numeric/spline.rs
- Rename
Calculus::diff
toCalculus::derivative
(Important!)
- Add
util::useful::{gen_range, zip_range}
- Add
structure::poly::Calculus::integrate
- Update
puruspe
to0.2.0
(Fix a bug in gamma function)
- New distribution :
WeightedUniform
- New sampling method :
PRS
(Piecewise Rejection Sampling) - Documentation for these new methods will be added later.
- Control
lambda
ofLevenbergMarquardt
(#49)- Add
set_lambda_init
&set_lambda_max
(#49)
- Add
- More flexible root finding
- Add getter methods for
RootFinder
- Add getter methods for
RootState
- Add getter methods for
- Implement Cholesky decomposition in
O3
feature. - Implement symmetricity check method -
is_symmetric
for Matrix.
- Update
netcdf
dependency to0.7
- Fix
nc
feature issue - not compatible with hdf5 version 1.12.0
- Fix
- Update
pyo3
dependency to1.15
- Update
float-cmp
dev dependency to0.9
- Add more trigonometric ops
asin_acos(&self) -> (Self, Self)
asinh_acosh(&self) -> (Self, Self)
- Update dependencies
blas
:0.21.0
->0.22.0
lapack
:0.17.0
->0.19.0
- Fix errata in
col_map
,row_map
- Change signature of
cubic_spline
- Originally,
(Vec<f64>, Vec<f64>) -> Vec<Polynomial>
- Now,
(&Vec<f64>, &Vec<f64>) -> CubicSpline
- Originally,
- Add Truncated SVD
- Add
truncated(&self)
method forSVD
- Add
- Fix a bug in quantile of
statistics/stat.rs
- Update docs
prelude/mod.rs
: Update default numerical integration method
- Update
matrixmultiply
dependency- Add
threading
feature - Enhance matrix multiplication performance : See matmul
- Add
- Update dependencies
rand
: 0.7 -> 0.8rand_distr
: 0.3 -> 0.4matrixmultiply
: 0.2 -> 0.3netcdf
: 0.5 -> 0.6blas
: 0.20 -> 0.21lapack
: 0.16 -> 0.17pyo3
: 0.12 -> 0.13
- Automatic generated gradient & hessian via
proc_macro
- Currently only support
Fn(f64) -> f64
- Currently only support
use peroxide::fuga::*;
fn main() {
f(2f64).print(); // x^3 = 8
f_grad(2f64).print(); // 3 * x^2 = 12
f_hess(2f64).print(); // 6 * x = 12
}
#[ad_function] // generates f_grad, f_hess
fn f(x: f64) -> f64 {
x.powi(3) // x^3
}
- Implement Gauss-Kronrod Quadrature
- G7K15
- G10K21
- G15K31
- G20K41
- G25K51
- G30K61
- Now, prelude's default integration is
G7K15(1e-16)
- Implement Chebyshev polynomial
- Implement more higher order Gauss-Legendre Quadrature (Up to 30)
- Replace all
Dual
,HyperDual
,Number
withAD
- Remove
Dual, HyperDual, Number
- Remove
- It affected all of numerical functions
numerical/root.rs
numerical/ode.rs
numerical/optimize.rs
numerical/utils.rs
- Also many traits are changed
traits/num.rs
traits/pointer.rs
- No more default in
util::non_macro::concat
- Now,
VecOps
has default implmentations - It requiredFPVector
- Implements all numerical operations of
AD
- Inverse trigonometric:
asin, acos, atan
- Inverse hyperbolic:
asinh, acosh, atanh
- Power of AD:
pow(&self, other: AD) -> Self
- Inverse trigonometric:
- Remove all
proc_macro
(Remove dependency ofperoxide-ad
)- Now,
AD
are enumsAD0(f64)
AD1(f64, f64)
AD2(f64, f64, f64)
- Now,
csv
becomes optional- Remove dependency of
csv, serde, iota, ...
- Remove dependency of
- Reduce compile time via
watt
integration- Now,
peroxide-ad
is pre-compiled to wasm
- Now,
- Fix dimension error of
apply
inO3
feature - Import
structure/dataframe.rs
intoprelude
- Update version of
README.md
- Now,
DataFrame
can contain multiple type columns. Refer to dataframe. DataFrame
is merged default feature. No moredataframe
feature required. Thus,dataframe
feature is removed.- But if you want to
netcdf
file format, thennc
feature is required.
- Fix errata in
README.md
- Remove unnecessary imports
- Add doc for
Matrix::qr
&Matrix::svd
- Enhance doc for
Matrix::pseudo_inv
- Implement
pseudo_inv
viasvd
(O3
feature only)
- Update dependencies
indexmap
: 1.5 -> 1.6pyo3
: 0.11 -> 0.12
- Add
print
for&Vec<T>
- Fix dimension error of
SVD.u
- Add
svd
toMatrix
(Only available inO3
feature)
- Remove
packed_simd
dependency (Fixpacked_simd
error) - Add
O3
version ofqr
(usinglapack_dgeqrf
)
- Add more sugar for
Vec<f64>
ConvToMat
: ConvertVec<f64>
to_col
: To Column matrixto_row
: To Row matrix
- Add new methods for
Matrix
submat(&self, start: (usize, usize), end: (usize, usize))
: Return submatrixsubs_mat(&mut self, start, end, &Matrix)
: Substitute submatrix
- Update
netcdf
dependencies- Now, use
netcdf = 0.5
- Now, use
- Add new methods for
DataFrame
head_print(&self, n: usize)
: Return n lines from headtail_print(&self, n: usize)
: Return n lines before tail
- Change licenses : BSD-3-Clause -> MIT OR Apache-2.0
- Update version of dependencies
- Implement more Vector Products
cross
outer
- Implement more Matrix Products
kronecker
hadamard
- Add assertion for matrix multiplications
- Implement Binomial distribution
- Reduce compile time
- Reduce order of
AD{i}
: 10 -> 5
- Reduce order of
- Add
numerical/root.rs
(See docs)- Low-level API
- High-level API
- Add
ADLift<F, T>
for lifting genericAD
function
- Impl
std::ops
withf64
forAD{i}
and vice versa - Increase Accuracy of Spline Extension (Thanks to schrieveslaach)
- Integrate
src/structure/ad.rs
intoprelude
- Add generic automatic differenitation trait -
AD
- Add
structure/ad.rs
- Add
peroxide-ad
(proc_macro
for AD) - Implement
AD1
~AD10
(Upto 10th order) - Modify
traits/num.rs
- Change some methods to provided methods
- Add
get_env(&self)
inExplicitODE
- Add
get_env(&self)
inImplicitODE
- Fix
set_header
error ofDataFrame
- Add
Environment
trait innumerica/ode.rs
ODE
->ODE<E: Environment>
ExplicitODE
->ExplicitODE<E: Environment>
f: Fn(&mut State<f64>)
->f: Fn(&mut State<f64>, &E)
- Add
set_env(E)
ImplicitODE
->ImplicitODE<E: Environment>
f: Fn(&mut State<Dual>)
->f: Fn(&mut State<Dual>, &E)
- Add
set_env(E)
- Fetch
prelude
with new Linear algebra- Add
SimpleLinearAlgebra
- Add
- Fix error in
LinearAlgebra::lu
- Add
gepp, gecp
for partial pivoting and complete pivoting - Peroxide chooses
gecp
default
- Add
- No more
unwrap
lu
returnsPQLU
directlyinv
returnsMatrix
directlypseudo_inv
returnsMatrix
directly
- Implement two solve algorithms
- LU decomposition via Gaussian elimination with Complete pivoting (Stable)
- WAZ decomposition (Unstable)
#[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]
}
- Fix errata in
Sub
ofRedox
- Add
tests/linalg.rs
: It comparesperoxide
andjulia
withtest_data/*.nc
- Add
traits/sugar.rs
VecOps
: Vector operation with vectors and scalarsScalable
: Easy to resize vector or matrix and also concatenation
- Add
col_reduce
,row_reduce
[Caution!] Huge Update!
No more direct re-exporting. Below code is not allowed.
extern crate peroxide;
use peroxide::*;
Now, peroxide has two re-export options - prelude
and fuga
.
prelude
: To use simplefuga
: To control numerical algorithms
For example,
// Prelude
#[macro_use]
extern crate peroxide;
use peroxide::prelude::*;
fn main() {
let a = c!(1, 2, 3);
assert_eq!(a.norm(), 14f64.sqrt());
}
// Fuga
#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;
fn main() {
let a = c!(1, 2, 3);
assert_eq!(a.norm(Norm::L2), 14f64.sqrt());
}
- Remove
operation
- Create
traits
traits
contains below submodules.
fp.rs
: Functional Programming toolboxgeneral.rs
: General algorithmsmath.rs
: Mathematical traitsmutable.rs
: Mutable toolboxnum.rs
:Real
&Number
& VariousOps
pointer.rs
:Redox<T: Vector>
&MatrixPtr
- From Ver
0.23.0
, peroxide uses 2018 edition.
- From ver 0.23.0,
Matrix * Vec<f64> = Vec<f64>
and vice versa.
- Replace
norm_l*()
asnorm(Norm::L*)
- Move
interp::lagrange_polynomial
,special::legendre::legendre_polynomial
tostructure/polynomial.rs
- Remove
LinearOps
instructure/matrix.rs
- Replace
to_matrix(&self)
withInto<Matrix>
- Replace
from_matrix(&self)
withInto<Vec<f64>>
- Move
transpose(), t()
toMatrix::transpose(), Matrix::t()
- Replace
- Remove
VecOps
instructure/vec.rs
- Replace
add, sub, s_mul
withtraits::math::Vector
- Replace
norm()
withtraits::math::Normed
- Replace
dot()
withtraits::math::InnerProduct
- Use
Redox<T: Vector>
rather thanVecOps
(Refer totraits/pointer.rs
)
- Replace
- Remove
special/legendre.rs
- Add
gemv
,gevm
instructure/matrix.rs
numerical/integral.rs
- Newton Cotes quadrature -
integrate(f, (a, b), NewtonCotes(usize))
- Gauss Legendre quadrature -
integrate(f, (a, b), GaussLegendre(usize))
- Newton Cotes quadrature -
swap_with_perm
: Swap with permutation
More CubicSpline
(By schrieveslaach)
polynomial(&self, x: T) -> Polynomial
: Returns a reference thePolynomial
at the given pointx
.
More Vector::norm
(By nateckert)
- Add more
norm
forVec<f64>
:norm_l1(&self), norm_l2(&self), norm_linf(&self), norm_lp(&self)
- Gaussian elimination with LU decomposition
Perm * Matrix
: Syntactic sugar forswap_with_perm(_, Row)
Matrix * Perm
: Syntactic sugar forswap_with_perm(_, Col)
- More numerical integrations
- Unify vector norms
- Make
csv
tooptional
- QR Decomposition
- Add
qr(&self) -> QR
inLinearAlgebra
trait - Add
QR
to represent QR decomposition
- Add
- Reduced Row Echelon Form
- Add
rref(&self) -> Matrix
inLinearAlgebra
trait
- Add
- Modify Polynomial evaluate algorithm via Horner's Method (Thanks to Nateckert)
- Create
util/wrapper.rs
: Wrapper for other crates.- Trait
SampleRNG
: Extract random sample fromVec<T>
sample(&self, n: usize) -> Vec<Self::Item>
- Trait
- More
Printable
Vec<usize>
,Vec<u32>
,Vec<u64>
Vec<isize>
,Vec<i32>
,Vec<i64>
- Fix a bug for
det
,inv
&pseudo_inv
for large matrix- Set precision of
lu
to more lower :1e-7
to1e-40
- Set precision of
- QR decomposition
- Effective pseudo inverse algorithm using QR
- Enhance performance of
Matrix
- New dependency -
matrixmultiply
- Change default matrix multiplication behavior - depend on
matrixmultiply
- If size of matrix is smaller than
1000 x 1000
,default
is faster thanO3
- New function -
gemm
: Wrapper ofdgemm
ofmatrixmultiply
gemm(alpha, A, B, beta, C)
:C = alpha * A * B + beta * C
- Add
operation/row_ops.rs
- Add
RawMatrix
row_ptr(&self, usize) -> Vec<*const f64>
col_ptr(&self, usize) -> Vec<*const f64>
- Add
- Add
as_slice, as_mut_slice
forMatrix
- Add
ptr_to_vec
inutil/low_level
- Add
Eigen
- Implement jacobi method
extern crate peroxide;
use peroxide::fuga::*;
fn main() {
let a = MATLAB::new("1 2; 2 3");
let eigen = eigen(&a, Jacobi);
let (eig_val, eig_vec) = eigen.extract();
eig_val.print();
eig_vec.print();
}
- Modify
PowOps
- Rename
powf(&self, Self)
topow(&self, Self)
- Create
powf(&self, f64)
- Rename
- Implement
std::ops
forRedoxVector
- Implement
PowOps
forRedoxVector
- Update Documents
- Remove dependencies -
special
,special-fun
- Now, use special functions & distributions for WASM.
- New dependency - puruspe (PURe RUSt SPEcial function library)
- Re-implement special functions by
puruspe
-
ln_gamma
-
gamma
-
inc_gamma
-
inv_inc_gamma
-
beta
-
inc_beta
-
inv_inc_beta
-
erf
-
erfc
-
inv_erf
-
inv_erfc
-
- Add
Div
forMatrix
- Revert
cfg(feature="special")
ascfg(feature="specials")
for WASM.specials = ["special", "special-fun"]
- Implement special functions by pure Rust.
- Add Accessoires to
CubicSpline
(By schrieveslaach)- return number of polynomials
- access element through
std::ops::Index
- Move
docs
domain : https://peroxide.surge.sh - Add more R macros
rt
dt
pt
- New dependencies
order-stat
: For ordered statisticsfloat-cmp
: To compare floating numbers convenientlyspecial-fun
: To use additional special functions
OrderedStat
- Now, we can calculate quantile (perfectly matched with R quantile)
- Implemented list
- Type1
- Type2
- Type3, ... , Type 9
- Remove
special
feature - Now,special
,special-fun
are necessary dependencies. - New method over
RNG
trait. -cdf
- Some additional R macros
rnorm
dnorm
prorm
- Some additional special functions
inc_beta
: Regularized incomplete Beta integralinc_gamma
: Regularized incomplete lower Gamma integralhyp2f1
: Hypergeometric function
- Update
REAME.md
- Fix comments of
plot.rs
- Modify
vector
- Replace last
native
withO3
- Add
sum
toVecOps
- Replace last
- Modify documentation of
dist
- Remove checkbox
- Replace
~
with<del>
tag
- Remove travis-ci error in
examples
- Remove some legacy codes
- No differences with
0.19.2
- Remove test errors of
dataframe.rs
- New dependency -
rand_distr
- Now, any distributions are depend on
rand_distr
- Now, any distributions are depend on
- Add
StudentT
distribution - Rename
example
toexamples
- Now use
cargo build --examples
. But it should require all features so, not recommended. Instead of this, you can see real examples in Peroxide Gallery.
- Now use
- New dependency in
dataframe
feature -json
- Add
WithJSON
trait indataframe.rs
- Implement
WithJSON
forDataFrame
-
to_json_value
-
from_json_value
-
- Add missing trait bound for
Real
trait - Fix error of
plot.rs
- Change python library dependency :
pylab
->matplotlib.pyplot
- Change python library dependency :
- [Hotfix] Fix spacing bug for
r>100
cases.
- Fix spacing constraint - space should be larger than length of key
- Fix global spacing of
dataframe
to column-wise spacing.
- Improve generic of
jacobian
- Fix limitation of key length: 5 -> unlimited
- Rename feature :
oxidize
->O3
- Cubic spline structure (By schrieveslaach)
- Add documentation for
DataFrame
structure::DataFrame::WithNetCDF
- Modify
read_nc(file_path: &str, header: Vec<&str>)
->read_nc(file_path: &str)
- Add
read_nc_by_header(file_path: &str, header: Vec<&str>)
- Modify
- Implement
Statistics
forDataFrame
- With surge, new documentation web sites available - peroxide.info
structure/dataframe.rs
indexmap
netcdf
dataframe
- Pretty print
- Able to print different length
- Convert to Col matrix
- Initialize with header
- Call by header (
Index
with header) - Call by row
- Insert pair
- Insert row
-
IndexMut
with header - Any column operations
- Read from csv
- Write to csv
- Read from netcdf
- Write to netcdf
- Remove
NumError
forNumber
- Add
PartialOrd
forNumber, Dual, HyperDual
structure::dual::ExpLogOps::ln
structure::hyperdual::Div
structure::hyperdual::ExpLogOps::ln
numerical::optimize
F: Fn(&Vec<f64>, Vec<Number>) -> Option<Vec<Number>>
util::low_level
unsafe fn copy_vec_ptr(dst: &mut Vec<*mut f64>, src: &Vec<f64>)
unsafe fn swap_vec_ptr(lhs: &mut Vec<*mut f64>, rhs: &mut Vec<*mut f64>)
structure::matrix::Matrix::swap
->operation::mut_ops::MutMatrix::swap
- Now
swap
becomes mutable function
- Now
- Now, we can insert pair of data to
plot
fn insert_pair(&self, pait: (Vec<f64>, Vec<f64>)) -> &mut Self
- More generic
optimize
- function pointer ->
Box<F>
- function pointer ->
operation::mut_ops::MutMatrix
fn col_mut(&mut self, idx: usize) -> Vec<*mut f64>
fn row_mut(&mut self, idx: usize) -> Vec<*mut f64>
structure::Matrix::FP::{col_mut_map, row_mut_map}
structure::matrix::Matrix
fn ptr(&self) -> *const f64
fn mut_ptr(&self) -> *mut f64
Index for Matrix
IndexMut for Matrix
fn main() {
// ===================================
// Low Level
// ===================================
let mut a = ml_matrix("1 2; 3 4");
a.print();
// c[0] c[1]
// r[0] 1 2
// r[1] 3 4
unsafe {
let mut p: Vec<*mut f64> = a.col_mut(1); // Mutable second column
for i in 0 .. p.len() {
*p[i] = i as f64;
}
}
a.print();
// c[0] c[1]
// r[0] 1 0
// r[1] 3 1
// ===================================
// High Level
// ===================================
let mut b = ml_matrix("1 2 3; 4 5 6");
b.col_mut_map(|x| x.normalize());
b.print();
// c[0] c[1] c[2]
// r[0] 0.2425 0.3714 0.4472
// r[1] 0.9701 0.9285 0.8944
}
- Smart pointer of Vector -
RedoxVector
- SIMD integrated -
packed_simd
- Revive Gauss-Legendre 4th order ODE solver
- Come back to Travis-CI (only default feature)
- Legendre Polynomial (
legendre_polynomial(n: usize) -> Polynomial
) - Gauss-Legendre Quadrature based on numerical table (up to
n=16
)
- More optimization of
vector.rs
- Can use
openblas
feature inode.rs
- [Important] More features
- You can choose next features
openblas
: BLAS & LAPACK back-endplot
: Plot with matplotlib (depends onpyo3
- should use nightly compiler)
- You can choose next features
- More BLAS
- Vector & Vector Addition/Subtraction (
daxpy
) - Vector & Scalar multiplication (
dscal
) - Vector & Vector dot product (
ddot
) - Vector Euclidean norm (
dnrm2
)
- Vector & Vector Addition/Subtraction (
- More LAPACK
- QR decomposition (
dgeqrf
)- get Q,R (
dorgqr
)
- get Q,R (
- get Condition number (
dgecon
)
- QR decomposition (
- [Important] Finally, BLAS integrated.
-
You can choose
blas, lapack
bynative
features.cargo build --features native
-
Default features are no BLAS (Pure Rust)
cargo build
-
To use BLAS in Rust can be bothered. Should refer to OpenBLAS for Rust
-
BLAS implemented Ops
- Matrix & Matrix Addition/Subtraction (
daxpy
) - Matrix & Scalar Addition/Subtraction (
daxpy
) - Matrix & Matrix Multiplication (
dgemm
) - Matrix & Vector Multiplication (
dgemv
)
- Matrix & Matrix Addition/Subtraction (
-
LAPACK implemented ops
- LU Factorization (
dgetrf
) - Inverse by LU (
dgetri
) - Solve by LU (
dgetrs
)
- LU Factorization (
-
- Move unnecessary
bin
files to example directory
- [Important] Remove inefficient things
- Remove
util/pickle.rs
- Remove
serde
,serde-pickle
dependencies
- Remove
- Optimize original code
- Matrix
change_shape
col(usize), row(usize)
diag
subs_col, subs_row
Add<Matrix>
Mul<Matrix>
- Block matrix multiplication
- Matrix
- Add
normalize
forVec<f64>
- Add
col_map
forMatrix
- Add
row_map
forMatrix
- Add
get_error
forOptimizer
- Now, we can see root mean square error of
Optimizer
- Now, we can see root mean square error of
- Optimizer documents
- Change non-reasonable syntax
set_legends
->set_legend
(inutil/plot.rs
)
- Add
set_markers
forPlot2D
- Can support
Point
,Circle
,Line
- Can support
- Fix error of
powf
inPowOps
forNumber
- Cover all cases
- Change output type of
optimize
- Original:
Matrix
- Changed:
Vec<f64>
- Original:
- [Important] Change the definition of
powf
inPowOps
powf(&self, Self) -> Self
- Apply this definition to
Dual
HyperDual
Number
- And remove
PowOps
ofVec<f64>
- More utils
max<T>(v: Vec<T>) -> T where T: PartialOrd + Copy + Clone
min<T>(v: Vec<T>) -> T where T: PartialOrd + Copy + Clone
- Implement Levenberg-Marquardt Algorithm (Refer to
bin/optimize.rs
) to_diag
forMatrix
to_diag
: Extract diagonal matrix from a matrix
- Add non-linear regression algorithms (Optimizations) to
numerical/optimize.rs
- Gradient Descent
- Gauss Newton (Not yet implemented)
- Levenberg Marquardt
- Add julia-like macros
hstack!
: Vectors to Column matrixvstack!
: Vectors to Row matrix
- Modify
jacobian
- Receive
Fn(Vec<Number>) -> Vec<Number>
- Receive
- Remove
bdf.rs
,gauss_legendre.rs
- More extended functional programming for
Vec
- Extend
zip_with
to any real vector
- Extend
- Add
extract
forPQLU
extract: PQLU -> (p, q, l, u)
- Update whole documentations - part 2.
- For convenience
- New method -
to_vec
ofMatrix
Matrix
toVec<Vec<f64>>
- Change input type of
set_legends
ofplot.rs
Vec<String>
->Vec<&str>
- New method -
- Update whole documentations - part 1.
- Fix performance issue in
0.11.2
- Fix non-efficient parts of
take
ofMatrix
- Fix non-efficient parts of
- Exclude
bin
directory - Apply
stop_condition
forODE
- Remove dependency of
inline-python
- [Important] Now, only nightly support (Because of
pyo3
) - Integrate with
inline-python
- Update
README.md
- Now, we can draw & save plot
- New dependency -
pyo3
- Plot is implemented in
util/plot.rs
- New dependency -
- Modify
integrate
ofnumerical/ode.rs
- Now,
integrate
provides [param
|values
] matrix.
- Now,
- Change
rand
crate version -0.7.0
- Add
Number
enum for generic function input to ODE.Number
is composed ofF(f64), D(Dual), E(NumError)
- It replace
Real
trait
- Modify
State<T>
structure. (state
->value
)pub struct State<T> { param: T, value: Vec<T>, deriv: Vec<T> }
- Modify
ExplicitODE
- Remove
count
field
- Remove
- Gitbook & README update
- [Important!] Re-define ode structure
- Great improve UI - Like
SimpleWriter
- Implement
ExMethod::Euler
- Implement
ExMethod::RK4
- Great improve UI - Like
- Fix bug in
SimpleWriter
- Fix "always header" bug
std::ops
for&Dual
std::ops
for&HyperDual
- [Important!] Remove
Rem
forMatrix
(Thanks to russellb23) - [Important!] Change
Mul
forMatrix
Mul<Matrix> for Matrix
is Matrix multiplication!
- Now, we can use
std::ops
for&Matrix
extern crate peroxide; use peroxide::fuga::*; fn main() { let a = ml_matrix("1 2;3 4"); (&a + &a).print(); (&a * &a).print(); (&a - &a).print(); }
Real
Trait is appeared & implemented for some types.Real
forf64
Real
forDual
Real
forHyperDual
extern crate peroxide; use peroxide::*; fn main() { let x_f64 = 2f64; let x_dual = dual(2, 1); let x_hyper = hyper_dual(2, 1, 0); f(x_f64).print(); f(x_dual).print(); f(x_hyper).print(); } fn f<T: Real>(x: T) -> T { return x.powi(2); }
- Implement dot product for
Vec<Dual>
(Thanks to russellb23)
- Add
log(&self, base: f64)
toExpLogOps
- Implement
Printable
toOPDist<T>, TPDist<T>
- New trait
ParametricDist
forOPDist<T>, TPDist<T>
(Just extract parameters) - New module:
util/writer.rs
- You can write pickle file with pipelines.
- Implement Arnoldi iteration & Gram-schmidt (Not yet merged)
bin/arnoldi.rs
bin/schmidt.rs
- Add
Debug, Clone
toOPDist<T>, TPDist<T>
- Add
zeros_shape
,eye_shape
toutil/non_macro.rs
- Fix
Matrix::from_index
- You should use index function which returns
f64
- You should use index function which returns
- Modify
Pickle
trait - Allow multiple data to one pickle filewrite_single_pickle
: Just write vector or matrix to one pickle file.write_pickle(&self, writer: &mut Write)
extern crate peroxide; use peroxide::*; use std::fs::File; use std::io::Write; fn main () { let mut w: Box<Write>; match File::create(path) { Ok(p) => writer = Box::new(p), Err(e) => (), } let a = ml_matrix("1 2;3 4"); a.write_pickle(&mut w).expect("Can't write pickle file"); }
- Implement matrix norm (usage:
a.norm(<input_norm>)
)PQ(p, q)
:L_pq
normOne
:L_1
normInfinity
:L_∞
normFrobenius
: Frobenius norm (=PQ(2,2)
)
HyperDual
for 2nd order Automatic Differentiation
- Implement Tri-Diagonal Matrix Algorithm
- Add
tdma
tonumerical/utils.rs
- Add
- Modify
matrix/lu
to correct doolittle algorithm
- Add two dependencies in
Cargo.toml
serde
serde_pickle
- Add
pickle.rs
toutil
- Write
Vec<f64>
to pickle file easily - Write
Matrix
to pickle file (Caution: It depends on shape of matrix)
- Write
- Fix all warnings from compiler
- New constructor in
matrix.rs
- Matrix from index operations -
from_index<F>(F, (usize, usize))
- Matrix from index operations -
- Update print of Matrix
- Extend limit from
10x10
to100x10
or10x100
or20x20
- Extend limit from
- Fix bug of
take
ofFPMatrix
- Early return if size is smaller than row or column
- Add
ops.rs
tostatistics
- Factorial:
factorial(n)
- Permutation:
P(n,r)
- Combination:
C(n,r)
- Combination with Repetition:
H(n,r)
- Factorial:
- Add constraint to uniform distribution
- Reduce & modify
README.md
- Add missing modules to module structure
- Remove
Usage
section (Move to Peroxide Gitbook)
- Add Peroxide Gitbook link to
README
- Fix
statistics/rand.rs
,statistics/dist.rs
- pub use rand crate to private use
- Now you can use
rand(usize, usize)
function inutil/non_macro.rs
- Fix bugs of
cbind
,rbind
- Add Linear Discriminant (Least Square) example
- Fix complete pivoting
- Add
det
test intests
- Add
tov
inbin
- Tolman-Oppenheimer-Volkoff equation
- Fix error of
Sub<Dual> for f64
- Fix error of
Div<Dual> for f64
- Bump
rand
dependency to 0.6 (Thanks to koute) - Fix error of
powf
operation ofdual
- Now, it works fine.
- Fix errors of test
- Fix
write
,write_with_header
- Move
round
parameter towrite_round
,write_with_header_round
- Move
- Add
solve_with_condition
toode.rs
- Now, you can give stop condition to ode solver.
- Add various distributions in
dist.rs
Bernoulli(mu)
Beta(a, b)
- Modify
write
,write_with_header
- Now there is round option
- Fix error of
bdf.rs
- Modify
bdf.rs
- Put
max_iter = 10
- Simplify non-autonomous jacobian
- Put
- Move distributions(
Uniform
,Normal
) fromrand.rs
todist.rs
- Now
Uniform
&Normal
are enums - Remove
Uniform::new
&Normal::new
- Now
- Add
special/function.rs
- Add
gaussian
- Add
- Implement
GL4
- Gauss-Legendre 4th order- Add
GL4(f64)
toODEMethod
- Add
- Add
take
toFP
trait for Matrix - Add
skip
toFP
trait for Matrix - Fix
fmt::Display
ofMatrix
- If larger than 10x10 -> Only print 10x10 part
- Add
ode.rs
tonumeric
- Add
solve
- numerical solve ODE - Now you can choose two methods
RK4
BDF1
- Add
- Change
rk4
- All functions should have form
f(Dual, Vec<Dual>) -> Vec<Dual>
- All functions should have form
- Fix error of
spread
- Modify matrix declaration
p_matrix
->py_matrix
m_matrix
->ml_matrix
- Add
r_matrix
(same asmatrix
)
- Add
util/api.rs
- Can choose various coding style
MATLAB
PYTHON
R
- Can choose various coding style
- Remove
CreateMatrix
- Deprecated
Matrix::new
-> Usematrix
instead
- Deprecated
- Update
matrix.rs
- Add
p_matrix
,m_matrix
- Pythonic matrix
- MATLAB matrix
- Add
write_with_header
formatrix.rs
- Now, can write matrix with header
- Add
- Add
runge_kutta.rs
- Implement RK4 algorithm for Non-autonomous equation
- Add
grave
- Move
rok4a.rs
tograve
- Fix error of
Div
forDual
- Add
rok4a.rs
- Now, deprecated
- Add
non_auto_jacobian
to utils- TODO: Generalize jacobian
- Add
bdf.rs
- Implement Backward Euler Method
- Add comfortable tools for
Vec<Dual>
- Add
jacobian
innumerical/utils
- Add
newton
innumerical
- Newton-Raphson Method
- Fix error of
inv
- Reverse order of permutations
- Update
Dual
- Also add
Ops<Dual> for f64
- Also add
- Add
multinomial.rs
- Implement
print
,eval
- TODO: Partial eval?
- Implement
- Update
Dual
- Add
Add<f64> for Dual
- Add
Sub<f64> for Dual
- Add
Mul<f64> for Dual
- Add
Div<f64> for Dual
- Add
- Update
FPVector
- Add
filter, take, drop
- Add
- Update
read
- Move
read
toMatrix::read
- Can set
delimiter
- Move
- Add
pseudo_inv
method forMatrix
- New
useful.rs
in util- Move
tab, quot_rem, nearly_eq
frommatrix.rs
touseful.rs
- Move
choose_*
frompolynomial.rs
touseful.rs
- Move
- Fix error of
VectorOps
-dot
- Fix typo of
fmt::Display
forPolynomial
- Fix module structures - Thanks to md-file-tree
- Implement Horner's Algorithm -
Div
for Polynomial - TODO: Fix
print
of Polynomial (Fixed!) - Add
Dual
for Automatic Differentiation to structure- structure
- matrix
- vector
- polynomial
- dual
- structure
- Make
operation
directory & addextra_ops.rs
- Fix
README
- Implement
Calculus
forPolynomial
- Re-construct all module structures
- structure
- matrix.rs
- vector.rs
- polynomial.rs
- statistics
- stat.rs
- rand.rs
- macros
- r_macro.rs
- matlab_macro.rs
- util
- print.rs
- structure
- Add
numerical
directory- Add interp.rs
- Lagrange Polynomial (
lagrange_polynomial
) - Chebyshev Nodes (
chebyshev_nodes
)
- Lagrange Polynomial (
- Add spline.rs
- Natural Cubic Spline (
cubic_spline
)
- Natural Cubic Spline (
- Add interp.rs
- Impl
pow
for Polynomial - Fixed
fmt::Display
for Polynomial
- Add
print.rs
for print any values conveniently- Implement
print
for Vector - Implement
print
for Matrix - Implement
print
forf32, f64, usize, u32, u64, i32, i64
- Implement
- Add
poly.rs
to dealPolynomial
- Implement
fmt::Display
for Polynomial - Add
new
- Implement
eval
for Polynomial - Implement
Neg, Add, Sub, Mul<T>
for Polynomial - Implement
Mul, Add<T>, Sub<T>, Div<T>
for Polynomial
- Implement
- Change gaussian generate method
marsaglia_polar
toziggurat
- Add comments and examples to
rand.rs
- Add
linspace
tomatlab_macro
- Fixed
linspace
export error - Add
rand.rs
- Generic
Rand
structure sample
method- Marsaglia Polar
Rand
toUniform
andNormal
- Generic
- Extend
matrix
macro to single valued matrix - Make
lm
- And also make
lm
macro -lm!(y ~ x)
- Make
LinearOps
Trait - But not necessary
- Add badges to README
- Fix README - add cargo.toml
- Modify
std::ops
for Matrixf64
to generic- Add comments
- Matmul for
Matrix
vsVector
vice versa
- Add
eye
tomatlab_macro
- Extend
zeros
to matrix - Fix
cov
forVec<f64>
- not consume anymore - Add
cor
- Update
README
- Add
matlab_macro
- Add
read
- Can read matrix from csv
- Add comment to
write
,read
- Fix all README
- Add
write
forMatrix
- Can write matrix to csv!
- Modify
block
,inv_u
,combine
- Just change code syntax
- Modify
lu
- Just change code syntax
- Add
IndexMut
implementation forMatrix
- Modify
Rem
- Just using
IndexMut
- Very fast!
- Just using
- Fixed
block
&combine
- Only squared matrices -> Every matrices
- More add R-like macro
cbind
rbind
- README update
- Refactor structure
- Move all macro to
r_macro.rs
- Move all macro to
- Add
stat.rs
mean, var, sd
- Modify
spread
- Fix bugs of all cases
- Use modern syntax
- Fix
Cargo.toml
- Replace
lu
withplu
- Make Algorithm trait for Vector
rank, sign, arg_max
- Change
PartialEq
forMatrix
- Add
nearly_eq
function - Use
nearly_eq
forMatrix::eq
- Add
- Add
swap
- Make
PQLU
structure - Remove
pivot
,to_perm
- Replace
plu
withlu
lu
returnsOption<PQLU>
- Enhance error handling with
lu, det, inv
- Complete Pivoting LU Decomposition
- Fix error of
lu
- initializeu
- Remove non-necessary comments
- Remove
vec2mat, mat2vec
- Change
col
,row
functionscol, row
returnsVec<f64>
- Add
diag
- Add
det
- Add
reduce
invector_macro
- Add
inv_l
,inv_u
- Add
block
,combine
- Fix error of
block
,combine
- Fix error of
inv_l
- Add
inv
- Remove
Vector
struct- Replace with
vector_macro
c!
&seq!
- Replace with
- Make R-like matrix macro
matrix!(1;4;1, 2, 2, Row)
- Vector
seq
: moved from matrix to vector- Rename
Generic
trait -CreateMatrix
- LU Decomposition
matrix
function - Same as R- Fix
README.md
- More documentation
seq
function - Same as R- Extract Col & Row
a.col(1)
: Extract 1st column ofa
as Column matrixa.row(1)
: Extract 1st row ofa
as Row matrix
- Update Documentation
- Update README
- Change structure
- remove
ozone
- remove