├── .codecov.yml ├── .coveragerc ├── .github └── workflows │ └── python-package.yml ├── .gitignore ├── .readthedocs.yml ├── CHANGES.txt ├── LICENSE.txt ├── MANIFEST.in ├── README.md ├── bin ├── Dockerfile ├── MPEG7.npz ├── build_docs.sh ├── cibw_before_build_linux.sh ├── cibw_before_build_macos.sh ├── cibw_before_build_win.sh ├── create_testenv.sh ├── ex_image_align.py ├── ex_srsf_align.py ├── ex_srsf_align_bayes.py ├── ex_srvf_align.py ├── gait_data.npz ├── gfortran_utils.sh ├── image.mat ├── install_miniconda.sh ├── openblas_support.py ├── repair_windows.sh ├── simu_data.npz └── test.sh ├── binder ├── apt.txt ├── environment.yaml ├── postBuild ├── requirements.txt └── trigger_binder.sh ├── debug ├── debug_data.h5 ├── debug_data.py ├── debug_data_oc_logit.h5 ├── debug_data_oc_mlogit.h5 ├── debug_data_oc_mlogit.py ├── debug_warp_mlogistic.py ├── debug_warp_oclogistic.py ├── debug_warp_ocmlogistic.py ├── debugc_warp_mlogistic.py ├── debugc_warp_oclogistic.py ├── debugc_warp_ocmlogistic.py ├── oc_geod.py ├── oc_karcher.py ├── oc_logit.py └── ps_geod.py ├── doc ├── _static │ └── switcher.json ├── artwork │ ├── icon.png │ └── logo.png ├── build │ ├── html │ │ ├── .buildinfo │ │ ├── .doctrees │ │ │ ├── boxplots.doctree │ │ │ ├── curve_functions.doctree │ │ │ ├── curve_statistics.doctree │ │ │ ├── environment.pickle │ │ │ ├── fPCA.doctree │ │ │ ├── fPLS.doctree │ │ │ ├── geodesic.doctree │ │ │ ├── index.doctree │ │ │ ├── pcr_regression.doctree │ │ │ ├── regression.doctree │ │ │ ├── time_warping.doctree │ │ │ ├── tolerance.doctree │ │ │ ├── umap_metric.doctree │ │ │ └── utility_functions.doctree │ │ ├── _modules │ │ │ ├── boxplots.html │ │ │ ├── curve_functions.html │ │ │ ├── curve_stats.html │ │ │ ├── fPCA.html │ │ │ ├── fPLS.html │ │ │ ├── geodesic.html │ │ │ ├── index.html │ │ │ ├── pcr_regression.html │ │ │ ├── regression.html │ │ │ ├── time_warping.html │ │ │ ├── tolerance.html │ │ │ ├── umap_metric.html │ │ │ └── utility_functions.html │ │ ├── _sources │ │ │ ├── boxplots.rst.txt │ │ │ ├── curve_functions.rst.txt │ │ │ ├── curve_statistics.rst.txt │ │ │ ├── fPCA.rst.txt │ │ │ ├── fPLS.rst.txt │ │ │ ├── geodesic.rst.txt │ │ │ ├── index.rst.txt │ │ │ ├── pcr_regression.rst.txt │ │ │ ├── regression.rst.txt │ │ │ ├── time_warping.rst.txt │ │ │ ├── tolerance.rst.txt │ │ │ ├── umap_metric.rst.txt │ │ │ └── utility_functions.rst.txt │ │ ├── _static │ │ │ ├── basic.css │ │ │ ├── doctools.js │ │ │ ├── documentation_options.js │ │ │ ├── file.png │ │ │ ├── language_data.js │ │ │ ├── minus.png │ │ │ ├── plus.png │ │ │ ├── pygments.css │ │ │ └── searchtools.js │ │ ├── boxplots.html │ │ ├── curve_functions.html │ │ ├── curve_statistics.html │ │ ├── fPCA.html │ │ ├── fPLS.html │ │ ├── genindex.html │ │ ├── geodesic.html │ │ ├── index.html │ │ ├── objects.inv │ │ ├── pcr_regression.html │ │ ├── py-modindex.html │ │ ├── regression.html │ │ ├── search.html │ │ ├── searchindex.js │ │ ├── time_warping.html │ │ ├── tolerance.html │ │ ├── umap_metric.html │ │ └── utility_functions.html │ ├── latex │ │ ├── .doctrees │ │ │ ├── boxplots.doctree │ │ │ ├── curve_functions.doctree │ │ │ ├── curve_statistics.doctree │ │ │ ├── environment.pickle │ │ │ ├── fPCA.doctree │ │ │ ├── fPLS.doctree │ │ │ ├── geodesic.doctree │ │ │ ├── index.doctree │ │ │ ├── pcr_regression.doctree │ │ │ ├── regression.doctree │ │ │ ├── time_warping.doctree │ │ │ ├── tolerance.doctree │ │ │ ├── umap_metric.doctree │ │ │ └── utility_functions.doctree │ │ ├── LICRcyr2utf8.xdy │ │ ├── LICRlatin2utf8.xdy │ │ ├── LatinRules.xdy │ │ ├── Makefile │ │ ├── fdasrsf.pdf │ │ ├── latexmkjarc │ │ ├── latexmkrc │ │ ├── make.bat │ │ ├── python.ist │ │ ├── sphinx.sty │ │ ├── sphinx.xdy │ │ ├── sphinxhighlight.sty │ │ ├── sphinxhowto.cls │ │ ├── sphinxmanual.cls │ │ └── sphinxmessages.sty │ └── man │ │ └── .doctrees │ │ ├── boxplots.doctree │ │ ├── curve_functions.doctree │ │ ├── curve_statistics.doctree │ │ ├── fPCA.doctree │ │ ├── fPLS.doctree │ │ ├── geodesic.doctree │ │ ├── index.doctree │ │ ├── pcr_regression.doctree │ │ ├── regression.doctree │ │ ├── time_warping.doctree │ │ ├── tolerance.doctree │ │ ├── umap_metric.doctree │ │ └── utility_functions.doctree ├── requirements.txt └── source │ ├── api.rst │ ├── boxplots.rst │ ├── conf.py │ ├── curve_example.ipynb │ ├── curve_functions.rst │ ├── curve_statistics.rst │ ├── elastic_changepoint.rst │ ├── elastic_glm_regression.rst │ ├── example_cluster.ipynb │ ├── example_mvwarping.ipynb │ ├── fPCA.rst │ ├── fPLS.rst │ ├── fPNS.rst │ ├── fpca_example.ipynb │ ├── geodesic.rst │ ├── image.rst │ ├── index.rst │ ├── kmeans.rst │ ├── pcr_regression.rst │ ├── regression.rst │ ├── time_warping.rst │ ├── time_warping_example.ipynb │ ├── tolerance.rst │ ├── umap_metric.rst │ ├── user_guide.rst │ └── utility_functions.rst ├── environment-dev.yml ├── fdasrsf ├── __init__.py ├── _distributor_init.py ├── bayesian_functions.py ├── boxplots.py ├── curve_functions.py ├── curve_pcr_regression.py ├── curve_regression.py ├── curve_stats.py ├── elastic_changepoint.py ├── elastic_glm_regression.py ├── fPCA.py ├── fPLS.py ├── fPNS.py ├── geodesic.py ├── geometry.py ├── gp.py ├── image.py ├── image_functions.py ├── interparc.py ├── kmeans.py ├── pcr_regression.py ├── plot_style.py ├── pns.py ├── rbfgs.py ├── regression.py ├── time_warping.py ├── tolerance.py ├── umap_metric.py └── utility_functions.py ├── notebooks ├── example_cluster.ipynb ├── example_curve.ipynb ├── example_fpca.ipynb ├── example_mvwarping.ipynb └── example_warping.ipynb ├── pyproject.toml ├── requirements.txt ├── setup.cfg ├── setup.py ├── src ├── DP.c ├── DP.h ├── DynamicProgrammingQ2.c ├── DynamicProgrammingQ2.h ├── ImageRegister.h ├── UnitSquareImage.cpp ├── UnitSquareImage.h ├── armadillo ├── armadillo_bits │ ├── BaseCube_bones.hpp │ ├── BaseCube_meat.hpp │ ├── Base_bones.hpp │ ├── Base_meat.hpp │ ├── Col_bones.hpp │ ├── Col_meat.hpp │ ├── CubeToMatOp_bones.hpp │ ├── CubeToMatOp_meat.hpp │ ├── Cube_bones.hpp │ ├── Cube_meat.hpp │ ├── GenCube_bones.hpp │ ├── GenCube_meat.hpp │ ├── Gen_bones.hpp │ ├── Gen_meat.hpp │ ├── GlueCube_bones.hpp │ ├── GlueCube_meat.hpp │ ├── Glue_bones.hpp │ ├── Glue_meat.hpp │ ├── MapMat_bones.hpp │ ├── MapMat_meat.hpp │ ├── Mat_bones.hpp │ ├── Mat_meat.hpp │ ├── OpCube_bones.hpp │ ├── OpCube_meat.hpp │ ├── Op_bones.hpp │ ├── Op_meat.hpp │ ├── Proxy.hpp │ ├── ProxyCube.hpp │ ├── Row_bones.hpp │ ├── Row_meat.hpp │ ├── SizeCube_bones.hpp │ ├── SizeCube_meat.hpp │ ├── SizeMat_bones.hpp │ ├── SizeMat_meat.hpp │ ├── SpBase_bones.hpp │ ├── SpBase_meat.hpp │ ├── SpCol_bones.hpp │ ├── SpCol_meat.hpp │ ├── SpGlue_bones.hpp │ ├── SpGlue_meat.hpp │ ├── SpMat_bones.hpp │ ├── SpMat_iterators_meat.hpp │ ├── SpMat_meat.hpp │ ├── SpOp_bones.hpp │ ├── SpOp_meat.hpp │ ├── SpProxy.hpp │ ├── SpRow_bones.hpp │ ├── SpRow_meat.hpp │ ├── SpSubview_bones.hpp │ ├── SpSubview_col_list_bones.hpp │ ├── SpSubview_col_list_meat.hpp │ ├── SpSubview_iterators_meat.hpp │ ├── SpSubview_meat.hpp │ ├── SpToDGlue_bones.hpp │ ├── SpToDGlue_meat.hpp │ ├── SpToDOp_bones.hpp │ ├── SpToDOp_meat.hpp │ ├── SpValProxy_bones.hpp │ ├── SpValProxy_meat.hpp │ ├── access.hpp │ ├── arma_cmath.hpp │ ├── arma_config.hpp │ ├── arma_forward.hpp │ ├── arma_ostream_bones.hpp │ ├── arma_ostream_meat.hpp │ ├── arma_rel_comparators.hpp │ ├── arma_rng.hpp │ ├── arma_rng_cxx03.hpp │ ├── arma_static_check.hpp │ ├── arma_str.hpp │ ├── arma_version.hpp │ ├── arrayops_bones.hpp │ ├── arrayops_meat.hpp │ ├── auxlib_bones.hpp │ ├── auxlib_meat.hpp │ ├── band_helper.hpp │ ├── compiler_check.hpp │ ├── compiler_setup.hpp │ ├── compiler_setup_post.hpp │ ├── cond_rel_bones.hpp │ ├── cond_rel_meat.hpp │ ├── config.hpp │ ├── config.hpp.cmake │ ├── constants.hpp │ ├── constants_old.hpp │ ├── csv_name.hpp │ ├── debug.hpp │ ├── def_arpack.hpp │ ├── def_atlas.hpp │ ├── def_blas.hpp │ ├── def_fftw3.hpp │ ├── def_lapack.hpp │ ├── def_superlu.hpp │ ├── diagmat_proxy.hpp │ ├── diagview_bones.hpp │ ├── diagview_meat.hpp │ ├── diskio_bones.hpp │ ├── diskio_meat.hpp │ ├── distr_param.hpp │ ├── eGlueCube_bones.hpp │ ├── eGlueCube_meat.hpp │ ├── eGlue_bones.hpp │ ├── eGlue_meat.hpp │ ├── eOpCube_bones.hpp │ ├── eOpCube_meat.hpp │ ├── eOp_bones.hpp │ ├── eOp_meat.hpp │ ├── eglue_core_bones.hpp │ ├── eglue_core_meat.hpp │ ├── eop_aux.hpp │ ├── eop_core_bones.hpp │ ├── eop_core_meat.hpp │ ├── fft_engine_fftw3.hpp │ ├── fft_engine_kissfft.hpp │ ├── field_bones.hpp │ ├── field_meat.hpp │ ├── fill.hpp │ ├── fn_accu.hpp │ ├── fn_all.hpp │ ├── fn_any.hpp │ ├── fn_approx_equal.hpp │ ├── fn_as_scalar.hpp │ ├── fn_chi2rnd.hpp │ ├── fn_chol.hpp │ ├── fn_clamp.hpp │ ├── fn_cond_rcond.hpp │ ├── fn_conv.hpp │ ├── fn_conv_to.hpp │ ├── fn_cor.hpp │ ├── fn_cov.hpp │ ├── fn_cross.hpp │ ├── fn_cumprod.hpp │ ├── fn_cumsum.hpp │ ├── fn_det.hpp │ ├── fn_diagmat.hpp │ ├── fn_diags_spdiags.hpp │ ├── fn_diagvec.hpp │ ├── fn_diff.hpp │ ├── fn_dot.hpp │ ├── fn_eig_gen.hpp │ ├── fn_eig_pair.hpp │ ├── fn_eig_sym.hpp │ ├── fn_eigs_gen.hpp │ ├── fn_eigs_sym.hpp │ ├── fn_elem.hpp │ ├── fn_eps.hpp │ ├── fn_expmat.hpp │ ├── fn_eye.hpp │ ├── fn_fft.hpp │ ├── fn_fft2.hpp │ ├── fn_find.hpp │ ├── fn_find_unique.hpp │ ├── fn_flip.hpp │ ├── fn_hess.hpp │ ├── fn_hist.hpp │ ├── fn_histc.hpp │ ├── fn_index_max.hpp │ ├── fn_index_min.hpp │ ├── fn_inplace_strans.hpp │ ├── fn_inplace_trans.hpp │ ├── fn_interp1.hpp │ ├── fn_interp2.hpp │ ├── fn_intersect.hpp │ ├── fn_inv.hpp │ ├── fn_inv_sympd.hpp │ ├── fn_join.hpp │ ├── fn_kmeans.hpp │ ├── fn_kron.hpp │ ├── fn_log_det.hpp │ ├── fn_log_normpdf.hpp │ ├── fn_logmat.hpp │ ├── fn_lu.hpp │ ├── fn_max.hpp │ ├── fn_mean.hpp │ ├── fn_median.hpp │ ├── fn_min.hpp │ ├── fn_misc.hpp │ ├── fn_mvnrnd.hpp │ ├── fn_n_unique.hpp │ ├── fn_nonzeros.hpp │ ├── fn_norm.hpp │ ├── fn_normalise.hpp │ ├── fn_normcdf.hpp │ ├── fn_normpdf.hpp │ ├── fn_numel.hpp │ ├── fn_ones.hpp │ ├── fn_orth_null.hpp │ ├── fn_pinv.hpp │ ├── fn_polyfit.hpp │ ├── fn_polyval.hpp │ ├── fn_powext.hpp │ ├── fn_powmat.hpp │ ├── fn_princomp.hpp │ ├── fn_prod.hpp │ ├── fn_qr.hpp │ ├── fn_quantile.hpp │ ├── fn_qz.hpp │ ├── fn_randg.hpp │ ├── fn_randi.hpp │ ├── fn_randn.hpp │ ├── fn_randperm.hpp │ ├── fn_randu.hpp │ ├── fn_range.hpp │ ├── fn_rank.hpp │ ├── fn_regspace.hpp │ ├── fn_repelem.hpp │ ├── fn_repmat.hpp │ ├── fn_reshape.hpp │ ├── fn_resize.hpp │ ├── fn_reverse.hpp │ ├── fn_roots.hpp │ ├── fn_schur.hpp │ ├── fn_shift.hpp │ ├── fn_shuffle.hpp │ ├── fn_size.hpp │ ├── fn_solve.hpp │ ├── fn_sort.hpp │ ├── fn_sort_index.hpp │ ├── fn_speye.hpp │ ├── fn_spones.hpp │ ├── fn_sprandn.hpp │ ├── fn_sprandu.hpp │ ├── fn_spsolve.hpp │ ├── fn_sqrtmat.hpp │ ├── fn_stddev.hpp │ ├── fn_strans.hpp │ ├── fn_sum.hpp │ ├── fn_svd.hpp │ ├── fn_svds.hpp │ ├── fn_sylvester.hpp │ ├── fn_symmat.hpp │ ├── fn_toeplitz.hpp │ ├── fn_trace.hpp │ ├── fn_trans.hpp │ ├── fn_trapz.hpp │ ├── fn_trig.hpp │ ├── fn_trimat.hpp │ ├── fn_trimat_ind.hpp │ ├── fn_trunc_exp.hpp │ ├── fn_trunc_log.hpp │ ├── fn_unique.hpp │ ├── fn_var.hpp │ ├── fn_vecnorm.hpp │ ├── fn_vectorise.hpp │ ├── fn_wishrnd.hpp │ ├── fn_zeros.hpp │ ├── glue_affmul_bones.hpp │ ├── glue_affmul_meat.hpp │ ├── glue_atan2_bones.hpp │ ├── glue_atan2_meat.hpp │ ├── glue_conv_bones.hpp │ ├── glue_conv_meat.hpp │ ├── glue_cor_bones.hpp │ ├── glue_cor_meat.hpp │ ├── glue_cov_bones.hpp │ ├── glue_cov_meat.hpp │ ├── glue_cross_bones.hpp │ ├── glue_cross_meat.hpp │ ├── glue_hist_bones.hpp │ ├── glue_hist_meat.hpp │ ├── glue_histc_bones.hpp │ ├── glue_histc_meat.hpp │ ├── glue_hypot_bones.hpp │ ├── glue_hypot_meat.hpp │ ├── glue_intersect_bones.hpp │ ├── glue_intersect_meat.hpp │ ├── glue_join_bones.hpp │ ├── glue_join_meat.hpp │ ├── glue_kron_bones.hpp │ ├── glue_kron_meat.hpp │ ├── glue_max_bones.hpp │ ├── glue_max_meat.hpp │ ├── glue_min_bones.hpp │ ├── glue_min_meat.hpp │ ├── glue_mixed_bones.hpp │ ├── glue_mixed_meat.hpp │ ├── glue_mvnrnd_bones.hpp │ ├── glue_mvnrnd_meat.hpp │ ├── glue_polyfit_bones.hpp │ ├── glue_polyfit_meat.hpp │ ├── glue_polyval_bones.hpp │ ├── glue_polyval_meat.hpp │ ├── glue_powext_bones.hpp │ ├── glue_powext_meat.hpp │ ├── glue_quantile_bones.hpp │ ├── glue_quantile_meat.hpp │ ├── glue_relational_bones.hpp │ ├── glue_relational_meat.hpp │ ├── glue_solve_bones.hpp │ ├── glue_solve_meat.hpp │ ├── glue_times_bones.hpp │ ├── glue_times_meat.hpp │ ├── glue_times_misc_bones.hpp │ ├── glue_times_misc_meat.hpp │ ├── glue_toeplitz_bones.hpp │ ├── glue_toeplitz_meat.hpp │ ├── glue_trapz_bones.hpp │ ├── glue_trapz_meat.hpp │ ├── gmm_diag_bones.hpp │ ├── gmm_diag_meat.hpp │ ├── gmm_full_bones.hpp │ ├── gmm_full_meat.hpp │ ├── gmm_misc_bones.hpp │ ├── gmm_misc_meat.hpp │ ├── hdf5_misc.hpp │ ├── hdf5_name.hpp │ ├── include_hdf5.hpp │ ├── include_superlu.hpp │ ├── injector_bones.hpp │ ├── injector_meat.hpp │ ├── memory.hpp │ ├── mp_misc.hpp │ ├── mtGlueCube_bones.hpp │ ├── mtGlueCube_meat.hpp │ ├── mtGlue_bones.hpp │ ├── mtGlue_meat.hpp │ ├── mtOpCube_bones.hpp │ ├── mtOpCube_meat.hpp │ ├── mtOp_bones.hpp │ ├── mtOp_meat.hpp │ ├── mtSpGlue_bones.hpp │ ├── mtSpGlue_meat.hpp │ ├── mtSpOp_bones.hpp │ ├── mtSpOp_meat.hpp │ ├── mul_gemm.hpp │ ├── mul_gemm_mixed.hpp │ ├── mul_gemv.hpp │ ├── mul_herk.hpp │ ├── mul_syrk.hpp │ ├── newarp_DenseGenMatProd_bones.hpp │ ├── newarp_DenseGenMatProd_meat.hpp │ ├── newarp_DoubleShiftQR_bones.hpp │ ├── newarp_DoubleShiftQR_meat.hpp │ ├── newarp_EigsSelect.hpp │ ├── newarp_GenEigsSolver_bones.hpp │ ├── newarp_GenEigsSolver_meat.hpp │ ├── newarp_SortEigenvalue.hpp │ ├── newarp_SparseGenMatProd_bones.hpp │ ├── newarp_SparseGenMatProd_meat.hpp │ ├── newarp_SparseGenRealShiftSolve_bones.hpp │ ├── newarp_SparseGenRealShiftSolve_meat.hpp │ ├── newarp_SymEigsShiftSolver_bones.hpp │ ├── newarp_SymEigsShiftSolver_meat.hpp │ ├── newarp_SymEigsSolver_bones.hpp │ ├── newarp_SymEigsSolver_meat.hpp │ ├── newarp_TridiagEigen_bones.hpp │ ├── newarp_TridiagEigen_meat.hpp │ ├── newarp_UpperHessenbergEigen_bones.hpp │ ├── newarp_UpperHessenbergEigen_meat.hpp │ ├── newarp_UpperHessenbergQR_bones.hpp │ ├── newarp_UpperHessenbergQR_meat.hpp │ ├── newarp_cx_attrib.hpp │ ├── op_all_bones.hpp │ ├── op_all_meat.hpp │ ├── op_any_bones.hpp │ ├── op_any_meat.hpp │ ├── op_chi2rnd_bones.hpp │ ├── op_chi2rnd_meat.hpp │ ├── op_chol_bones.hpp │ ├── op_chol_meat.hpp │ ├── op_clamp_bones.hpp │ ├── op_clamp_meat.hpp │ ├── op_col_as_mat_bones.hpp │ ├── op_col_as_mat_meat.hpp │ ├── op_cond_bones.hpp │ ├── op_cond_meat.hpp │ ├── op_cor_bones.hpp │ ├── op_cor_meat.hpp │ ├── op_cov_bones.hpp │ ├── op_cov_meat.hpp │ ├── op_cumprod_bones.hpp │ ├── op_cumprod_meat.hpp │ ├── op_cumsum_bones.hpp │ ├── op_cumsum_meat.hpp │ ├── op_cx_scalar_bones.hpp │ ├── op_cx_scalar_meat.hpp │ ├── op_det_bones.hpp │ ├── op_det_meat.hpp │ ├── op_diagmat_bones.hpp │ ├── op_diagmat_meat.hpp │ ├── op_diagvec_bones.hpp │ ├── op_diagvec_meat.hpp │ ├── op_diff_bones.hpp │ ├── op_diff_meat.hpp │ ├── op_dot_bones.hpp │ ├── op_dot_meat.hpp │ ├── op_dotext_bones.hpp │ ├── op_dotext_meat.hpp │ ├── op_expmat_bones.hpp │ ├── op_expmat_meat.hpp │ ├── op_fft_bones.hpp │ ├── op_fft_meat.hpp │ ├── op_find_bones.hpp │ ├── op_find_meat.hpp │ ├── op_find_unique_bones.hpp │ ├── op_find_unique_meat.hpp │ ├── op_flip_bones.hpp │ ├── op_flip_meat.hpp │ ├── op_hist_bones.hpp │ ├── op_hist_meat.hpp │ ├── op_htrans_bones.hpp │ ├── op_htrans_meat.hpp │ ├── op_index_max_bones.hpp │ ├── op_index_max_meat.hpp │ ├── op_index_min_bones.hpp │ ├── op_index_min_meat.hpp │ ├── op_inv_gen_bones.hpp │ ├── op_inv_gen_meat.hpp │ ├── op_inv_spd_bones.hpp │ ├── op_inv_spd_meat.hpp │ ├── op_log_det_bones.hpp │ ├── op_log_det_meat.hpp │ ├── op_logmat_bones.hpp │ ├── op_logmat_meat.hpp │ ├── op_max_bones.hpp │ ├── op_max_meat.hpp │ ├── op_mean_bones.hpp │ ├── op_mean_meat.hpp │ ├── op_median_bones.hpp │ ├── op_median_meat.hpp │ ├── op_min_bones.hpp │ ├── op_min_meat.hpp │ ├── op_misc_bones.hpp │ ├── op_misc_meat.hpp │ ├── op_nonzeros_bones.hpp │ ├── op_nonzeros_meat.hpp │ ├── op_norm2est_bones.hpp │ ├── op_norm2est_meat.hpp │ ├── op_norm_bones.hpp │ ├── op_norm_meat.hpp │ ├── op_normalise_bones.hpp │ ├── op_normalise_meat.hpp │ ├── op_orth_null_bones.hpp │ ├── op_orth_null_meat.hpp │ ├── op_pinv_bones.hpp │ ├── op_pinv_meat.hpp │ ├── op_powmat_bones.hpp │ ├── op_powmat_meat.hpp │ ├── op_princomp_bones.hpp │ ├── op_princomp_meat.hpp │ ├── op_prod_bones.hpp │ ├── op_prod_meat.hpp │ ├── op_range_bones.hpp │ ├── op_range_meat.hpp │ ├── op_rank_bones.hpp │ ├── op_rank_meat.hpp │ ├── op_rcond_bones.hpp │ ├── op_rcond_meat.hpp │ ├── op_relational_bones.hpp │ ├── op_relational_meat.hpp │ ├── op_repelem_bones.hpp │ ├── op_repelem_meat.hpp │ ├── op_repmat_bones.hpp │ ├── op_repmat_meat.hpp │ ├── op_reshape_bones.hpp │ ├── op_reshape_meat.hpp │ ├── op_resize_bones.hpp │ ├── op_resize_meat.hpp │ ├── op_reverse_bones.hpp │ ├── op_reverse_meat.hpp │ ├── op_roots_bones.hpp │ ├── op_roots_meat.hpp │ ├── op_row_as_mat_bones.hpp │ ├── op_row_as_mat_meat.hpp │ ├── op_shift_bones.hpp │ ├── op_shift_meat.hpp │ ├── op_shuffle_bones.hpp │ ├── op_shuffle_meat.hpp │ ├── op_sort_bones.hpp │ ├── op_sort_index_bones.hpp │ ├── op_sort_index_meat.hpp │ ├── op_sort_meat.hpp │ ├── op_sp_minus_bones.hpp │ ├── op_sp_minus_meat.hpp │ ├── op_sp_plus_bones.hpp │ ├── op_sp_plus_meat.hpp │ ├── op_sqrtmat_bones.hpp │ ├── op_sqrtmat_meat.hpp │ ├── op_stddev_bones.hpp │ ├── op_stddev_meat.hpp │ ├── op_strans_bones.hpp │ ├── op_strans_meat.hpp │ ├── op_sum_bones.hpp │ ├── op_sum_meat.hpp │ ├── op_symmat_bones.hpp │ ├── op_symmat_meat.hpp │ ├── op_toeplitz_bones.hpp │ ├── op_toeplitz_meat.hpp │ ├── op_trimat_bones.hpp │ ├── op_trimat_meat.hpp │ ├── op_unique_bones.hpp │ ├── op_unique_meat.hpp │ ├── op_var_bones.hpp │ ├── op_var_meat.hpp │ ├── op_vecnorm_bones.hpp │ ├── op_vecnorm_meat.hpp │ ├── op_vectorise_bones.hpp │ ├── op_vectorise_meat.hpp │ ├── op_wishrnd_bones.hpp │ ├── op_wishrnd_meat.hpp │ ├── operator_cube_div.hpp │ ├── operator_cube_minus.hpp │ ├── operator_cube_plus.hpp │ ├── operator_cube_relational.hpp │ ├── operator_cube_schur.hpp │ ├── operator_cube_times.hpp │ ├── operator_div.hpp │ ├── operator_minus.hpp │ ├── operator_ostream.hpp │ ├── operator_plus.hpp │ ├── operator_relational.hpp │ ├── operator_schur.hpp │ ├── operator_times.hpp │ ├── podarray_bones.hpp │ ├── podarray_meat.hpp │ ├── promote_type.hpp │ ├── rbfgs.h │ ├── restrictors.hpp │ ├── running_stat_bones.hpp │ ├── running_stat_meat.hpp │ ├── running_stat_vec_bones.hpp │ ├── running_stat_vec_meat.hpp │ ├── sp_auxlib_bones.hpp │ ├── sp_auxlib_meat.hpp │ ├── span.hpp │ ├── spdiagview_bones.hpp │ ├── spdiagview_meat.hpp │ ├── spglue_join_bones.hpp │ ├── spglue_join_meat.hpp │ ├── spglue_kron_bones.hpp │ ├── spglue_kron_meat.hpp │ ├── spglue_max_bones.hpp │ ├── spglue_max_meat.hpp │ ├── spglue_merge_bones.hpp │ ├── spglue_merge_meat.hpp │ ├── spglue_min_bones.hpp │ ├── spglue_min_meat.hpp │ ├── spglue_minus_bones.hpp │ ├── spglue_minus_meat.hpp │ ├── spglue_plus_bones.hpp │ ├── spglue_plus_meat.hpp │ ├── spglue_relational_bones.hpp │ ├── spglue_relational_meat.hpp │ ├── spglue_schur_bones.hpp │ ├── spglue_schur_meat.hpp │ ├── spglue_times_bones.hpp │ ├── spglue_times_meat.hpp │ ├── spop_diagmat_bones.hpp │ ├── spop_diagmat_meat.hpp │ ├── spop_htrans_bones.hpp │ ├── spop_htrans_meat.hpp │ ├── spop_max_bones.hpp │ ├── spop_max_meat.hpp │ ├── spop_mean_bones.hpp │ ├── spop_mean_meat.hpp │ ├── spop_min_bones.hpp │ ├── spop_min_meat.hpp │ ├── spop_misc_bones.hpp │ ├── spop_misc_meat.hpp │ ├── spop_norm_bones.hpp │ ├── spop_norm_meat.hpp │ ├── spop_normalise_bones.hpp │ ├── spop_normalise_meat.hpp │ ├── spop_repmat_bones.hpp │ ├── spop_repmat_meat.hpp │ ├── spop_reverse_bones.hpp │ ├── spop_reverse_meat.hpp │ ├── spop_strans_bones.hpp │ ├── spop_strans_meat.hpp │ ├── spop_sum_bones.hpp │ ├── spop_sum_meat.hpp │ ├── spop_symmat_bones.hpp │ ├── spop_symmat_meat.hpp │ ├── spop_trimat_bones.hpp │ ├── spop_trimat_meat.hpp │ ├── spop_var_bones.hpp │ ├── spop_var_meat.hpp │ ├── spop_vecnorm_bones.hpp │ ├── spop_vecnorm_meat.hpp │ ├── spop_vectorise_bones.hpp │ ├── spop_vectorise_meat.hpp │ ├── spsolve_factoriser_bones.hpp │ ├── spsolve_factoriser_meat.hpp │ ├── strip.hpp │ ├── subview_bones.hpp │ ├── subview_cube_bones.hpp │ ├── subview_cube_each_bones.hpp │ ├── subview_cube_each_meat.hpp │ ├── subview_cube_meat.hpp │ ├── subview_cube_slices_bones.hpp │ ├── subview_cube_slices_meat.hpp │ ├── subview_each_bones.hpp │ ├── subview_each_meat.hpp │ ├── subview_elem1_bones.hpp │ ├── subview_elem1_meat.hpp │ ├── subview_elem2_bones.hpp │ ├── subview_elem2_meat.hpp │ ├── subview_field_bones.hpp │ ├── subview_field_meat.hpp │ ├── subview_meat.hpp │ ├── sym_helper.hpp │ ├── traits.hpp │ ├── translate_arpack.hpp │ ├── translate_atlas.hpp │ ├── translate_blas.hpp │ ├── translate_fftw3.hpp │ ├── translate_lapack.hpp │ ├── translate_superlu.hpp │ ├── trimat_helper.hpp │ ├── typedef_elem.hpp │ ├── typedef_elem_check.hpp │ ├── typedef_mat.hpp │ ├── typedef_mat_fixed.hpp │ ├── unwrap.hpp │ ├── unwrap_cube.hpp │ ├── unwrap_spmat.hpp │ ├── upgrade_val.hpp │ ├── wall_clock_bones.hpp │ ├── wall_clock_meat.hpp │ ├── xtrans_mat_bones.hpp │ ├── xtrans_mat_meat.hpp │ ├── xvec_htrans_bones.hpp │ └── xvec_htrans_meat.hpp ├── bayesian.cpp ├── bayesian.h ├── c8lib.c ├── c8lib.h ├── cDP.pxd ├── cDPQ.pxd ├── cUnitSquareImage.pxd ├── cbayesian.pxd ├── cbayesian.pyx ├── cfPLS.pxd ├── cmlogit.pxd ├── coclogit.pxd ├── cocmlogit.pxd ├── crbfgs.pxd ├── crbfgs.pyx ├── cyarma.pxd ├── cyarma.pyx ├── dp_build.py ├── dp_grid.c ├── dp_grid.h ├── dp_nbhd.c ├── dp_nbhd.h ├── fpls_warp.pyx ├── fpls_warp_grad.c ├── fpls_warp_grad.h ├── imagecpp.pyx ├── matrix_exponential.c ├── matrix_exponential.h ├── misc_funcs.c ├── misc_funcs.h ├── mlogit_warp.pyx ├── mlogit_warp_grad.c ├── mlogit_warp_grad.h ├── myVector.cpp ├── myVector.h ├── oclogit_warp.pyx ├── oclogit_warp_grad.c ├── oclogit_warp_grad.h ├── ocmlogit_warp.pyx ├── ocmlogit_warp_grad.c ├── ocmlogit_warp_grad.h ├── optimum_reparamN2.pyx ├── optimum_reparam_N.pyx ├── r8lib.c ├── r8lib.h ├── rbfgs.cpp └── rbfgs.h └── test └── test_all.py /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | require_ci_to_pass: yes 3 | 4 | coverage: 5 | precision: 2 6 | round: down 7 | range: "70...100" 8 | 9 | status: 10 | project: yes 11 | patch: yes 12 | changes: no 13 | 14 | comment: 15 | layout: "reach, diff, flags, files" 16 | behavior: default 17 | require_changes: false # if true: only post the comment if coverage changes 18 | require_base: no # [yes :: must have a base report to post] 19 | require_head: yes # [yes :: must have a head report to post] 20 | branches: null # branch names that can post comment -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source=fdasrsf 3 | 4 | omit = 5 | # exclude tests files from coverage calculation 6 | fdasrsf_python/bin/* 7 | fdasrsf_python/debug/* -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /build 3 | /fdasrsf/__pycache__ 4 | .ipynb_checkpoints 5 | *.fdb_latexmk 6 | *.fls 7 | *.aux 8 | *.ilg 9 | *.ind 10 | *.log 11 | *.toc 12 | *.pyc 13 | /dist 14 | fdasrsf.egg-info/ 15 | build 16 | .vscode/ 17 | src/cbayesian.cpp 18 | src/fpls_warp.c 19 | src/mlogit_warp.c 20 | src/oclogit_warp.c 21 | src/optimum_reparam_N.c 22 | src/optimum_reparamN2.c 23 | src/ocmlogit_warp.c 24 | src/imagecpp.cpp 25 | fdasrsf_python.code-workspace 26 | *.so 27 | .coverage 28 | src/*.dSYM/ 29 | src/rbfgs 30 | src/crbfgs.cpp 31 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the version of Python and other tools you might need 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.11" 13 | 14 | # Build documentation in the docs/ directory with Sphinx 15 | sphinx: 16 | configuration: doc/source/conf.py 17 | 18 | # Build documentation with MkDocs 19 | #mkdocs: 20 | # configuration: mkdocs.yml 21 | 22 | # Optionally build your docs in additional formats such as PDF and ePub 23 | formats: all 24 | 25 | # Optionally set the version of Python and requirements required to build your docs 26 | python: 27 | install: 28 | - requirements: doc/requirements.txt 29 | - method: setuptools 30 | path: . -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2021, J. Derek Tucker 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | graft src 2 | graft notebooks 3 | include LICENSE.txt 4 | include README.md 5 | include bin/MPEG7.npz 6 | include bin/simu_data.npz -------------------------------------------------------------------------------- /bin/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jupyter/minimal-notebook 2 | 3 | ARG SRC_DIR=. 4 | 5 | LABEL maintainer="J. Derek Tucker " 6 | 7 | ADD $SRC_DIR /home/jovyan/fdasrsf 8 | RUN /bin/bash /home/jovyan/fdasrsf/bin/create_testenv.sh --global --no-setup 9 | 10 | USER root 11 | 12 | RUN pip install -e /home/jovyan/fdasrsf 13 | 14 | # Switch back to jovyan to avoid accidental container runs as root 15 | USER $NB_UID 16 | 17 | ENV PYTHONPATH $PYTHONPATH:"$HOME" 18 | -------------------------------------------------------------------------------- /bin/MPEG7.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/bin/MPEG7.npz -------------------------------------------------------------------------------- /bin/build_docs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sphinx-build -b html doc/source doc/build/html 4 | sphinx-build -b latex doc/source doc/build/latex 5 | sphinx-build -b man doc/source doc/build/man 6 | cd doc/build/latex 7 | latexmk -pdf fdasrsf.tex 8 | cd .. -------------------------------------------------------------------------------- /bin/cibw_before_build_linux.sh: -------------------------------------------------------------------------------- 1 | set -xe 2 | 3 | 4 | NIGHTLY_FLAG="" 5 | 6 | if [ "$#" -eq 1 ]; then 7 | PROJECT_DIR="$1" 8 | elif [ "$#" -eq 2 ] && [ "$1" = "--nightly" ]; then 9 | NIGHTLY_FLAG="--nightly" 10 | PROJECT_DIR="$2" 11 | else 12 | echo "Usage: $0 [--nightly] " 13 | exit 1 14 | fi 15 | 16 | PLATFORM=$(PYTHONPATH=bin python -c "import openblas_support; print(openblas_support.get_plat())") 17 | 18 | printenv 19 | # Update license 20 | 21 | # Install Openblas 22 | basedir=$(python bin/openblas_support.py $NIGHTLY_FLAG) 23 | cp -r $basedir/lib/* /usr/local/lib 24 | cp $basedir/include/* /usr/local/include -------------------------------------------------------------------------------- /bin/cibw_before_build_win.sh: -------------------------------------------------------------------------------- 1 | 2 | python -m pip install mkl-devel 3 | -------------------------------------------------------------------------------- /bin/create_testenv.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex # fail on first error, print commands 4 | 5 | while test $# -gt 0; do 6 | case "$1" in 7 | --global) 8 | GLOBAL=1 9 | ;; 10 | --no-setup) 11 | NO_SETUP=1 12 | ;; 13 | esac 14 | shift 15 | done 16 | 17 | command -v conda >/dev/null 2>&1 || { 18 | echo "Requires conda but it is not installed. Run install_miniconda.sh." >&2 19 | exit 1 20 | } 21 | 22 | ENVNAME="${ENVNAME:-testenv}" # if no ENVNAME is specified, use testenv 23 | 24 | if [ -z ${GLOBAL} ]; then 25 | source $(dirname $(dirname $(which conda)))/etc/profile.d/conda.sh 26 | if conda env list | grep -q ${ENVNAME}; then 27 | echo "Environment ${ENVNAME} already exists, keeping up to date" 28 | conda activate ${ENVNAME} 29 | mamba env update -f environment-dev.yml 30 | else 31 | conda config --add channels conda-forge 32 | conda update -n base conda --yes 33 | conda config --set channel_priority strict 34 | conda install -c conda-forge mamba --yes 35 | mamba env create -f environment-dev.yml 36 | conda activate ${ENVNAME} 37 | fi 38 | else 39 | conda config --add channels conda-forge 40 | conda update -n base conda --yes 41 | conda install gcc gxx --yes 42 | fi 43 | 44 | # Install editable using the setup.py 45 | if [ -z ${NO_SETUP} ]; then 46 | python setup.py install 47 | fi -------------------------------------------------------------------------------- /bin/ex_image_align.py: -------------------------------------------------------------------------------- 1 | #%% 2 | import fdasrsf as fs 3 | import numpy as np 4 | from scipy.io import loadmat 5 | import matplotlib.pyplot as plt 6 | 7 | dat = loadmat('image.mat') 8 | I1 = dat['I1'] 9 | I2 = dat['I2'] 10 | 11 | (m,n) = I1.shape 12 | 13 | I1 -= I1.min() 14 | I1 /= I1.max() 15 | 16 | I2 -= I2.min() 17 | I2 /= I2.max() 18 | 19 | F1 = np.zeros((m,n,2)) 20 | F1[:,:,1],F1[:,:,0] = np.gradient(I1, 1/699,1/699) 21 | F2 = np.zeros((m,n,2)) 22 | F2[:,:,1],F2[:,:,0] = np.gradient(I2, 1/699,1/699) 23 | 24 | F1 -= F1.min() 25 | F1 /= F1.max() 26 | 27 | F2 -= F2.min() 28 | F2 /= F2.max() 29 | 30 | # %% 31 | M = 10 32 | b = fs.formbasisTid(M, m, n, 't') 33 | 34 | gamnew,Inew,H,stepsize = fs.reparam_image(F1,F2,None,b,stepsize=1e-2, itermax=1000) 35 | 36 | I2_new = fs.apply_gam_imag(I2,gamnew) 37 | 38 | plt.figure() 39 | ax1 = plt.subplot(131) 40 | plt.imshow(I1) 41 | plt.title('I1'); 42 | ax1 = plt.subplot(132) 43 | plt.imshow(I2) 44 | plt.title('I2'); 45 | ax1 = plt.subplot(133) 46 | plt.imshow(I2_new) 47 | plt.title('I2 Warped'); 48 | 49 | plt.figure() 50 | gamid = fs.makediffeoid(m,n) 51 | plt.quiver(gamid[:,:,0],gamid[:,:,1],gamid[:,:,0]-gamnew[:,:,0],gamid[:,:,1]-gamnew[:,:,1]) 52 | 53 | # %% 54 | -------------------------------------------------------------------------------- /bin/ex_srsf_align.py: -------------------------------------------------------------------------------- 1 | # %% 2 | import fdasrsf as fs 3 | import numpy as np 4 | 5 | data = np.load("bin/simu_data.npz") 6 | time = data["arr_1"] 7 | f = data["arr_0"] 8 | obj = fs.fdawarp(f, time) 9 | obj.srsf_align(parallel=True) 10 | -------------------------------------------------------------------------------- /bin/ex_srsf_align_bayes.py: -------------------------------------------------------------------------------- 1 | #%% 2 | import fdasrsf as fs 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | 6 | data = np.load('fdasrsf_python/bin/simu_data.npz') 7 | time = data['arr_1'] 8 | f = data['arr_0'] 9 | y1i = f[:,0] + np.random.normal(0,np.sqrt(0.01),f.shape[0]) 10 | y2i = f[:,7] + np.random.normal(0,np.sqrt(0.01),f.shape[0]) 11 | 12 | out = fs.pairwise_align_bayes_infHMC(y1i, y2i, time) 13 | -------------------------------------------------------------------------------- /bin/ex_srvf_align.py: -------------------------------------------------------------------------------- 1 | #%% 2 | import fdasrsf as fs 3 | import numpy as np 4 | data = np.load('fdasrsf_python/bin/MPEG7.npz',allow_pickle=True) 5 | Xdata = data['Xdata'] 6 | curve = Xdata[0,1] 7 | n,M = curve.shape 8 | K = Xdata.shape[1] 9 | 10 | beta = np.zeros((n,M,K)) 11 | for i in range(0,K): 12 | beta[:,:,i] = Xdata[0,i] 13 | 14 | obj = fs.fdacurve(beta,N=M) 15 | obj.karcher_mean(rotation=False) 16 | obj.srvf_align(rotation=False) 17 | obj.karcher_cov() 18 | obj.shape_pca() 19 | obj.plot_pca() -------------------------------------------------------------------------------- /bin/gait_data.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/bin/gait_data.npz -------------------------------------------------------------------------------- /bin/image.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/bin/image.mat -------------------------------------------------------------------------------- /bin/install_miniconda.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e # fail on first error 4 | 5 | if conda --version > /dev/null 2>&1; then 6 | echo "conda appears to already be installed" 7 | exit 0 8 | fi 9 | 10 | PYTHON_VERSION=${PYTHON_VERSION:-3.6} # if no python specified, use 3.6 11 | 12 | if [ ${PYTHON_VERSION} == "2.7" ]; then 13 | INSTALL_FOLDER="$HOME/miniconda2" 14 | else 15 | INSTALL_FOLDER="$HOME/miniconda3" 16 | fi 17 | 18 | 19 | if [ ! -d $INSTALL_FOLDER ] || [ ! -e $INSTALL_FOLDER/bin/conda ]; then 20 | if [ "$(uname)" == "Darwin" ]; then 21 | URL_OS="MacOSX" 22 | elif [ "$(expr substr "$(uname -s)" 1 5)" == "Linux" ]; then 23 | URL_OS="Linux" 24 | elif [ "$(expr substr "$(uname -s)" 1 10)" == "MINGW32_NT" ]; then 25 | URL_OS="Windows" 26 | fi 27 | 28 | echo "Downloading miniconda for $URL_OS" 29 | DOWNLOAD_PATH="miniconda.sh" 30 | if [ ${PYTHON_VERSION} == "2.7" ]; then 31 | wget http://repo.continuum.io/miniconda/Miniconda-latest-$URL_OS-x86_64.sh -O ${DOWNLOAD_PATH}; 32 | else 33 | wget http://repo.continuum.io/miniconda/Miniconda3-latest-$URL_OS-x86_64.sh -O ${DOWNLOAD_PATH}; 34 | fi 35 | 36 | echo "Installing miniconda for python-$PYTHON_VERSION to $INSTALL_FOLDER" 37 | # install miniconda to home folder 38 | bash ${DOWNLOAD_PATH} -b -f -p $INSTALL_FOLDER 39 | 40 | # tidy up 41 | rm ${DOWNLOAD_PATH} 42 | else 43 | echo "Miniconda already installed at ${INSTALL_FOLDER}. Updating, adding to path and exiting" 44 | fi 45 | 46 | export PATH="$INSTALL_FOLDER/bin:$PATH" 47 | echo "Adding $INSTALL_FOLDER to PATH. Consider adding it in your .rc file as well." 48 | conda update -q -y conda -------------------------------------------------------------------------------- /bin/repair_windows.sh: -------------------------------------------------------------------------------- 1 | set -xe 2 | 3 | WHEEL="$1" 4 | DEST_DIR="$2" 5 | 6 | # create a temporary directory in the destination folder and unpack the wheel 7 | # into there 8 | pushd $DEST_DIR 9 | mkdir -p tmp 10 | pushd tmp 11 | wheel unpack $WHEEL 12 | pushd fdsasrsf* 13 | 14 | # To avoid DLL hell, the file name of libopenblas that's being vendored with 15 | # the wheel has to be name-mangled. delvewheel is unable to name-mangle PYD 16 | # containing extra data at the end of the binary, which frequently occurs when 17 | # building with mingw. 18 | # We therefore find each PYD in the directory structure and strip them. 19 | 20 | for f in $(find ./fdasrsf* -name '*.pyd'); do strip $f; done 21 | 22 | 23 | # now repack the wheel and overwrite the original 24 | wheel pack . 25 | mv -fv *.whl $WHEEL 26 | 27 | cd $DEST_DIR 28 | rm -rf tmp 29 | 30 | # the libopenblas.dll is placed into this directory in the cibw_before_build 31 | # script. 32 | delvewheel repair --add-path /c/opt/openblas/openblas_dll --no-dll libsf_error_state.dll -w $DEST_DIR $WHEEL -------------------------------------------------------------------------------- /bin/simu_data.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/bin/simu_data.npz -------------------------------------------------------------------------------- /bin/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | python bin/ex_srsf_align.py -------------------------------------------------------------------------------- /binder/apt.txt: -------------------------------------------------------------------------------- 1 | libopenblas-dev -------------------------------------------------------------------------------- /binder/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - defaults 4 | dependencies: 5 | - arviz>=0.9 6 | - Cython 7 | - joblib 8 | - kiwisolver 9 | - matplotlib 10 | - patsy 11 | - pyparsing 12 | - python-dateutil 13 | - scipy 14 | - six 15 | - tqdm 16 | - tornado 17 | - numpy>=1.13 18 | - scipy>=0.18 19 | - pandas 20 | - patsy>=0.5 21 | - h5py>=2.7 22 | - typing-extensions>=3.7 23 | - bokeh>=0.12 24 | - coverage>=5.1 25 | - python-graphviz 26 | - ipython>=7.16 27 | - nbsphinx>=0.4 28 | - nose>=1.3 29 | - nose-parameterized>=0.6 30 | - numpydoc>=0.9 31 | - pycodestyle>=2.3 32 | - pyflakes>=1.5 33 | - pylint>=1.7 34 | - pytest-cov>=2.5 35 | - pytest>=3.0 36 | - recommonmark>=0.4 37 | - scikit-learn 38 | - seaborn>=0.8 39 | - sphinx-autobuild>=0.7 40 | - sphinx>=1.5 41 | - watermark 42 | - parameterized 43 | - black 44 | - ipywidgets 45 | - mkl-devel 46 | - dill 47 | - libblas=*=*mkl 48 | - xlrd 49 | - toyplot 50 | - pip 51 | -------------------------------------------------------------------------------- /binder/postBuild: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | python setup.py install 4 | -------------------------------------------------------------------------------- /binder/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi 2 | cycler 3 | Cython 4 | joblib 5 | kiwisolver 6 | matplotlib 7 | numpy 8 | patsy 9 | pyparsing 10 | python-dateutil 11 | scipy 12 | six 13 | tornado 14 | -------------------------------------------------------------------------------- /binder/trigger_binder.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function trigger_binder() { 4 | local URL="${1}" 5 | 6 | curl -L --connect-timeout 10 --max-time 30 "${URL}" 7 | curl_return=$? 8 | 9 | # Return code 28 is when the --max-time is reached 10 | if [ "${curl_return}" -eq 0 ] || [ "${curl_return}" -eq 28 ]; then 11 | if [[ "${curl_return}" -eq 28 ]]; then 12 | printf "\nBinder build started.\nCheck back soon.\n" 13 | fi 14 | else 15 | return "${curl_return}" 16 | fi 17 | 18 | return 0 19 | } 20 | 21 | function main() { 22 | # 1: the Binder build API URL to curl 23 | trigger_binder $1 24 | } 25 | 26 | main "$@" || exit 1 -------------------------------------------------------------------------------- /debug/debug_data.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/debug/debug_data.h5 -------------------------------------------------------------------------------- /debug/debug_data_oc_logit.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/debug/debug_data_oc_logit.h5 -------------------------------------------------------------------------------- /debug/debug_data_oc_mlogit.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/debug/debug_data_oc_mlogit.h5 -------------------------------------------------------------------------------- /debug/debugc_warp_mlogistic.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import fdasrsf as fs 3 | import mlogit_warp as mw 4 | import h5py 5 | 6 | fun = h5py.File('/Users/jdtucker/Documents/Research/fdasrsf/debug/debug_data.h5') 7 | q = fun['q'][:] 8 | y = fun['y'][:] 9 | time = fun['time'][:] 10 | alpha = fun['alpha'][:] 11 | beta = fun['beta'][:] 12 | 13 | max_itr = 10000 # 4000 14 | tol = 1e-10 15 | delta = .01 16 | display = 1 17 | 18 | gam_old = mw.mlogit_warp(np.ascontiguousarray(alpha), 19 | np.ascontiguousarray(beta), 20 | time, np.ascontiguousarray(q), 21 | np.ascontiguousarray(y, dtype=np.int32), max_itr, 22 | tol, delta, display) 23 | -------------------------------------------------------------------------------- /debug/debugc_warp_oclogistic.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from scipy.linalg import norm 3 | import fdasrsf as fs 4 | import oclogit_warp as lw 5 | import h5py 6 | 7 | fun = h5py.File('/home/dtucker/fdasrsf/debug/debug_data_oc_logit.h5') 8 | q = fun['q'][:] 9 | y = fun['y'].value 10 | alpha = fun['alpha'].value 11 | nu = fun['nu'][:] 12 | 13 | max_itr = 9000 # 4000 14 | tol = 1e-4 15 | deltag = .05 16 | deltaO = .1 17 | display = 1 18 | 19 | q, scale = fs.scale_curve(q) # q/norm(q) 20 | nu, scale = fs.scale_curve(nu) # nu/norm(nu) 21 | 22 | gam_old, O_old = lw.oclogit_warp(np.ascontiguousarray(alpha), 23 | np.ascontiguousarray(nu), 24 | np.ascontiguousarray(q), 25 | np.ascontiguousarray(y, dtype=np.int32), 26 | max_itr, tol, deltaO, deltag, display) 27 | -------------------------------------------------------------------------------- /debug/debugc_warp_ocmlogistic.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from scipy.linalg import norm 3 | import fdasrsf as fs 4 | import ocmlogit_warp as mw 5 | import h5py 6 | 7 | fun = h5py.File('/home/dtucker/fdasrsf/debug_data_oc_mlogit.h5') 8 | q = fun['q'][:] 9 | y = fun['y'][:] 10 | alpha = fun['alpha'][:] 11 | nu = fun['nu'][:] 12 | 13 | max_itr = 8000 # 4000 14 | tol = 1e-4 15 | deltag = .05 16 | deltaO = .08 17 | display = 1 18 | 19 | alpha = alpha/norm(alpha) 20 | q, scale = fs.scale_curve(q) # q/norm(q) 21 | for ii in range(0, nu.shape[2]): 22 | nu[:, :, ii], scale = fs.scale_curve(nu[:, :, ii]) # nu/norm(nu) 23 | 24 | gam_old, O_old = mw.ocmlogit_warp(np.ascontiguousarray(alpha), 25 | np.ascontiguousarray(nu), 26 | np.ascontiguousarray(q), 27 | np.ascontiguousarray(y, dtype=np.int32), max_itr, 28 | tol, deltaO, deltag, display) 29 | -------------------------------------------------------------------------------- /debug/oc_karcher.py: -------------------------------------------------------------------------------- 1 | #%% 2 | import fdasrsf as fs 3 | import matplotlib.pyplot as plt 4 | from scipy.io import loadmat 5 | import numpy as np 6 | data = loadmat("C:/Users/jdtuck/Downloads/MPEG7.mat") 7 | 8 | Xdata = data["Xdata"] 9 | curve = Xdata[0,1] 10 | n,M = curve.shape 11 | K = Xdata.shape[1] 12 | 13 | beta = np.zeros((n,M,K)) 14 | for i in range(0,K): 15 | beta[:,:,i] = Xdata[0,i] 16 | 17 | obj = fs.fdacurve(beta,N=M) 18 | obj.karcher_mean() 19 | obj.srvf_align() 20 | obj.karcher_cov() 21 | obj.shape_pca() -------------------------------------------------------------------------------- /doc/_static/switcher.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "dev", 4 | "version": "dev", 5 | "url": "https://fdasrsf-python.readthedocs.io/en/latest/" 6 | }, 7 | { 8 | "name": "2.6.1 (stable)", 9 | "version": "stable", 10 | "url": "https://fdasrsf-python.readthedocs.io/en/stable/", 11 | "preferred": true 12 | } 13 | ] -------------------------------------------------------------------------------- /doc/artwork/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/artwork/icon.png -------------------------------------------------------------------------------- /doc/artwork/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/artwork/logo.png -------------------------------------------------------------------------------- /doc/build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 4cca0ef9b07771ba9fe49c0d5c9d1532 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /doc/build/html/.doctrees/boxplots.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/boxplots.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/curve_functions.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/curve_functions.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/curve_statistics.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/curve_statistics.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/environment.pickle -------------------------------------------------------------------------------- /doc/build/html/.doctrees/fPCA.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/fPCA.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/fPLS.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/fPLS.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/geodesic.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/geodesic.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/index.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/pcr_regression.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/pcr_regression.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/regression.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/regression.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/time_warping.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/time_warping.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/tolerance.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/tolerance.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/umap_metric.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/umap_metric.doctree -------------------------------------------------------------------------------- /doc/build/html/.doctrees/utility_functions.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/.doctrees/utility_functions.doctree -------------------------------------------------------------------------------- /doc/build/html/_sources/boxplots.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Functional Boxplots 6 | =========================== 7 | 8 | .. automodule:: boxplots 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | -------------------------------------------------------------------------------- /doc/build/html/_sources/curve_functions.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Curve Functions 6 | =============== 7 | .. automodule:: curve_functions 8 | :members: 9 | -------------------------------------------------------------------------------- /doc/build/html/_sources/curve_statistics.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Curve Registration 6 | ================== 7 | .. automodule:: curve_stats 8 | :members: 9 | -------------------------------------------------------------------------------- /doc/build/html/_sources/fPCA.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Functional Principal Component Analysis 6 | ======================================= 7 | .. automodule:: fPCA 8 | :members: 9 | 10 | .. toctree:: 11 | :maxdepth: 2 -------------------------------------------------------------------------------- /doc/build/html/_sources/fPLS.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Functional Principal Least Squares 6 | ================================== 7 | .. automodule:: fPLS 8 | :members: -------------------------------------------------------------------------------- /doc/build/html/_sources/geodesic.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | SRVF Geodesic Computation 6 | ========================= 7 | .. automodule:: geodesic 8 | :members: 9 | -------------------------------------------------------------------------------- /doc/build/html/_sources/pcr_regression.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Principal Component Regression 6 | ====================================== 7 | 8 | .. automodule:: pcr_regression 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/build/html/_sources/regression.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Regression 6 | ================== 7 | 8 | .. automodule:: regression 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/build/html/_sources/time_warping.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Functional Alignment 6 | ==================== 7 | 8 | .. automodule:: time_warping 9 | :members: 10 | 11 | .. autosummary:: 12 | :toctree: autosummary -------------------------------------------------------------------------------- /doc/build/html/_sources/tolerance.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Functional Tolerance Bounds 6 | =================================== 7 | 8 | .. automodule:: tolerance 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/build/html/_sources/umap_metric.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | UMAP EFDA Metrics 6 | ================= 7 | 8 | .. automodule:: umap_metric 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/build/html/_sources/utility_functions.rst.txt: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Utility Functions 6 | ================= 7 | .. automodule:: utility_functions 8 | :members: -------------------------------------------------------------------------------- /doc/build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | const DOCUMENTATION_OPTIONS = { 2 | VERSION: '2.6.2', 3 | LANGUAGE: 'en', 4 | COLLAPSE_INDEX: false, 5 | BUILDER: 'html', 6 | FILE_SUFFIX: '.html', 7 | LINK_SUFFIX: '.html', 8 | HAS_SOURCE: true, 9 | SOURCELINK_SUFFIX: '.txt', 10 | NAVIGATION_WITH_KEYS: false, 11 | SHOW_SEARCH_SUMMARY: true, 12 | ENABLE_SEARCH_SHORTCUTS: true, 13 | }; -------------------------------------------------------------------------------- /doc/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/_static/file.png -------------------------------------------------------------------------------- /doc/build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/_static/minus.png -------------------------------------------------------------------------------- /doc/build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/_static/plus.png -------------------------------------------------------------------------------- /doc/build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/html/objects.inv -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/boxplots.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/boxplots.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/curve_functions.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/curve_functions.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/curve_statistics.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/curve_statistics.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/environment.pickle -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/fPCA.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/fPCA.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/fPLS.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/fPLS.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/geodesic.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/geodesic.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/index.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/pcr_regression.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/pcr_regression.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/regression.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/regression.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/time_warping.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/time_warping.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/tolerance.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/tolerance.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/umap_metric.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/umap_metric.doctree -------------------------------------------------------------------------------- /doc/build/latex/.doctrees/utility_functions.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/.doctrees/utility_functions.doctree -------------------------------------------------------------------------------- /doc/build/latex/LatinRules.xdy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/LatinRules.xdy -------------------------------------------------------------------------------- /doc/build/latex/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx LaTeX output 2 | 3 | ALLDOCS = $(basename $(wildcard *.tex)) 4 | ALLPDF = $(addsuffix .pdf,$(ALLDOCS)) 5 | ALLDVI = $(addsuffix .dvi,$(ALLDOCS)) 6 | ALLXDV = 7 | ALLPS = $(addsuffix .ps,$(ALLDOCS)) 8 | 9 | # Prefix for archive names 10 | ARCHIVEPREFIX = 11 | # Additional LaTeX options (passed via variables in latexmkrc/latexmkjarc file) 12 | export LATEXOPTS ?= 13 | # Additional latexmk options 14 | LATEXMKOPTS ?= 15 | # format: pdf or dvi (used only by archive targets) 16 | FMT = pdf 17 | 18 | LATEX = latexmk -dvi 19 | PDFLATEX = latexmk -pdf -dvi- -ps- 20 | 21 | 22 | %.dvi: %.tex FORCE_MAKE 23 | $(LATEX) $(LATEXMKOPTS) '$<' 24 | 25 | %.ps: %.dvi 26 | dvips '$<' 27 | 28 | %.pdf: %.tex FORCE_MAKE 29 | $(PDFLATEX) $(LATEXMKOPTS) '$<' 30 | 31 | all: $(ALLPDF) 32 | 33 | all-dvi: $(ALLDVI) 34 | 35 | all-ps: $(ALLPS) 36 | 37 | all-pdf: $(ALLPDF) 38 | 39 | zip: all-$(FMT) 40 | mkdir $(ARCHIVEPREFIX)docs-$(FMT) 41 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) 42 | zip -q -r -9 $(ARCHIVEPREFIX)docs-$(FMT).zip $(ARCHIVEPREFIX)docs-$(FMT) 43 | rm -r $(ARCHIVEPREFIX)docs-$(FMT) 44 | 45 | tar: all-$(FMT) 46 | mkdir $(ARCHIVEPREFIX)docs-$(FMT) 47 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) 48 | tar cf $(ARCHIVEPREFIX)docs-$(FMT).tar $(ARCHIVEPREFIX)docs-$(FMT) 49 | rm -r $(ARCHIVEPREFIX)docs-$(FMT) 50 | 51 | gz: tar 52 | gzip -9 < $(ARCHIVEPREFIX)docs-$(FMT).tar > $(ARCHIVEPREFIX)docs-$(FMT).tar.gz 53 | 54 | bz2: tar 55 | bzip2 -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar 56 | 57 | xz: tar 58 | xz -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar 59 | 60 | clean: 61 | rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ps *.tar *.tar.gz *.tar.bz2 *.tar.xz $(ALLPDF) $(ALLDVI) $(ALLXDV) *.fls *.fdb_latexmk 62 | 63 | .PHONY: all all-pdf all-dvi all-ps clean zip tar gz bz2 xz 64 | .PHONY: FORCE_MAKE -------------------------------------------------------------------------------- /doc/build/latex/fdasrsf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/latex/fdasrsf.pdf -------------------------------------------------------------------------------- /doc/build/latex/latexmkjarc: -------------------------------------------------------------------------------- 1 | $latex = 'pdflatex ' . $ENV{'LATEXOPTS'} . ' -kanji=utf8 %O %S'; 2 | $dvipdf = 'dvipdfmx %O -o %D %S'; 3 | $makeindex = 'internal mendex %S %B %D'; 4 | sub mendex { 5 | my ($source, $basename, $destination) = @_; 6 | my $dictfile = $basename . ".dic"; 7 | unlink($destination); 8 | system("mendex", "-U", "-f", "-d", $dictfile, "-s", "python.ist", $source); 9 | if ($? > 0) { 10 | print("mendex exited with error code $? (ignored)\n"); 11 | } 12 | if (!-e $destination) { 13 | # create an empty .ind file if nothing 14 | open(FH, ">" . $destination); 15 | close(FH); 16 | } 17 | return 0; 18 | } 19 | add_cus_dep( "glo", "gls", 0, "makeglo" ); 20 | sub makeglo { 21 | return system( "mendex -J -f -s gglo.ist -o '$_[0].gls' '$_[0].glo'" ); 22 | } -------------------------------------------------------------------------------- /doc/build/latex/latexmkrc: -------------------------------------------------------------------------------- 1 | $latex = 'latex ' . $ENV{'LATEXOPTS'} . ' %O %S'; 2 | $pdflatex = 'pdflatex ' . $ENV{'LATEXOPTS'} . ' %O %S'; 3 | $lualatex = 'lualatex ' . $ENV{'LATEXOPTS'} . ' %O %S'; 4 | $xelatex = 'xelatex --no-pdf ' . $ENV{'LATEXOPTS'} . ' %O %S'; 5 | $makeindex = 'makeindex -s python.ist %O -o %D %S'; 6 | add_cus_dep( "glo", "gls", 0, "makeglo" ); 7 | sub makeglo { 8 | return system( "makeindex -s gglo.ist -o '$_[0].gls' '$_[0].glo'" ); 9 | } -------------------------------------------------------------------------------- /doc/build/latex/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | pushd %~dp0 6 | 7 | set PDFLATEX=latexmk -pdf -dvi- -ps- 8 | 9 | set "LATEXOPTS= " 10 | 11 | if "%1" == "" goto all-pdf 12 | 13 | if "%1" == "all-pdf" ( 14 | :all-pdf 15 | for %%i in (*.tex) do ( 16 | %PDFLATEX% %LATEXMKOPTS% %%i 17 | ) 18 | goto end 19 | ) 20 | 21 | if "%1" == "all-pdf-ja" ( 22 | goto all-pdf 23 | ) 24 | 25 | if "%1" == "clean" ( 26 | del /q /s *.dvi *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ps *.tar *.tar.gz *.tar.bz2 *.tar.xz *.fls *.fdb_latexmk 27 | goto end 28 | ) 29 | 30 | :end 31 | popd -------------------------------------------------------------------------------- /doc/build/latex/python.ist: -------------------------------------------------------------------------------- 1 | line_max 100 2 | headings_flag 1 3 | heading_prefix " \\bigletter " 4 | 5 | preamble "\\begin{sphinxtheindex} 6 | \\let\\bigletter\\sphinxstyleindexlettergroup 7 | \\let\\spxpagem \\sphinxstyleindexpagemain 8 | \\let\\spxentry \\sphinxstyleindexentry 9 | \\let\\spxextra \\sphinxstyleindexextra 10 | 11 | " 12 | 13 | postamble "\n\n\\end{sphinxtheindex}\n" 14 | 15 | symhead_positive "{\\sphinxsymbolsname}" 16 | numhead_positive "{\\sphinxnumbersname}" 17 | -------------------------------------------------------------------------------- /doc/build/latex/sphinxmessages.sty: -------------------------------------------------------------------------------- 1 | % 2 | % sphinxmessages.sty 3 | % 4 | % message resources for Sphinx 5 | % 6 | \ProvidesPackage{sphinxmessages}[2019/01/04 v2.0 Localized LaTeX macros (Sphinx team)] 7 | 8 | \renewcommand{\literalblockcontinuedname}{continued from previous page} 9 | \renewcommand{\literalblockcontinuesname}{continues on next page} 10 | \renewcommand{\sphinxnonalphabeticalgroupname}{Non\sphinxhyphen{}alphabetical} 11 | \renewcommand{\sphinxsymbolsname}{Symbols} 12 | \renewcommand{\sphinxnumbersname}{Numbers} 13 | \def\pageautorefname{page} 14 | 15 | \addto\captionsenglish{\renewcommand{\figurename}{Fig.\@{} }} 16 | \def\fnum@figure{\figurename\thefigure{}} 17 | 18 | \addto\captionsenglish{\renewcommand{\tablename}{Table }} 19 | \def\fnum@table{\tablename\thetable{}} 20 | 21 | \addto\captionsenglish{\renewcommand{\literalblockname}{Listing}} -------------------------------------------------------------------------------- /doc/build/man/.doctrees/boxplots.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/boxplots.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/curve_functions.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/curve_functions.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/curve_statistics.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/curve_statistics.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/fPCA.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/fPCA.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/fPLS.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/fPLS.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/geodesic.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/geodesic.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/index.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/pcr_regression.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/pcr_regression.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/regression.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/regression.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/time_warping.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/time_warping.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/tolerance.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/tolerance.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/umap_metric.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/umap_metric.doctree -------------------------------------------------------------------------------- /doc/build/man/.doctrees/utility_functions.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdtuck/fdasrsf_python/f9c33ea0db151472ec1136516e647f1bb77f7d6f/doc/build/man/.doctrees/utility_functions.doctree -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy>=1.25.0 2 | setuptools<=73.0.1 3 | cffi>=1.0.0 4 | numba 5 | scipy>=1.14 6 | matplotlib 7 | Cython 8 | joblib 9 | patsy 10 | tqdm 11 | nbsphinx 12 | findblas 13 | pydata_sphinx_theme 14 | -------------------------------------------------------------------------------- /doc/source/api.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | API Reference 6 | ============= 7 | 8 | .. toctree:: 9 | :includehidden: 10 | :maxdepth: 4 11 | :caption: Modules: 12 | :titlesonly: 13 | 14 | time_warping.rst 15 | fPCA.rst 16 | fPNS.rst 17 | boxplots.rst 18 | fPLS.rst 19 | regression.rst 20 | pcr_regression.rst 21 | elastic_changepoint.rst 22 | elastic_glm_regression.rst 23 | tolerance.rst 24 | kmeans.rst 25 | image.rst 26 | curve_statistics.rst 27 | geodesic.rst 28 | utility_functions.rst 29 | curve_functions.rst 30 | umap_metric.rst 31 | -------------------------------------------------------------------------------- /doc/source/boxplots.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Functional Boxplots 6 | =========================== 7 | 8 | .. automodule:: boxplots 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | -------------------------------------------------------------------------------- /doc/source/curve_functions.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Curve Functions 6 | =============== 7 | .. automodule:: curve_functions 8 | :members: 9 | -------------------------------------------------------------------------------- /doc/source/curve_statistics.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Curve Registration 6 | ================== 7 | .. automodule:: curve_stats 8 | :members: 9 | -------------------------------------------------------------------------------- /doc/source/elastic_changepoint.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Functional Changepoint 6 | ============================== 7 | 8 | .. automodule:: elastic_changepoint 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/source/elastic_glm_regression.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic GLM Regression 6 | ====================== 7 | 8 | .. automodule:: elastic_glm_regression 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/source/fPCA.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Functional Principal Component Analysis 6 | ======================================= 7 | .. automodule:: fPCA 8 | :members: 9 | 10 | .. toctree:: 11 | :maxdepth: 2 -------------------------------------------------------------------------------- /doc/source/fPLS.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Functional Principal Least Squares 6 | ================================== 7 | .. automodule:: fPLS 8 | :members: -------------------------------------------------------------------------------- /doc/source/fPNS.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Functional Principal Nested Spheres Analysis 6 | ============================================ 7 | .. automodule:: fPNS 8 | :members: 9 | 10 | .. toctree:: 11 | :maxdepth: 2 -------------------------------------------------------------------------------- /doc/source/geodesic.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | SRVF Geodesic Computation 6 | ========================= 7 | .. automodule:: geodesic 8 | :members: 9 | -------------------------------------------------------------------------------- /doc/source/image.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Image Warping 6 | ========================= 7 | .. automodule:: image 8 | :members: 9 | -------------------------------------------------------------------------------- /doc/source/kmeans.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Functional Clustering 6 | ============================= 7 | 8 | .. automodule:: kmeans 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/source/pcr_regression.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Principal Component Regression 6 | ====================================== 7 | 8 | .. automodule:: pcr_regression 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/source/regression.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Regression 6 | ================== 7 | 8 | .. automodule:: regression 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/source/time_warping.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Functional Alignment 6 | ==================== 7 | 8 | .. automodule:: time_warping 9 | :members: 10 | 11 | .. autosummary:: 12 | :toctree: autosummary -------------------------------------------------------------------------------- /doc/source/tolerance.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Elastic Functional Tolerance Bounds 6 | =================================== 7 | 8 | .. automodule:: tolerance 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/source/umap_metric.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | UMAP EFDA Metrics 6 | ================= 7 | 8 | .. automodule:: umap_metric 9 | :members: 10 | 11 | .. toctree:: 12 | :maxdepth: 1 -------------------------------------------------------------------------------- /doc/source/user_guide.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | User Guide 6 | ========== 7 | 8 | Contents: 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | time_warping_example.ipynb 14 | fpca_example.ipynb 15 | example_mvwarping.ipynb 16 | example_cluster.ipynb 17 | curve_example.ipynb 18 | -------------------------------------------------------------------------------- /doc/source/utility_functions.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../artwork/logo.png 2 | :width: 200px 3 | :align: right 4 | 5 | Utility Functions 6 | ================= 7 | .. automodule:: utility_functions 8 | :members: -------------------------------------------------------------------------------- /environment-dev.yml: -------------------------------------------------------------------------------- 1 | name: testenv 2 | channels: 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - arviz>=0.9 7 | - Cython 8 | - joblib 9 | - kiwisolver 10 | - matplotlib 11 | - patsy 12 | - pyparsing 13 | - python-dateutil 14 | - scipy 15 | - six 16 | - tqdm 17 | - cffi>=1.0.0 18 | - numba 19 | - tornado 20 | - numpy>=1.25 21 | - scipy>=0.18 22 | - pandas >=0.18 23 | - patsy>=0.5 24 | - h5py>=2.7 25 | - typing-extensions>=3.7 26 | - bokeh>=0.12 27 | - coverage>=5.1 28 | - python-graphviz 29 | - ipython>=7.16 30 | - nbsphinx>=0.4 31 | - nose>=1.3 32 | - nose-parameterized>=0.6 33 | - numpydoc>=0.9 34 | - pycodestyle>=2.3 35 | - pyflakes>=1.5 36 | - pylint>=1.7 37 | - pytest-cov>=2.5 38 | - pytest>=3.0 39 | - recommonmark>=0.4 40 | - scikit-learn>=0.20 41 | - seaborn>=0.8 42 | - sphinx-autobuild>=0.7 43 | - sphinx>=1.5 44 | - watermark 45 | - toyplot 46 | - parameterized 47 | - black 48 | - ipywidgets 49 | - dill 50 | -------------------------------------------------------------------------------- /fdasrsf/_distributor_init.py: -------------------------------------------------------------------------------- 1 | try: 2 | from . import _distributor_init_local # noqa: F401 3 | except ImportError: 4 | pass -------------------------------------------------------------------------------- /fdasrsf/fPLS.py: -------------------------------------------------------------------------------- 1 | """ 2 | Partial Least Squares using SVD 3 | 4 | moduleauthor:: J. Derek Tucker 5 | 6 | """ 7 | import numpy as np 8 | from fdasrsf.utility_functions import diffop, geigen, innerprod_q 9 | 10 | 11 | def pls_svd(time, qf, qg, no, alpha=0.0): 12 | """ 13 | This function computes the partial least squares using SVD 14 | 15 | :param time: vector describing time samples 16 | :param qf: numpy ndarray of shape (M,N) of N functions with M samples 17 | :param qg: numpy ndarray of shape (M,N) of N functions with M samples 18 | :param no: number of components 19 | :param alpha: amount of smoothing (Default = 0.0 i.e., none) 20 | 21 | :rtype: numpy ndarray 22 | :return wqf: f weight function 23 | :return wqg: g weight function 24 | :return alpha: smoothing value 25 | :return values: singular values 26 | 27 | """ 28 | binsize = np.diff(time) 29 | binsize = binsize.mean() 30 | 31 | Kfg = np.cov(qf, qg) 32 | Kfg = Kfg[0 : qf.shape[0], qf.shape[0] : Kfg.shape[0]] 33 | nx = Kfg.shape[0] 34 | D4x = diffop(nx, binsize) 35 | values, Lmat, Mmat = geigen(Kfg, np.eye(nx) + alpha * D4x, np.eye(nx) + alpha * D4x) 36 | wf = Lmat[:, 0:no] 37 | wg = Mmat[:, 0:no] 38 | 39 | for ii in range(0, no): 40 | wf[:, ii] = wf[:, ii] / np.sqrt(innerprod_q(time, wf[:, ii], wf[:, ii])) 41 | wg[:, ii] = wg[:, ii] / np.sqrt(innerprod_q(time, wg[:, ii], wg[:, ii])) 42 | 43 | wqf = wf 44 | wqg = wg 45 | 46 | N = qf.shape[1] 47 | rfi = np.zeros(N) 48 | rgi = np.zeros(N) 49 | 50 | for l in range(0, N): 51 | rfi[l] = innerprod_q(time, qf[:, l], wqf[:, 0]) 52 | rgi[l] = innerprod_q(time, qg[:, l], wqg[:, 0]) 53 | 54 | cost = np.cov(rfi, rgi)[1, 0] 55 | 56 | return wqf, wqg, alpha, values, cost 57 | -------------------------------------------------------------------------------- /fdasrsf/gp.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def kernel(x, y, l2): 5 | # RBF Kernel 6 | sqdist = np.sum(x**2, 1).reshape(-1, 1) + np.sum(y**2, 1) - 2 * np.dot(x, y.T) 7 | return np.exp(-0.5 * (1 / l2) * sqdist) 8 | 9 | 10 | def gp_posterior(X, y, Xtest, l2=0.1, noise_var=1e-6): 11 | # compute the mean at our test points. 12 | N, n = len(X), len(Xtest) 13 | K = kernel(X, X, l2) 14 | L = np.linalg.cholesky(K + noise_var * np.eye(N)) 15 | Lk = np.linalg.solve(L, kernel(X, Xtest, l2)) 16 | mu = np.dot(Lk.T, np.linalg.solve(L, y)) 17 | # compute the variance at our test points. 18 | K_ = kernel(Xtest, Xtest, l2) 19 | sd = np.sqrt(np.diag(K_) - np.sum(Lk**2, axis=0)) 20 | return (mu, sd) 21 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi 2 | cycler 3 | Cython 4 | cffi>=1.0.0 5 | numba 6 | joblib 7 | kiwisolver 8 | matplotlib 9 | numpy>=1.25.0 10 | patsy 11 | findblas 12 | pyparsing 13 | python-dateutil 14 | scipy>=1.14 15 | six 16 | tornado 17 | tqdm 18 | looseversion 19 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [build_sphinx] 2 | project = 'fdasrvf' 3 | version = 2.6 4 | release = 2.6.2 5 | source-dir = doc/source 6 | build-dir = doc/build 7 | all_files = 1 8 | 9 | [upload_sphinx] 10 | upload-dir = doc/build/html 11 | -------------------------------------------------------------------------------- /src/DP.h: -------------------------------------------------------------------------------- 1 | void DP(double *q1, double *q2, int n, int N, double lam, int Disp, double *yy); 2 | -------------------------------------------------------------------------------- /src/DynamicProgrammingQ2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "dp_grid.h" 5 | #include "dp_nbhd.h" 6 | 7 | void DynamicProgrammingQ2(double *Q1, double *T1, double *Q2, double *T2, int m1, int n1, int n2, 8 | double *tv1, double *tv2, int n1v, int n2v, double *G, double *T, double *size, double lam1, 9 | size_t nbhd_dim){ 10 | int *idxv1 = 0; 11 | int *idxv2 = 0; 12 | double *E = 0; /* E[ntv1*j+i] = cost of best path to (tv1[i],tv2[j]) */ 13 | int *P = 0; /* P[ntv1*j+i] = predecessor of (tv1[i],tv2[j]) along best path */ 14 | size_t nbhd_count; /* Number of indexes */ 15 | 16 | idxv1=(int*)malloc((n1v)*sizeof(int)); 17 | idxv2=(int*)malloc((n2v)*sizeof(int)); 18 | E=(double*)malloc((n1v)*(n2v)*sizeof(double)); 19 | P=(int*)calloc((n1v)*(n2v),sizeof(int)); 20 | 21 | Pair * dp_nbhd = dp_generate_nbhd(nbhd_dim, &nbhd_count); 22 | 23 | /* dp_costs() needs indexes for gridpoints precomputed */ 24 | dp_all_indexes( T1, n1, tv1, n1v, idxv1 ); 25 | dp_all_indexes( T2, n2, tv2, n2v, idxv2 ); 26 | 27 | /* Compute cost of best path from (0,0) to every other grid point */ 28 | dp_costs( Q1, T1, n1, Q2, T2, n2, 29 | m1, tv1, idxv1, n1v, tv2, idxv2, n2v, E, P, lam1, 30 | nbhd_count, dp_nbhd ); 31 | 32 | /* Reconstruct best path from (0,0) to (1,1) */ 33 | *size = dp_build_gamma( P, tv1, n1v, tv2, n2v, G, T ); 34 | 35 | // free allocated memory 36 | free(dp_nbhd); 37 | free(idxv1); free(idxv2); free(E); free(P); 38 | } 39 | -------------------------------------------------------------------------------- /src/DynamicProgrammingQ2.h: -------------------------------------------------------------------------------- 1 | void DynamicProgrammingQ2(double *Q1, double *T1, double *Q2, double *T2, int m1, int n1, int n2, 2 | double *tv1, double *tv2, int n1v, int n2v, double *G, double *T, double *size, double lam1, 3 | size_t nbhd_dim); 4 | -------------------------------------------------------------------------------- /src/UnitSquareImage.h: -------------------------------------------------------------------------------- 1 | #ifndef UNITSQUAREIMAGE_H 2 | #define UNITSQUAREIMAGE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "ImageRegister.h" 8 | 9 | using namespace std; 10 | 11 | 12 | void findgrad(double *dfdu, double *dfdv, const double *f, int n, int t); 13 | void findgrad2D(double *dfdu, double *dfdv, double *f, int n, int t, int d); 14 | void multfact_image(double *multfact, const double *dfdu, const double *dfdv, int n, int t, int d); 15 | void surface_to_q(double *q, const double *f, const double *multfact, int n, int t, int d); 16 | void Calculate_Distance(double *H, const double *q1, const double *q2, int n, int t, int d); 17 | void findphistar(double *w, double *q, double *b, int n, int t, int d, int K); 18 | void findupdategam(double *gamupdate, const double *v, const double *w, const double *b, int n, int t, int d, int K); 19 | void updategam(double *gamnew, const double *gamupdate, const double *gamid, double eps, int n, int t, int D); 20 | void Apply_gam_gamid(double *gamcum, const double *gamid, const double *gaminc, int m, int n); 21 | void Apply_Gamma_Surf(double *Fnew, const double *F, const double *gam, int n, int d); 22 | int check_crossing(double *f, int n, int t, int D); 23 | int ReparamSurf(double *Fnew, double *gamnew, double *H, 24 | double *Ft, const double *Fm, const double *gam, 25 | double *b, const double *gamid, 26 | const int n, const int t, const int d, const int D, const int K, 27 | const double eps, const double tol, const int itermax); 28 | 29 | void InvtGamma(double *gaminv, const double *gam, const double *gamid, int n); 30 | void jacob_image(double *A, const double *F, int n, int t); 31 | 32 | #endif -------------------------------------------------------------------------------- /src/armadillo_bits/CubeToMatOp_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup CubeToMatOp 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | CubeToMatOp::CubeToMatOp(const T1& in_m) 27 | : m(in_m) 28 | { 29 | arma_extra_debug_sigprint(); 30 | } 31 | 32 | 33 | 34 | template 35 | inline 36 | CubeToMatOp::CubeToMatOp(const T1& in_m, const uword in_aux_uword) 37 | : m(in_m) 38 | , aux_uword(in_aux_uword) 39 | { 40 | arma_extra_debug_sigprint(); 41 | } 42 | 43 | 44 | 45 | template 46 | inline 47 | CubeToMatOp::~CubeToMatOp() 48 | { 49 | arma_extra_debug_sigprint(); 50 | } 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /src/armadillo_bits/GlueCube_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup GlueCube 20 | //! @{ 21 | 22 | 23 | 24 | //! analog of the Glue class, intended for Cube objects 25 | template 26 | class GlueCube : public BaseCube< typename T1::elem_type, GlueCube > 27 | { 28 | public: 29 | 30 | typedef typename T1::elem_type elem_type; 31 | typedef typename get_pod_type::result pod_type; 32 | 33 | inline GlueCube(const BaseCube& in_A, const BaseCube& in_B); 34 | inline ~GlueCube(); 35 | 36 | const T1& A; //!< first operand; must be derived from BaseCube 37 | const T2& B; //!< second operand; must be derived from BaseCube 38 | }; 39 | 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /src/armadillo_bits/GlueCube_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup GlueCube 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | GlueCube::GlueCube(const BaseCube& in_A, const BaseCube& in_B) 27 | : A(in_A.get_ref()) 28 | , B(in_B.get_ref()) 29 | { 30 | arma_extra_debug_sigprint(); 31 | } 32 | 33 | 34 | 35 | template 36 | inline 37 | GlueCube::~GlueCube() 38 | { 39 | arma_extra_debug_sigprint(); 40 | } 41 | 42 | 43 | 44 | //! @} 45 | -------------------------------------------------------------------------------- /src/armadillo_bits/Glue_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup Glue 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | Glue::Glue(const T1& in_A, const T2& in_B) 27 | : A(in_A) 28 | , B(in_B) 29 | { 30 | arma_extra_debug_sigprint(); 31 | } 32 | 33 | 34 | 35 | template 36 | inline 37 | Glue::Glue(const T1& in_A, const T2& in_B, const uword in_aux_uword) 38 | : A(in_A) 39 | , B(in_B) 40 | , aux_uword(in_aux_uword) 41 | { 42 | arma_extra_debug_sigprint(); 43 | } 44 | 45 | 46 | 47 | template 48 | inline 49 | Glue::~Glue() 50 | { 51 | arma_extra_debug_sigprint(); 52 | } 53 | 54 | 55 | 56 | //! @} 57 | -------------------------------------------------------------------------------- /src/armadillo_bits/SizeCube_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup SizeCube 20 | //! @{ 21 | 22 | 23 | 24 | class SizeCube 25 | { 26 | public: 27 | 28 | const uword n_rows; 29 | const uword n_cols; 30 | const uword n_slices; 31 | 32 | inline explicit SizeCube(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices); 33 | 34 | inline uword operator[](const uword dim) const; 35 | inline uword operator()(const uword dim) const; 36 | 37 | inline bool operator==(const SizeCube& s) const; 38 | inline bool operator!=(const SizeCube& s) const; 39 | 40 | inline SizeCube operator+(const SizeCube& s) const; 41 | inline SizeCube operator-(const SizeCube& s) const; 42 | 43 | inline SizeCube operator+(const uword val) const; 44 | inline SizeCube operator-(const uword val) const; 45 | 46 | inline SizeCube operator*(const uword val) const; 47 | inline SizeCube operator/(const uword val) const; 48 | }; 49 | 50 | 51 | 52 | //! @} 53 | -------------------------------------------------------------------------------- /src/armadillo_bits/SizeMat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup SizeMat 20 | //! @{ 21 | 22 | 23 | 24 | class SizeMat 25 | { 26 | public: 27 | 28 | const uword n_rows; 29 | const uword n_cols; 30 | 31 | inline explicit SizeMat(const uword in_n_rows, const uword in_n_cols); 32 | 33 | inline uword operator[](const uword dim) const; 34 | inline uword operator()(const uword dim) const; 35 | 36 | inline bool operator==(const SizeMat& s) const; 37 | inline bool operator!=(const SizeMat& s) const; 38 | 39 | inline SizeMat operator+(const SizeMat& s) const; 40 | inline SizeMat operator-(const SizeMat& s) const; 41 | 42 | inline SizeMat operator+(const uword val) const; 43 | inline SizeMat operator-(const uword val) const; 44 | 45 | inline SizeMat operator*(const uword val) const; 46 | inline SizeMat operator/(const uword val) const; 47 | }; 48 | 49 | 50 | 51 | //! @} 52 | -------------------------------------------------------------------------------- /src/armadillo_bits/SpToDGlue_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup SpToDGlue 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | class SpToDGlue : public Base< typename T1::elem_type, SpToDGlue > 26 | { 27 | public: 28 | 29 | typedef typename T1::elem_type elem_type; 30 | typedef typename get_pod_type::result pod_type; 31 | 32 | inline explicit SpToDGlue(const T1& in_A, const T2& in_B); 33 | inline ~SpToDGlue(); 34 | 35 | const T1& A; //!< first operand; must be derived from Base or SpBase 36 | const T2& B; //!< second operand; must be derived from Base or SpBase 37 | 38 | static constexpr bool is_row = glue_type::template traits::is_row; 39 | static constexpr bool is_col = glue_type::template traits::is_col; 40 | static constexpr bool is_xvec = glue_type::template traits::is_xvec; 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | -------------------------------------------------------------------------------- /src/armadillo_bits/SpToDGlue_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup SpToDGlue 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | SpToDGlue::SpToDGlue(const T1& in_A, const T2& in_B) 27 | : A(in_A) 28 | , B(in_B) 29 | { 30 | arma_extra_debug_sigprint(); 31 | } 32 | 33 | 34 | 35 | template 36 | inline 37 | SpToDGlue::~SpToDGlue() 38 | { 39 | arma_extra_debug_sigprint(); 40 | } 41 | 42 | 43 | 44 | //! @} 45 | -------------------------------------------------------------------------------- /src/armadillo_bits/SpToDOp_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup SpToDOp 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | SpToDOp::SpToDOp(const T1& in_m) 27 | : m(in_m) 28 | { 29 | arma_extra_debug_sigprint(); 30 | } 31 | 32 | 33 | 34 | template 35 | inline 36 | SpToDOp::SpToDOp(const T1& in_m, const typename T1::elem_type in_aux) 37 | : m(in_m) 38 | , aux(in_aux) 39 | { 40 | arma_extra_debug_sigprint(); 41 | } 42 | 43 | 44 | 45 | template 46 | inline 47 | SpToDOp::~SpToDOp() 48 | { 49 | arma_extra_debug_sigprint(); 50 | } 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /src/armadillo_bits/arma_static_check.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup arma_static_check 20 | //! @{ 21 | 22 | 23 | #undef arma_static_check 24 | #define arma_static_check(condition, message) static_assert( !(condition), message ) 25 | 26 | #undef arma_type_check 27 | #define arma_type_check(condition) static_assert( !(condition), "error: type mismatch or unsupported type" ) 28 | 29 | 30 | //! @} 31 | -------------------------------------------------------------------------------- /src/armadillo_bits/arma_version.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup arma_version 20 | //! @{ 21 | 22 | 23 | 24 | #define ARMA_VERSION_MAJOR 12 25 | #define ARMA_VERSION_MINOR 6 26 | #define ARMA_VERSION_PATCH 7 27 | #define ARMA_VERSION_NAME "Cortisol Retox" 28 | 29 | 30 | 31 | struct arma_version 32 | { 33 | static constexpr unsigned int major = ARMA_VERSION_MAJOR; 34 | static constexpr unsigned int minor = ARMA_VERSION_MINOR; 35 | static constexpr unsigned int patch = ARMA_VERSION_PATCH; 36 | 37 | static 38 | inline 39 | std::string 40 | as_string() 41 | { 42 | const char* nickname = ARMA_VERSION_NAME; 43 | 44 | std::ostringstream ss; 45 | 46 | ss << arma_version::major 47 | << '.' 48 | << arma_version::minor 49 | << '.' 50 | << arma_version::patch 51 | << " (" 52 | << nickname 53 | << ')'; 54 | 55 | return ss.str(); 56 | } 57 | }; 58 | 59 | 60 | 61 | //! @} 62 | -------------------------------------------------------------------------------- /src/armadillo_bits/compiler_setup_post.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | #if defined(_MSC_VER) 21 | 22 | #pragma warning(pop) 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/armadillo_bits/cond_rel_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup cond_rel 20 | //! @{ 21 | 22 | 23 | // 24 | // for preventing pedantic compiler warnings 25 | 26 | template 27 | class cond_rel 28 | { 29 | public: 30 | 31 | template arma_inline static bool lt(const eT A, const eT B); 32 | template arma_inline static bool gt(const eT A, const eT B); 33 | 34 | template arma_inline static bool leq(const eT A, const eT B); 35 | template arma_inline static bool geq(const eT A, const eT B); 36 | 37 | template arma_inline static eT make_neg(const eT val); 38 | }; 39 | 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /src/armadillo_bits/def_fftw3.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | #if defined(ARMA_USE_FFTW3) 20 | 21 | 22 | extern "C" 23 | { 24 | // function prefix for single precision: fftwf_ 25 | // function prefix for double precision: fftw_ 26 | 27 | 28 | // single precision (float) 29 | 30 | void_ptr fftwf_plan_dft_1d(int N, void* input, void* output, int fftw3_sign, unsigned int fftw3_flags); 31 | 32 | void fftwf_execute(void_ptr plan); 33 | void fftwf_destroy_plan(void_ptr plan); 34 | 35 | void fftwf_cleanup(); 36 | 37 | 38 | // double precision (double) 39 | 40 | void_ptr fftw_plan_dft_1d(int N, void* input, void* output, int fftw3_sign, unsigned int fftw3_flags); 41 | 42 | void fftw_execute(void_ptr plan); 43 | void fftw_destroy_plan(void_ptr plan); 44 | 45 | void fftw_cleanup(); 46 | } 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_cor.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_cor 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | arma_warn_unused 26 | inline 27 | const Op 28 | cor(const Base& X, const uword norm_type = 0) 29 | { 30 | arma_extra_debug_sigprint(); 31 | 32 | arma_debug_check( (norm_type > 1), "cor(): parameter 'norm_type' must be 0 or 1" ); 33 | 34 | return Op(X.get_ref(), norm_type, 0); 35 | } 36 | 37 | 38 | 39 | template 40 | arma_warn_unused 41 | inline 42 | const Glue 43 | cor(const Base& A, const Base& B, const uword norm_type = 0) 44 | { 45 | arma_extra_debug_sigprint(); 46 | 47 | arma_debug_check( (norm_type > 1), "cor(): parameter 'norm_type' must be 0 or 1" ); 48 | 49 | return Glue(A.get_ref(), B.get_ref(), norm_type); 50 | } 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_cov.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_cov 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | arma_warn_unused 26 | inline 27 | const Op 28 | cov(const Base& X, const uword norm_type = 0) 29 | { 30 | arma_extra_debug_sigprint(); 31 | 32 | arma_debug_check( (norm_type > 1), "cov(): parameter 'norm_type' must be 0 or 1" ); 33 | 34 | return Op(X.get_ref(), norm_type, 0); 35 | } 36 | 37 | 38 | 39 | template 40 | arma_warn_unused 41 | inline 42 | const Glue 43 | cov(const Base& A, const Base& B, const uword norm_type = 0) 44 | { 45 | arma_extra_debug_sigprint(); 46 | 47 | arma_debug_check( (norm_type > 1), "cov(): parameter 'norm_type' must be 0 or 1" ); 48 | 49 | return Glue(A.get_ref(), B.get_ref(), norm_type); 50 | } 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_cross.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_cross 20 | //! @{ 21 | 22 | 23 | 24 | //! cross product (only valid for 3 dimensional vectors) 25 | template 26 | arma_warn_unused 27 | inline 28 | typename 29 | enable_if2 30 | < 31 | is_arma_type::value && is_arma_type::value && is_same_type::value, 32 | const Glue 33 | >::result 34 | cross(const T1& X, const T2& Y) 35 | { 36 | arma_extra_debug_sigprint(); 37 | 38 | return Glue(X, Y); 39 | } 40 | 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_kmeans.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_kmeans 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | typename enable_if2::value, bool>::result 27 | kmeans 28 | ( 29 | Mat& means, 30 | const Base& data, 31 | const uword k, 32 | const gmm_seed_mode& seed_mode, 33 | const uword n_iter, 34 | const bool print_mode 35 | ) 36 | { 37 | arma_extra_debug_sigprint(); 38 | 39 | typedef typename T1::elem_type eT; 40 | 41 | gmm_priv::gmm_diag model; 42 | 43 | const bool status = model.kmeans_wrapper(means, data.get_ref(), k, seed_mode, n_iter, print_mode); 44 | 45 | if(status) 46 | { 47 | means = model.means; 48 | } 49 | else 50 | { 51 | means.soft_reset(); 52 | } 53 | 54 | return status; 55 | } 56 | 57 | 58 | 59 | //! @} 60 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_nonzeros.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_nonzeros 20 | //! @{ 21 | 22 | 23 | template 24 | arma_warn_unused 25 | inline 26 | const Op 27 | nonzeros(const Base& X) 28 | { 29 | arma_extra_debug_sigprint(); 30 | 31 | return Op(X.get_ref()); 32 | } 33 | 34 | 35 | 36 | template 37 | arma_warn_unused 38 | inline 39 | const SpToDOp 40 | nonzeros(const SpBase& X) 41 | { 42 | arma_extra_debug_sigprint(); 43 | 44 | return SpToDOp(X.get_ref()); 45 | } 46 | 47 | 48 | 49 | //! @} 50 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_polyval.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_polyval 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | arma_warn_unused 26 | inline 27 | typename 28 | enable_if2 29 | < 30 | (is_supported_blas_type::value && is_arma_type::value && is_same_type::value), 31 | const Glue 32 | >::result 33 | polyval(const Base& P, const T2& X) 34 | { 35 | arma_extra_debug_sigprint(); 36 | 37 | return Glue(P.get_ref(), X); 38 | } 39 | 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_repelem.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup fn_repelem 21 | //! @{ 22 | 23 | 24 | template 25 | arma_warn_unused 26 | arma_inline 27 | typename 28 | enable_if2 29 | < 30 | is_arma_type::value, 31 | const Op 32 | >::result 33 | repelem(const T1& A, const uword r, const uword c) 34 | { 35 | arma_extra_debug_sigprint(); 36 | 37 | return Op(A, r, c); 38 | } 39 | 40 | 41 | 42 | template 43 | arma_warn_unused 44 | arma_inline 45 | const SpOp 46 | repelem(const SpBase& A, const uword r, const uword c) 47 | { 48 | arma_extra_debug_sigprint(); 49 | 50 | return SpOp(A.get_ref(), r, c); 51 | } 52 | 53 | 54 | 55 | //! @} 56 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_repmat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup fn_repmat 21 | //! @{ 22 | 23 | 24 | template 25 | arma_warn_unused 26 | arma_inline 27 | typename 28 | enable_if2 29 | < 30 | is_arma_type::value, 31 | const Op 32 | >::result 33 | repmat(const T1& A, const uword r, const uword c) 34 | { 35 | arma_extra_debug_sigprint(); 36 | 37 | return Op(A, r, c); 38 | } 39 | 40 | 41 | 42 | template 43 | arma_warn_unused 44 | arma_inline 45 | const SpOp 46 | repmat(const SpBase& A, const uword r, const uword c) 47 | { 48 | arma_extra_debug_sigprint(); 49 | 50 | return SpOp(A.get_ref(), r, c); 51 | } 52 | 53 | 54 | 55 | //! @} 56 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_spones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_spones 20 | //! @{ 21 | 22 | 23 | 24 | //! Generate a sparse matrix with the non-zero values in the same locations as in the given sparse matrix X, 25 | //! with the non-zero values set to one 26 | template 27 | arma_warn_unused 28 | inline 29 | SpMat 30 | spones(const SpBase& X) 31 | { 32 | arma_extra_debug_sigprint(); 33 | 34 | typedef typename T1::elem_type eT; 35 | 36 | const unwrap_spmat U(X.get_ref()); 37 | 38 | SpMat out(arma_layout_indicator(), U.M); 39 | 40 | arrayops::inplace_set( access::rwp(out.values), eT(1), out.n_nonzero ); 41 | 42 | return out; 43 | } 44 | 45 | 46 | 47 | //! @} 48 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_trapz.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_trapz 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | arma_warn_unused 26 | inline 27 | const Glue 28 | trapz 29 | ( 30 | const Base& X, 31 | const Base& Y, 32 | const uword dim = 0 33 | ) 34 | { 35 | arma_extra_debug_sigprint(); 36 | 37 | return Glue(X.get_ref(), Y.get_ref(), dim); 38 | } 39 | 40 | 41 | 42 | template 43 | arma_warn_unused 44 | inline 45 | const Op 46 | trapz 47 | ( 48 | const Base& Y, 49 | const uword dim = 0 50 | ) 51 | { 52 | arma_extra_debug_sigprint(); 53 | 54 | return Op(Y.get_ref(), dim, uword(0)); 55 | } 56 | 57 | 58 | 59 | //! @} 60 | -------------------------------------------------------------------------------- /src/armadillo_bits/fn_unique.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup fn_unique 20 | //! @{ 21 | 22 | 23 | template 24 | arma_warn_unused 25 | inline 26 | typename 27 | enable_if2 28 | < 29 | is_arma_type::value && resolves_to_vector::yes, 30 | const Op 31 | >::result 32 | unique(const T1& A) 33 | { 34 | arma_extra_debug_sigprint(); 35 | 36 | return Op(A); 37 | } 38 | 39 | 40 | template 41 | arma_warn_unused 42 | inline 43 | typename 44 | enable_if2 45 | < 46 | is_arma_type::value && resolves_to_vector::no, 47 | const Op 48 | >::result 49 | unique(const T1& A) 50 | { 51 | arma_extra_debug_sigprint(); 52 | 53 | return Op(A); 54 | } 55 | 56 | 57 | //! @} 58 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_atan2_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_atan2 21 | //! @{ 22 | 23 | 24 | 25 | class glue_atan2 26 | : public traits_glue_or 27 | { 28 | public: 29 | 30 | 31 | // matrices 32 | 33 | template inline static void apply(Mat& out, const Glue& expr); 34 | 35 | template inline static void apply_noalias(Mat& out, const Proxy& P1, const Proxy& P2); 36 | 37 | 38 | // cubes 39 | 40 | template inline static void apply(Cube& out, const GlueCube& expr); 41 | 42 | template inline static void apply_noalias(Cube& out, const ProxyCube& P1, const ProxyCube& P2); 43 | }; 44 | 45 | 46 | 47 | //! @} 48 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_cor_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_cor 21 | //! @{ 22 | 23 | 24 | 25 | class glue_cor 26 | { 27 | public: 28 | 29 | template 30 | struct traits 31 | { 32 | static constexpr bool is_row = false; // T1::is_col; // TODO: check 33 | static constexpr bool is_col = false; // T2::is_col; // TODO: check 34 | static constexpr bool is_xvec = false; 35 | }; 36 | 37 | template inline static void apply(Mat& out, const Glue& X); 38 | }; 39 | 40 | 41 | 42 | //! @} 43 | 44 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_cov_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_cov 21 | //! @{ 22 | 23 | 24 | 25 | class glue_cov 26 | { 27 | public: 28 | 29 | template 30 | struct traits 31 | { 32 | static constexpr bool is_row = false; // T1::is_col; // TODO: check 33 | static constexpr bool is_col = false; // T2::is_col; // TODO: check 34 | static constexpr bool is_xvec = false; 35 | }; 36 | 37 | template inline static void apply(Mat& out, const Glue& X); 38 | }; 39 | 40 | 41 | 42 | //! @} 43 | 44 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_cross_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_cross 21 | //! @{ 22 | 23 | 24 | 25 | class glue_cross 26 | { 27 | public: 28 | 29 | template 30 | struct traits 31 | { 32 | static constexpr bool is_row = T1::is_row; 33 | static constexpr bool is_col = T1::is_col; 34 | static constexpr bool is_xvec = true; 35 | }; 36 | 37 | template inline static void apply(Mat& out, const Glue& X); 38 | }; 39 | 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_hist_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup glue_hist 20 | //! @{ 21 | 22 | 23 | class glue_hist 24 | : public traits_glue_default 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply_noalias(Mat& out, const Mat& X, const Mat& C, const uword dim); 30 | 31 | template 32 | inline static void apply(Mat& out, const mtGlue& expr); 33 | }; 34 | 35 | 36 | 37 | class glue_hist_default 38 | { 39 | public: 40 | 41 | template 42 | struct traits 43 | { 44 | static constexpr bool is_row = T1::is_row; 45 | static constexpr bool is_col = T1::is_col; 46 | static constexpr bool is_xvec = T1::is_xvec; 47 | }; 48 | 49 | template 50 | inline static void apply(Mat& out, const mtGlue& expr); 51 | }; 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_histc_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup glue_histc 20 | //! @{ 21 | 22 | 23 | class glue_histc 24 | : public traits_glue_default 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply_noalias(Mat& C, const Mat& A, const Mat& B, const uword dim); 30 | 31 | template 32 | inline static void apply(Mat& C, const mtGlue& expr); 33 | }; 34 | 35 | 36 | 37 | class glue_histc_default 38 | { 39 | public: 40 | 41 | template 42 | struct traits 43 | { 44 | static constexpr bool is_row = T1::is_row; 45 | static constexpr bool is_col = T1::is_col; 46 | static constexpr bool is_xvec = T1::is_xvec; 47 | }; 48 | 49 | template 50 | inline static void apply(Mat& C, const mtGlue& expr); 51 | }; 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_hypot_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_hypot 21 | //! @{ 22 | 23 | 24 | 25 | class glue_hypot 26 | : public traits_glue_or 27 | { 28 | public: 29 | 30 | 31 | // matrices 32 | 33 | template inline static void apply(Mat& out, const Glue& expr); 34 | 35 | template inline static void apply_noalias(Mat& out, const Proxy& P1, const Proxy& P2); 36 | 37 | 38 | // cubes 39 | 40 | template inline static void apply(Cube& out, const GlueCube& expr); 41 | 42 | template inline static void apply_noalias(Cube& out, const ProxyCube& P1, const ProxyCube& P2); 43 | }; 44 | 45 | 46 | 47 | //! @} 48 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_intersect_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup glue_intersect 20 | //! @{ 21 | 22 | 23 | 24 | class glue_intersect 25 | { 26 | public: 27 | 28 | template 29 | struct traits 30 | { 31 | static constexpr bool is_row = (T1::is_row && T2::is_row); 32 | static constexpr bool is_col = (T1::is_col || T2::is_col); 33 | static constexpr bool is_xvec = false; 34 | }; 35 | 36 | template 37 | inline static void apply(Mat& out, const Glue& X); 38 | 39 | template 40 | inline static void apply(Mat& out, uvec& iA, uvec& iB, const Base& A_expr, const Base& B_expr, const bool calc_indx); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | 47 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_max_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_max 21 | //! @{ 22 | 23 | 24 | 25 | class glue_max 26 | : public traits_glue_or 27 | { 28 | public: 29 | 30 | // dense matrices 31 | 32 | template inline static void apply(Mat& out, const Glue& X); 33 | 34 | template inline static void apply(Mat& out, const Proxy& PA, const Proxy& PB); 35 | 36 | 37 | // cubes 38 | 39 | template inline static void apply(Cube& out, const GlueCube& X); 40 | 41 | template inline static void apply(Cube& out, const ProxyCube& PA, const ProxyCube& PB); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | 48 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_min_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_min 21 | //! @{ 22 | 23 | 24 | 25 | class glue_min 26 | : public traits_glue_or 27 | { 28 | public: 29 | 30 | // dense matrices 31 | 32 | template inline static void apply(Mat& out, const Glue& X); 33 | 34 | template inline static void apply(Mat& out, const Proxy& PA, const Proxy& PB); 35 | 36 | 37 | // cubes 38 | 39 | template inline static void apply(Cube& out, const GlueCube& X); 40 | 41 | template inline static void apply(Cube& out, const ProxyCube& PA, const ProxyCube& PB); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | 48 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_polyfit_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_polyfit 21 | //! @{ 22 | 23 | 24 | 25 | class glue_polyfit 26 | { 27 | public: 28 | 29 | template 30 | struct traits 31 | { 32 | static constexpr bool is_row = false; 33 | static constexpr bool is_col = true; 34 | static constexpr bool is_xvec = false; 35 | }; 36 | 37 | template inline static bool apply_noalias(Mat& out, const Col& X, const Col& Y, const uword N); 38 | 39 | template inline static bool apply_direct(Mat& out, const Base& X_expr, const Base& Y_expr, const uword N); 40 | 41 | template inline static void apply(Mat& out, const Glue& expr); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | 48 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_polyval_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_polyval 21 | //! @{ 22 | 23 | 24 | 25 | class glue_polyval 26 | { 27 | public: 28 | 29 | template 30 | struct traits 31 | { 32 | static constexpr bool is_row = T2::is_row; 33 | static constexpr bool is_col = T2::is_col; 34 | static constexpr bool is_xvec = T2::is_xvec; 35 | }; 36 | 37 | template inline static void apply_noalias(Mat& out, const Mat& P, const Mat& X); 38 | 39 | template inline static void apply(Mat& out, const Glue& expr); 40 | }; 41 | 42 | 43 | 44 | //! @} 45 | 46 | -------------------------------------------------------------------------------- /src/armadillo_bits/glue_toeplitz_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup glue_toeplitz 21 | //! @{ 22 | 23 | 24 | 25 | class glue_toeplitz 26 | : public traits_glue_default 27 | { 28 | public: 29 | 30 | template inline static void apply(Mat& out, const Glue& in); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /src/armadillo_bits/include_hdf5.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | #if defined(ARMA_USE_HDF5) 20 | 21 | #undef H5_USE_110_API 22 | #define H5_USE_110_API 23 | 24 | #if defined(__has_include) 25 | #if __has_include() 26 | #include 27 | #else 28 | #undef ARMA_USE_HDF5 29 | #pragma message ("WARNING: use of HDF5 disabled; hdf5.h header not found") 30 | #endif 31 | #else 32 | #include 33 | #endif 34 | 35 | #if defined(H5_USE_16_API) || defined(H5_USE_16_API_DEFAULT) 36 | #pragma message ("WARNING: use of HDF5 disabled; incompatible configuration: H5_USE_16_API or H5_USE_16_API_DEFAULT") 37 | #undef ARMA_USE_HDF5 38 | #endif 39 | 40 | // // TODO 41 | // #if defined(H5_USE_18_API) || defined(H5_USE_18_API_DEFAULT) 42 | // #pragma message ("WARNING: detected possibly incompatible configuration of HDF5: H5_USE_18_API or H5_USE_18_API_DEFAULT") 43 | // #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/armadillo_bits/mtGlueCube_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup mtGlueCube 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | class mtGlueCube : public BaseCube< out_eT, mtGlueCube > 26 | { 27 | public: 28 | 29 | typedef out_eT elem_type; 30 | typedef typename get_pod_type::result pod_type; 31 | 32 | arma_inline mtGlueCube(const T1& in_A, const T2& in_B); 33 | arma_inline mtGlueCube(const T1& in_A, const T2& in_B, const uword in_aux_uword); 34 | arma_inline ~mtGlueCube(); 35 | 36 | arma_aligned const T1& A; //!< first operand; must be derived from BaseCube 37 | arma_aligned const T2& B; //!< second operand; must be derived from BaseCube 38 | arma_aligned uword aux_uword; //!< storage of auxiliary data, uword format 39 | }; 40 | 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /src/armadillo_bits/mtGlueCube_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup mtGlueCube 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | mtGlueCube::mtGlueCube(const T1& in_A, const T2& in_B) 27 | : A(in_A) 28 | , B(in_B) 29 | { 30 | arma_extra_debug_sigprint(); 31 | } 32 | 33 | 34 | 35 | template 36 | inline 37 | mtGlueCube::mtGlueCube(const T1& in_A, const T2& in_B, const uword in_aux_uword) 38 | : A(in_A) 39 | , B(in_B) 40 | , aux_uword(in_aux_uword) 41 | { 42 | arma_extra_debug_sigprint(); 43 | } 44 | 45 | 46 | 47 | template 48 | inline 49 | mtGlueCube::~mtGlueCube() 50 | { 51 | arma_extra_debug_sigprint(); 52 | } 53 | 54 | 55 | 56 | //! @} 57 | -------------------------------------------------------------------------------- /src/armadillo_bits/mtGlue_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup mtGlue 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | mtGlue::mtGlue(const T1& in_A, const T2& in_B) 27 | : A(in_A) 28 | , B(in_B) 29 | { 30 | arma_extra_debug_sigprint(); 31 | } 32 | 33 | 34 | 35 | template 36 | inline 37 | mtGlue::mtGlue(const T1& in_A, const T2& in_B, const uword in_aux_uword) 38 | : A(in_A) 39 | , B(in_B) 40 | , aux_uword(in_aux_uword) 41 | { 42 | arma_extra_debug_sigprint(); 43 | } 44 | 45 | 46 | 47 | template 48 | inline 49 | mtGlue::~mtGlue() 50 | { 51 | arma_extra_debug_sigprint(); 52 | } 53 | 54 | 55 | 56 | //! @} 57 | -------------------------------------------------------------------------------- /src/armadillo_bits/mtSpGlue_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup mtSpGlue 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | mtSpGlue::mtSpGlue(const T1& in_A, const T2& in_B) 27 | : A(in_A) 28 | , B(in_B) 29 | { 30 | arma_extra_debug_sigprint(); 31 | } 32 | 33 | 34 | 35 | template 36 | inline 37 | mtSpGlue::~mtSpGlue() 38 | { 39 | arma_extra_debug_sigprint(); 40 | } 41 | 42 | 43 | 44 | template 45 | template 46 | arma_inline 47 | bool 48 | mtSpGlue::is_alias(const SpMat& X) const 49 | { 50 | return (A.is_alias(X) || B.is_alias(X)); 51 | } 52 | 53 | 54 | 55 | //! @} 56 | -------------------------------------------------------------------------------- /src/armadillo_bits/newarp_DenseGenMatProd_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | namespace newarp 20 | { 21 | 22 | 23 | //! Define matrix operations on existing matrix objects 24 | template 25 | class DenseGenMatProd 26 | { 27 | private: 28 | 29 | const Mat& op_mat; 30 | 31 | 32 | public: 33 | 34 | const uword n_rows; // number of rows of the underlying matrix 35 | const uword n_cols; // number of columns of the underlying matrix 36 | 37 | inline DenseGenMatProd(const Mat& mat_obj); 38 | 39 | inline void perform_op(eT* x_in, eT* y_out) const; 40 | }; 41 | 42 | 43 | } // namespace newarp 44 | -------------------------------------------------------------------------------- /src/armadillo_bits/newarp_DenseGenMatProd_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | namespace newarp 20 | { 21 | 22 | 23 | template 24 | inline 25 | DenseGenMatProd::DenseGenMatProd(const Mat& mat_obj) 26 | : op_mat(mat_obj) 27 | , n_rows(mat_obj.n_rows) 28 | , n_cols(mat_obj.n_cols) 29 | { 30 | arma_extra_debug_sigprint(); 31 | } 32 | 33 | 34 | 35 | // Perform the matrix-vector multiplication operation \f$y=Ax\f$. 36 | // y_out = A * x_in 37 | template 38 | inline 39 | void 40 | DenseGenMatProd::perform_op(eT* x_in, eT* y_out) const 41 | { 42 | arma_extra_debug_sigprint(); 43 | 44 | const Col x(x_in , n_cols, false, true); 45 | Col y(y_out, n_rows, false, true); 46 | 47 | y = op_mat * x; 48 | } 49 | 50 | 51 | } // namespace newarp 52 | -------------------------------------------------------------------------------- /src/armadillo_bits/newarp_SparseGenMatProd_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | namespace newarp 20 | { 21 | 22 | 23 | //! Define matrix operations on existing matrix objects 24 | template 25 | class SparseGenMatProd 26 | { 27 | private: 28 | 29 | const SpMat& op_mat; 30 | SpMat op_mat_st; 31 | 32 | 33 | public: 34 | 35 | const uword n_rows; // number of rows of the underlying matrix 36 | const uword n_cols; // number of columns of the underlying matrix 37 | 38 | inline SparseGenMatProd(const SpMat& mat_obj); 39 | 40 | inline void perform_op(eT* x_in, eT* y_out) const; 41 | }; 42 | 43 | 44 | } // namespace newarp 45 | -------------------------------------------------------------------------------- /src/armadillo_bits/newarp_SparseGenRealShiftSolve_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | namespace newarp 20 | { 21 | 22 | 23 | //! Define matrix operations on existing matrix objects 24 | template 25 | class SparseGenRealShiftSolve 26 | { 27 | private: 28 | 29 | #if defined(ARMA_USE_SUPERLU) 30 | // The following objects are read-only in perform_op() 31 | mutable superlu_supermatrix_wrangler l; 32 | mutable superlu_supermatrix_wrangler u; 33 | mutable superlu_array_wrangler perm_c; 34 | mutable superlu_array_wrangler perm_r; 35 | #endif 36 | 37 | 38 | public: 39 | 40 | bool valid = false; 41 | 42 | const uword n_rows; // number of rows of the underlying matrix 43 | const uword n_cols; // number of columns of the underlying matrix 44 | 45 | inline SparseGenRealShiftSolve(const SpMat& mat_obj, const eT shift); 46 | 47 | inline void perform_op(eT* x_in, eT* y_out) const; 48 | }; 49 | 50 | 51 | } // namespace newarp 52 | -------------------------------------------------------------------------------- /src/armadillo_bits/newarp_SymEigsShiftSolver_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | namespace newarp 20 | { 21 | 22 | 23 | //! This class implements the eigen solver for real symmetric matrices in the shift-and-invert mode. 24 | template 25 | class SymEigsShiftSolver : public SymEigsSolver 26 | { 27 | private: 28 | 29 | const eT sigma; 30 | 31 | // Sort the first nev Ritz pairs in ascending algebraic order 32 | // This is used to return the final results 33 | void sort_ritzpair(); 34 | 35 | 36 | public: 37 | 38 | //! Constructor to create a solver object. 39 | inline SymEigsShiftSolver(const OpType& op_, uword nev_, uword ncv_, const eT sigma_); 40 | }; 41 | 42 | 43 | } // namespace newarp 44 | -------------------------------------------------------------------------------- /src/armadillo_bits/newarp_SymEigsShiftSolver_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | namespace newarp 20 | { 21 | 22 | 23 | template 24 | inline 25 | void 26 | SymEigsShiftSolver::sort_ritzpair() 27 | { 28 | arma_extra_debug_sigprint(); 29 | 30 | // First transform back the Ritz values, and then sort 31 | for(uword i = 0; i < this->nev; i++) 32 | { 33 | this->ritz_val(i) = eT(1.0) / this->ritz_val(i) + sigma; 34 | } 35 | SymEigsSolver::sort_ritzpair(); 36 | } 37 | 38 | 39 | 40 | template 41 | inline 42 | SymEigsShiftSolver::SymEigsShiftSolver(const OpType& op_, uword nev_, uword ncv_, const eT sigma_) 43 | : SymEigsSolver::SymEigsSolver(op_, nev_, ncv_) 44 | , sigma(sigma_) 45 | { 46 | arma_extra_debug_sigprint(); 47 | } 48 | 49 | 50 | } // namespace newarp 51 | -------------------------------------------------------------------------------- /src/armadillo_bits/newarp_cx_attrib.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | namespace newarp 20 | { 21 | 22 | 23 | //! Tiny functions to check attributes of complex numbers 24 | struct cx_attrib 25 | { 26 | template 27 | arma_inline static bool is_real (const std::complex& v, const T eps) { return (std::abs(v.imag()) <= eps); } 28 | 29 | template 30 | arma_inline static bool is_complex(const std::complex& v, const T eps) { return (std::abs(v.imag()) > eps); } 31 | 32 | template 33 | arma_inline static bool is_conj(const std::complex& v1, const std::complex& v2, const T eps) { return (std::abs(v1 - std::conj(v2)) <= eps); } 34 | }; 35 | 36 | 37 | } // namespace newarp 38 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_chi2rnd_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_chi2rnd 20 | //! @{ 21 | 22 | 23 | class op_chi2rnd 24 | : public traits_op_passthru 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply(Mat& out, const Op& in); 30 | 31 | template 32 | inline static void apply_noalias(Mat& out, const Proxy& P); 33 | 34 | template 35 | inline static void fill_constant_df(Mat& out, const eT df); 36 | }; 37 | 38 | 39 | 40 | template 41 | class op_chi2rnd_varying_df 42 | { 43 | public: 44 | 45 | arma_aligned std::mt19937_64 motor; 46 | 47 | inline ~op_chi2rnd_varying_df(); 48 | inline op_chi2rnd_varying_df(); 49 | 50 | inline eT operator()(const eT df); 51 | }; 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_chol_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_chol 20 | //! @{ 21 | 22 | 23 | 24 | class op_chol 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply(Mat& out, const Op& X); 31 | 32 | template 33 | inline static bool apply_direct(Mat& out, const Base& A_expr, const uword layout); 34 | }; 35 | 36 | 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_col_as_mat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_col_as_mat 20 | //! @{ 21 | 22 | 23 | class op_col_as_mat 24 | : public traits_op_default 25 | { 26 | public: 27 | 28 | template inline static void apply(Mat& out, const CubeToMatOp& expr); 29 | }; 30 | 31 | 32 | 33 | //! @} 34 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_col_as_mat_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_col_as_mat 20 | //! @{ 21 | 22 | 23 | 24 | template 25 | inline 26 | void 27 | op_col_as_mat::apply(Mat& out, const CubeToMatOp& expr) 28 | { 29 | arma_extra_debug_sigprint(); 30 | 31 | typedef typename T1::elem_type eT; 32 | 33 | const unwrap_cube U(expr.m); 34 | const Cube& A = U.M; 35 | 36 | const uword in_col = expr.aux_uword; 37 | 38 | arma_debug_check_bounds( (in_col >= A.n_cols), "Cube::col_as_mat(): index out of bounds" ); 39 | 40 | const uword A_n_rows = A.n_rows; 41 | const uword A_n_slices = A.n_slices; 42 | 43 | out.set_size(A_n_rows, A_n_slices); 44 | 45 | for(uword s=0; s < A_n_slices; ++s) 46 | { 47 | arrayops::copy(out.colptr(s), A.slice_colptr(s, in_col), A_n_rows); 48 | } 49 | } 50 | 51 | 52 | 53 | //! @} 54 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_cond_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_cond 20 | //! @{ 21 | 22 | 23 | class op_cond 24 | : public traits_op_default 25 | { 26 | public: 27 | 28 | template static inline typename T1::pod_type apply(const Base& X); 29 | 30 | template static inline typename get_pod_type::result apply_diag(const Mat& A); 31 | template static inline typename get_pod_type::result apply_sym ( Mat& A); 32 | template static inline typename get_pod_type::result apply_gen ( Mat& A); 33 | }; 34 | 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_cor_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_cor 21 | //! @{ 22 | 23 | 24 | 25 | class op_cor 26 | : public traits_op_default 27 | { 28 | public: 29 | 30 | template inline static void apply(Mat& out, const Op< T1, op_cor>& in); 31 | template inline static void apply(Mat& out, const Op< Op, op_cor>& in); 32 | }; 33 | 34 | 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_cov_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_cov 21 | //! @{ 22 | 23 | 24 | 25 | class op_cov 26 | : public traits_op_default 27 | { 28 | public: 29 | 30 | template inline static void apply(Mat& out, const Op< T1, op_cov>& in); 31 | template inline static void apply(Mat& out, const Op< Op, op_cov>& in); 32 | }; 33 | 34 | 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_cumprod_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_cumprod 20 | //! @{ 21 | 22 | 23 | 24 | class op_cumprod 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 31 | 32 | template 33 | inline static void apply(Mat& out, const Op& in); 34 | }; 35 | 36 | 37 | 38 | class op_cumprod_vec 39 | : public traits_op_passthru 40 | { 41 | public: 42 | 43 | template 44 | inline static void apply(Mat& out, const Op& in); 45 | }; 46 | 47 | 48 | 49 | //! @} 50 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_cumsum_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_cumsum 20 | //! @{ 21 | 22 | 23 | 24 | class op_cumsum 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 31 | 32 | template 33 | inline static void apply(Mat& out, const Op& in); 34 | }; 35 | 36 | 37 | 38 | class op_cumsum_vec 39 | : public traits_op_passthru 40 | { 41 | public: 42 | 43 | template 44 | inline static void apply(Mat& out, const Op& in); 45 | }; 46 | 47 | 48 | 49 | //! @} 50 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_diff_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_diff 20 | //! @{ 21 | 22 | 23 | 24 | class op_diff 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply_noalias(Mat& out, const Mat& X, const uword k, const uword dim); 31 | 32 | template 33 | inline static void apply(Mat& out, const Op& in); 34 | }; 35 | 36 | 37 | 38 | class op_diff_vec 39 | : public traits_op_passthru 40 | { 41 | public: 42 | 43 | template 44 | inline static void apply(Mat& out, const Op& in); 45 | }; 46 | 47 | 48 | 49 | //! @} 50 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_dotext_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_dotext 20 | //! @{ 21 | 22 | 23 | 24 | class op_dotext 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | 30 | template 31 | inline static eT direct_rowvec_mat_colvec (const eT* A_mem, const Mat& B, const eT* C_mem); 32 | 33 | template 34 | inline static eT direct_rowvec_transmat_colvec (const eT* A_mem, const Mat& B, const eT* C_mem); 35 | 36 | template 37 | inline static eT direct_rowvec_diagmat_colvec (const eT* A_mem, const Mat& B, const eT* C_mem); 38 | 39 | template 40 | inline static eT direct_rowvec_invdiagmat_colvec(const eT* A_mem, const Mat& B, const eT* C_mem); 41 | 42 | template 43 | inline static eT direct_rowvec_invdiagvec_colvec(const eT* A_mem, const Mat& B, const eT* C_mem); 44 | 45 | }; 46 | 47 | 48 | 49 | //! @} 50 | 51 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_expmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_expmat 21 | //! @{ 22 | 23 | 24 | 25 | class op_expmat 26 | : public traits_op_default 27 | { 28 | public: 29 | 30 | template 31 | inline static void apply(Mat& out, const Op& expr); 32 | 33 | template 34 | inline static bool apply_direct(Mat& out, const Base& X); 35 | }; 36 | 37 | 38 | 39 | class op_expmat_sym 40 | : public traits_op_default 41 | { 42 | public: 43 | 44 | template 45 | inline static void apply(Mat& out, const Op& in); 46 | 47 | template 48 | inline static bool apply_direct(Mat& out, const Base& expr); 49 | }; 50 | 51 | 52 | 53 | //! @} 54 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_hist_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_hist 21 | //! @{ 22 | 23 | 24 | 25 | class op_hist 26 | : public traits_op_passthru 27 | { 28 | public: 29 | 30 | template 31 | inline static void apply_noalias(Mat& out, const Mat& A, const uword n_bins, const uword dim); 32 | 33 | template 34 | inline static void apply(Mat& out, const mtOp& X); 35 | }; 36 | 37 | 38 | 39 | //! @} 40 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_nonzeros_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_nonzeros 21 | //! @{ 22 | 23 | 24 | 25 | class op_nonzeros 26 | : public traits_op_col 27 | { 28 | public: 29 | 30 | // for dense matrices 31 | 32 | template 33 | static inline void apply_noalias(Mat& out, const Proxy& P); 34 | 35 | template 36 | static inline void apply(Mat& out, const Op& X); 37 | }; 38 | 39 | 40 | 41 | class op_nonzeros_spmat 42 | : public traits_op_col 43 | { 44 | public: 45 | 46 | template 47 | static inline void apply(Mat& out, const SpToDOp& X); 48 | }; 49 | 50 | 51 | 52 | //! @} 53 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_normalise_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_normalise 21 | //! @{ 22 | 23 | 24 | 25 | class op_normalise_vec 26 | : public traits_op_passthru 27 | { 28 | public: 29 | 30 | template inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | class op_normalise_mat 36 | : public traits_op_default 37 | { 38 | public: 39 | 40 | template inline static void apply(Mat& out, const Op& in); 41 | 42 | template inline static void apply(Mat& out, const Mat& A, const uword p, const uword dim); 43 | }; 44 | 45 | 46 | 47 | //! @} 48 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_orth_null_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_orth_null 21 | //! @{ 22 | 23 | 24 | 25 | class op_orth 26 | : public traits_op_default 27 | { 28 | public: 29 | 30 | template 31 | inline static void apply(Mat& out, const Op& expr); 32 | 33 | template 34 | inline static bool apply_direct(Mat& out, const Base& expr, typename T1::pod_type tol); 35 | }; 36 | 37 | 38 | 39 | class op_null 40 | : public traits_op_default 41 | { 42 | public: 43 | 44 | template 45 | inline static void apply(Mat& out, const Op& expr); 46 | 47 | template 48 | inline static bool apply_direct(Mat& out, const Base& expr, typename T1::pod_type tol); 49 | }; 50 | 51 | 52 | 53 | //! @} 54 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_prod_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_prod 20 | //! @{ 21 | 22 | 23 | class op_prod 24 | : public traits_op_xvec 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 30 | 31 | template 32 | inline static void apply(Mat& out, const Op& in); 33 | 34 | template 35 | inline static eT prod(const subview& S); 36 | 37 | template 38 | inline static typename T1::elem_type prod(const Base& X); 39 | }; 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_range_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_range 20 | //! @{ 21 | 22 | 23 | class op_range 24 | : public traits_op_xvec 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply(Mat& out, const Op& in); 30 | 31 | template 32 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 33 | 34 | template 35 | inline static typename T1::elem_type vector_range(const T1& expr); 36 | }; 37 | 38 | 39 | 40 | //! @} 41 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_rank_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_rank 21 | //! @{ 22 | 23 | 24 | 25 | class op_rank 26 | : public traits_op_default 27 | { 28 | public: 29 | 30 | template inline static bool apply(uword& out, const Base& expr, const typename T1::pod_type tol); 31 | 32 | template inline static bool apply_gen(uword& out, Mat& A, typename get_pod_type::result tol); 33 | 34 | template inline static bool apply_sym(uword& out, Mat& A, typename get_pod_type::result tol); 35 | 36 | template inline static bool apply_diag(uword& out, Mat& A, typename get_pod_type::result tol); 37 | }; 38 | 39 | 40 | 41 | //! @} 42 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_rcond_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_rcond 20 | //! @{ 21 | 22 | 23 | class op_rcond 24 | : public traits_op_default 25 | { 26 | public: 27 | 28 | template static inline typename T1::pod_type apply(const Base& X); 29 | }; 30 | 31 | 32 | //! @} 33 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_repelem_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_repelem 21 | //! @{ 22 | 23 | 24 | 25 | class op_repelem 26 | : public traits_op_default 27 | { 28 | public: 29 | 30 | template inline static void apply_noalias(Mat& out, const obj& X, const uword copies_per_row, const uword copies_per_col); 31 | 32 | template inline static void apply(Mat& out, const Op& in); 33 | }; 34 | 35 | 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_repmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_repmat 21 | //! @{ 22 | 23 | 24 | 25 | class op_repmat 26 | : public traits_op_default 27 | { 28 | public: 29 | 30 | template inline static void apply_noalias(Mat& out, const obj& X, const uword copies_per_row, const uword copies_per_col); 31 | 32 | template inline static void apply(Mat& out, const Op& in); 33 | }; 34 | 35 | 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_reverse_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_reverse 20 | //! @{ 21 | 22 | 23 | 24 | class op_reverse 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | class op_reverse_vec 36 | : public traits_op_passthru 37 | { 38 | public: 39 | 40 | template 41 | inline static void apply(Mat& out, const Op& in); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_roots_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_roots 20 | //! @{ 21 | 22 | 23 | 24 | class op_roots 25 | : public traits_op_col 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply(Mat< std::complex >& out, const mtOp, T1, op_roots>& expr); 31 | 32 | template 33 | inline static bool apply_direct(Mat< std::complex >& out, const Base& X); 34 | 35 | template 36 | inline static bool apply_noalias(Mat< std::complex::result> >& out, const Mat& X); 37 | }; 38 | 39 | 40 | 41 | //! @} 42 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_row_as_mat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_row_as_mat 20 | //! @{ 21 | 22 | 23 | class op_row_as_mat 24 | : public traits_op_default 25 | { 26 | public: 27 | 28 | template inline static void apply(Mat& out, const CubeToMatOp& expr); 29 | }; 30 | 31 | 32 | 33 | //! @} 34 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_shift_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_shift 21 | //! @{ 22 | 23 | 24 | 25 | class op_shift_vec 26 | : public traits_op_passthru 27 | { 28 | public: 29 | 30 | template inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | class op_shift 36 | : public traits_op_default 37 | { 38 | public: 39 | 40 | template inline static void apply_noalias(Mat& out, const Mat& X, const uword len, const uword neg, const uword dim); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_shuffle_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | 20 | //! \addtogroup op_shuffle 21 | //! @{ 22 | 23 | 24 | 25 | class op_shuffle 26 | : public traits_op_default 27 | { 28 | public: 29 | 30 | template inline static void apply_direct(Mat& out, const Mat& X, const uword dim); 31 | 32 | template inline static void apply(Mat& out, const Op& in); 33 | }; 34 | 35 | 36 | 37 | class op_shuffle_vec 38 | : public traits_op_passthru 39 | { 40 | public: 41 | 42 | template inline static void apply(Mat& out, const Op& in); 43 | }; 44 | 45 | 46 | 47 | //! @} 48 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_stddev_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_stddev 20 | //! @{ 21 | 22 | 23 | 24 | class op_stddev 25 | : public traits_op_xvec 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply(Mat& out, const mtOp& in); 31 | 32 | template 33 | inline static void apply_noalias(Mat::result>& out, const Mat& X, const uword norm_type, const uword dim); 34 | }; 35 | 36 | 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /src/armadillo_bits/op_toeplitz_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup op_toeplitz 20 | //! @{ 21 | 22 | 23 | 24 | class op_toeplitz 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | class op_toeplitz_c 36 | : public traits_op_default 37 | { 38 | public: 39 | 40 | template 41 | inline static void apply(Mat& out, const Op& in); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | -------------------------------------------------------------------------------- /src/armadillo_bits/rbfgs.h: -------------------------------------------------------------------------------- 1 | #ifndef RBFGS_H 2 | #define RBFGS_H 3 | 4 | #include "armadillo" 5 | 6 | using namespace arma; 7 | 8 | using namespace std; 9 | 10 | 11 | #endif // end of RBFGS_H 12 | -------------------------------------------------------------------------------- /src/armadillo_bits/spglue_kron_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spglue_kron 20 | //! @{ 21 | 22 | 23 | 24 | class spglue_kron 25 | { 26 | public: 27 | 28 | template 29 | struct traits 30 | { 31 | static constexpr bool is_row = (T1::is_row && T2::is_row); 32 | static constexpr bool is_col = (T1::is_col && T2::is_col); 33 | static constexpr bool is_xvec = false; 34 | }; 35 | 36 | template 37 | inline static void apply(SpMat& out, const SpGlue& X); 38 | 39 | template 40 | inline static void apply_noalias(SpMat& out, const SpMat& A, const SpMat& B); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | -------------------------------------------------------------------------------- /src/armadillo_bits/spglue_merge_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spglue_merge 20 | //! @{ 21 | 22 | 23 | 24 | class spglue_merge 25 | { 26 | public: 27 | 28 | template 29 | inline static void subview_merge(SpSubview& sv, const SpMat& B); 30 | 31 | template 32 | inline static void subview_merge(SpSubview& sv, const Mat& B); 33 | 34 | template 35 | inline static void symmat_merge(SpMat& out, const SpMat& A, const SpMat& B); 36 | 37 | template 38 | inline static void diagview_merge(SpMat& out, const SpMat& A, const SpMat& B); 39 | }; 40 | 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_htrans_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_htrans 20 | //! @{ 21 | 22 | 23 | //! hermitian transpose operation for sparse matrices 24 | 25 | class spop_htrans 26 | { 27 | public: 28 | 29 | template 30 | struct traits 31 | { 32 | static constexpr bool is_row = T1::is_col; // deliberately swapped 33 | static constexpr bool is_col = T1::is_row; 34 | static constexpr bool is_xvec = T1::is_xvec; 35 | }; 36 | 37 | template 38 | inline static void apply(SpMat& out, const SpOp& in, const typename arma_not_cx::result* junk = nullptr); 39 | 40 | template 41 | inline static void apply(SpMat& out, const SpOp& in, const typename arma_cx_only::result* junk = nullptr); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_norm_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_norm 20 | //! @{ 21 | 22 | 23 | class spop_norm 24 | : public traits_op_default 25 | { 26 | public: 27 | 28 | template inline static typename get_pod_type::result mat_norm_1(const SpMat& X); 29 | 30 | template inline static typename get_pod_type::result mat_norm_2(const SpMat& X, const typename arma_real_only::result* junk = nullptr); 31 | template inline static typename get_pod_type::result mat_norm_2(const SpMat& X, const typename arma_cx_only::result* junk = nullptr); 32 | 33 | template inline static typename get_pod_type::result mat_norm_inf(const SpMat& X); 34 | 35 | template inline static typename get_pod_type::result vec_norm_k(const eT* mem, const uword N, const uword k); 36 | }; 37 | 38 | 39 | //! @} 40 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_normalise_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_normalise 20 | //! @{ 21 | 22 | 23 | class spop_normalise 24 | : public traits_op_passthru 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply(SpMat& out, const SpOp& expr); 30 | 31 | template 32 | inline static void apply_direct(SpMat& out, const SpMat& X, const uword p); 33 | }; 34 | 35 | 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_repmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_repmat 20 | //! @{ 21 | 22 | 23 | 24 | class spop_repmat 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply(SpMat& out, const SpOp& X); 31 | 32 | template 33 | inline static void apply_noalias(SpMat& out, const uword A_n_rows, const uword A_n_cols, const SpMat& B); 34 | }; 35 | 36 | 37 | 38 | //! @} 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_reverse_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_reverse 20 | //! @{ 21 | 22 | 23 | class spop_reverse 24 | : public traits_op_passthru 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply_spmat(SpMat& out, const SpMat& X, const uword dim); 30 | 31 | template 32 | inline static void apply_proxy(SpMat& out, const T1& X, const uword dim); 33 | 34 | template 35 | inline static void apply(SpMat& out, const SpOp& in); 36 | }; 37 | 38 | 39 | 40 | //! @} 41 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_strans_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_strans 20 | //! @{ 21 | 22 | 23 | //! simple transpose operation (no complex conjugates) for sparse matrices 24 | 25 | class spop_strans 26 | { 27 | public: 28 | 29 | template 30 | struct traits 31 | { 32 | static constexpr bool is_row = T1::is_col; // deliberately swapped 33 | static constexpr bool is_col = T1::is_row; 34 | static constexpr bool is_xvec = T1::is_xvec; 35 | }; 36 | 37 | template 38 | inline static void apply_noalias(SpMat& B, const SpMat& A); 39 | 40 | template 41 | inline static void apply(SpMat& out, const SpOp& in); 42 | 43 | template 44 | inline static void apply(SpMat& out, const SpOp& in); 45 | }; 46 | 47 | 48 | 49 | //! @} 50 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_sum_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_sum 20 | //! @{ 21 | 22 | 23 | class spop_sum 24 | : public traits_op_xvec 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply(SpMat& out, const SpOp& in); 30 | }; 31 | 32 | 33 | //! @} 34 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_symmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_symmat 20 | //! @{ 21 | 22 | 23 | 24 | class spop_symmat 25 | : public traits_op_default 26 | { 27 | public: 28 | 29 | template 30 | inline static void apply(SpMat& out, const SpOp& in); 31 | }; 32 | 33 | 34 | 35 | class spop_symmat_cx 36 | : public traits_op_default 37 | { 38 | public: 39 | 40 | template 41 | inline static void apply(SpMat& out, const SpOp& in); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | -------------------------------------------------------------------------------- /src/armadillo_bits/spop_vecnorm_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup spop_vecnorm 20 | //! @{ 21 | 22 | 23 | class spop_vecnorm 24 | : public traits_op_xvec 25 | { 26 | public: 27 | 28 | template 29 | inline static void apply(SpMat& out, const mtSpOp& expr); 30 | 31 | template 32 | inline static void apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword k); 33 | }; 34 | 35 | 36 | // 37 | 38 | 39 | class spop_vecnorm_ext 40 | : public traits_op_xvec 41 | { 42 | public: 43 | 44 | template 45 | inline static void apply(SpMat& out, const mtSpOp& expr); 46 | 47 | template 48 | inline static void apply_direct(Mat< typename get_pod_type::result >& out, const SpMat& X, const uword method_id); 49 | }; 50 | 51 | 52 | //! @} 53 | -------------------------------------------------------------------------------- /src/armadillo_bits/wall_clock_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | 19 | //! \addtogroup wall_clock 20 | //! @{ 21 | 22 | 23 | //! Class for measuring time intervals 24 | class wall_clock 25 | { 26 | public: 27 | 28 | inline wall_clock(); 29 | inline ~wall_clock(); 30 | 31 | inline void tic(); //!< start the timer 32 | arma_warn_unused inline double toc(); //!< return the number of seconds since the last call to tic() 33 | 34 | 35 | private: 36 | 37 | bool valid = false; 38 | 39 | std::chrono::steady_clock::time_point chrono_time1; 40 | }; 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /src/bayesian.h: -------------------------------------------------------------------------------- 1 | #ifndef BAYESIAN_H 2 | #define BAYESIAN_H 3 | 4 | #include "armadillo" 5 | 6 | using namespace arma; 7 | using namespace std; 8 | 9 | vec calcY(double area, vec gy); 10 | 11 | vec cuL2norm2(vec x, vec y); 12 | 13 | // simple trapezoidal numerical integration 14 | double trapzCpp(vec x, vec y); 15 | 16 | // order vectors and calculate l2 norm, for f.L2norm() 17 | double order_l2norm(vec x, vec y); 18 | 19 | #endif // end of BAYESIAN_H 20 | -------------------------------------------------------------------------------- /src/cDP.pxd: -------------------------------------------------------------------------------- 1 | cdef extern from "DP.h": 2 | void DP(double *q1, double *q2, int n1, int N1, double lam1, int Disp, double *yy) 3 | -------------------------------------------------------------------------------- /src/cDPQ.pxd: -------------------------------------------------------------------------------- 1 | cdef extern from "DynamicProgrammingQ2.h": 2 | void DynamicProgrammingQ2(double *Q1, double *T1, double *Q2, double *T2, int m1, int n1, int n2, 3 | double *tv1, double *tv2, int n1v, int n2v, double *G, double *T, 4 | double *size, double lam1, size_t nbhd_dim) -------------------------------------------------------------------------------- /src/cUnitSquareImage.pxd: -------------------------------------------------------------------------------- 1 | from libcpp cimport bool 2 | 3 | cdef extern from "UnitSquareImage.h": 4 | void findgrad2D(double *dfdu, double *dfdv, double *f, int n, int t, int d); 5 | int check_crossing(double *f, int n, int t, int D); 6 | -------------------------------------------------------------------------------- /src/cbayesian.pxd: -------------------------------------------------------------------------------- 1 | from libcpp cimport bool 2 | cimport cyarma 3 | from cyarma cimport vec 4 | 5 | cdef extern from "bayesian.h": 6 | vec calcY(double area, vec gy); 7 | vec cuL2norm2(vec x, vec y); 8 | double trapzCpp(vec x, vec y); 9 | double order_l2norm(vec x, vec y); 10 | -------------------------------------------------------------------------------- /src/cbayesian.pyx: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | cimport cbayesian 3 | cimport cyarma 4 | cimport numpy as np 5 | 6 | include "cyarma.pyx" 7 | 8 | from libcpp cimport bool 9 | 10 | def bcalcY(area, np.ndarray[double, ndim=1, mode="c"] y): 11 | y = np.ascontiguousarray(y) 12 | cdef vec ay = numpy_to_vec_d(y) 13 | cdef vec out = calcY(area, ay) 14 | 15 | cdef np.ndarray[np.double_t,ndim=1] out1 = vec_to_numpy(out, None) 16 | 17 | return(out1) 18 | 19 | def bcuL2norm2(np.ndarray[double, ndim=1, mode="c"] x, np.ndarray[double, ndim=1, mode="c"] y): 20 | x = np.ascontiguousarray(x) 21 | y = np.ascontiguousarray(y) 22 | cdef vec ax = numpy_to_vec_d(x) 23 | cdef vec ay = numpy_to_vec_d(y) 24 | cdef vec out = cuL2norm2(ax, ay) 25 | 26 | cdef np.ndarray[np.double_t,ndim=1] out1 = vec_to_numpy(out, None) 27 | 28 | return(out1) 29 | 30 | def ctrapzCpp(np.ndarray[double, ndim=1, mode="c"] x, np.ndarray[double, ndim=1, mode="c"] y): 31 | x = np.ascontiguousarray(x) 32 | y = np.ascontiguousarray(y) 33 | cdef vec ax = numpy_to_vec_d(x) 34 | cdef vec ay = numpy_to_vec_d(y) 35 | 36 | cdef double out = trapzCpp(ax, ay) 37 | 38 | return(out) 39 | 40 | def border_l2norm(np.ndarray[double, ndim=1, mode="c"] x, np.ndarray[double, ndim=1, mode="c"] y): 41 | x = np.ascontiguousarray(x) 42 | y = np.ascontiguousarray(y) 43 | cdef vec ax = numpy_to_vec_d(x) 44 | cdef vec ay = numpy_to_vec_d(y) 45 | 46 | cdef double out = order_l2norm(ax, ay) 47 | 48 | return(out) 49 | -------------------------------------------------------------------------------- /src/cfPLS.pxd: -------------------------------------------------------------------------------- 1 | cdef extern from "fpls_warp_grad.h": 2 | void fpls_warp_grad(int *m1, int *n1, double *ti, double *gami, double *qf, double *qg, double *wf, double *wg, 3 | int *max_itri, double *toli, double *deltai, int *displayi, double *gamout) 4 | -------------------------------------------------------------------------------- /src/cmlogit.pxd: -------------------------------------------------------------------------------- 1 | cdef extern from "mlogit_warp_grad.h": 2 | void mlogit_warp_grad(int *m1, int *m2, double *alpha, double *beta, double *ti, double *gami, double *q, int *y, int *max_itri, double *toli, double *deltai, int *displayi, double *gamout) 3 | -------------------------------------------------------------------------------- /src/coclogit.pxd: -------------------------------------------------------------------------------- 1 | cdef extern from "oclogit_warp_grad.h": 2 | void oclogit_warp_grad(int *n1, int *T1, double *alpha, double *nu, double *q, int *y, int *max_itri, double *toli, double *deltaOi, double *deltagi, int *displayi, double *gamout, double *Oout) 3 | -------------------------------------------------------------------------------- /src/cocmlogit.pxd: -------------------------------------------------------------------------------- 1 | cdef extern from "ocmlogit_warp_grad.h": 2 | void ocmlogit_warp_grad(int *n1, int *T1, int *m1, double *alpha, double *nu, double *q, int *y, int *max_itri, double *toli, double *deltaOi, double *deltagi, int *displayi, double *gamout, double *Oout) 3 | -------------------------------------------------------------------------------- /src/crbfgs.pxd: -------------------------------------------------------------------------------- 1 | from libcpp cimport bool 2 | cimport cyarma 3 | from cyarma cimport vec 4 | 5 | cdef extern from "rbfgs.h": 6 | vec rlbfgs_optim(vec q1, vec q2, vec time, int maxiter, double lam, int penalty); 7 | -------------------------------------------------------------------------------- /src/dp_build.py: -------------------------------------------------------------------------------- 1 | from cffi import FFI 2 | import os 3 | 4 | ffibuilder = FFI() 5 | 6 | with open(os.path.join(os.path.dirname(__file__), "DP.h")) as f: 7 | ffibuilder.cdef(f.read()) 8 | 9 | ffibuilder.set_source("_DP", 10 | '#include "DP.h"', 11 | sources=["src/DP.c"], 12 | include_dirs=["src/"], 13 | ) 14 | 15 | if __name__ == "__main__": 16 | ffibuilder.compile(verbose=True) -------------------------------------------------------------------------------- /src/dp_nbhd.h: -------------------------------------------------------------------------------- 1 | #ifndef DP_NBHD_H 2 | #define DP_NBHD_H 1 3 | 4 | #include 5 | 6 | typedef int Pair[2]; 7 | 8 | Pair * dp_generate_nbhd(size_t nbhd_dim, size_t * nbhd_count); 9 | 10 | #endif /* DP_NBHD_H */ 11 | 12 | -------------------------------------------------------------------------------- /src/fpls_warp_grad.h: -------------------------------------------------------------------------------- 1 | void fpls_warp_grad(int *m1, int *n1, double *ti, double *gami, double *qf, double *qg, double *wf, double *wg, 2 | int *max_itri, double *toli, double *deltai, int *displayi, double *gamout); -------------------------------------------------------------------------------- /src/matrix_exponential.h: -------------------------------------------------------------------------------- 1 | double *r8mat_expm1 ( int n, double a[] ); 2 | double *r8mat_expm2 ( int n, double a[] ); 3 | double *r8mat_expm3 ( int n, double a[] ); 4 | -------------------------------------------------------------------------------- /src/mlogit_warp_grad.h: -------------------------------------------------------------------------------- 1 | void mlogit_warp_grad(int *m1, int *m2, double *alpha, double *beta, double *ti, double *gami, double *q, int *y, int *max_itri, double *toli, double *deltai, int *displayi, double *gamout); 2 | -------------------------------------------------------------------------------- /src/myVector.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | #define SQRT5 2.23606797749978969641 8 | #define EPS 0.00000000001 9 | 10 | // Prototypes: ----------------------------------------------------------------- 11 | double InProd(const double *u, const double *v, int d); 12 | void GramSchmitd(double *x, int &n, int d); 13 | 14 | double innerSquare(const double *u, const double *v, int n, int t, int d); 15 | void GramSchmitdSquare(double *x, int &n, int n1, int n2, int d); 16 | -------------------------------------------------------------------------------- /src/oclogit_warp_grad.h: -------------------------------------------------------------------------------- 1 | void oclogit_warp_grad(int *n1, int *T1, double *alpha, double *nu, double *q, int *y, int *max_itri, double *toli, double *deltaOi, double *deltagi, int *displayi, double *gamout, double *Oout); 2 | -------------------------------------------------------------------------------- /src/ocmlogit_warp_grad.h: -------------------------------------------------------------------------------- 1 | void ocmlogit_warp_grad(int *n1, int *T1, int *m1, double *alpha, double *nu, double *q, int *y, int *max_itri, double *toli, double *deltaOi, double *deltagi, int *displayi, double *gamout, double *Oout); 2 | -------------------------------------------------------------------------------- /src/rbfgs.h: -------------------------------------------------------------------------------- 1 | #ifndef RBFGS_H 2 | #define RBFGS_H 3 | 4 | #include "armadillo" 5 | 6 | using namespace arma; 7 | using namespace std; 8 | 9 | #ifndef M_PI 10 | #define M_PI 3.14159265358979323846 11 | #endif 12 | 13 | vec rlbfgs_optim(vec q1, vec q2, vec time, int maxiter, double lam, int penalty); 14 | 15 | #endif // end of RBFGS_H 16 | --------------------------------------------------------------------------------