├── README.md ├── bin ├── libfftw3f-3.dll ├── libfftw3f-3.lib ├── libgcc_s_seh-1.dll ├── libopenblas.dll ├── libopenblas.dll.a ├── libquadmath-0.dll ├── libwinpthread-1.dll ├── opencv_world330.lib ├── pthreadVC2.dll ├── pthreadVC2.lib └── yolo3.lib ├── detectors └── yolo3.cpp ├── include ├── armadillo ├── armadillo_bits │ ├── BaseCube_bones.hpp │ ├── BaseCube_meat.hpp │ ├── Base_bones.hpp │ ├── Base_meat.hpp │ ├── Col_bones.hpp │ ├── Col_meat.hpp │ ├── Cube_bones.hpp │ ├── Cube_meat.hpp │ ├── GenCube_bones.hpp │ ├── GenCube_meat.hpp │ ├── GenSpecialiser.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_iterators_meat.hpp │ ├── SpSubview_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_rng.hpp │ ├── arma_rng_cxx11.hpp │ ├── arma_rng_cxx98.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_extra.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 │ ├── debug.hpp │ ├── def_arpack.hpp │ ├── def_atlas.hpp │ ├── def_blas.hpp │ ├── def_hdf5.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.hpp │ ├── field_bones.hpp │ ├── field_meat.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.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_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_intersect.hpp │ ├── fn_inv.hpp │ ├── fn_join.hpp │ ├── fn_kmeans.hpp │ ├── fn_kron.hpp │ ├── fn_log_det.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_princomp.hpp │ ├── fn_prod.hpp │ ├── fn_qr.hpp │ ├── fn_qz.hpp │ ├── fn_randg.hpp │ ├── fn_randi.hpp │ ├── fn_randn.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_syl_lyap.hpp │ ├── fn_symmat.hpp │ ├── fn_toeplitz.hpp │ ├── fn_trace.hpp │ ├── fn_trans.hpp │ ├── fn_trapz.hpp │ ├── fn_trig.hpp │ ├── fn_trimat.hpp │ ├── fn_trunc_exp.hpp │ ├── fn_trunc_log.hpp │ ├── fn_unique.hpp │ ├── fn_var.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_relational_bones.hpp │ ├── glue_relational_meat.hpp │ ├── glue_solve_bones.hpp │ ├── glue_solve_meat.hpp │ ├── glue_times_bones.hpp │ ├── glue_times_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 │ ├── include_atlas.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 │ ├── 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_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_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_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_bones.hpp │ ├── op_inv_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_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_princomp_bones.hpp │ ├── op_princomp_meat.hpp │ ├── op_prod_bones.hpp │ ├── op_prod_meat.hpp │ ├── op_range_bones.hpp │ ├── op_range_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_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_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_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 │ ├── 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_minus_bones.hpp │ ├── spglue_minus_meat.hpp │ ├── spglue_plus_bones.hpp │ ├── spglue_plus_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_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 │ ├── 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 │ ├── sympd_helper.hpp │ ├── traits.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 │ ├── wrapper_arpack.hpp │ ├── wrapper_atlas.hpp │ ├── wrapper_blas.hpp │ ├── wrapper_lapack.hpp │ ├── wrapper_superlu.hpp │ ├── xtrans_mat_bones.hpp │ ├── xtrans_mat_meat.hpp │ ├── xvec_htrans_bones.hpp │ └── xvec_htrans_meat.hpp ├── fftw3.h ├── opencv │ ├── cv.h │ ├── cv.hpp │ ├── cvaux.h │ ├── cvaux.hpp │ ├── cvwimage.h │ ├── cxcore.h │ ├── cxcore.hpp │ ├── cxeigen.hpp │ ├── cxmisc.h │ ├── highgui.h │ └── ml.h ├── opencv2 │ ├── calib3d.hpp │ ├── calib3d │ │ ├── calib3d.hpp │ │ └── calib3d_c.h │ ├── core.hpp │ ├── core │ │ ├── affine.hpp │ │ ├── base.hpp │ │ ├── bufferpool.hpp │ │ ├── core.hpp │ │ ├── core_c.h │ │ ├── cuda.hpp │ │ ├── cuda.inl.hpp │ │ ├── cuda_stream_accessor.hpp │ │ ├── cuda_types.hpp │ │ ├── cv_cpu_dispatch.h │ │ ├── cv_cpu_helper.h │ │ ├── cvdef.h │ │ ├── cvstd.hpp │ │ ├── cvstd.inl.hpp │ │ ├── directx.hpp │ │ ├── eigen.hpp │ │ ├── fast_math.hpp │ │ ├── hal │ │ │ ├── hal.hpp │ │ │ ├── interface.h │ │ │ ├── intrin.hpp │ │ │ ├── intrin_cpp.hpp │ │ │ ├── intrin_neon.hpp │ │ │ └── intrin_sse.hpp │ │ ├── ippasync.hpp │ │ ├── mat.hpp │ │ ├── mat.inl.hpp │ │ ├── matx.hpp │ │ ├── neon_utils.hpp │ │ ├── ocl.hpp │ │ ├── ocl_genbase.hpp │ │ ├── opengl.hpp │ │ ├── operations.hpp │ │ ├── optim.hpp │ │ ├── ovx.hpp │ │ ├── persistence.hpp │ │ ├── ptr.inl.hpp │ │ ├── saturate.hpp │ │ ├── softfloat.hpp │ │ ├── sse_utils.hpp │ │ ├── traits.hpp │ │ ├── types.hpp │ │ ├── types_c.h │ │ ├── utility.hpp │ │ ├── utils │ │ │ ├── logger.hpp │ │ │ └── trace.hpp │ │ ├── va_intel.hpp │ │ ├── version.hpp │ │ └── wimage.hpp │ ├── cvconfig.h │ ├── dnn.hpp │ ├── dnn │ │ ├── all_layers.hpp │ │ ├── dict.hpp │ │ ├── dnn.hpp │ │ ├── dnn.inl.hpp │ │ ├── layer.details.hpp │ │ ├── layer.hpp │ │ └── shape_utils.hpp │ ├── features2d.hpp │ ├── features2d │ │ └── features2d.hpp │ ├── flann.hpp │ ├── flann │ │ ├── all_indices.h │ │ ├── allocator.h │ │ ├── any.h │ │ ├── autotuned_index.h │ │ ├── composite_index.h │ │ ├── config.h │ │ ├── defines.h │ │ ├── dist.h │ │ ├── dummy.h │ │ ├── dynamic_bitset.h │ │ ├── flann.hpp │ │ ├── flann_base.hpp │ │ ├── general.h │ │ ├── ground_truth.h │ │ ├── hdf5.h │ │ ├── heap.h │ │ ├── hierarchical_clustering_index.h │ │ ├── index_testing.h │ │ ├── kdtree_index.h │ │ ├── kdtree_single_index.h │ │ ├── kmeans_index.h │ │ ├── linear_index.h │ │ ├── logger.h │ │ ├── lsh_index.h │ │ ├── lsh_table.h │ │ ├── matrix.h │ │ ├── miniflann.hpp │ │ ├── nn_index.h │ │ ├── object_factory.h │ │ ├── params.h │ │ ├── random.h │ │ ├── result_set.h │ │ ├── sampling.h │ │ ├── saving.h │ │ ├── simplex_downhill.h │ │ └── timer.h │ ├── highgui.hpp │ ├── highgui │ │ ├── highgui.hpp │ │ └── highgui_c.h │ ├── imgcodecs.hpp │ ├── imgcodecs │ │ ├── imgcodecs.hpp │ │ ├── imgcodecs_c.h │ │ └── ios.h │ ├── imgproc.hpp │ ├── imgproc │ │ ├── detail │ │ │ └── distortion_model.hpp │ │ ├── hal │ │ │ ├── hal.hpp │ │ │ └── interface.h │ │ ├── imgproc.hpp │ │ ├── imgproc_c.h │ │ └── types_c.h │ ├── ml.hpp │ ├── ml │ │ └── ml.hpp │ ├── objdetect.hpp │ ├── objdetect │ │ ├── detection_based_tracker.hpp │ │ ├── objdetect.hpp │ │ └── objdetect_c.h │ ├── opencv.hpp │ ├── opencv_modules.hpp │ ├── photo.hpp │ ├── photo │ │ ├── cuda.hpp │ │ ├── photo.hpp │ │ └── photo_c.h │ ├── shape.hpp │ ├── shape │ │ ├── emdL1.hpp │ │ ├── hist_cost.hpp │ │ ├── shape.hpp │ │ ├── shape_distance.hpp │ │ └── shape_transformer.hpp │ ├── stitching.hpp │ ├── stitching │ │ ├── detail │ │ │ ├── autocalib.hpp │ │ │ ├── blenders.hpp │ │ │ ├── camera.hpp │ │ │ ├── exposure_compensate.hpp │ │ │ ├── matchers.hpp │ │ │ ├── motion_estimators.hpp │ │ │ ├── seam_finders.hpp │ │ │ ├── timelapsers.hpp │ │ │ ├── util.hpp │ │ │ ├── util_inl.hpp │ │ │ ├── warpers.hpp │ │ │ └── warpers_inl.hpp │ │ └── warpers.hpp │ ├── superres.hpp │ ├── superres │ │ └── optical_flow.hpp │ ├── video.hpp │ ├── video │ │ ├── background_segm.hpp │ │ ├── tracking.hpp │ │ ├── tracking_c.h │ │ └── video.hpp │ ├── videoio.hpp │ ├── videoio │ │ ├── cap_ios.h │ │ ├── videoio.hpp │ │ └── videoio_c.h │ ├── videostab.hpp │ ├── videostab │ │ ├── deblurring.hpp │ │ ├── fast_marching.hpp │ │ ├── fast_marching_inl.hpp │ │ ├── frame_source.hpp │ │ ├── global_motion.hpp │ │ ├── inpainting.hpp │ │ ├── log.hpp │ │ ├── motion_core.hpp │ │ ├── motion_stabilizing.hpp │ │ ├── optical_flow.hpp │ │ ├── outlier_rejection.hpp │ │ ├── ring_buffer.hpp │ │ ├── stabilizer.hpp │ │ └── wobble_suppression.hpp │ └── world.hpp ├── pthread.h ├── sched.h ├── semaphore.h └── sigpack │ ├── Doxyfile │ ├── base │ └── base.h │ ├── fftw │ └── fftw.h │ ├── filter │ └── filter.h │ ├── gplot │ └── gplot.h │ ├── image │ └── image.h │ ├── kalman │ └── kalman.h │ ├── parser │ └── parser.h │ ├── resampling │ └── resampling.h │ ├── sigpack.h │ ├── spectrum │ └── spectrum.h │ ├── timing │ └── timing.h │ └── window │ └── window.h ├── libhog ├── CMakeLists.txt ├── fhog.h ├── gradientMex.cpp ├── gradientMex.h ├── sse.hpp └── wrappers.hpp ├── top ├── cnntype.h ├── drawlib.c └── td.cpp ├── trackers ├── hungarian │ └── hungarian.cpp ├── kalman.cpp └── kcf.cpp ├── yolo3tracker.sln ├── yolo3tracker.vcxproj ├── yolo3tracker.vcxproj.filters └── yolo3tracker.vcxproj.user /README.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Obstacle detection or tracking moving objects is one of the most interesting topics in computer vision. 4 | This problem could be solved in two steps: 5 | 6 | 1, Detecting moving objects in each frame 7 | 2, Tracking historical objects with some tracking algorithms 8 | 9 | An assignment problem is used to associate the objects detected by detectors and tracked by trackers. 10 | 11 | We can found some introduction of this framework here, 12 | https://towardsdatascience.com/computer-vision-for-tracking-8220759eee85 13 | 14 | Another example in more detail with matlab code (detecors and trackers may different), 15 | https://www.mathworks.com/help/vision/examples/motion-based-multiple-object-tracking.html 16 | 17 | Here I implemented a highly efficient and scalable C++ framework to combine the state of art 18 | deep-learning based detectors (Yolo3 demoed here) and correlation filters based trackers 19 | (KCF, Kalman Filters also implemented). The assignment problem is solved by hungarian algorithm. 20 | 21 | # Detectors: Yolo3 22 | 23 | Yolo3 is trained for detecting bottles, cans and hands in this demo. It is trained with Keras 24 | and compiled with tensorflow C++ into a DLL. (YOLO3.DLL under bin folder). CUDA 9.2 is used to 25 | compile the tensorflow C++ library. 26 | 27 | YOLO3.DLL can be compiled with the code under folder detectors and tensorflow C++ library if 28 | you have tensorflow C++ library compiled. 29 | 30 | # Trackers: Kalman Filter and KCF 31 | 32 | Kalman filter is fast but less accurate. KCF is accurate but much slower. 33 | They are implemnted with exactly same interface, so we can easily switch from one to another 34 | in the project. 35 | 36 | # Live Camera Capture: OpenCV 37 | 38 | OpenCV is used to capture live video frames and used for image preprocessing. 39 | 40 | # Misc 41 | 42 | YOLO3.DLL and the model file are too big. They can be downloaded from following link: 43 | https://pan.baidu.com/s/1CPYU2o59vutoq-OJewObRw -------------------------------------------------------------------------------- /bin/libfftw3f-3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/libfftw3f-3.dll -------------------------------------------------------------------------------- /bin/libfftw3f-3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/libfftw3f-3.lib -------------------------------------------------------------------------------- /bin/libgcc_s_seh-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/libgcc_s_seh-1.dll -------------------------------------------------------------------------------- /bin/libopenblas.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/libopenblas.dll -------------------------------------------------------------------------------- /bin/libopenblas.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/libopenblas.dll.a -------------------------------------------------------------------------------- /bin/libquadmath-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/libquadmath-0.dll -------------------------------------------------------------------------------- /bin/libwinpthread-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/libwinpthread-1.dll -------------------------------------------------------------------------------- /bin/opencv_world330.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/opencv_world330.lib -------------------------------------------------------------------------------- /bin/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/pthreadVC2.dll -------------------------------------------------------------------------------- /bin/pthreadVC2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/pthreadVC2.lib -------------------------------------------------------------------------------- /bin/yolo3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/bin/yolo3.lib -------------------------------------------------------------------------------- /detectors/yolo3.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/detectors/yolo3.cpp -------------------------------------------------------------------------------- /include/armadillo_bits/GenSpecialiser.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup GenSpecialiser 18 | //! @{ 19 | 20 | 21 | template 22 | struct GenSpecialiser 23 | { 24 | arma_inline elem_type generate() const { return elem_type(); } 25 | }; 26 | 27 | 28 | template 29 | struct GenSpecialiser 30 | { 31 | arma_inline elem_type generate() const { return elem_type(0); } 32 | }; 33 | 34 | 35 | template 36 | struct GenSpecialiser 37 | { 38 | arma_inline elem_type generate() const { return elem_type(1); } 39 | }; 40 | 41 | 42 | template 43 | struct GenSpecialiser 44 | { 45 | arma_inline elem_type generate() const { return elem_type(arma_rng::randu()); } 46 | }; 47 | 48 | 49 | template 50 | struct GenSpecialiser 51 | { 52 | arma_inline elem_type generate() const { return elem_type(arma_rng::randn()); } 53 | }; 54 | 55 | 56 | //! @} 57 | -------------------------------------------------------------------------------- /include/armadillo_bits/GlueCube_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup GlueCube 18 | //! @{ 19 | 20 | 21 | 22 | //! analog of the Glue class, intended for Cube objects 23 | template 24 | class GlueCube : public BaseCube > 25 | { 26 | public: 27 | 28 | typedef typename T1::elem_type elem_type; 29 | typedef typename get_pod_type::result pod_type; 30 | 31 | arma_inline GlueCube(const BaseCube& in_A, const BaseCube& in_B); 32 | arma_inline ~GlueCube(); 33 | 34 | const T1& A; //!< first operand 35 | const T2& B; //!< second operand 36 | 37 | }; 38 | 39 | 40 | 41 | //! @} 42 | -------------------------------------------------------------------------------- /include/armadillo_bits/GlueCube_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup GlueCube 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | GlueCube::GlueCube(const BaseCube& in_A, const BaseCube& in_B) 25 | : A(in_A.get_ref()) 26 | , B(in_B.get_ref()) 27 | { 28 | arma_extra_debug_sigprint(); 29 | } 30 | 31 | 32 | 33 | template 34 | inline 35 | GlueCube::~GlueCube() 36 | { 37 | arma_extra_debug_sigprint(); 38 | } 39 | 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /include/armadillo_bits/Glue_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup Glue 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | Glue::Glue(const T1& in_A, const T2& in_B) 25 | : A(in_A) 26 | , B(in_B) 27 | { 28 | arma_extra_debug_sigprint(); 29 | } 30 | 31 | 32 | 33 | template 34 | inline 35 | Glue::Glue(const T1& in_A, const T2& in_B, const uword in_aux_uword) 36 | : A(in_A) 37 | , B(in_B) 38 | , aux_uword(in_aux_uword) 39 | { 40 | arma_extra_debug_sigprint(); 41 | } 42 | 43 | 44 | 45 | template 46 | inline 47 | Glue::~Glue() 48 | { 49 | arma_extra_debug_sigprint(); 50 | } 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /include/armadillo_bits/SizeCube_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup SizeCube 18 | //! @{ 19 | 20 | 21 | 22 | class SizeCube 23 | { 24 | public: 25 | 26 | const uword n_rows; 27 | const uword n_cols; 28 | const uword n_slices; 29 | 30 | inline explicit SizeCube(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices); 31 | 32 | inline uword operator[](const uword dim) const; 33 | inline uword operator()(const uword dim) const; 34 | 35 | inline bool operator==(const SizeCube& s) const; 36 | inline bool operator!=(const SizeCube& s) const; 37 | 38 | inline SizeCube operator+(const SizeCube& s) const; 39 | inline SizeCube operator-(const SizeCube& s) const; 40 | 41 | inline SizeCube operator+(const uword val) const; 42 | inline SizeCube operator-(const uword val) const; 43 | 44 | inline SizeCube operator*(const uword val) const; 45 | inline SizeCube operator/(const uword val) const; 46 | }; 47 | 48 | 49 | 50 | //! @} 51 | -------------------------------------------------------------------------------- /include/armadillo_bits/SizeMat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup SizeMat 18 | //! @{ 19 | 20 | 21 | 22 | class SizeMat 23 | { 24 | public: 25 | 26 | const uword n_rows; 27 | const uword n_cols; 28 | 29 | inline explicit SizeMat(const uword in_n_rows, const uword in_n_cols); 30 | 31 | inline uword operator[](const uword dim) const; 32 | inline uword operator()(const uword dim) const; 33 | 34 | inline bool operator==(const SizeMat& s) const; 35 | inline bool operator!=(const SizeMat& s) const; 36 | 37 | inline SizeMat operator+(const SizeMat& s) const; 38 | inline SizeMat operator-(const SizeMat& s) const; 39 | 40 | inline SizeMat operator+(const uword val) const; 41 | inline SizeMat operator-(const uword val) const; 42 | 43 | inline SizeMat operator*(const uword val) const; 44 | inline SizeMat operator/(const uword val) const; 45 | }; 46 | 47 | 48 | 49 | //! @} 50 | -------------------------------------------------------------------------------- /include/armadillo_bits/SpGlue_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup SpGlue 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | class SpGlue : public SpBase > 24 | { 25 | public: 26 | 27 | typedef typename T1::elem_type elem_type; 28 | typedef typename get_pod_type::result pod_type; 29 | 30 | static const bool is_row = ( (T1::is_row || T2::is_row) && is_spglue_elem::value ) || ( (is_spglue_times::value || is_spglue_times2::value) ? T1::is_row : false ); 31 | static const bool is_col = ( (T1::is_col || T2::is_col) && is_spglue_elem::value ) || ( (is_spglue_times::value || is_spglue_times2::value) ? T2::is_col : false ); 32 | 33 | arma_inline SpGlue(const T1& in_A, const T2& in_B); 34 | arma_inline SpGlue(const T1& in_A, const T2& in_B, const elem_type in_aux); 35 | arma_inline ~SpGlue(); 36 | 37 | const T1& A; //!< first operand 38 | const T2& B; //!< second operand 39 | elem_type aux; 40 | }; 41 | 42 | 43 | 44 | //! @} 45 | -------------------------------------------------------------------------------- /include/armadillo_bits/SpGlue_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup SpGlue 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | SpGlue::SpGlue(const T1& in_A, const T2& in_B) 25 | : A(in_A) 26 | , B(in_B) 27 | { 28 | arma_extra_debug_sigprint(); 29 | } 30 | 31 | 32 | 33 | template 34 | inline 35 | SpGlue::SpGlue(const T1& in_A, const T2& in_B, const typename T1::elem_type in_aux) 36 | : A(in_A) 37 | , B(in_B) 38 | , aux(in_aux) 39 | { 40 | arma_extra_debug_sigprint(); 41 | } 42 | 43 | 44 | 45 | template 46 | inline 47 | SpGlue::~SpGlue() 48 | { 49 | arma_extra_debug_sigprint(); 50 | } 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /include/armadillo_bits/SpOp_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup SpOp 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | SpOp::SpOp(const T1& in_m) 25 | : m(in_m) 26 | { 27 | arma_extra_debug_sigprint(); 28 | } 29 | 30 | 31 | 32 | template 33 | inline 34 | SpOp::SpOp(const T1& in_m, const typename T1::elem_type in_aux) 35 | : m(in_m) 36 | , aux(in_aux) 37 | { 38 | arma_extra_debug_sigprint(); 39 | } 40 | 41 | 42 | 43 | template 44 | inline 45 | SpOp::SpOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) 46 | : m(in_m) 47 | , aux_uword_a(in_aux_uword_a) 48 | , aux_uword_b(in_aux_uword_b) 49 | { 50 | arma_extra_debug_sigprint(); 51 | } 52 | 53 | 54 | 55 | template 56 | inline 57 | SpOp::~SpOp() 58 | { 59 | arma_extra_debug_sigprint(); 60 | } 61 | 62 | 63 | 64 | //! @} 65 | -------------------------------------------------------------------------------- /include/armadillo_bits/arma_static_check.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup arma_static_check 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | struct arma_type_check_cxx1998 24 | { 25 | arma_inline 26 | static 27 | void 28 | apply() 29 | { 30 | static const char 31 | junk[ ERROR___INCORRECT_OR_UNSUPPORTED_TYPE ? -1 : +1 ]; 32 | } 33 | }; 34 | 35 | 36 | 37 | template<> 38 | struct arma_type_check_cxx1998 39 | { 40 | arma_inline 41 | static 42 | void 43 | apply() 44 | { 45 | } 46 | }; 47 | 48 | 49 | 50 | #if defined(ARMA_USE_CXX11) 51 | 52 | #define arma_static_check(condition, message) static_assert( !(condition), #message ) 53 | 54 | #define arma_type_check(condition) static_assert( !(condition), "error: incorrect or unsupported type" ) 55 | 56 | #else 57 | 58 | #define arma_static_check(condition, message) static const char message[ (condition) ? -1 : +1 ] 59 | 60 | #define arma_type_check(condition) arma_type_check_cxx1998::apply() 61 | 62 | #endif 63 | 64 | 65 | 66 | //! @} 67 | -------------------------------------------------------------------------------- /include/armadillo_bits/arma_version.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup arma_version 18 | //! @{ 19 | 20 | 21 | 22 | #define ARMA_VERSION_MAJOR 9 23 | #define ARMA_VERSION_MINOR 100 24 | #define ARMA_VERSION_PATCH 5 25 | #define ARMA_VERSION_NAME "Armatus Ad Infinitum" 26 | 27 | 28 | 29 | struct arma_version 30 | { 31 | static const unsigned int major = ARMA_VERSION_MAJOR; 32 | static const unsigned int minor = ARMA_VERSION_MINOR; 33 | static const unsigned int patch = ARMA_VERSION_PATCH; 34 | 35 | static 36 | inline 37 | std::string 38 | as_string() 39 | { 40 | const char* nickname = ARMA_VERSION_NAME; 41 | 42 | std::stringstream ss; 43 | ss << arma_version::major 44 | << '.' 45 | << arma_version::minor 46 | << '.' 47 | << arma_version::patch 48 | << " (" 49 | << nickname 50 | << ')'; 51 | 52 | return ss.str(); 53 | } 54 | }; 55 | 56 | 57 | 58 | //! @} 59 | -------------------------------------------------------------------------------- /include/armadillo_bits/compiler_extra.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | #if (__cplusplus >= 201103L) 19 | #undef ARMA_USE_CXX11 20 | #define ARMA_USE_CXX11 21 | #endif 22 | 23 | 24 | // MS really can't get its proverbial shit together 25 | #if (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L)) 26 | #undef ARMA_USE_CXX11 27 | #define ARMA_USE_CXX11 28 | #undef ARMA_DONT_PRINT_CXX11_WARNING 29 | #define ARMA_DONT_PRINT_CXX11_WARNING 30 | #endif 31 | 32 | 33 | #if (defined(_OPENMP) && (_OPENMP >= 201107)) 34 | #undef ARMA_USE_OPENMP 35 | #define ARMA_USE_OPENMP 36 | #endif 37 | -------------------------------------------------------------------------------- /include/armadillo_bits/compiler_setup_post.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | #if defined(_MSC_VER) 19 | 20 | #pragma warning(pop) 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /include/armadillo_bits/cond_rel_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup cond_rel 18 | //! @{ 19 | 20 | 21 | // 22 | // for preventing pedantic compiler warnings 23 | 24 | template 25 | class cond_rel 26 | { 27 | public: 28 | 29 | template arma_inline static bool lt(const eT A, const eT B); 30 | template arma_inline static bool gt(const eT A, const eT B); 31 | 32 | template arma_inline static bool leq(const eT A, const eT B); 33 | template arma_inline static bool geq(const eT A, const eT B); 34 | 35 | template arma_inline static eT make_neg(const eT val); 36 | }; 37 | 38 | 39 | 40 | //! @} 41 | -------------------------------------------------------------------------------- /include/armadillo_bits/distr_param.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup distr_param 19 | //! @{ 20 | 21 | 22 | 23 | class distr_param 24 | { 25 | public: 26 | 27 | uword state; 28 | 29 | union 30 | { 31 | int a_int; 32 | double a_double; 33 | }; 34 | 35 | union 36 | { 37 | int b_int; 38 | double b_double; 39 | }; 40 | 41 | 42 | inline distr_param() 43 | : state(0) 44 | { 45 | } 46 | 47 | 48 | inline explicit distr_param(const int a, const int b) 49 | : state(1) 50 | , a_int(a) 51 | , b_int(b) 52 | { 53 | } 54 | 55 | 56 | inline explicit distr_param(const double a, const double b) 57 | : state(2) 58 | , a_double(a) 59 | , b_double(b) 60 | { 61 | } 62 | }; 63 | 64 | 65 | 66 | //! @} 67 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_cond.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_cond 18 | //! @{ 19 | 20 | 21 | template 22 | arma_warn_unused 23 | inline 24 | typename enable_if2::value, typename T1::pod_type>::result 25 | cond(const Base& X) 26 | { 27 | arma_extra_debug_sigprint(); 28 | 29 | typedef typename T1::pod_type T; 30 | 31 | Col S; 32 | 33 | const bool status = auxlib::svd_dc(S, X); 34 | 35 | if(status == false) 36 | { 37 | arma_debug_warn("cond(): svd failed"); 38 | 39 | return T(0); 40 | } 41 | 42 | if(S.n_elem > 0) 43 | { 44 | return T( max(S) / min(S) ); 45 | } 46 | else 47 | { 48 | return T(0); 49 | } 50 | } 51 | 52 | 53 | 54 | template 55 | arma_warn_unused 56 | inline 57 | typename enable_if2::value, typename T1::pod_type>::result 58 | rcond(const Base& X) 59 | { 60 | arma_extra_debug_sigprint(); 61 | 62 | return auxlib::rcond(X.get_ref()); 63 | } 64 | 65 | 66 | 67 | //! @} 68 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_cor.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_cor 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | inline 25 | const Op 26 | cor(const Base& X, const uword norm_type = 0) 27 | { 28 | arma_extra_debug_sigprint(); 29 | 30 | arma_debug_check( (norm_type > 1), "cor(): parameter 'norm_type' must be 0 or 1" ); 31 | 32 | return Op(X.get_ref(), norm_type, 0); 33 | } 34 | 35 | 36 | 37 | template 38 | arma_warn_unused 39 | inline 40 | const Glue 41 | cor(const Base& A, const Base& B, const uword norm_type = 0) 42 | { 43 | arma_extra_debug_sigprint(); 44 | 45 | arma_debug_check( (norm_type > 1), "cor(): parameter 'norm_type' must be 0 or 1" ); 46 | 47 | return Glue(A.get_ref(), B.get_ref(), norm_type); 48 | } 49 | 50 | 51 | 52 | //! @} 53 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_cov.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_cov 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | inline 25 | const Op 26 | cov(const Base& X, const uword norm_type = 0) 27 | { 28 | arma_extra_debug_sigprint(); 29 | 30 | arma_debug_check( (norm_type > 1), "cov(): parameter 'norm_type' must be 0 or 1" ); 31 | 32 | return Op(X.get_ref(), norm_type, 0); 33 | } 34 | 35 | 36 | 37 | template 38 | arma_warn_unused 39 | inline 40 | const Glue 41 | cov(const Base& A, const Base& B, const uword norm_type = 0) 42 | { 43 | arma_extra_debug_sigprint(); 44 | 45 | arma_debug_check( (norm_type > 1), "cov(): parameter 'norm_type' must be 0 or 1" ); 46 | 47 | return Glue(A.get_ref(), B.get_ref(), norm_type); 48 | } 49 | 50 | 51 | 52 | //! @} 53 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_cross.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_cross 18 | //! @{ 19 | 20 | 21 | 22 | //! cross product (only valid for 3 dimensional vectors) 23 | template 24 | arma_warn_unused 25 | inline 26 | const Glue 27 | cross(const Base& X, const Base& Y) 28 | { 29 | arma_extra_debug_sigprint(); 30 | 31 | return Glue(X.get_ref(), Y.get_ref()); 32 | } 33 | 34 | 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_cumprod.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_cumprod 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | typename 26 | enable_if2 27 | < 28 | is_arma_type::value, 29 | const Op 30 | >::result 31 | cumprod(const T1& X) 32 | { 33 | arma_extra_debug_sigprint(); 34 | 35 | return Op(X); 36 | } 37 | 38 | 39 | 40 | template 41 | arma_warn_unused 42 | arma_inline 43 | typename 44 | enable_if2 45 | < 46 | is_arma_type::value, 47 | const Op 48 | >::result 49 | cumprod(const T1& X, const uword dim) 50 | { 51 | arma_extra_debug_sigprint(); 52 | 53 | return Op(X, dim, 0); 54 | } 55 | 56 | 57 | 58 | template 59 | arma_warn_unused 60 | arma_inline 61 | const typename arma_scalar_only::result & 62 | cumprod(const T& x) 63 | { 64 | return x; 65 | } 66 | 67 | 68 | 69 | //! @} 70 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_cumsum.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_cumsum 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | typename 26 | enable_if2 27 | < 28 | is_arma_type::value, 29 | const Op 30 | >::result 31 | cumsum(const T1& X) 32 | { 33 | arma_extra_debug_sigprint(); 34 | 35 | return Op(X); 36 | } 37 | 38 | 39 | 40 | template 41 | arma_warn_unused 42 | arma_inline 43 | typename 44 | enable_if2 45 | < 46 | is_arma_type::value, 47 | const Op 48 | >::result 49 | cumsum(const T1& X, const uword dim) 50 | { 51 | arma_extra_debug_sigprint(); 52 | 53 | return Op(X, dim, 0); 54 | } 55 | 56 | 57 | 58 | template 59 | arma_warn_unused 60 | arma_inline 61 | const typename arma_scalar_only::result & 62 | cumsum(const T& x) 63 | { 64 | return x; 65 | } 66 | 67 | 68 | 69 | //! @} 70 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_diagvec.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_diagvec 18 | //! @{ 19 | 20 | 21 | //! extract a diagonal from a matrix 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | const Op 26 | diagvec(const Base& X, const sword diag_id = 0) 27 | { 28 | arma_extra_debug_sigprint(); 29 | 30 | return Op(X.get_ref(), ((diag_id < 0) ? -diag_id : diag_id), ((diag_id < 0) ? 1 : 0) ); 31 | } 32 | 33 | 34 | 35 | template 36 | arma_warn_unused 37 | arma_inline 38 | const SpOp 39 | diagvec(const SpBase& X, const sword diag_id = 0) 40 | { 41 | arma_extra_debug_sigprint(); 42 | 43 | return SpOp(X.get_ref(), ((diag_id < 0) ? -diag_id : diag_id), ((diag_id < 0) ? 1 : 0) ); 44 | } 45 | 46 | 47 | 48 | //! @} 49 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_diff.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_diff 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | typename 26 | enable_if2 27 | < 28 | is_arma_type::value, 29 | const Op 30 | >::result 31 | diff 32 | ( 33 | const T1& X, 34 | const uword k = 1 35 | ) 36 | { 37 | arma_extra_debug_sigprint(); 38 | 39 | return Op(X, k, 0); 40 | } 41 | 42 | 43 | 44 | template 45 | arma_warn_unused 46 | arma_inline 47 | typename 48 | enable_if2 49 | < 50 | is_arma_type::value, 51 | const Op 52 | >::result 53 | diff 54 | ( 55 | const T1& X, 56 | const uword k, 57 | const uword dim 58 | ) 59 | { 60 | arma_extra_debug_sigprint(); 61 | 62 | return Op(X, k, dim); 63 | } 64 | 65 | 66 | 67 | //! @} 68 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_find_unique.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_find_unique 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | inline 25 | typename 26 | enable_if2 27 | < 28 | is_arma_type::value, 29 | const mtOp 30 | >::result 31 | find_unique 32 | ( 33 | const T1& X, 34 | const bool ascending_indices = true 35 | ) 36 | { 37 | arma_extra_debug_sigprint(); 38 | 39 | return mtOp(X, ((ascending_indices) ? uword(1) : uword(0)), uword(0)); 40 | } 41 | 42 | 43 | 44 | template 45 | arma_warn_unused 46 | inline 47 | uvec 48 | find_unique 49 | ( 50 | const BaseCube& X, 51 | const bool ascending_indices = true 52 | ) 53 | { 54 | arma_extra_debug_sigprint(); 55 | 56 | typedef typename T1::elem_type eT; 57 | 58 | const unwrap_cube tmp(X.get_ref()); 59 | 60 | const Mat R( const_cast< eT* >(tmp.M.memptr()), tmp.M.n_elem, 1, false ); 61 | 62 | return find_unique(R,ascending_indices); 63 | } 64 | 65 | 66 | 67 | //! @} 68 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_flip.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_flip 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | typename enable_if2< is_arma_type::value, const Op >::result 26 | flipud(const T1& X) 27 | { 28 | arma_extra_debug_sigprint(); 29 | 30 | return Op(X); 31 | } 32 | 33 | 34 | 35 | template 36 | arma_warn_unused 37 | arma_inline 38 | typename enable_if2< is_arma_type::value, const Op >::result 39 | fliplr(const T1& X) 40 | { 41 | arma_extra_debug_sigprint(); 42 | 43 | return Op(X); 44 | } 45 | 46 | 47 | 48 | template 49 | arma_warn_unused 50 | arma_inline 51 | const SpOp 52 | flipud(const SpBase& X) 53 | { 54 | arma_extra_debug_sigprint(); 55 | 56 | return SpOp(X.get_ref()); 57 | } 58 | 59 | 60 | 61 | template 62 | arma_warn_unused 63 | arma_inline 64 | const SpOp 65 | fliplr(const SpBase& X) 66 | { 67 | arma_extra_debug_sigprint(); 68 | 69 | return SpOp(X.get_ref()); 70 | } 71 | 72 | 73 | 74 | //! @} 75 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_histc.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_histc 18 | //! @{ 19 | 20 | 21 | template 22 | arma_warn_unused 23 | arma_inline 24 | typename 25 | enable_if2 26 | < 27 | (is_arma_type::value) && (is_arma_type::value) && (is_not_complex::value) && (is_same_type::value), 28 | const mtGlue 29 | >::result 30 | histc(const T1& X, const T2& Y) 31 | { 32 | arma_extra_debug_sigprint(); 33 | 34 | return mtGlue(X, Y); 35 | } 36 | 37 | 38 | 39 | template 40 | arma_warn_unused 41 | arma_inline 42 | typename 43 | enable_if2 44 | < 45 | (is_arma_type::value) && (is_arma_type::value) && (is_not_complex::value) && (is_same_type::value), 46 | const mtGlue 47 | >::result 48 | histc(const T1& X, const T2& Y, const uword dim) 49 | { 50 | arma_extra_debug_sigprint(); 51 | 52 | return mtGlue(X, Y, dim); 53 | } 54 | 55 | 56 | //! @} 57 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_intersect.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_intersect 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | inline 25 | typename 26 | enable_if2 27 | < 28 | ( is_arma_type::value && is_arma_type::value && is_same_type::value ), 29 | const Glue 30 | >::result 31 | intersect 32 | ( 33 | const T1& A, 34 | const T2& B 35 | ) 36 | { 37 | arma_extra_debug_sigprint(); 38 | 39 | return Glue(A, B); 40 | } 41 | 42 | 43 | 44 | template 45 | inline 46 | void 47 | intersect 48 | ( 49 | Mat& C, 50 | uvec& iA, 51 | uvec& iB, 52 | const Base& A, 53 | const Base& B 54 | ) 55 | { 56 | arma_extra_debug_sigprint(); 57 | 58 | glue_intersect::apply(C, iA, iB, A.get_ref(), B.get_ref(), true); 59 | } 60 | 61 | 62 | 63 | //! @} 64 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_kmeans.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_kmeans 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | typename enable_if2::value, bool>::result 25 | kmeans 26 | ( 27 | Mat& means, 28 | const Base& data, 29 | const uword k, 30 | const gmm_seed_mode& seed_mode, 31 | const uword n_iter, 32 | const bool print_mode 33 | ) 34 | { 35 | arma_extra_debug_sigprint(); 36 | 37 | typedef typename T1::elem_type eT; 38 | 39 | gmm_priv::gmm_diag model; 40 | 41 | const bool status = model.kmeans_wrapper(means, data.get_ref(), k, seed_mode, n_iter, print_mode); 42 | 43 | if(status == true) 44 | { 45 | means = model.means; 46 | } 47 | else 48 | { 49 | means.soft_reset(); 50 | } 51 | 52 | return status; 53 | } 54 | 55 | 56 | 57 | //! @} 58 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_nonzeros.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_nonzeros 18 | //! @{ 19 | 20 | 21 | template 22 | arma_warn_unused 23 | inline 24 | const Op 25 | nonzeros(const Base& X) 26 | { 27 | arma_extra_debug_sigprint(); 28 | 29 | return Op(X.get_ref()); 30 | } 31 | 32 | 33 | 34 | template 35 | arma_warn_unused 36 | inline 37 | Col 38 | nonzeros(const SpBase& X) 39 | { 40 | arma_extra_debug_sigprint(); 41 | 42 | Col out; 43 | 44 | op_nonzeros::apply_noalias(out, X.get_ref()); 45 | 46 | return out; 47 | } 48 | 49 | 50 | 51 | //! @} 52 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_polyval.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_polyval 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | inline 25 | typename 26 | enable_if2 27 | < 28 | (is_supported_blas_type::value && is_arma_type::value && is_same_type::value), 29 | const Glue 30 | >::result 31 | polyval(const Base& P, const T2& X) 32 | { 33 | arma_extra_debug_sigprint(); 34 | 35 | return Glue(P.get_ref(), X); 36 | } 37 | 38 | 39 | 40 | //! @} 41 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_repelem.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup fn_repelem 19 | //! @{ 20 | 21 | 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | typename 26 | enable_if2 27 | < 28 | is_arma_type::value, 29 | const Op 30 | >::result 31 | repelem(const T1& A, const uword r, const uword c) 32 | { 33 | arma_extra_debug_sigprint(); 34 | 35 | return Op(A, r, c); 36 | } 37 | 38 | 39 | 40 | template 41 | arma_warn_unused 42 | arma_inline 43 | const SpOp 44 | repelem(const SpBase& A, const uword r, const uword c) 45 | { 46 | arma_extra_debug_sigprint(); 47 | 48 | return SpOp(A.get_ref(), r, c); 49 | } 50 | 51 | 52 | 53 | //! @} 54 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_repmat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup fn_repmat 19 | //! @{ 20 | 21 | 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | typename 26 | enable_if2 27 | < 28 | is_arma_type::value, 29 | const Op 30 | >::result 31 | repmat(const T1& A, const uword r, const uword c) 32 | { 33 | arma_extra_debug_sigprint(); 34 | 35 | return Op(A, r, c); 36 | } 37 | 38 | 39 | 40 | template 41 | arma_warn_unused 42 | arma_inline 43 | const SpOp 44 | repmat(const SpBase& A, const uword r, const uword c) 45 | { 46 | arma_extra_debug_sigprint(); 47 | 48 | return SpOp(A.get_ref(), r, c); 49 | } 50 | 51 | 52 | 53 | //! @} 54 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_roots.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_roots 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | inline 25 | typename 26 | enable_if2 27 | < 28 | is_supported_blas_type::value, 29 | const mtOp, T1, op_roots> 30 | >::result 31 | roots(const Base& X) 32 | { 33 | arma_extra_debug_sigprint(); 34 | 35 | return mtOp, T1, op_roots>(X.get_ref()); 36 | } 37 | 38 | 39 | 40 | template 41 | inline 42 | typename 43 | enable_if2 44 | < 45 | is_supported_blas_type::value, 46 | bool 47 | >::result 48 | roots(Mat< std::complex >& out, const Base& X) 49 | { 50 | arma_extra_debug_sigprint(); 51 | 52 | const bool status = op_roots::apply_direct(out, X.get_ref()); 53 | 54 | if(status == false) { arma_debug_warn("roots(): eigen decomposition failed"); } 55 | 56 | return status; 57 | } 58 | 59 | 60 | 61 | //! @} 62 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_shift.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup fn_shift 19 | //! @{ 20 | 21 | 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | typename 26 | enable_if2 27 | < 28 | (is_arma_type::value), 29 | const Op 30 | >::result 31 | shift 32 | ( 33 | const T1& X, 34 | const sword N 35 | ) 36 | { 37 | arma_extra_debug_sigprint(); 38 | 39 | const uword len = (N < 0) ? uword(-N) : uword(N); 40 | const uword neg = (N < 0) ? uword( 1) : uword(0); 41 | 42 | return Op(X, len, neg, uword(0), 'j'); 43 | } 44 | 45 | 46 | 47 | template 48 | arma_warn_unused 49 | arma_inline 50 | typename 51 | enable_if2 52 | < 53 | (is_arma_type::value), 54 | const Op 55 | >::result 56 | shift 57 | ( 58 | const T1& X, 59 | const sword N, 60 | const uword dim 61 | ) 62 | { 63 | arma_extra_debug_sigprint(); 64 | 65 | const uword len = (N < 0) ? uword(-N) : uword(N); 66 | const uword neg = (N < 0) ? uword( 1) : uword(0); 67 | 68 | return Op(X, len, neg, dim, 'j'); 69 | } 70 | 71 | 72 | 73 | //! @} 74 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_shuffle.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup fn_shuffle 19 | //! @{ 20 | 21 | 22 | template 23 | arma_warn_unused 24 | arma_inline 25 | typename 26 | enable_if2 27 | < 28 | (is_arma_type::value), 29 | const Op 30 | >::result 31 | shuffle 32 | ( 33 | const T1& X 34 | ) 35 | { 36 | arma_extra_debug_sigprint(); 37 | 38 | return Op(X); 39 | } 40 | 41 | 42 | 43 | template 44 | arma_warn_unused 45 | arma_inline 46 | typename 47 | enable_if2 48 | < 49 | (is_arma_type::value), 50 | const Op 51 | >::result 52 | shuffle 53 | ( 54 | const T1& X, 55 | const uword dim 56 | ) 57 | { 58 | arma_extra_debug_sigprint(); 59 | 60 | return Op(X, dim, 0); 61 | } 62 | 63 | 64 | 65 | //! @} 66 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_spones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_spones 18 | //! @{ 19 | 20 | 21 | 22 | //! Generate a sparse matrix with the non-zero values in the same locations as in the given sparse matrix X, 23 | //! with the non-zero values set to one 24 | template 25 | arma_warn_unused 26 | inline 27 | SpMat 28 | spones(const SpBase& X) 29 | { 30 | arma_extra_debug_sigprint(); 31 | 32 | typedef typename T1::elem_type eT; 33 | 34 | SpMat out( X.get_ref() ); 35 | 36 | arrayops::inplace_set( access::rwp(out.values), eT(1), out.n_nonzero ); 37 | 38 | return out; 39 | } 40 | 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_toeplitz.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_toeplitz 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | inline 25 | const Op 26 | toeplitz(const Base& X) 27 | { 28 | arma_extra_debug_sigprint(); 29 | 30 | return Op( X.get_ref() ); 31 | } 32 | 33 | 34 | 35 | template 36 | arma_warn_unused 37 | inline 38 | const Op 39 | circ_toeplitz(const Base& X) 40 | { 41 | arma_extra_debug_sigprint(); 42 | 43 | return Op( X.get_ref() ); 44 | } 45 | 46 | 47 | 48 | template 49 | arma_warn_unused 50 | inline 51 | const Glue 52 | toeplitz(const Base& X, const Base& Y) 53 | { 54 | arma_extra_debug_sigprint(); 55 | 56 | return Glue( X.get_ref(), Y.get_ref() ); 57 | } 58 | 59 | 60 | 61 | //! @} 62 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_trapz.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_trapz 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | arma_warn_unused 24 | inline 25 | const Glue 26 | trapz 27 | ( 28 | const Base& X, 29 | const Base& Y, 30 | const uword dim = 0 31 | ) 32 | { 33 | arma_extra_debug_sigprint(); 34 | 35 | return Glue(X.get_ref(), Y.get_ref(), dim); 36 | } 37 | 38 | 39 | 40 | template 41 | arma_warn_unused 42 | inline 43 | const Op 44 | trapz 45 | ( 46 | const Base& Y, 47 | const uword dim = 0 48 | ) 49 | { 50 | arma_extra_debug_sigprint(); 51 | 52 | return Op(Y.get_ref(), dim, uword(0)); 53 | } 54 | 55 | 56 | 57 | //! @} 58 | -------------------------------------------------------------------------------- /include/armadillo_bits/fn_unique.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup fn_unique 18 | //! @{ 19 | 20 | 21 | template 22 | arma_warn_unused 23 | inline 24 | typename 25 | enable_if2 26 | < 27 | is_arma_type::value, 28 | const Op 29 | >::result 30 | unique(const T1& A) 31 | { 32 | arma_extra_debug_sigprint(); 33 | 34 | return Op(A); 35 | } 36 | 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_affmul_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup glue_affmul 18 | //! @{ 19 | 20 | 21 | 22 | class glue_affmul 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Glue& X); 28 | 29 | template 30 | inline static void apply_noalias(Mat& out, const T1& A, const T2& B); 31 | 32 | template 33 | inline static void apply_noalias_square(Mat& out, const T1& A, const T2& B); 34 | 35 | template 36 | inline static void apply_noalias_rectangle(Mat& out, const T1& A, const T2& B); 37 | 38 | template 39 | inline static void apply_noalias_generic(Mat& out, const T1& A, const T2& B); 40 | }; 41 | 42 | 43 | 44 | //! @} 45 | 46 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_atan2_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_atan2 19 | //! @{ 20 | 21 | 22 | 23 | class glue_atan2 24 | { 25 | public: 26 | 27 | 28 | // matrices 29 | 30 | template inline static void apply(Mat& out, const Glue& expr); 31 | 32 | template inline static void apply_noalias(Mat& out, const Proxy& P1, const Proxy& P2); 33 | 34 | 35 | // cubes 36 | 37 | template inline static void apply(Cube& out, const GlueCube& expr); 38 | 39 | template inline static void apply_noalias(Cube& out, const ProxyCube& P1, const ProxyCube& P2); 40 | }; 41 | 42 | 43 | 44 | //! @} 45 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_conv_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_conv 19 | //! @{ 20 | 21 | 22 | 23 | class glue_conv 24 | { 25 | public: 26 | 27 | template inline static void apply(Mat& out, const Mat& A, const Mat& B, const bool A_is_col); 28 | 29 | template inline static void apply(Mat& out, const Glue& X); 30 | }; 31 | 32 | 33 | 34 | class glue_conv2 35 | { 36 | public: 37 | 38 | template inline static void apply(Mat& out, const Mat& A, const Mat& B); 39 | 40 | template inline static void apply(Mat& out, const Glue& expr); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | 47 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_cor_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_cor 19 | //! @{ 20 | 21 | 22 | 23 | class glue_cor 24 | { 25 | public: 26 | 27 | template inline static void direct_cor(Mat& out, const Mat& A, const Mat& B, const uword norm_type); 28 | template inline static void direct_cor(Mat< std::complex >& out, const Mat< std::complex >& A, const Mat< std::complex >& B, const uword norm_type); 29 | 30 | template inline static void apply(Mat& out, const Glue& X); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | 37 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_cov_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_cov 19 | //! @{ 20 | 21 | 22 | 23 | class glue_cov 24 | { 25 | public: 26 | 27 | template inline static void direct_cov(Mat& out, const Mat& A, const Mat& B, const uword norm_type); 28 | template inline static void direct_cov(Mat< std::complex >& out, const Mat< std::complex >& A, const Mat< std::complex >& B, const uword norm_type); 29 | 30 | template inline static void apply(Mat& out, const Glue& X); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | 37 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_cross_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_cross 19 | //! @{ 20 | 21 | 22 | 23 | class glue_cross 24 | { 25 | public: 26 | 27 | template inline static void apply(Mat& out, const Glue& X); 28 | }; 29 | 30 | 31 | 32 | //! @} 33 | 34 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_hist_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup glue_hist 18 | //! @{ 19 | 20 | 21 | class glue_hist 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply_noalias(Mat& out, const Mat& X, const Mat& C, const uword dim); 27 | 28 | template 29 | inline static void apply(Mat& out, const mtGlue& expr); 30 | }; 31 | 32 | 33 | 34 | class glue_hist_default 35 | { 36 | public: 37 | 38 | template 39 | inline static void apply(Mat& out, const mtGlue& expr); 40 | }; 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_histc_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup glue_histc 18 | //! @{ 19 | 20 | 21 | class glue_histc 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply_noalias(Mat& C, const Mat& A, const Mat& B, const uword dim); 27 | 28 | template 29 | inline static void apply(Mat& C, const mtGlue& expr); 30 | }; 31 | 32 | 33 | 34 | class glue_histc_default 35 | { 36 | public: 37 | 38 | template 39 | inline static void apply(Mat& C, const mtGlue& expr); 40 | }; 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_hypot_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_hypot 19 | //! @{ 20 | 21 | 22 | 23 | class glue_hypot 24 | { 25 | public: 26 | 27 | 28 | // matrices 29 | 30 | template inline static void apply(Mat& out, const Glue& expr); 31 | 32 | template inline static void apply_noalias(Mat& out, const Proxy& P1, const Proxy& P2); 33 | 34 | 35 | // cubes 36 | 37 | template inline static void apply(Cube& out, const GlueCube& expr); 38 | 39 | template inline static void apply_noalias(Cube& out, const ProxyCube& P1, const ProxyCube& P2); 40 | }; 41 | 42 | 43 | 44 | //! @} 45 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_intersect_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup glue_intersect 18 | //! @{ 19 | 20 | 21 | 22 | class glue_intersect 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Glue& X); 28 | 29 | template 30 | inline static void apply(Mat& out, uvec& iA, uvec& iB, const Base& A_expr, const Base& B_expr, const bool calc_indx); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | 37 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_join_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_join 19 | //! @{ 20 | 21 | 22 | 23 | class glue_join_cols 24 | { 25 | public: 26 | 27 | template 28 | inline static void apply(Mat& out, const Glue& X); 29 | 30 | template 31 | inline static void apply_noalias(Mat& out, const Proxy& A, const Proxy& B); 32 | }; 33 | 34 | 35 | 36 | class glue_join_rows 37 | { 38 | public: 39 | 40 | template 41 | inline static void apply(Mat& out, const Glue& X); 42 | 43 | template 44 | inline static void apply_noalias(Mat& out, const Proxy& A, const Proxy& B); 45 | }; 46 | 47 | 48 | 49 | class glue_join_slices 50 | { 51 | public: 52 | 53 | template 54 | inline static void apply(Cube& out, const GlueCube& X); 55 | }; 56 | 57 | 58 | 59 | //! @} 60 | 61 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_kron_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_kron 19 | //! @{ 20 | 21 | 22 | 23 | class glue_kron 24 | { 25 | public: 26 | 27 | template inline static void direct_kron(Mat& out, const Mat& A, const Mat& B); 28 | template inline static void direct_kron(Mat< std::complex >& out, const Mat< std::complex >& A, const Mat& B); 29 | template inline static void direct_kron(Mat< std::complex >& out, const Mat& A, const Mat< std::complex >& B); 30 | 31 | template inline static void apply(Mat& out, const Glue& X); 32 | }; 33 | 34 | 35 | 36 | //! @} 37 | 38 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_max_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_max 19 | //! @{ 20 | 21 | 22 | 23 | class glue_max 24 | { 25 | public: 26 | 27 | // dense matrices 28 | 29 | template inline static void apply(Mat& out, const Glue& X); 30 | 31 | template inline static void apply(Mat< eT >& out, const Proxy& PA, const Proxy& PB); 32 | 33 | template inline static void apply(Mat< std::complex >& out, const Proxy& PA, const Proxy& PB); 34 | 35 | 36 | // cubes 37 | 38 | template inline static void apply(Cube& out, const GlueCube& X); 39 | 40 | template inline static void apply(Cube< eT >& out, const ProxyCube& PA, const ProxyCube& PB); 41 | 42 | template inline static void apply(Cube< std::complex >& out, const ProxyCube& PA, const ProxyCube& PB); 43 | }; 44 | 45 | 46 | 47 | //! @} 48 | 49 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_min_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_min 19 | //! @{ 20 | 21 | 22 | 23 | class glue_min 24 | { 25 | public: 26 | 27 | // dense matrices 28 | 29 | template inline static void apply(Mat& out, const Glue& X); 30 | 31 | template inline static void apply(Mat< eT >& out, const Proxy& PA, const Proxy& PB); 32 | 33 | template inline static void apply(Mat< std::complex >& out, const Proxy& PA, const Proxy& PB); 34 | 35 | 36 | // cubes 37 | 38 | template inline static void apply(Cube& out, const GlueCube& X); 39 | 40 | template inline static void apply(Cube< eT >& out, const ProxyCube& PA, const ProxyCube& PB); 41 | 42 | template inline static void apply(Cube< std::complex >& out, const ProxyCube& PA, const ProxyCube& PB); 43 | }; 44 | 45 | 46 | 47 | //! @} 48 | 49 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_mvnrnd_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup glue_mvnrnd 18 | //! @{ 19 | 20 | 21 | class glue_mvnrnd 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply(Mat& out, const Glue& expr); 27 | 28 | template 29 | inline static bool apply_direct(Mat& out, const Base& M, const Base& C, const uword N); 30 | 31 | template 32 | inline static bool apply_noalias(Mat& out, const Mat& M, const Mat& C, const uword N); 33 | }; 34 | 35 | 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_polyfit_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_polyfit 19 | //! @{ 20 | 21 | 22 | 23 | class glue_polyfit 24 | { 25 | public: 26 | 27 | template inline static bool apply_noalias(Mat& out, const Col& X, const Col& Y, const uword N); 28 | 29 | template inline static bool apply_direct(Mat& out, const Base& X_expr, const Base& Y_expr, const uword N); 30 | 31 | template inline static void apply(Mat& out, const Glue& expr); 32 | }; 33 | 34 | 35 | 36 | //! @} 37 | 38 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_polyval_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_polyval 19 | //! @{ 20 | 21 | 22 | 23 | class glue_polyval 24 | { 25 | public: 26 | 27 | template inline static void apply_noalias(Mat& out, const Mat& P, const Mat& X); 28 | 29 | template inline static void apply(Mat& out, const Glue& expr); 30 | }; 31 | 32 | 33 | 34 | //! @} 35 | 36 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_toeplitz_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_toeplitz 19 | //! @{ 20 | 21 | 22 | 23 | class glue_toeplitz 24 | { 25 | public: 26 | 27 | template inline static void apply(Mat& out, const Glue& in); 28 | }; 29 | 30 | 31 | 32 | //! @} 33 | -------------------------------------------------------------------------------- /include/armadillo_bits/glue_trapz_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup glue_trapz 19 | //! @{ 20 | 21 | 22 | 23 | class glue_trapz 24 | { 25 | public: 26 | 27 | template inline static void apply(Mat& out, const Glue& in); 28 | 29 | template inline static void apply_noalias(Mat& out, const Mat& X, const Mat& Y, const uword dim); 30 | }; 31 | 32 | 33 | 34 | class op_trapz 35 | { 36 | public: 37 | 38 | template inline static void apply(Mat& out, const Op& in); 39 | 40 | template inline static void apply_noalias(Mat& out, const Mat& Y, const uword dim); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | -------------------------------------------------------------------------------- /include/armadillo_bits/include_atlas.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | #if defined(ARMA_USE_ATLAS) 18 | #if !defined(ARMA_ATLAS_INCLUDE_DIR) 19 | extern "C" 20 | { 21 | #include 22 | #include 23 | } 24 | #else 25 | #define ARMA_STR1(x) x 26 | #define ARMA_STR2(x) ARMA_STR1(x) 27 | 28 | #define ARMA_CBLAS ARMA_STR2(ARMA_ATLAS_INCLUDE_DIR)ARMA_STR2(cblas.h) 29 | #define ARMA_CLAPACK ARMA_STR2(ARMA_ATLAS_INCLUDE_DIR)ARMA_STR2(clapack.h) 30 | 31 | extern "C" 32 | { 33 | #include ARMA_INCFILE_WRAP(ARMA_CBLAS) 34 | #include ARMA_INCFILE_WRAP(ARMA_CLAPACK) 35 | } 36 | 37 | #undef ARMA_STR1 38 | #undef ARMA_STR2 39 | #undef ARMA_CBLAS 40 | #undef ARMA_CLAPACK 41 | #endif 42 | #endif 43 | -------------------------------------------------------------------------------- /include/armadillo_bits/include_hdf5.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | #if defined(ARMA_USE_HDF5) 18 | #if !defined(ARMA_HDF5_INCLUDE_DIR) 19 | #include 20 | #else 21 | #define ARMA_STR1(x) x 22 | #define ARMA_STR2(x) ARMA_STR1(x) 23 | 24 | #define ARMA_HDF5_HEADER ARMA_STR2(ARMA_HDF5_INCLUDE_DIR)ARMA_STR2(hdf5.h) 25 | 26 | #include ARMA_INCFILE_WRAP(ARMA_HDF5_HEADER) 27 | 28 | #undef ARMA_STR1 29 | #undef ARMA_STR2 30 | #undef ARMA_HDF5_HEADER 31 | #endif 32 | 33 | #if defined(H5_USE_16_API_DEFAULT) || defined(H5_USE_16_API) 34 | #pragma message ("WARNING: disabling use of HDF5 due to its incompatible configuration") 35 | #undef ARMA_USE_HDF5 36 | #undef ARMA_USE_HDF5_ALT 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /include/armadillo_bits/mtGlueCube_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup mtGlueCube 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | class mtGlueCube : public BaseCube > 24 | { 25 | public: 26 | 27 | typedef out_eT elem_type; 28 | typedef typename get_pod_type::result pod_type; 29 | 30 | arma_inline mtGlueCube(const T1& in_A, const T2& in_B); 31 | arma_inline mtGlueCube(const T1& in_A, const T2& in_B, const uword in_aux_uword); 32 | arma_inline ~mtGlueCube(); 33 | 34 | arma_aligned const T1& A; //!< first operand 35 | arma_aligned const T2& B; //!< second operand 36 | arma_aligned uword aux_uword; //!< storage of auxiliary data, uword format 37 | }; 38 | 39 | 40 | 41 | //! @} 42 | -------------------------------------------------------------------------------- /include/armadillo_bits/mtGlueCube_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup mtGlueCube 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | mtGlueCube::mtGlueCube(const T1& in_A, const T2& in_B) 25 | : A(in_A) 26 | , B(in_B) 27 | { 28 | arma_extra_debug_sigprint(); 29 | } 30 | 31 | 32 | 33 | template 34 | inline 35 | mtGlueCube::mtGlueCube(const T1& in_A, const T2& in_B, const uword in_aux_uword) 36 | : A(in_A) 37 | , B(in_B) 38 | , aux_uword(in_aux_uword) 39 | { 40 | arma_extra_debug_sigprint(); 41 | } 42 | 43 | 44 | 45 | template 46 | inline 47 | mtGlueCube::~mtGlueCube() 48 | { 49 | arma_extra_debug_sigprint(); 50 | } 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /include/armadillo_bits/mtGlue_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup mtGlue 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | mtGlue::mtGlue(const T1& in_A, const T2& in_B) 25 | : A(in_A) 26 | , B(in_B) 27 | { 28 | arma_extra_debug_sigprint(); 29 | } 30 | 31 | 32 | 33 | template 34 | inline 35 | mtGlue::mtGlue(const T1& in_A, const T2& in_B, const uword in_aux_uword) 36 | : A(in_A) 37 | , B(in_B) 38 | , aux_uword(in_aux_uword) 39 | { 40 | arma_extra_debug_sigprint(); 41 | } 42 | 43 | 44 | 45 | template 46 | inline 47 | mtGlue::~mtGlue() 48 | { 49 | arma_extra_debug_sigprint(); 50 | } 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /include/armadillo_bits/mtSpOp_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup mtSpOp 18 | //! @{ 19 | 20 | // Class for delayed multi-type sparse operations. These are operations where 21 | // the resulting type is different than the stored type. 22 | 23 | 24 | 25 | template 26 | class mtSpOp : public SpBase > 27 | { 28 | public: 29 | 30 | typedef out_eT elem_type; 31 | typedef typename get_pod_type::result pod_type; 32 | 33 | typedef typename T1::elem_type in_eT; 34 | 35 | static const bool is_row = false; 36 | static const bool is_col = false; 37 | 38 | inline explicit mtSpOp(const T1& in_m); 39 | inline mtSpOp(const T1& in_m, const uword aux_uword_a, const uword aux_uword_b); 40 | 41 | inline ~mtSpOp(); 42 | 43 | arma_aligned const T1& m; 44 | arma_aligned uword aux_uword_a; 45 | arma_aligned uword aux_uword_b; 46 | }; 47 | 48 | 49 | 50 | //! @} 51 | -------------------------------------------------------------------------------- /include/armadillo_bits/mtSpOp_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup mtSpOp 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | mtSpOp::mtSpOp(const T1& in_m) 25 | : m(in_m) 26 | { 27 | arma_extra_debug_sigprint(); 28 | } 29 | 30 | 31 | 32 | template 33 | inline 34 | mtSpOp::mtSpOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) 35 | : m(in_m) 36 | , aux_uword_a(in_aux_uword_a) 37 | , aux_uword_b(in_aux_uword_b) 38 | { 39 | arma_extra_debug_sigprint(); 40 | } 41 | 42 | 43 | 44 | template 45 | inline 46 | mtSpOp::~mtSpOp() 47 | { 48 | arma_extra_debug_sigprint(); 49 | } 50 | -------------------------------------------------------------------------------- /include/armadillo_bits/newarp_DenseGenMatProd_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | namespace newarp 18 | { 19 | 20 | 21 | //! Define matrix operations on existing matrix objects 22 | template 23 | class DenseGenMatProd 24 | { 25 | private: 26 | 27 | const Mat& op_mat; 28 | 29 | 30 | public: 31 | 32 | const uword n_rows; // number of rows of the underlying matrix 33 | const uword n_cols; // number of columns of the underlying matrix 34 | 35 | inline DenseGenMatProd(const Mat& mat_obj); 36 | 37 | inline void perform_op(eT* x_in, eT* y_out) const; 38 | }; 39 | 40 | 41 | } // namespace newarp 42 | -------------------------------------------------------------------------------- /include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | namespace newarp 18 | { 19 | 20 | 21 | template 22 | inline 23 | DenseGenMatProd::DenseGenMatProd(const Mat& mat_obj) 24 | : op_mat(mat_obj) 25 | , n_rows(mat_obj.n_rows) 26 | , n_cols(mat_obj.n_cols) 27 | { 28 | arma_extra_debug_sigprint(); 29 | } 30 | 31 | 32 | 33 | // Perform the matrix-vector multiplication operation \f$y=Ax\f$. 34 | // y_out = A * x_in 35 | template 36 | inline 37 | void 38 | DenseGenMatProd::perform_op(eT* x_in, eT* y_out) const 39 | { 40 | arma_extra_debug_sigprint(); 41 | 42 | const Col x(x_in , n_cols, false, true); 43 | Col y(y_out, n_rows, false, true); 44 | 45 | y = op_mat * x; 46 | } 47 | 48 | 49 | } // namespace newarp 50 | -------------------------------------------------------------------------------- /include/armadillo_bits/newarp_SparseGenMatProd_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | namespace newarp 18 | { 19 | 20 | 21 | //! Define matrix operations on existing matrix objects 22 | template 23 | class SparseGenMatProd 24 | { 25 | private: 26 | 27 | const SpMat& op_mat; 28 | 29 | 30 | public: 31 | 32 | const uword n_rows; // number of rows of the underlying matrix 33 | const uword n_cols; // number of columns of the underlying matrix 34 | 35 | inline SparseGenMatProd(const SpMat& mat_obj); 36 | 37 | inline void perform_op(eT* x_in, eT* y_out) const; 38 | }; 39 | 40 | 41 | } // namespace newarp 42 | -------------------------------------------------------------------------------- /include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | namespace newarp 18 | { 19 | 20 | 21 | template 22 | inline 23 | SparseGenMatProd::SparseGenMatProd(const SpMat& mat_obj) 24 | : op_mat(mat_obj) 25 | , n_rows(mat_obj.n_rows) 26 | , n_cols(mat_obj.n_cols) 27 | { 28 | arma_extra_debug_sigprint(); 29 | } 30 | 31 | 32 | 33 | // Perform the matrix-vector multiplication operation \f$y=Ax\f$. 34 | // y_out = A * x_in 35 | template 36 | inline 37 | void 38 | SparseGenMatProd::perform_op(eT* x_in, eT* y_out) const 39 | { 40 | arma_extra_debug_sigprint(); 41 | 42 | const Col x(x_in , n_cols, false, true); 43 | Col y(y_out, n_rows, false, true); 44 | 45 | y = op_mat * x; 46 | } 47 | 48 | 49 | } // namespace newarp 50 | -------------------------------------------------------------------------------- /include/armadillo_bits/newarp_cx_attrib.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | namespace newarp 18 | { 19 | 20 | 21 | //! Tiny functions to check attributes of complex numbers 22 | struct cx_attrib 23 | { 24 | template 25 | arma_inline static bool is_real (const std::complex& v, const T eps) { return (std::abs(v.imag()) <= eps); } 26 | 27 | template 28 | arma_inline static bool is_complex(const std::complex& v, const T eps) { return (std::abs(v.imag()) > eps); } 29 | 30 | template 31 | 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); } 32 | }; 33 | 34 | 35 | } // namespace newarp 36 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_chi2rnd_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_chi2rnd 18 | //! @{ 19 | 20 | 21 | class op_chi2rnd 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply(Mat& out, const Op& in); 27 | 28 | template 29 | inline static void apply_noalias(Mat& out, const Proxy& P); 30 | 31 | template 32 | inline static void fill_constant_df(Mat& out, const eT df); 33 | }; 34 | 35 | 36 | 37 | #if defined(ARMA_USE_CXX11) 38 | 39 | template 40 | class op_chi2rnd_varying_df 41 | { 42 | public: 43 | 44 | arma_aligned std::mt19937_64 motor; 45 | 46 | inline ~op_chi2rnd_varying_df(); 47 | inline op_chi2rnd_varying_df(); 48 | 49 | inline eT operator()(const eT df); 50 | }; 51 | 52 | #endif 53 | 54 | 55 | //! @} 56 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_chol_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_chol 18 | //! @{ 19 | 20 | 21 | 22 | class op_chol 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& X); 28 | 29 | template 30 | inline static bool apply_direct(Mat& out, const Base& A_expr, const uword layout); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_clamp_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_clamp 19 | //! @{ 20 | 21 | 22 | 23 | class op_clamp 24 | { 25 | public: 26 | 27 | // matrices 28 | 29 | template inline static void apply(Mat& out, const mtOp& in); 30 | 31 | template inline static void apply_proxy_noalias(Mat& out, const Proxy& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val); 32 | 33 | template inline static void apply_direct(Mat& out, const Mat& X, const eT min_val, const eT max_val); 34 | 35 | // cubes 36 | 37 | template inline static void apply(Cube& out, const mtOpCube& in); 38 | 39 | template inline static void apply_proxy_noalias(Cube& out, const ProxyCube& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val); 40 | 41 | template inline static void apply_direct(Cube& out, const Cube& X, const eT min_val, const eT max_val); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_cor_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_cor 19 | //! @{ 20 | 21 | 22 | 23 | class op_cor 24 | { 25 | public: 26 | 27 | template inline static void direct_cor(Mat& out, const Mat& X, const uword norm_type); 28 | template inline static void direct_cor(Mat< std::complex >& out, const Mat< std::complex >& X, const uword norm_type); 29 | 30 | template inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_cov_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_cov 19 | //! @{ 20 | 21 | 22 | 23 | class op_cov 24 | { 25 | public: 26 | 27 | template inline static void direct_cov(Mat& out, const Mat& X, const uword norm_type); 28 | template inline static void direct_cov(Mat< std::complex >& out, const Mat< std::complex >& X, const uword norm_type); 29 | 30 | template inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_cumprod_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_cumprod 18 | //! @{ 19 | 20 | 21 | 22 | class op_cumprod 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 28 | 29 | template 30 | inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | class op_cumprod_default 36 | { 37 | public: 38 | 39 | template 40 | inline static void apply(Mat& out, const Op& in); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_cumsum_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_cumsum 18 | //! @{ 19 | 20 | 21 | 22 | class op_cumsum 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 28 | 29 | template 30 | inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | class op_cumsum_default 36 | { 37 | public: 38 | 39 | template 40 | inline static void apply(Mat& out, const Op& in); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_diagmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_diagmat 18 | //! @{ 19 | 20 | 21 | 22 | class op_diagmat 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& X); 28 | }; 29 | 30 | 31 | 32 | class op_diagmat2 33 | { 34 | public: 35 | 36 | template 37 | inline static void apply(Mat& out, const Proxy& P, const uword row_offset, const uword col_offset); 38 | 39 | template 40 | inline static void apply(Mat& out, const Op& X); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_diagvec_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_diagvec 18 | //! @{ 19 | 20 | 21 | 22 | class op_diagvec 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& X); 28 | 29 | template 30 | arma_hot inline static void apply_unwrap(Mat& out, const T1& X, const uword row_offset, const uword col_offset, const uword len); 31 | 32 | template 33 | arma_hot inline static void apply_proxy(Mat& out, const Proxy& P, const uword row_offset, const uword col_offset, const uword len); 34 | }; 35 | 36 | 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_diff_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_diff 18 | //! @{ 19 | 20 | 21 | 22 | class op_diff 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply_noalias(Mat& out, const Mat& X, const uword k, const uword dim); 28 | 29 | template 30 | inline static void apply(Mat& out, const Op& in); 31 | }; 32 | 33 | 34 | 35 | class op_diff_default 36 | { 37 | public: 38 | 39 | template 40 | inline static void apply(Mat& out, const Op& in); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_dotext_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_dotext 18 | //! @{ 19 | 20 | 21 | 22 | class op_dotext 23 | { 24 | public: 25 | 26 | 27 | template 28 | inline static eT direct_rowvec_mat_colvec (const eT* A_mem, const Mat& B, const eT* C_mem); 29 | 30 | template 31 | inline static eT direct_rowvec_transmat_colvec (const eT* A_mem, const Mat& B, const eT* C_mem); 32 | 33 | template 34 | inline static eT direct_rowvec_diagmat_colvec (const eT* A_mem, const Mat& B, const eT* C_mem); 35 | 36 | template 37 | inline static eT direct_rowvec_invdiagmat_colvec(const eT* A_mem, const Mat& B, const eT* C_mem); 38 | 39 | template 40 | inline static eT direct_rowvec_invdiagvec_colvec(const eT* A_mem, const Mat& B, const eT* C_mem); 41 | 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | 48 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_expmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_expmat 19 | //! @{ 20 | 21 | 22 | 23 | class op_expmat 24 | { 25 | public: 26 | 27 | template 28 | inline static void apply(Mat& out, const Op& expr); 29 | 30 | template 31 | inline static bool apply_direct(Mat& out, const Base& X); 32 | }; 33 | 34 | 35 | 36 | class op_expmat_sym 37 | { 38 | public: 39 | 40 | template 41 | inline static void apply(Mat& out, const Op& in); 42 | 43 | template 44 | inline static bool apply_direct(Mat& out, const Base& expr); 45 | }; 46 | 47 | 48 | 49 | //! @} 50 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_flip_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_flip 18 | //! @{ 19 | 20 | 21 | 22 | class op_flipud 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& in); 28 | 29 | template 30 | inline static void apply_direct(Mat& out, const Mat& X); 31 | 32 | template 33 | inline static void apply_proxy_noalias(Mat& out, const Proxy& P); 34 | }; 35 | 36 | 37 | 38 | 39 | class op_fliplr 40 | { 41 | public: 42 | 43 | template 44 | inline static void apply(Mat& out, const Op& in); 45 | 46 | template 47 | inline static void apply_direct(Mat& out, const Mat& X); 48 | 49 | template 50 | inline static void apply_proxy_noalias(Mat& out, const Proxy& P); 51 | }; 52 | 53 | 54 | 55 | //! @} 56 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_hist_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_hist 19 | //! @{ 20 | 21 | 22 | 23 | class op_hist 24 | { 25 | public: 26 | 27 | template 28 | inline static void apply_noalias(Mat& out, const Mat& A, const uword n_bins, const bool A_is_row); 29 | 30 | template 31 | inline static void apply(Mat& out, const mtOp& X); 32 | }; 33 | 34 | 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_index_max_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_index_max 18 | //! @{ 19 | 20 | 21 | class op_index_max 22 | { 23 | public: 24 | 25 | // dense matrices 26 | 27 | template 28 | inline static void apply(Mat& out, const mtOp& in); 29 | 30 | template 31 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 32 | 33 | 34 | // cubes 35 | 36 | template 37 | inline static void apply(Cube& out, const mtOpCube& in); 38 | 39 | template 40 | inline static void apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_not_cx::result* junk = 0); 41 | 42 | template 43 | inline static void apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_cx_only::result* junk = 0); 44 | 45 | 46 | // sparse matrices 47 | 48 | template 49 | inline static void apply(Mat& out, const SpBase& expr, const uword dim); 50 | }; 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_index_min_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_index_min 18 | //! @{ 19 | 20 | 21 | class op_index_min 22 | { 23 | public: 24 | 25 | // dense matrices 26 | 27 | template 28 | inline static void apply(Mat& out, const mtOp& in); 29 | 30 | template 31 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 32 | 33 | 34 | // cubes 35 | 36 | template 37 | inline static void apply(Cube& out, const mtOpCube& in); 38 | 39 | template 40 | inline static void apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_not_cx::result* junk = 0); 41 | 42 | template 43 | inline static void apply_noalias(Cube& out, const Cube& X, const uword dim, const typename arma_cx_only::result* junk = 0); 44 | 45 | 46 | // sparse matrices 47 | 48 | template 49 | inline static void apply(Mat& out, const SpBase& expr, const uword dim); 50 | }; 51 | 52 | 53 | 54 | //! @} 55 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_inv_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_inv 18 | //! @{ 19 | 20 | 21 | 22 | //! 'invert matrix' operation (general matrices) 23 | class op_inv 24 | { 25 | public: 26 | 27 | template 28 | inline static void apply(Mat& out, const Op& in); 29 | 30 | template 31 | inline static void apply_noalias(Mat& out, const Mat& A); 32 | 33 | template 34 | inline static void apply_diagmat(Mat& out, const T1& X); 35 | }; 36 | 37 | 38 | 39 | //! 'invert matrix' operation (triangular matrices) 40 | class op_inv_tr 41 | { 42 | public: 43 | 44 | template 45 | inline static void apply(Mat& out, const Op& in); 46 | }; 47 | 48 | 49 | 50 | //! 'invert matrix' operation (symmetric positive definite matrices) 51 | class op_inv_sympd 52 | { 53 | public: 54 | 55 | template 56 | inline static void apply(Mat& out, const Op& in); 57 | }; 58 | 59 | 60 | 61 | //! @} 62 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_nonzeros_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_nonzeros 19 | //! @{ 20 | 21 | 22 | 23 | class op_nonzeros 24 | { 25 | public: 26 | 27 | // for dense matrices 28 | 29 | template 30 | static inline void apply_noalias(Mat& out, const Proxy& P); 31 | 32 | template 33 | static inline void apply(Mat& out, const Op& X); 34 | 35 | 36 | // for sparse matrices 37 | 38 | template 39 | static inline void apply_noalias(Mat& out, const SpBase& X); 40 | }; 41 | 42 | 43 | 44 | //! @} 45 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_normalise_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_normalise 19 | //! @{ 20 | 21 | 22 | 23 | class op_normalise_vec 24 | { 25 | public: 26 | 27 | template inline static void apply(Mat& out, const Op& in); 28 | }; 29 | 30 | 31 | 32 | class op_normalise_mat 33 | { 34 | public: 35 | 36 | template inline static void apply(Mat& out, const Op& in); 37 | 38 | template inline static void apply(Mat& out, const Mat& A, const uword p, const uword dim); 39 | }; 40 | 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_orth_null_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_orth_null 19 | //! @{ 20 | 21 | 22 | 23 | class op_orth 24 | { 25 | public: 26 | 27 | template 28 | inline static void apply(Mat& out, const Op& expr); 29 | 30 | template 31 | inline static bool apply_direct(Mat& out, const Base& expr, typename T1::pod_type tol); 32 | }; 33 | 34 | 35 | 36 | class op_null 37 | { 38 | public: 39 | 40 | template 41 | inline static void apply(Mat& out, const Op& expr); 42 | 43 | template 44 | inline static bool apply_direct(Mat& out, const Base& expr, typename T1::pod_type tol); 45 | }; 46 | 47 | 48 | 49 | //! @} 50 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_pinv_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_pinv 19 | //! @{ 20 | 21 | 22 | 23 | class op_pinv 24 | { 25 | public: 26 | 27 | template inline static void apply(Mat& out, const Op& in); 28 | 29 | template inline static bool apply_direct(Mat& out, const Base& expr, typename T1::pod_type tol, const bool use_divide_and_conquer); 30 | }; 31 | 32 | 33 | 34 | //! @} 35 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_prod_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_prod 18 | //! @{ 19 | 20 | 21 | class op_prod 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 27 | 28 | template 29 | inline static void apply(Mat& out, const Op& in); 30 | 31 | template 32 | inline static eT prod(const subview& S); 33 | 34 | template 35 | inline static typename T1::elem_type prod(const Base& X); 36 | }; 37 | 38 | 39 | //! @} 40 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_range_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_range 18 | //! @{ 19 | 20 | 21 | class op_range 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply(Mat& out, const Op& in); 27 | 28 | template 29 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 30 | 31 | template 32 | inline static typename T1::elem_type vector_range(const T1& expr); 33 | }; 34 | 35 | 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_repelem_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_repelem 19 | //! @{ 20 | 21 | 22 | 23 | class op_repelem 24 | { 25 | public: 26 | 27 | template inline static void apply_noalias(Mat& out, const obj& X, const uword copies_per_row, const uword copies_per_col); 28 | 29 | template inline static void apply(Mat& out, const Op& in); 30 | }; 31 | 32 | 33 | 34 | //! @} 35 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_repmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_repmat 19 | //! @{ 20 | 21 | 22 | 23 | class op_repmat 24 | { 25 | public: 26 | 27 | template inline static void apply_noalias(Mat& out, const obj& X, const uword copies_per_row, const uword copies_per_col); 28 | 29 | template inline static void apply(Mat& out, const Op& in); 30 | }; 31 | 32 | 33 | 34 | //! @} 35 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_reshape_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_reshape 19 | //! @{ 20 | 21 | 22 | 23 | class op_reshape 24 | { 25 | public: 26 | 27 | template inline static void apply_unwrap(Mat& out, const Mat& A, const uword in_n_rows, const uword in_n_cols, const uword in_dim); 28 | 29 | template inline static void apply_proxy (Mat& out, const Proxy& P, const uword in_n_rows, const uword in_n_cols); 30 | 31 | template inline static void apply (Mat& out, const Op& in); 32 | }; 33 | 34 | 35 | 36 | class op_reshape_ext 37 | { 38 | public: 39 | 40 | template inline static void apply( Mat& out, const Op& in); 41 | template inline static void apply(Cube& out, const OpCube& in); 42 | }; 43 | 44 | 45 | 46 | //! @} 47 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_resize_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_resize 19 | //! @{ 20 | 21 | 22 | 23 | class op_resize 24 | { 25 | public: 26 | 27 | template inline static void apply( Mat& out, const Op& in); 28 | template inline static void apply(Cube& out, const OpCube& in); 29 | }; 30 | 31 | 32 | 33 | //! @} 34 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_reverse_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_reverse 18 | //! @{ 19 | 20 | 21 | 22 | class op_reverse_vec 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& in); 28 | }; 29 | 30 | 31 | 32 | 33 | class op_reverse_mat 34 | { 35 | public: 36 | 37 | template 38 | inline static void apply(Mat& out, const Op& in); 39 | }; 40 | 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_roots_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_roots 18 | //! @{ 19 | 20 | 21 | 22 | class op_roots 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat< std::complex >& out, const mtOp, T1, op_roots>& expr); 28 | 29 | template 30 | inline static bool apply_direct(Mat< std::complex >& out, const Base& X); 31 | 32 | template 33 | inline static bool apply_noalias(Mat< std::complex::result> >& out, const Mat& X); 34 | }; 35 | 36 | 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_shift_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_shift 19 | //! @{ 20 | 21 | 22 | 23 | class op_shift_default 24 | { 25 | public: 26 | 27 | template inline static void apply(Mat& out, const Op& in); 28 | }; 29 | 30 | 31 | 32 | class op_shift 33 | { 34 | public: 35 | 36 | template inline static void apply(Mat& out, const Op& in); 37 | 38 | template inline static void apply_direct(Mat& out, const Mat& X, const uword len, const uword neg, const uword dim); 39 | 40 | template inline static void apply_noalias(Mat& out, const Mat& X, const uword len, const uword neg, const uword dim); 41 | 42 | template inline static void apply_alias(Mat& out, const uword len, const uword neg, const uword dim); 43 | }; 44 | 45 | 46 | 47 | //! @} 48 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_shuffle_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_shuffle 19 | //! @{ 20 | 21 | 22 | 23 | class op_shuffle 24 | { 25 | public: 26 | 27 | template inline static void apply_direct(Mat& out, const Mat& X, const uword dim); 28 | 29 | template inline static void apply(Mat& out, const Op& in); 30 | }; 31 | 32 | 33 | 34 | class op_shuffle_default 35 | { 36 | public: 37 | 38 | template inline static void apply(Mat& out, const Op& in); 39 | }; 40 | 41 | 42 | 43 | //! @} 44 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_stddev_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_stddev 18 | //! @{ 19 | 20 | //! Class for finding the standard deviation 21 | class op_stddev 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply(Mat& out, const mtOp& in); 27 | }; 28 | 29 | //! @} 30 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_symmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_symmat 18 | //! @{ 19 | 20 | 21 | 22 | class op_symmat 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& in); 28 | }; 29 | 30 | 31 | 32 | class op_symmat_cx 33 | { 34 | public: 35 | 36 | template 37 | inline static void apply(Mat& out, const Op& in); 38 | }; 39 | 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_toeplitz_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup op_toeplitz 18 | //! @{ 19 | 20 | 21 | 22 | class op_toeplitz 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& in); 28 | }; 29 | 30 | 31 | 32 | class op_toeplitz_c 33 | { 34 | public: 35 | 36 | template 37 | inline static void apply(Mat& out, const Op& in); 38 | }; 39 | 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /include/armadillo_bits/op_unique_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup op_unique 19 | //! @{ 20 | 21 | 22 | 23 | class op_unique 24 | { 25 | public: 26 | 27 | template 28 | inline static bool apply_helper(Mat& out, const Proxy& P); 29 | 30 | template 31 | inline static void apply(Mat& out, const Op& in); 32 | }; 33 | 34 | 35 | 36 | template 37 | struct arma_unique_comparator 38 | { 39 | arma_inline 40 | bool 41 | operator() (const eT a, const eT b) const 42 | { 43 | return ( a < b ); 44 | } 45 | }; 46 | 47 | 48 | 49 | template 50 | struct arma_unique_comparator< std::complex > 51 | { 52 | arma_inline 53 | bool 54 | operator() (const std::complex& a, const std::complex& b) const 55 | { 56 | const T a_real = a.real(); 57 | const T b_real = b.real(); 58 | 59 | return ( (a_real < b_real) ? true : ((a_real == b_real) ? (a.imag() < b.imag()) : false) ); 60 | } 61 | }; 62 | 63 | 64 | 65 | //! @} 66 | -------------------------------------------------------------------------------- /include/armadillo_bits/span.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | 18 | //! \addtogroup span 19 | //! @{ 20 | 21 | 22 | struct span_alt {}; 23 | 24 | 25 | template 26 | class span_base 27 | { 28 | public: 29 | static const span_alt all; 30 | }; 31 | 32 | 33 | template 34 | const span_alt span_base::all = span_alt(); 35 | 36 | 37 | class span : public span_base<> 38 | { 39 | public: 40 | 41 | uword a; 42 | uword b; 43 | bool whole; 44 | 45 | inline 46 | span() 47 | : whole(true) 48 | { 49 | } 50 | 51 | 52 | inline 53 | span(const span_alt&) 54 | : whole(true) 55 | { 56 | } 57 | 58 | 59 | inline 60 | explicit 61 | span(const uword in_a) 62 | : a(in_a) 63 | , b(in_a) 64 | , whole(false) 65 | { 66 | } 67 | 68 | 69 | // the "explicit" keyword is required here to prevent a C++11 compiler 70 | // automatically converting {a,b} into an instance of span() when submatrices are specified 71 | inline 72 | explicit 73 | span(const uword in_a, const uword in_b) 74 | : a(in_a) 75 | , b(in_b) 76 | , whole(false) 77 | { 78 | } 79 | 80 | }; 81 | 82 | 83 | 84 | //! @} 85 | -------------------------------------------------------------------------------- /include/armadillo_bits/spglue_join_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spglue_join 18 | //! @{ 19 | 20 | 21 | 22 | class spglue_join_cols 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(SpMat& out, const SpGlue& X); 28 | 29 | template 30 | inline static void apply_noalias(SpMat& out, const SpMat& A, const SpMat& B); 31 | }; 32 | 33 | 34 | 35 | class spglue_join_rows 36 | { 37 | public: 38 | 39 | template 40 | inline static void apply(SpMat& out, const SpGlue& X); 41 | 42 | template 43 | inline static void apply_direct(SpMat& out, const SpMat& A, const SpMat& B); 44 | }; 45 | 46 | 47 | 48 | //! @} 49 | -------------------------------------------------------------------------------- /include/armadillo_bits/spglue_kron_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spglue_kron 18 | //! @{ 19 | 20 | 21 | 22 | class spglue_kron 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(SpMat& out, const SpGlue& X); 28 | 29 | template 30 | inline static void apply_noalias(SpMat& out, const SpMat& A, const SpMat& B); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /include/armadillo_bits/spglue_minus_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spglue_minus 18 | //! @{ 19 | 20 | 21 | 22 | class spglue_minus 23 | { 24 | public: 25 | 26 | template 27 | arma_hot inline static void apply(SpMat& out, const SpGlue& X); 28 | 29 | template 30 | arma_hot inline static void apply_noalias(SpMat& result, const SpProxy& pa, const SpProxy& pb); 31 | }; 32 | 33 | 34 | 35 | class spglue_minus2 36 | { 37 | public: 38 | 39 | template 40 | arma_hot inline static void apply(SpMat& out, const SpGlue& X); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | 47 | -------------------------------------------------------------------------------- /include/armadillo_bits/spglue_plus_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spglue_plus 18 | //! @{ 19 | 20 | 21 | 22 | class spglue_plus 23 | { 24 | public: 25 | 26 | template 27 | arma_hot inline static void apply(SpMat& out, const SpGlue& X); 28 | 29 | template 30 | arma_hot inline static void apply_noalias(SpMat& out, const SpProxy& pa, const SpProxy& pb); 31 | }; 32 | 33 | 34 | 35 | class spglue_plus2 36 | { 37 | public: 38 | 39 | template 40 | arma_hot inline static void apply(SpMat& out, const SpGlue& X); 41 | }; 42 | 43 | 44 | 45 | //! @} 46 | 47 | -------------------------------------------------------------------------------- /include/armadillo_bits/spglue_times_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spglue_times 18 | //! @{ 19 | 20 | 21 | 22 | class spglue_times 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(SpMat& out, const SpGlue& X); 28 | 29 | template 30 | arma_hot inline static void apply_noalias(SpMat& c, const SpProxy& pa, const SpProxy& pb); 31 | }; 32 | 33 | 34 | 35 | class spglue_times2 36 | { 37 | public: 38 | 39 | template 40 | inline static void apply(SpMat& out, const SpGlue& X); 41 | }; 42 | 43 | 44 | 45 | class spglue_times_misc 46 | { 47 | public: 48 | 49 | template 50 | inline static void sparse_times_dense(Mat& out, const T1& x, const T2& y); 51 | 52 | template 53 | inline static void dense_times_sparse(Mat& out, const T1& x, const T2& y); 54 | }; 55 | 56 | 57 | 58 | //! @} 59 | 60 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_diagmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_diagmat 18 | //! @{ 19 | 20 | 21 | class spop_diagmat 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply(SpMat& out, const SpOp& in); 27 | 28 | template 29 | inline static void apply_noalias(SpMat& out, const SpProxy& p); 30 | }; 31 | 32 | 33 | 34 | class spop_diagmat2 35 | { 36 | public: 37 | 38 | template 39 | inline static void apply(SpMat& out, const SpOp& in); 40 | 41 | template 42 | inline static void apply_noalias(SpMat& out, const SpMat& X, const uword row_offset, const uword col_offset); 43 | }; 44 | 45 | 46 | 47 | //! @} 48 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_htrans_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_htrans 18 | //! @{ 19 | 20 | 21 | //! hermitian transpose operation for sparse matrices 22 | 23 | class spop_htrans 24 | { 25 | public: 26 | 27 | template 28 | inline static void apply(SpMat& out, const SpOp& in, const typename arma_not_cx::result* junk = 0); 29 | 30 | template 31 | inline static void apply(SpMat& out, const SpOp& in, const typename arma_cx_only::result* junk = 0); 32 | }; 33 | 34 | 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_htrans_meat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_htrans 18 | //! @{ 19 | 20 | 21 | 22 | template 23 | inline 24 | void 25 | spop_htrans::apply(SpMat& out, const SpOp& in, const typename arma_not_cx::result* junk) 26 | { 27 | arma_extra_debug_sigprint(); 28 | arma_ignore(junk); 29 | 30 | spop_strans::apply(out, in); 31 | } 32 | 33 | 34 | 35 | template 36 | inline 37 | void 38 | spop_htrans::apply(SpMat& out, const SpOp& in, const typename arma_cx_only::result* junk) 39 | { 40 | arma_extra_debug_sigprint(); 41 | arma_ignore(junk); 42 | 43 | typedef typename T1::elem_type eT; 44 | 45 | spop_strans::apply(out, in); 46 | 47 | const uword N = out.n_nonzero; 48 | 49 | for(uword i=0; i 26 | inline static void apply(SpMat& out, const SpOp& expr); 27 | 28 | template 29 | inline static void apply_direct(SpMat& out, const SpMat& X, const uword p, const uword dim); 30 | }; 31 | 32 | 33 | 34 | //! @} 35 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_repmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_repmat 18 | //! @{ 19 | 20 | 21 | 22 | class spop_repmat 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(SpMat& out, const SpOp& X); 28 | 29 | template 30 | inline static void apply_noalias(SpMat& out, const uword A_n_rows, const uword A_n_cols, const SpMat& B); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_reverse_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_reverse 18 | //! @{ 19 | 20 | 21 | class spop_reverse 22 | { 23 | public: 24 | 25 | template 26 | inline static void apply_spmat(SpMat& out, const SpMat& X, const uword dim); 27 | 28 | template 29 | inline static void apply_proxy(SpMat& out, const T1& X, const uword dim); 30 | 31 | template 32 | inline static void apply(SpMat& out, const SpOp& in); 33 | }; 34 | 35 | 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_strans_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_strans 18 | //! @{ 19 | 20 | 21 | //! simple transpose operation (no complex conjugates) for sparse matrices 22 | 23 | class spop_strans 24 | { 25 | public: 26 | 27 | template 28 | inline static void apply_noalias(SpMat& B, const SpMat& A); 29 | 30 | template 31 | inline static void apply(SpMat& out, const SpOp& in); 32 | 33 | template 34 | inline static void apply(SpMat& out, const SpOp& in); 35 | }; 36 | 37 | 38 | 39 | //! @} 40 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_sum_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_sum 18 | //! @{ 19 | 20 | 21 | class spop_sum 22 | { 23 | public: 24 | 25 | template 26 | arma_hot inline static void apply(SpMat& out, const SpOp& in); 27 | }; 28 | 29 | 30 | //! @} 31 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_symmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_symmat 18 | //! @{ 19 | 20 | 21 | 22 | class spop_symmat 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply(SpMat& out, const SpOp& in); 28 | }; 29 | 30 | 31 | 32 | class spop_symmat_cx 33 | { 34 | public: 35 | 36 | template 37 | inline static void apply(SpMat& out, const SpOp& in); 38 | }; 39 | 40 | 41 | 42 | //! @} 43 | -------------------------------------------------------------------------------- /include/armadillo_bits/spop_trimat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup spop_trimat 18 | //! @{ 19 | 20 | 21 | 22 | class spop_trimat 23 | { 24 | public: 25 | 26 | template 27 | inline static void apply_noalias(SpMat& out, const SpProxy& P, const bool upper); 28 | 29 | template 30 | inline static void apply(SpMat& out, const SpOp& in); 31 | }; 32 | 33 | 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /include/armadillo_bits/wall_clock_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup wall_clock 18 | //! @{ 19 | 20 | 21 | //! Class for measuring time intervals 22 | class wall_clock 23 | { 24 | public: 25 | 26 | inline wall_clock(); 27 | inline ~wall_clock(); 28 | 29 | inline void tic(); //!< start the timer 30 | inline double toc(); //!< return the number of seconds since the last call to tic() 31 | 32 | 33 | private: 34 | 35 | bool valid; 36 | 37 | #if defined(ARMA_USE_CXX11) 38 | std::chrono::steady_clock::time_point chrono_time1; 39 | #elif defined(ARMA_HAVE_GETTIMEOFDAY) 40 | struct timeval posix_time1; 41 | struct timeval posix_time2; 42 | #else 43 | std::clock_t time1; 44 | #endif 45 | }; 46 | 47 | 48 | //! @} 49 | -------------------------------------------------------------------------------- /include/armadillo_bits/xtrans_mat_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup xtrans_mat 18 | //! @{ 19 | 20 | 21 | template 22 | class xtrans_mat : public Base > 23 | { 24 | public: 25 | 26 | typedef eT elem_type; 27 | typedef typename get_pod_type::result pod_type; 28 | 29 | static const bool is_row = false; 30 | static const bool is_col = false; 31 | 32 | static const bool really_do_conj = (do_conj && is_cx::yes); 33 | 34 | arma_aligned const Mat& X; 35 | arma_aligned mutable Mat Y; 36 | 37 | arma_aligned const uword n_rows; 38 | arma_aligned const uword n_cols; 39 | arma_aligned const uword n_elem; 40 | 41 | inline explicit xtrans_mat(const Mat& in_X); 42 | 43 | inline void extract(Mat& out) const; 44 | 45 | inline eT operator[](const uword ii) const; 46 | inline eT at_alt (const uword ii) const; 47 | 48 | arma_inline eT at(const uword in_row, const uword in_col) const; 49 | }; 50 | 51 | 52 | 53 | //! @} 54 | -------------------------------------------------------------------------------- /include/armadillo_bits/xvec_htrans_bones.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 2 | // Copyright 2008-2016 National ICT Australia (NICTA) 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ------------------------------------------------------------------------ 15 | 16 | 17 | //! \addtogroup xvec_htrans 18 | //! @{ 19 | 20 | 21 | template 22 | class xvec_htrans : public Base > 23 | { 24 | public: 25 | 26 | typedef eT elem_type; 27 | typedef typename get_pod_type::result pod_type; 28 | 29 | static const bool is_row = false; 30 | static const bool is_col = false; 31 | 32 | arma_aligned const eT* const mem; 33 | 34 | const uword n_rows; 35 | const uword n_cols; 36 | const uword n_elem; 37 | 38 | 39 | inline explicit xvec_htrans(const eT* const in_mem, const uword in_n_rows, const uword in_n_cols); 40 | 41 | inline void extract(Mat& out) const; 42 | 43 | inline eT operator[](const uword ii) const; 44 | inline eT at_alt (const uword ii) const; 45 | 46 | inline eT at (const uword in_row, const uword in_col) const; 47 | }; 48 | 49 | 50 | 51 | //! @} 52 | -------------------------------------------------------------------------------- /include/opencv/cxmisc.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENCV_OLD_CXMISC_H 2 | #define OPENCV_OLD_CXMISC_H 3 | 4 | #ifdef __cplusplus 5 | # include "opencv2/core/utility.hpp" 6 | #endif 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /include/opencv2/core/bufferpool.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved. 6 | 7 | #ifndef OPENCV_CORE_BUFFER_POOL_HPP 8 | #define OPENCV_CORE_BUFFER_POOL_HPP 9 | 10 | #ifdef _MSC_VER 11 | #pragma warning(push) 12 | #pragma warning(disable: 4265) 13 | #endif 14 | 15 | namespace cv 16 | { 17 | 18 | //! @addtogroup core 19 | //! @{ 20 | 21 | class BufferPoolController 22 | { 23 | protected: 24 | ~BufferPoolController() { } 25 | public: 26 | virtual size_t getReservedSize() const = 0; 27 | virtual size_t getMaxReservedSize() const = 0; 28 | virtual void setMaxReservedSize(size_t size) = 0; 29 | virtual void freeAllReservedBuffers() = 0; 30 | }; 31 | 32 | //! @} 33 | 34 | } 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(pop) 38 | #endif 39 | 40 | #endif // OPENCV_CORE_BUFFER_POOL_HPP 41 | -------------------------------------------------------------------------------- /include/opencv2/core/ovx.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | // Copyright (C) 2016, Intel Corporation, all rights reserved. 6 | // Third party copyrights are property of their respective owners. 7 | 8 | // OpenVX related definitions and declarations 9 | 10 | #pragma once 11 | #ifndef OPENCV_OVX_HPP 12 | #define OPENCV_OVX_HPP 13 | 14 | #include "cvdef.h" 15 | 16 | namespace cv 17 | { 18 | /// Check if use of OpenVX is possible 19 | CV_EXPORTS_W bool haveOpenVX(); 20 | 21 | /// Check if use of OpenVX is enabled 22 | CV_EXPORTS_W bool useOpenVX(); 23 | 24 | /// Enable/disable use of OpenVX 25 | CV_EXPORTS_W void setUseOpenVX(bool flag); 26 | } // namespace cv 27 | 28 | #endif // OPENCV_OVX_HPP 29 | -------------------------------------------------------------------------------- /include/opencv2/flann/config.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_CONFIG_H_ 31 | #define OPENCV_FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "1.6.10" 37 | 38 | #endif /* OPENCV_FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /include/opencv2/flann/dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENCV_FLANN_DUMMY_H_ 3 | #define OPENCV_FLANN_DUMMY_H_ 4 | 5 | namespace cvflann 6 | { 7 | 8 | #if (defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS 9 | __declspec(dllexport) 10 | #endif 11 | void dummyfunc(); 12 | 13 | } 14 | 15 | 16 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 17 | -------------------------------------------------------------------------------- /include/opencv2/imgproc/hal/interface.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENCV_IMGPROC_HAL_INTERFACE_H 2 | #define OPENCV_IMGPROC_HAL_INTERFACE_H 3 | 4 | //! @addtogroup imgproc_hal_interface 5 | //! @{ 6 | 7 | //! @name Interpolation modes 8 | //! @sa cv::InterpolationFlags 9 | //! @{ 10 | #define CV_HAL_INTER_NEAREST 0 11 | #define CV_HAL_INTER_LINEAR 1 12 | #define CV_HAL_INTER_CUBIC 2 13 | #define CV_HAL_INTER_AREA 3 14 | #define CV_HAL_INTER_LANCZOS4 4 15 | //! @} 16 | 17 | //! @name Morphology operations 18 | //! @sa cv::MorphTypes 19 | //! @{ 20 | #define MORPH_ERODE 0 21 | #define MORPH_DILATE 1 22 | //! @} 23 | 24 | //! @} 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/opencv2/opencv_modules.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | // This definition means that OpenCV is built with enabled non-free code. 10 | // For example, patented algorithms for non-profit/non-commercial use only. 11 | /* #undef OPENCV_ENABLE_NONFREE */ 12 | 13 | #define HAVE_OPENCV_CALIB3D 14 | #define HAVE_OPENCV_CORE 15 | #define HAVE_OPENCV_DNN 16 | #define HAVE_OPENCV_FEATURES2D 17 | #define HAVE_OPENCV_FLANN 18 | #define HAVE_OPENCV_HIGHGUI 19 | #define HAVE_OPENCV_IMGCODECS 20 | #define HAVE_OPENCV_IMGPROC 21 | #define HAVE_OPENCV_ML 22 | #define HAVE_OPENCV_OBJDETECT 23 | #define HAVE_OPENCV_PHOTO 24 | #define HAVE_OPENCV_SHAPE 25 | #define HAVE_OPENCV_STITCHING 26 | #define HAVE_OPENCV_SUPERRES 27 | #define HAVE_OPENCV_VIDEO 28 | #define HAVE_OPENCV_VIDEOIO 29 | #define HAVE_OPENCV_VIDEOSTAB 30 | #define HAVE_OPENCV_WORLD 31 | 32 | 33 | -------------------------------------------------------------------------------- /include/sigpack/sigpack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangfcn/multiple-object-tracking/f895bc7c34269da5d4de5a7db0538f54da7a7fb3/include/sigpack/sigpack.h -------------------------------------------------------------------------------- /libhog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(FHOG_LIB_SRC gradientMex.cpp gradientMex.h sse.hpp fhog.hpp wrappers.hpp) 4 | 5 | add_library(fhog STATIC ${FHOG_LIB_SRC}) 6 | target_link_libraries(fhog ${OpenCV_LIBS}) 7 | set_target_properties(fhog PROPERTIES VERSION 1.0.0 SOVERSION 1) -------------------------------------------------------------------------------- /libhog/fhog.h: -------------------------------------------------------------------------------- 1 | /* 2 | - c++ wrapper for the piotr toolbox 3 | Created by Tomas Vojir, 2014 4 | */ 5 | 6 | 7 | #ifndef FHOG_HEADER_7813784354687 8 | #define FHOG_HEADER_7813784354687 9 | 10 | #include 11 | #include "gradientMex.h" 12 | 13 | class FHoG 14 | { 15 | public: 16 | static float * extract(float * I, int h, int w, float * H, int bin_size = 4, int n_orients = 9, int soft_bin = -1, float clip = 0.2) 17 | { 18 | float * M = (float *)_aligned_malloc(h * w * 4 * sizeof(float), 16); 19 | float * O = M + h * w * 2; 20 | 21 | gradMag( 22 | I, M, O, 23 | h, w, 24 | 1, true 25 | ); 26 | 27 | int n_chns = n_orients * 3 + 5; 28 | int hb = h / bin_size, 29 | wb = w / bin_size; 30 | 31 | memset(H, 0, hb * wb * n_chns * sizeof(float)); 32 | 33 | fhog(M, O, H, h, w, bin_size, n_orients, soft_bin, clip); 34 | 35 | _aligned_free(M); 36 | 37 | return (H); 38 | } 39 | }; 40 | 41 | #endif //FHOG_HEADER_7813784354687 -------------------------------------------------------------------------------- /libhog/gradientMex.h: -------------------------------------------------------------------------------- 1 | #ifndef GRADIENTMEX_HEADER_233244546834240 2 | #define GRADIENTMEX_HEADER_233244546834240 3 | 4 | void gradMag( float *I, float *M, float *O, int h, int w, int d, bool full ); 5 | void gradHist( float *M, float *O, float *H, int h, int w, 6 | int bin, int nOrients, int softBin, bool full ); 7 | void hog( float *M, float *O, float *H, int h, int w, int binSize, 8 | int nOrients, int softBin, bool full, float clip ); 9 | void fhog( float *M, float *O, float *H, int h, int w, int binSize, 10 | int nOrients, int softBin, float clip ); 11 | 12 | #endif //GRADIENTMEX_HEADER_233244546834240 -------------------------------------------------------------------------------- /libhog/wrappers.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Piotr's Computer Vision Matlab Toolbox Version 3.00 3 | * Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 4 | * Licensed under the Simplified BSD License [see external/bsd.txt] 5 | *******************************************************************************/ 6 | #ifndef _WRAPPERS_HPP_ 7 | #define _WRAPPERS_HPP_ 8 | #ifdef MATLAB_MEX_FILE 9 | 10 | // wrapper functions if compiling from Matlab 11 | #include "mex.h" 12 | inline void wrError(const char *errormsg) { mexErrMsgTxt(errormsg); } 13 | inline void* wrCalloc( size_t num, size_t size ) { return mxCalloc(num,size); } 14 | inline void* wrMalloc( size_t size ) { return mxMalloc(size); } 15 | inline void wrFree( void * ptr ) { mxFree(ptr); } 16 | 17 | #else 18 | #include 19 | 20 | // wrapper functions if compiling from C/C++ 21 | inline void wrError(const char *errormsg) { throw errormsg; } 22 | inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); } 23 | inline void* wrMalloc( size_t size ) { return malloc(size); } 24 | inline void wrFree( void * ptr ) { free(ptr); } 25 | 26 | #endif 27 | 28 | // platform independent aligned memory allocation (see also alFree) 29 | void* alMalloc( size_t size, int alignment ) { 30 | const size_t pSize = sizeof(void*), a = alignment-1; 31 | void *raw = wrMalloc(size + a + pSize); 32 | void *aligned = (void*) (((size_t) raw + pSize + a) & ~a); 33 | *(void**) ((size_t) aligned-pSize) = raw; 34 | return aligned; 35 | } 36 | 37 | // platform independent alignned memory de-allocation (see also alMalloc) 38 | void alFree(void* aligned) { 39 | void* raw = *(void**)((char*)aligned-sizeof(void*)); 40 | wrFree(raw); 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /top/cnntype.h: -------------------------------------------------------------------------------- 1 | #ifndef __CNN_TYPE_H__ 2 | #define __CNN_TYPE_H__ 3 | #include 4 | 5 | #define MTCNN_IMGW (1280) 6 | #define MTCNN_IMGH ( 720) 7 | 8 | #define CNN_BCHSIZ ( 8) 9 | 10 | typedef float cnn_type_t; 11 | typedef float acc_type_t; 12 | 13 | /* linux / mingw */ 14 | // #define _aligned_malloc(x, s) (aligned_alloc((x), (s))) 15 | // #define _aligned_free(x) (free(x)) 16 | 17 | #if defined (_MSC_VER) 18 | #define BEGIN_ALIGNED(x) __declspec(align(x)) 19 | #define DECLA_ALIGNED(x) 20 | 21 | #define BEGIN_NOINLINE __declspec(noinline) 22 | #define DECLA_NOINLINE 23 | 24 | #define __builtin_assume_aligned(v, x) (v) 25 | #define restrict __restrict 26 | #endif 27 | 28 | #if defined (__GNUC__) 29 | #define BEGIN_ALIGNED(x) 30 | #define DECLA_ALIGNED(x) __attribute__ ((aligned(x))) 31 | 32 | #define BEGIN_NOINLINE 33 | #define DECLA_NOINLINE __attribute__ ((noinline)) 34 | #endif 35 | 36 | typedef struct _bbox_pos_s 37 | { 38 | int l, t, b, r; 39 | int type; 40 | float score; 41 | } bbox_t; 42 | 43 | typedef struct _bbox_chain_s 44 | { 45 | int nbox; 46 | bbox_t bbox[128]; 47 | } bbox_chain_t; 48 | 49 | typedef struct 50 | { 51 | float obj_thresh; 52 | float nms_thresh; 53 | int anchors[18]; 54 | } yolo3_options_t; 55 | 56 | struct orderScore 57 | { 58 | cnn_type_t score; 59 | int oriOrder; 60 | }; 61 | 62 | typedef struct 63 | { 64 | cnn_type_t score; 65 | int index; 66 | } score_t; 67 | 68 | #endif // __CNN_TYPE_H__ 69 | -------------------------------------------------------------------------------- /yolo3tracker.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.421 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yolo3tracker", "yolo3tracker.vcxproj", "{DE1FBF22-F74A-4A70-8DF4-830714210A90}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {DE1FBF22-F74A-4A70-8DF4-830714210A90}.Debug|x64.ActiveCfg = Debug|x64 17 | {DE1FBF22-F74A-4A70-8DF4-830714210A90}.Debug|x64.Build.0 = Debug|x64 18 | {DE1FBF22-F74A-4A70-8DF4-830714210A90}.Debug|x86.ActiveCfg = Debug|Win32 19 | {DE1FBF22-F74A-4A70-8DF4-830714210A90}.Debug|x86.Build.0 = Debug|Win32 20 | {DE1FBF22-F74A-4A70-8DF4-830714210A90}.Release|x64.ActiveCfg = Release|x64 21 | {DE1FBF22-F74A-4A70-8DF4-830714210A90}.Release|x64.Build.0 = Release|x64 22 | {DE1FBF22-F74A-4A70-8DF4-830714210A90}.Release|x86.ActiveCfg = Release|Win32 23 | {DE1FBF22-F74A-4A70-8DF4-830714210A90}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {2A948033-2348-4EBA-87C3-95442F883259} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /yolo3tracker.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(OutDir) 5 | WindowsLocalDebugger 6 | 7 | --------------------------------------------------------------------------------