A generic, composable multidimensional array library.
- C++17 (full language features)
Supported compilers:
- gcc 9+
- clang 10+
A generic, composable multi-dimensional array library.
A generic, composable multidimensional array library.
Supported compilers:
add LU decompostion base and implemetation for eigen and armadillo backend
section 4.3 in
Antoniou A, Lu WS. Practical optimization: algorithms and engineering applications. Springer Science & Business Media; 2007 Dec 14.
clang error: note: read of variable whose lifetime has ended
branch: https://github.com/alifahrri/nmtools/tree/clang-compile-error-constexpr-variable-lifetime
CI log (clang-14)
2022-10-01T13:26:22.6894603Z In file included from /work/tests/meta/array/view/moveaxis.cpp:5:
2022-10-01T13:26:22.6895063Z In file included from /work/include/nmtools/array/view/moveaxis.hpp:4:
2022-10-01T13:26:22.6895649Z In file included from /work/include/nmtools/array/index/argsort.hpp:5:
2022-10-01T13:26:22.6919427Z /work/include/nmtools/array/shape.hpp:242:47: error: non-type template argument is not a constant expression
2022-10-01T13:26:22.6939473Z }, nmtools_tuple<meta::ct<(size_t)at(fixed_shape,0)>>{});
2022-10-01T13:26:22.6943928Z ^~~~~~~~~~~~~~~~~~~~~~~~~
2022-10-01T13:26:22.6951885Z /work/include/nmtools/array/view/transpose.hpp:42:50: note: in instantiation of function template specialization 'nmtools::shape<true, nmtools::array::ndarray_t<std::array<float, 12>, std::tuple<nmtools::meta::integral_constant<unsigned long, 1>, nmtools::meta::integral_constant<unsigned long, 2>, nmtools::meta::integral_constant<unsigned long, 6>>>>' requested here
2022-10-01T13:26:22.6956189Z using src_shape_type = decltype(nmtools::shape</*force_constant_index*/true>(meta::declval<array_t>()));
2022-10-01T13:26:22.6959811Z ^
2022-10-01T13:26:22.6966252Z /work/include/nmtools/array/view/decorator.hpp:129:26: note: in instantiation of template class 'nmtools::view::transpose_t<nmtools::array::ndarray_t<std::array<float, 12>, std::tuple<nmtools::meta::integral_constant<unsigned long, 1>, nmtools::meta::integral_constant<unsigned long, 2>, nmtools::meta::integral_constant<unsigned long, 6>>>, std::tuple<nmtools::meta::integral_constant<unsigned long, 1>, nmtools::meta::integral_constant<unsigned long, 0>, nmtools::meta::integral_constant<unsigned long, 2>>>' requested here
2022-10-01T13:26:22.6971507Z struct decorator_t : view_t<Ts...>
2022-10-01T13:26:22.6971763Z ^
2022-10-01T13:26:22.6983224Z /work/include/nmtools/array/view/transpose.hpp:100:16: note: in instantiation of template class 'nmtools::view::decorator_t<nmtools::view::transpose_t, nmtools::array::ndarray_t<std::array<float, 12>, std::tuple<nmtools::meta::integral_constant<unsigned long, 1>, nmtools::meta::integral_constant<unsigned long, 2>, nmtools::meta::integral_constant<unsigned long, 6>>>, std::tuple<nmtools::meta::integral_constant<unsigned long, 1>, nmtools::meta::integral_constant<unsigned long, 0>, nmtools::meta::integral_constant<unsigned long, 2>>>' requested here
2022-10-01T13:26:22.6984659Z return decorator_t<transpose_t,array_t,axes_t>{{array,axes}};
2022-10-01T13:26:22.6984952Z ^
2022-10-01T13:26:22.6992103Z /work/include/nmtools/array/view/moveaxis.hpp:37:56: note: in instantiation of function template specialization 'nmtools::view::transpose<nmtools::array::ndarray_t<std::array<float, 12>, std::tuple<nmtools::meta::integral_constant<unsigned long, 1>, nmtools::meta::integral_constant<unsigned long, 2>, nmtools::meta::integral_constant<unsigned long, 6>>>, std::tuple<nmtools::meta::integral_constant<unsigned long, 1>, nmtools::meta::integral_constant<unsigned long, 0>, nmtools::meta::integral_constant<unsigned long, 2>>>' requested here
2022-10-01T13:26:22.6994480Z using result_t = meta::remove_cvref_t<decltype(transpose(array,*order))>;
2022-10-01T13:26:22.6995209Z ^
2022-10-01T13:26:22.7005677Z /work/tests/meta/array/view/moveaxis.cpp:54:44: note: in instantiation of function template specialization 'nmtools::view::moveaxis<nmtools::array::ndarray_t<std::array<float, 12>, std::tuple<nmtools::meta::integral_constant<unsigned long, 1>, nmtools::meta::integral_constant<unsigned long, 2>, nmtools::meta::integral_constant<unsigned long, 6>>>, nmtools::meta::integral_constant<unsigned long, 0>, nmtools::meta::integral_constant<unsigned long, 1>>' requested here
2022-10-01T13:26:22.7006825Z using view_type = decltype(view::moveaxis(meta::declval<array_type>(),meta::declval<src_type>(),meta::declval<dst_type>()));
2022-10-01T13:26:22.7008561Z ^
2022-10-01T13:26:22.7013855Z /work/include/nmtools/array/shape.hpp:242:55: note: read of variable whose lifetime has ended
2022-10-01T13:26:22.7015592Z }, nmtools_tuple<meta::ct<(size_t)at(fixed_shape,0)>>{});
2022-10-01T13:26:22.7017908Z ^
works fine on gcc
related code: https://github.com/alifahrri/nmtools/blob/clang-compile-error-constexpr-variable-lifetime/include/nmtools/array/shape.hpp#L236
constexpr auto fixed_shape = meta::fixed_shape_v<array_t>;
if constexpr (!meta::is_fail_v<decltype(fixed_shape)>) {
return meta::template_reduce<len(fixed_shape)-1>([&](auto init, auto index){
using init_type = decltype(init);
using type = meta::append_type_t<init_type,meta::ct<(size_t)at(fixed_shape,index+1)>>;
return type{};
}, nmtools_tuple<meta::ct<(size_t)at(fixed_shape,0)>>{});
} else {
return impl::shape<array_t>(array);
}
nmtools::array
Add support for python
refactor backend directory structure to gla/backend
and update namepace accordingly
recursive fft
section 4.6 in
Antoniou A, Lu WS. Practical optimization: algorithms and engineering applications. Springer Science & Business Media; 2007 Dec 14.
init matrix support (eigen & armadillo backend)
no longer support fft
add functional inverse frontend with eigen and armadillo backend
from
template <size_t order, Formulas formula = Formulas::Centered, typename F, typename Scalar>
void finite_difference(F &f, Scalar x, Scalar step, Scalar &d)
{
detail::finite_difference(detail::Order<order>{}, detail::ComputeType<formula>{}, f, x, step, d);
}
to
template <size_t order, Formulas formula = Formulas::Centered, typename F, typename Scalar>
auto finite_difference(F &f, Scalar x, Scalar step)
{
return detail::finite_difference(detail::Order<order>{}, detail::ComputeType<formula>{}, f, x, step);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.