Skip to content
Snippets Groups Projects
Commit 2523c48b authored by GAUDIN Gregory's avatar GAUDIN Gregory
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 2052 additions and 0 deletions
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
#ifndef ARMA_INCLUDES
#define ARMA_INCLUDES
// NOTE: functions that are designed to be user accessible are described in the documentation (docs.html).
// NOTE: all other functions and classes (ie. not explicitly described in the documentation)
// NOTE: are considered as internal implementation details, and may be changed or removed without notice.
#include "armadillo_bits/config.hpp"
#include "armadillo_bits/compiler_check.hpp"
#include <cstdlib>
#include <cstddef>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cstdint>
#include <cmath>
#include <ctime>
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <new>
#include <limits>
#include <algorithm>
#include <complex>
#include <vector>
#include <utility>
#include <map>
#include <initializer_list>
#include <random>
#include <functional>
#include <chrono>
#include <atomic>
#if !defined(ARMA_DONT_USE_STD_MUTEX)
#include <mutex>
#endif
// #if defined(ARMA_HAVE_CXX17)
// #include <charconv>
// #include <system_error>
// #endif
#if ( defined(__unix__) || defined(__unix) || defined(_POSIX_C_SOURCE) || (defined(__APPLE__) && defined(__MACH__)) ) && !defined(_WIN32)
#include <unistd.h>
#endif
#if defined(ARMA_USE_TBB_ALLOC)
#if defined(__has_include)
#if __has_include(<tbb/scalable_allocator.h>)
#include <tbb/scalable_allocator.h>
#else
#undef ARMA_USE_TBB_ALLOC
#pragma message ("WARNING: use of TBB alloc disabled; tbb/scalable_allocator.h header not found")
#endif
#else
#include <tbb/scalable_allocator.h>
#endif
#endif
#if defined(ARMA_USE_MKL_ALLOC)
#if defined(__has_include)
#if __has_include(<mkl_service.h>)
#include <mkl_service.h>
#else
#undef ARMA_USE_MKL_ALLOC
#pragma message ("WARNING: use of MKL alloc disabled; mkl_service.h header not found")
#endif
#else
#include <mkl_service.h>
#endif
#endif
#include "armadillo_bits/compiler_setup.hpp"
#if defined(ARMA_USE_OPENMP)
#if defined(__has_include)
#if __has_include(<omp.h>)
#include <omp.h>
#else
#undef ARMA_USE_OPENMP
#pragma message ("WARNING: use of OpenMP disabled; omp.h header not found")
#endif
#else
#include <omp.h>
#endif
#endif
#include "armadillo_bits/include_hdf5.hpp"
#include "armadillo_bits/include_superlu.hpp"
//! \namespace arma namespace for Armadillo classes and functions
namespace arma
{
// preliminaries
#include "armadillo_bits/arma_forward.hpp"
#include "armadillo_bits/arma_static_check.hpp"
#include "armadillo_bits/typedef_elem.hpp"
#include "armadillo_bits/typedef_elem_check.hpp"
#include "armadillo_bits/typedef_mat.hpp"
#include "armadillo_bits/arma_str.hpp"
#include "armadillo_bits/arma_version.hpp"
#include "armadillo_bits/arma_config.hpp"
#include "armadillo_bits/traits.hpp"
#include "armadillo_bits/promote_type.hpp"
#include "armadillo_bits/upgrade_val.hpp"
#include "armadillo_bits/restrictors.hpp"
#include "armadillo_bits/access.hpp"
#include "armadillo_bits/span.hpp"
#include "armadillo_bits/distr_param.hpp"
#include "armadillo_bits/constants.hpp"
#include "armadillo_bits/constants_old.hpp"
#include "armadillo_bits/mp_misc.hpp"
#include "armadillo_bits/arma_rel_comparators.hpp"
#include "armadillo_bits/fill.hpp"
#if defined(ARMA_RNG_ALT)
#include ARMA_INCFILE_WRAP(ARMA_RNG_ALT)
#else
#include "armadillo_bits/arma_rng_cxx03.hpp"
#endif
#include "armadillo_bits/arma_rng.hpp"
//
// class prototypes
#include "armadillo_bits/Base_bones.hpp"
#include "armadillo_bits/BaseCube_bones.hpp"
#include "armadillo_bits/SpBase_bones.hpp"
#include "armadillo_bits/def_blas.hpp"
#include "armadillo_bits/def_atlas.hpp"
#include "armadillo_bits/def_lapack.hpp"
#include "armadillo_bits/def_arpack.hpp"
#include "armadillo_bits/def_superlu.hpp"
#include "armadillo_bits/def_fftw3.hpp"
#include "armadillo_bits/translate_blas.hpp"
#include "armadillo_bits/translate_atlas.hpp"
#include "armadillo_bits/translate_lapack.hpp"
#include "armadillo_bits/translate_arpack.hpp"
#include "armadillo_bits/translate_superlu.hpp"
#include "armadillo_bits/translate_fftw3.hpp"
#include "armadillo_bits/cond_rel_bones.hpp"
#include "armadillo_bits/arrayops_bones.hpp"
#include "armadillo_bits/podarray_bones.hpp"
#include "armadillo_bits/auxlib_bones.hpp"
#include "armadillo_bits/sp_auxlib_bones.hpp"
#include "armadillo_bits/injector_bones.hpp"
#include "armadillo_bits/Mat_bones.hpp"
#include "armadillo_bits/Col_bones.hpp"
#include "armadillo_bits/Row_bones.hpp"
#include "armadillo_bits/Cube_bones.hpp"
#include "armadillo_bits/xvec_htrans_bones.hpp"
#include "armadillo_bits/xtrans_mat_bones.hpp"
#include "armadillo_bits/SizeMat_bones.hpp"
#include "armadillo_bits/SizeCube_bones.hpp"
#include "armadillo_bits/SpValProxy_bones.hpp"
#include "armadillo_bits/SpMat_bones.hpp"
#include "armadillo_bits/SpCol_bones.hpp"
#include "armadillo_bits/SpRow_bones.hpp"
#include "armadillo_bits/SpSubview_bones.hpp"
#include "armadillo_bits/SpSubview_col_list_bones.hpp"
#include "armadillo_bits/spdiagview_bones.hpp"
#include "armadillo_bits/MapMat_bones.hpp"
#include "armadillo_bits/typedef_mat_fixed.hpp"
#include "armadillo_bits/field_bones.hpp"
#include "armadillo_bits/subview_bones.hpp"
#include "armadillo_bits/subview_elem1_bones.hpp"
#include "armadillo_bits/subview_elem2_bones.hpp"
#include "armadillo_bits/subview_field_bones.hpp"
#include "armadillo_bits/subview_cube_bones.hpp"
#include "armadillo_bits/diagview_bones.hpp"
#include "armadillo_bits/subview_each_bones.hpp"
#include "armadillo_bits/subview_cube_each_bones.hpp"
#include "armadillo_bits/subview_cube_slices_bones.hpp"
#include "armadillo_bits/hdf5_name.hpp"
#include "armadillo_bits/csv_name.hpp"
#include "armadillo_bits/diskio_bones.hpp"
#include "armadillo_bits/wall_clock_bones.hpp"
#include "armadillo_bits/running_stat_bones.hpp"
#include "armadillo_bits/running_stat_vec_bones.hpp"
#include "armadillo_bits/Op_bones.hpp"
#include "armadillo_bits/CubeToMatOp_bones.hpp"
#include "armadillo_bits/OpCube_bones.hpp"
#include "armadillo_bits/SpOp_bones.hpp"
#include "armadillo_bits/SpToDOp_bones.hpp"
#include "armadillo_bits/eOp_bones.hpp"
#include "armadillo_bits/eOpCube_bones.hpp"
#include "armadillo_bits/mtOp_bones.hpp"
#include "armadillo_bits/mtOpCube_bones.hpp"
#include "armadillo_bits/mtSpOp_bones.hpp"
#include "armadillo_bits/Glue_bones.hpp"
#include "armadillo_bits/eGlue_bones.hpp"
#include "armadillo_bits/mtGlue_bones.hpp"
#include "armadillo_bits/SpGlue_bones.hpp"
#include "armadillo_bits/mtSpGlue_bones.hpp"
#include "armadillo_bits/SpToDGlue_bones.hpp"
#include "armadillo_bits/GlueCube_bones.hpp"
#include "armadillo_bits/eGlueCube_bones.hpp"
#include "armadillo_bits/mtGlueCube_bones.hpp"
#include "armadillo_bits/eop_core_bones.hpp"
#include "armadillo_bits/eglue_core_bones.hpp"
#include "armadillo_bits/Gen_bones.hpp"
#include "armadillo_bits/GenCube_bones.hpp"
#include "armadillo_bits/op_diagmat_bones.hpp"
#include "armadillo_bits/op_diagvec_bones.hpp"
#include "armadillo_bits/op_dot_bones.hpp"
#include "armadillo_bits/op_det_bones.hpp"
#include "armadillo_bits/op_log_det_bones.hpp"
#include "armadillo_bits/op_inv_gen_bones.hpp"
#include "armadillo_bits/op_inv_spd_bones.hpp"
#include "armadillo_bits/op_htrans_bones.hpp"
#include "armadillo_bits/op_max_bones.hpp"
#include "armadillo_bits/op_min_bones.hpp"
#include "armadillo_bits/op_index_max_bones.hpp"
#include "armadillo_bits/op_index_min_bones.hpp"
#include "armadillo_bits/op_mean_bones.hpp"
#include "armadillo_bits/op_median_bones.hpp"
#include "armadillo_bits/op_sort_bones.hpp"
#include "armadillo_bits/op_sort_index_bones.hpp"
#include "armadillo_bits/op_sum_bones.hpp"
#include "armadillo_bits/op_stddev_bones.hpp"
#include "armadillo_bits/op_strans_bones.hpp"
#include "armadillo_bits/op_var_bones.hpp"
#include "armadillo_bits/op_repmat_bones.hpp"
#include "armadillo_bits/op_repelem_bones.hpp"
#include "armadillo_bits/op_reshape_bones.hpp"
#include "armadillo_bits/op_vectorise_bones.hpp"
#include "armadillo_bits/op_resize_bones.hpp"
#include "armadillo_bits/op_cov_bones.hpp"
#include "armadillo_bits/op_cor_bones.hpp"
#include "armadillo_bits/op_shift_bones.hpp"
#include "armadillo_bits/op_shuffle_bones.hpp"
#include "armadillo_bits/op_prod_bones.hpp"
#include "armadillo_bits/op_pinv_bones.hpp"
#include "armadillo_bits/op_dotext_bones.hpp"
#include "armadillo_bits/op_flip_bones.hpp"
#include "armadillo_bits/op_reverse_bones.hpp"
#include "armadillo_bits/op_princomp_bones.hpp"
#include "armadillo_bits/op_misc_bones.hpp"
#include "armadillo_bits/op_orth_null_bones.hpp"
#include "armadillo_bits/op_relational_bones.hpp"
#include "armadillo_bits/op_find_bones.hpp"
#include "armadillo_bits/op_find_unique_bones.hpp"
#include "armadillo_bits/op_chol_bones.hpp"
#include "armadillo_bits/op_cx_scalar_bones.hpp"
#include "armadillo_bits/op_trimat_bones.hpp"
#include "armadillo_bits/op_cumsum_bones.hpp"
#include "armadillo_bits/op_cumprod_bones.hpp"
#include "armadillo_bits/op_symmat_bones.hpp"
#include "armadillo_bits/op_hist_bones.hpp"
#include "armadillo_bits/op_unique_bones.hpp"
#include "armadillo_bits/op_toeplitz_bones.hpp"
#include "armadillo_bits/op_fft_bones.hpp"
#include "armadillo_bits/op_any_bones.hpp"
#include "armadillo_bits/op_all_bones.hpp"
#include "armadillo_bits/op_normalise_bones.hpp"
#include "armadillo_bits/op_clamp_bones.hpp"
#include "armadillo_bits/op_expmat_bones.hpp"
#include "armadillo_bits/op_nonzeros_bones.hpp"
#include "armadillo_bits/op_diff_bones.hpp"
#include "armadillo_bits/op_norm_bones.hpp"
#include "armadillo_bits/op_vecnorm_bones.hpp"
#include "armadillo_bits/op_norm2est_bones.hpp"
#include "armadillo_bits/op_sqrtmat_bones.hpp"
#include "armadillo_bits/op_logmat_bones.hpp"
#include "armadillo_bits/op_range_bones.hpp"
#include "armadillo_bits/op_chi2rnd_bones.hpp"
#include "armadillo_bits/op_wishrnd_bones.hpp"
#include "armadillo_bits/op_roots_bones.hpp"
#include "armadillo_bits/op_cond_bones.hpp"
#include "armadillo_bits/op_rcond_bones.hpp"
#include "armadillo_bits/op_sp_plus_bones.hpp"
#include "armadillo_bits/op_sp_minus_bones.hpp"
#include "armadillo_bits/op_powmat_bones.hpp"
#include "armadillo_bits/op_rank_bones.hpp"
#include "armadillo_bits/op_row_as_mat_bones.hpp"
#include "armadillo_bits/op_col_as_mat_bones.hpp"
#include "armadillo_bits/glue_times_bones.hpp"
#include "armadillo_bits/glue_times_misc_bones.hpp"
#include "armadillo_bits/glue_mixed_bones.hpp"
#include "armadillo_bits/glue_cov_bones.hpp"
#include "armadillo_bits/glue_cor_bones.hpp"
#include "armadillo_bits/glue_kron_bones.hpp"
#include "armadillo_bits/glue_cross_bones.hpp"
#include "armadillo_bits/glue_join_bones.hpp"
#include "armadillo_bits/glue_relational_bones.hpp"
#include "armadillo_bits/glue_solve_bones.hpp"
#include "armadillo_bits/glue_conv_bones.hpp"
#include "armadillo_bits/glue_toeplitz_bones.hpp"
#include "armadillo_bits/glue_hist_bones.hpp"
#include "armadillo_bits/glue_histc_bones.hpp"
#include "armadillo_bits/glue_max_bones.hpp"
#include "armadillo_bits/glue_min_bones.hpp"
#include "armadillo_bits/glue_trapz_bones.hpp"
#include "armadillo_bits/glue_atan2_bones.hpp"
#include "armadillo_bits/glue_hypot_bones.hpp"
#include "armadillo_bits/glue_polyfit_bones.hpp"
#include "armadillo_bits/glue_polyval_bones.hpp"
#include "armadillo_bits/glue_intersect_bones.hpp"
#include "armadillo_bits/glue_affmul_bones.hpp"
#include "armadillo_bits/glue_mvnrnd_bones.hpp"
#include "armadillo_bits/glue_quantile_bones.hpp"
#include "armadillo_bits/glue_powext_bones.hpp"
#include "armadillo_bits/gmm_misc_bones.hpp"
#include "armadillo_bits/gmm_diag_bones.hpp"
#include "armadillo_bits/gmm_full_bones.hpp"
#include "armadillo_bits/spop_max_bones.hpp"
#include "armadillo_bits/spop_min_bones.hpp"
#include "armadillo_bits/spop_sum_bones.hpp"
#include "armadillo_bits/spop_strans_bones.hpp"
#include "armadillo_bits/spop_htrans_bones.hpp"
#include "armadillo_bits/spop_misc_bones.hpp"
#include "armadillo_bits/spop_diagmat_bones.hpp"
#include "armadillo_bits/spop_mean_bones.hpp"
#include "armadillo_bits/spop_var_bones.hpp"
#include "armadillo_bits/spop_trimat_bones.hpp"
#include "armadillo_bits/spop_symmat_bones.hpp"
#include "armadillo_bits/spop_normalise_bones.hpp"
#include "armadillo_bits/spop_reverse_bones.hpp"
#include "armadillo_bits/spop_repmat_bones.hpp"
#include "armadillo_bits/spop_vectorise_bones.hpp"
#include "armadillo_bits/spop_norm_bones.hpp"
#include "armadillo_bits/spop_vecnorm_bones.hpp"
#include "armadillo_bits/spop_shift_bones.hpp"
#include "armadillo_bits/spglue_plus_bones.hpp"
#include "armadillo_bits/spglue_minus_bones.hpp"
#include "armadillo_bits/spglue_schur_bones.hpp"
#include "armadillo_bits/spglue_times_bones.hpp"
#include "armadillo_bits/spglue_join_bones.hpp"
#include "armadillo_bits/spglue_kron_bones.hpp"
#include "armadillo_bits/spglue_min_bones.hpp"
#include "armadillo_bits/spglue_max_bones.hpp"
#include "armadillo_bits/spglue_merge_bones.hpp"
#include "armadillo_bits/spglue_relational_bones.hpp"
#include "armadillo_bits/spsolve_factoriser_bones.hpp"
#if defined(ARMA_USE_NEWARP)
#include "armadillo_bits/newarp_EigsSelect.hpp"
#include "armadillo_bits/newarp_DenseGenMatProd_bones.hpp"
#include "armadillo_bits/newarp_SparseGenMatProd_bones.hpp"
#include "armadillo_bits/newarp_SparseGenRealShiftSolve_bones.hpp"
#include "armadillo_bits/newarp_DoubleShiftQR_bones.hpp"
#include "armadillo_bits/newarp_GenEigsSolver_bones.hpp"
#include "armadillo_bits/newarp_SymEigsSolver_bones.hpp"
#include "armadillo_bits/newarp_SymEigsShiftSolver_bones.hpp"
#include "armadillo_bits/newarp_TridiagEigen_bones.hpp"
#include "armadillo_bits/newarp_UpperHessenbergEigen_bones.hpp"
#include "armadillo_bits/newarp_UpperHessenbergQR_bones.hpp"
#endif
//
// low-level debugging and memory handling functions
#include "armadillo_bits/debug.hpp"
#include "armadillo_bits/memory.hpp"
//
// wrappers for various cmath functions
#include "armadillo_bits/arma_cmath.hpp"
//
// classes that underlay metaprogramming
#include "armadillo_bits/unwrap.hpp"
#include "armadillo_bits/unwrap_cube.hpp"
#include "armadillo_bits/unwrap_spmat.hpp"
#include "armadillo_bits/Proxy.hpp"
#include "armadillo_bits/ProxyCube.hpp"
#include "armadillo_bits/SpProxy.hpp"
#include "armadillo_bits/diagmat_proxy.hpp"
#include "armadillo_bits/strip.hpp"
#include "armadillo_bits/eop_aux.hpp"
//
// ostream
#include "armadillo_bits/arma_ostream_bones.hpp"
#include "armadillo_bits/arma_ostream_meat.hpp"
//
// n_unique, which is used by some sparse operators
#include "armadillo_bits/fn_n_unique.hpp"
//
// operators
#include "armadillo_bits/operator_plus.hpp"
#include "armadillo_bits/operator_minus.hpp"
#include "armadillo_bits/operator_times.hpp"
#include "armadillo_bits/operator_schur.hpp"
#include "armadillo_bits/operator_div.hpp"
#include "armadillo_bits/operator_relational.hpp"
#include "armadillo_bits/operator_cube_plus.hpp"
#include "armadillo_bits/operator_cube_minus.hpp"
#include "armadillo_bits/operator_cube_times.hpp"
#include "armadillo_bits/operator_cube_schur.hpp"
#include "armadillo_bits/operator_cube_div.hpp"
#include "armadillo_bits/operator_cube_relational.hpp"
#include "armadillo_bits/operator_ostream.hpp"
//
// user accessible functions
// the order of the fn_*.hpp include files matters,
// as some files require functionality given in preceding files
#include "armadillo_bits/fn_conv_to.hpp"
#include "armadillo_bits/fn_max.hpp"
#include "armadillo_bits/fn_min.hpp"
#include "armadillo_bits/fn_index_max.hpp"
#include "armadillo_bits/fn_index_min.hpp"
#include "armadillo_bits/fn_accu.hpp"
#include "armadillo_bits/fn_sum.hpp"
#include "armadillo_bits/fn_diagmat.hpp"
#include "armadillo_bits/fn_diagvec.hpp"
#include "armadillo_bits/fn_inv.hpp"
#include "armadillo_bits/fn_inv_sympd.hpp"
#include "armadillo_bits/fn_trace.hpp"
#include "armadillo_bits/fn_trans.hpp"
#include "armadillo_bits/fn_det.hpp"
#include "armadillo_bits/fn_log_det.hpp"
#include "armadillo_bits/fn_eig_gen.hpp"
#include "armadillo_bits/fn_eig_sym.hpp"
#include "armadillo_bits/fn_eig_pair.hpp"
#include "armadillo_bits/fn_lu.hpp"
#include "armadillo_bits/fn_zeros.hpp"
#include "armadillo_bits/fn_ones.hpp"
#include "armadillo_bits/fn_eye.hpp"
#include "armadillo_bits/fn_misc.hpp"
#include "armadillo_bits/fn_orth_null.hpp"
#include "armadillo_bits/fn_regspace.hpp"
#include "armadillo_bits/fn_find.hpp"
#include "armadillo_bits/fn_find_unique.hpp"
#include "armadillo_bits/fn_elem.hpp"
#include "armadillo_bits/fn_approx_equal.hpp"
#include "armadillo_bits/fn_norm.hpp"
#include "armadillo_bits/fn_vecnorm.hpp"
#include "armadillo_bits/fn_dot.hpp"
#include "armadillo_bits/fn_randu.hpp"
#include "armadillo_bits/fn_randn.hpp"
#include "armadillo_bits/fn_trig.hpp"
#include "armadillo_bits/fn_mean.hpp"
#include "armadillo_bits/fn_median.hpp"
#include "armadillo_bits/fn_stddev.hpp"
#include "armadillo_bits/fn_var.hpp"
#include "armadillo_bits/fn_sort.hpp"
#include "armadillo_bits/fn_sort_index.hpp"
#include "armadillo_bits/fn_strans.hpp"
#include "armadillo_bits/fn_chol.hpp"
#include "armadillo_bits/fn_qr.hpp"
#include "armadillo_bits/fn_svd.hpp"
#include "armadillo_bits/fn_solve.hpp"
#include "armadillo_bits/fn_repmat.hpp"
#include "armadillo_bits/fn_repelem.hpp"
#include "armadillo_bits/fn_reshape.hpp"
#include "armadillo_bits/fn_vectorise.hpp"
#include "armadillo_bits/fn_resize.hpp"
#include "armadillo_bits/fn_cov.hpp"
#include "armadillo_bits/fn_cor.hpp"
#include "armadillo_bits/fn_shift.hpp"
#include "armadillo_bits/fn_shuffle.hpp"
#include "armadillo_bits/fn_prod.hpp"
#include "armadillo_bits/fn_eps.hpp"
#include "armadillo_bits/fn_pinv.hpp"
#include "armadillo_bits/fn_rank.hpp"
#include "armadillo_bits/fn_kron.hpp"
#include "armadillo_bits/fn_flip.hpp"
#include "armadillo_bits/fn_reverse.hpp"
#include "armadillo_bits/fn_as_scalar.hpp"
#include "armadillo_bits/fn_princomp.hpp"
#include "armadillo_bits/fn_cross.hpp"
#include "armadillo_bits/fn_join.hpp"
#include "armadillo_bits/fn_conv.hpp"
#include "armadillo_bits/fn_trunc_exp.hpp"
#include "armadillo_bits/fn_trunc_log.hpp"
#include "armadillo_bits/fn_toeplitz.hpp"
#include "armadillo_bits/fn_trimat.hpp"
#include "armadillo_bits/fn_trimat_ind.hpp"
#include "armadillo_bits/fn_cumsum.hpp"
#include "armadillo_bits/fn_cumprod.hpp"
#include "armadillo_bits/fn_symmat.hpp"
#include "armadillo_bits/fn_sylvester.hpp"
#include "armadillo_bits/fn_hist.hpp"
#include "armadillo_bits/fn_histc.hpp"
#include "armadillo_bits/fn_unique.hpp"
#include "armadillo_bits/fn_fft.hpp"
#include "armadillo_bits/fn_fft2.hpp"
#include "armadillo_bits/fn_any.hpp"
#include "armadillo_bits/fn_all.hpp"
#include "armadillo_bits/fn_size.hpp"
#include "armadillo_bits/fn_numel.hpp"
#include "armadillo_bits/fn_inplace_strans.hpp"
#include "armadillo_bits/fn_inplace_trans.hpp"
#include "armadillo_bits/fn_randi.hpp"
#include "armadillo_bits/fn_randg.hpp"
#include "armadillo_bits/fn_cond_rcond.hpp"
#include "armadillo_bits/fn_normalise.hpp"
#include "armadillo_bits/fn_clamp.hpp"
#include "armadillo_bits/fn_expmat.hpp"
#include "armadillo_bits/fn_nonzeros.hpp"
#include "armadillo_bits/fn_interp1.hpp"
#include "armadillo_bits/fn_interp2.hpp"
#include "armadillo_bits/fn_qz.hpp"
#include "armadillo_bits/fn_diff.hpp"
#include "armadillo_bits/fn_hess.hpp"
#include "armadillo_bits/fn_schur.hpp"
#include "armadillo_bits/fn_kmeans.hpp"
#include "armadillo_bits/fn_sqrtmat.hpp"
#include "armadillo_bits/fn_logmat.hpp"
#include "armadillo_bits/fn_trapz.hpp"
#include "armadillo_bits/fn_range.hpp"
#include "armadillo_bits/fn_polyfit.hpp"
#include "armadillo_bits/fn_polyval.hpp"
#include "armadillo_bits/fn_intersect.hpp"
#include "armadillo_bits/fn_normpdf.hpp"
#include "armadillo_bits/fn_log_normpdf.hpp"
#include "armadillo_bits/fn_normcdf.hpp"
#include "armadillo_bits/fn_mvnrnd.hpp"
#include "armadillo_bits/fn_chi2rnd.hpp"
#include "armadillo_bits/fn_wishrnd.hpp"
#include "armadillo_bits/fn_roots.hpp"
#include "armadillo_bits/fn_randperm.hpp"
#include "armadillo_bits/fn_quantile.hpp"
#include "armadillo_bits/fn_powmat.hpp"
#include "armadillo_bits/fn_powext.hpp"
#include "armadillo_bits/fn_diags_spdiags.hpp"
#include "armadillo_bits/fn_speye.hpp"
#include "armadillo_bits/fn_spones.hpp"
#include "armadillo_bits/fn_sprandn.hpp"
#include "armadillo_bits/fn_sprandu.hpp"
#include "armadillo_bits/fn_eigs_sym.hpp"
#include "armadillo_bits/fn_eigs_gen.hpp"
#include "armadillo_bits/fn_spsolve.hpp"
#include "armadillo_bits/fn_svds.hpp"
//
// misc stuff
#include "armadillo_bits/hdf5_misc.hpp"
#include "armadillo_bits/fft_engine_kissfft.hpp"
#include "armadillo_bits/fft_engine_fftw3.hpp"
#include "armadillo_bits/band_helper.hpp"
#include "armadillo_bits/sym_helper.hpp"
#include "armadillo_bits/trimat_helper.hpp"
//
// classes implementing various forms of dense matrix multiplication
#include "armadillo_bits/mul_gemv.hpp"
#include "armadillo_bits/mul_gemm.hpp"
#include "armadillo_bits/mul_gemm_mixed.hpp"
#include "armadillo_bits/mul_syrk.hpp"
#include "armadillo_bits/mul_herk.hpp"
//
// class meat
#include "armadillo_bits/Op_meat.hpp"
#include "armadillo_bits/CubeToMatOp_meat.hpp"
#include "armadillo_bits/OpCube_meat.hpp"
#include "armadillo_bits/SpOp_meat.hpp"
#include "armadillo_bits/SpToDOp_meat.hpp"
#include "armadillo_bits/mtOp_meat.hpp"
#include "armadillo_bits/mtOpCube_meat.hpp"
#include "armadillo_bits/mtSpOp_meat.hpp"
#include "armadillo_bits/Glue_meat.hpp"
#include "armadillo_bits/GlueCube_meat.hpp"
#include "armadillo_bits/SpGlue_meat.hpp"
#include "armadillo_bits/mtSpGlue_meat.hpp"
#include "armadillo_bits/SpToDGlue_meat.hpp"
#include "armadillo_bits/eOp_meat.hpp"
#include "armadillo_bits/eOpCube_meat.hpp"
#include "armadillo_bits/eGlue_meat.hpp"
#include "armadillo_bits/eGlueCube_meat.hpp"
#include "armadillo_bits/mtGlue_meat.hpp"
#include "armadillo_bits/mtGlueCube_meat.hpp"
#include "armadillo_bits/Base_meat.hpp"
#include "armadillo_bits/BaseCube_meat.hpp"
#include "armadillo_bits/SpBase_meat.hpp"
#include "armadillo_bits/Gen_meat.hpp"
#include "armadillo_bits/GenCube_meat.hpp"
#include "armadillo_bits/eop_core_meat.hpp"
#include "armadillo_bits/eglue_core_meat.hpp"
#include "armadillo_bits/cond_rel_meat.hpp"
#include "armadillo_bits/arrayops_meat.hpp"
#include "armadillo_bits/podarray_meat.hpp"
#include "armadillo_bits/auxlib_meat.hpp"
#include "armadillo_bits/sp_auxlib_meat.hpp"
#include "armadillo_bits/injector_meat.hpp"
#include "armadillo_bits/Mat_meat.hpp"
#include "armadillo_bits/Col_meat.hpp"
#include "armadillo_bits/Row_meat.hpp"
#include "armadillo_bits/Cube_meat.hpp"
#include "armadillo_bits/xvec_htrans_meat.hpp"
#include "armadillo_bits/xtrans_mat_meat.hpp"
#include "armadillo_bits/SizeMat_meat.hpp"
#include "armadillo_bits/SizeCube_meat.hpp"
#include "armadillo_bits/field_meat.hpp"
#include "armadillo_bits/subview_meat.hpp"
#include "armadillo_bits/subview_elem1_meat.hpp"
#include "armadillo_bits/subview_elem2_meat.hpp"
#include "armadillo_bits/subview_field_meat.hpp"
#include "armadillo_bits/subview_cube_meat.hpp"
#include "armadillo_bits/diagview_meat.hpp"
#include "armadillo_bits/subview_each_meat.hpp"
#include "armadillo_bits/subview_cube_each_meat.hpp"
#include "armadillo_bits/subview_cube_slices_meat.hpp"
#include "armadillo_bits/SpValProxy_meat.hpp"
#include "armadillo_bits/SpMat_meat.hpp"
#include "armadillo_bits/SpMat_iterators_meat.hpp"
#include "armadillo_bits/SpCol_meat.hpp"
#include "armadillo_bits/SpRow_meat.hpp"
#include "armadillo_bits/SpSubview_meat.hpp"
#include "armadillo_bits/SpSubview_iterators_meat.hpp"
#include "armadillo_bits/SpSubview_col_list_meat.hpp"
#include "armadillo_bits/spdiagview_meat.hpp"
#include "armadillo_bits/MapMat_meat.hpp"
#include "armadillo_bits/diskio_meat.hpp"
#include "armadillo_bits/wall_clock_meat.hpp"
#include "armadillo_bits/running_stat_meat.hpp"
#include "armadillo_bits/running_stat_vec_meat.hpp"
#include "armadillo_bits/op_diagmat_meat.hpp"
#include "armadillo_bits/op_diagvec_meat.hpp"
#include "armadillo_bits/op_dot_meat.hpp"
#include "armadillo_bits/op_det_meat.hpp"
#include "armadillo_bits/op_log_det_meat.hpp"
#include "armadillo_bits/op_inv_gen_meat.hpp"
#include "armadillo_bits/op_inv_spd_meat.hpp"
#include "armadillo_bits/op_htrans_meat.hpp"
#include "armadillo_bits/op_max_meat.hpp"
#include "armadillo_bits/op_index_max_meat.hpp"
#include "armadillo_bits/op_index_min_meat.hpp"
#include "armadillo_bits/op_min_meat.hpp"
#include "armadillo_bits/op_mean_meat.hpp"
#include "armadillo_bits/op_median_meat.hpp"
#include "armadillo_bits/op_sort_meat.hpp"
#include "armadillo_bits/op_sort_index_meat.hpp"
#include "armadillo_bits/op_sum_meat.hpp"
#include "armadillo_bits/op_stddev_meat.hpp"
#include "armadillo_bits/op_strans_meat.hpp"
#include "armadillo_bits/op_var_meat.hpp"
#include "armadillo_bits/op_repmat_meat.hpp"
#include "armadillo_bits/op_repelem_meat.hpp"
#include "armadillo_bits/op_reshape_meat.hpp"
#include "armadillo_bits/op_vectorise_meat.hpp"
#include "armadillo_bits/op_resize_meat.hpp"
#include "armadillo_bits/op_cov_meat.hpp"
#include "armadillo_bits/op_cor_meat.hpp"
#include "armadillo_bits/op_shift_meat.hpp"
#include "armadillo_bits/op_shuffle_meat.hpp"
#include "armadillo_bits/op_prod_meat.hpp"
#include "armadillo_bits/op_pinv_meat.hpp"
#include "armadillo_bits/op_dotext_meat.hpp"
#include "armadillo_bits/op_flip_meat.hpp"
#include "armadillo_bits/op_reverse_meat.hpp"
#include "armadillo_bits/op_princomp_meat.hpp"
#include "armadillo_bits/op_misc_meat.hpp"
#include "armadillo_bits/op_orth_null_meat.hpp"
#include "armadillo_bits/op_relational_meat.hpp"
#include "armadillo_bits/op_find_meat.hpp"
#include "armadillo_bits/op_find_unique_meat.hpp"
#include "armadillo_bits/op_chol_meat.hpp"
#include "armadillo_bits/op_cx_scalar_meat.hpp"
#include "armadillo_bits/op_trimat_meat.hpp"
#include "armadillo_bits/op_cumsum_meat.hpp"
#include "armadillo_bits/op_cumprod_meat.hpp"
#include "armadillo_bits/op_symmat_meat.hpp"
#include "armadillo_bits/op_hist_meat.hpp"
#include "armadillo_bits/op_unique_meat.hpp"
#include "armadillo_bits/op_toeplitz_meat.hpp"
#include "armadillo_bits/op_fft_meat.hpp"
#include "armadillo_bits/op_any_meat.hpp"
#include "armadillo_bits/op_all_meat.hpp"
#include "armadillo_bits/op_normalise_meat.hpp"
#include "armadillo_bits/op_clamp_meat.hpp"
#include "armadillo_bits/op_expmat_meat.hpp"
#include "armadillo_bits/op_nonzeros_meat.hpp"
#include "armadillo_bits/op_diff_meat.hpp"
#include "armadillo_bits/op_norm_meat.hpp"
#include "armadillo_bits/op_vecnorm_meat.hpp"
#include "armadillo_bits/op_norm2est_meat.hpp"
#include "armadillo_bits/op_sqrtmat_meat.hpp"
#include "armadillo_bits/op_logmat_meat.hpp"
#include "armadillo_bits/op_range_meat.hpp"
#include "armadillo_bits/op_chi2rnd_meat.hpp"
#include "armadillo_bits/op_wishrnd_meat.hpp"
#include "armadillo_bits/op_roots_meat.hpp"
#include "armadillo_bits/op_cond_meat.hpp"
#include "armadillo_bits/op_rcond_meat.hpp"
#include "armadillo_bits/op_sp_plus_meat.hpp"
#include "armadillo_bits/op_sp_minus_meat.hpp"
#include "armadillo_bits/op_powmat_meat.hpp"
#include "armadillo_bits/op_rank_meat.hpp"
#include "armadillo_bits/op_row_as_mat_meat.hpp"
#include "armadillo_bits/op_col_as_mat_meat.hpp"
#include "armadillo_bits/glue_times_meat.hpp"
#include "armadillo_bits/glue_times_misc_meat.hpp"
#include "armadillo_bits/glue_mixed_meat.hpp"
#include "armadillo_bits/glue_cov_meat.hpp"
#include "armadillo_bits/glue_cor_meat.hpp"
#include "armadillo_bits/glue_kron_meat.hpp"
#include "armadillo_bits/glue_cross_meat.hpp"
#include "armadillo_bits/glue_join_meat.hpp"
#include "armadillo_bits/glue_relational_meat.hpp"
#include "armadillo_bits/glue_solve_meat.hpp"
#include "armadillo_bits/glue_conv_meat.hpp"
#include "armadillo_bits/glue_toeplitz_meat.hpp"
#include "armadillo_bits/glue_hist_meat.hpp"
#include "armadillo_bits/glue_histc_meat.hpp"
#include "armadillo_bits/glue_max_meat.hpp"
#include "armadillo_bits/glue_min_meat.hpp"
#include "armadillo_bits/glue_trapz_meat.hpp"
#include "armadillo_bits/glue_atan2_meat.hpp"
#include "armadillo_bits/glue_hypot_meat.hpp"
#include "armadillo_bits/glue_polyfit_meat.hpp"
#include "armadillo_bits/glue_polyval_meat.hpp"
#include "armadillo_bits/glue_intersect_meat.hpp"
#include "armadillo_bits/glue_affmul_meat.hpp"
#include "armadillo_bits/glue_mvnrnd_meat.hpp"
#include "armadillo_bits/glue_quantile_meat.hpp"
#include "armadillo_bits/glue_powext_meat.hpp"
#include "armadillo_bits/gmm_misc_meat.hpp"
#include "armadillo_bits/gmm_diag_meat.hpp"
#include "armadillo_bits/gmm_full_meat.hpp"
#include "armadillo_bits/spop_max_meat.hpp"
#include "armadillo_bits/spop_min_meat.hpp"
#include "armadillo_bits/spop_sum_meat.hpp"
#include "armadillo_bits/spop_strans_meat.hpp"
#include "armadillo_bits/spop_htrans_meat.hpp"
#include "armadillo_bits/spop_misc_meat.hpp"
#include "armadillo_bits/spop_diagmat_meat.hpp"
#include "armadillo_bits/spop_mean_meat.hpp"
#include "armadillo_bits/spop_var_meat.hpp"
#include "armadillo_bits/spop_trimat_meat.hpp"
#include "armadillo_bits/spop_symmat_meat.hpp"
#include "armadillo_bits/spop_normalise_meat.hpp"
#include "armadillo_bits/spop_reverse_meat.hpp"
#include "armadillo_bits/spop_repmat_meat.hpp"
#include "armadillo_bits/spop_vectorise_meat.hpp"
#include "armadillo_bits/spop_norm_meat.hpp"
#include "armadillo_bits/spop_vecnorm_meat.hpp"
#include "armadillo_bits/spop_shift_meat.hpp"
#include "armadillo_bits/spglue_plus_meat.hpp"
#include "armadillo_bits/spglue_minus_meat.hpp"
#include "armadillo_bits/spglue_schur_meat.hpp"
#include "armadillo_bits/spglue_times_meat.hpp"
#include "armadillo_bits/spglue_join_meat.hpp"
#include "armadillo_bits/spglue_kron_meat.hpp"
#include "armadillo_bits/spglue_min_meat.hpp"
#include "armadillo_bits/spglue_max_meat.hpp"
#include "armadillo_bits/spglue_merge_meat.hpp"
#include "armadillo_bits/spglue_relational_meat.hpp"
#include "armadillo_bits/spsolve_factoriser_meat.hpp"
#if defined(ARMA_USE_NEWARP)
#include "armadillo_bits/newarp_cx_attrib.hpp"
#include "armadillo_bits/newarp_SortEigenvalue.hpp"
#include "armadillo_bits/newarp_DenseGenMatProd_meat.hpp"
#include "armadillo_bits/newarp_SparseGenMatProd_meat.hpp"
#include "armadillo_bits/newarp_SparseGenRealShiftSolve_meat.hpp"
#include "armadillo_bits/newarp_DoubleShiftQR_meat.hpp"
#include "armadillo_bits/newarp_GenEigsSolver_meat.hpp"
#include "armadillo_bits/newarp_SymEigsSolver_meat.hpp"
#include "armadillo_bits/newarp_SymEigsShiftSolver_meat.hpp"
#include "armadillo_bits/newarp_TridiagEigen_meat.hpp"
#include "armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp"
#include "armadillo_bits/newarp_UpperHessenbergQR_meat.hpp"
#endif
}
#include "armadillo_bits/compiler_setup_post.hpp"
#endif
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
//! \addtogroup BaseCube
//! @{
template<typename elem_type, typename derived>
struct BaseCube_eval_Cube
{
arma_warn_unused arma_inline const derived& eval() const;
};
template<typename elem_type, typename derived>
struct BaseCube_eval_expr
{
arma_warn_unused inline Cube<elem_type> eval() const; //!< force the immediate evaluation of a delayed expression
};
template<typename elem_type, typename derived, bool condition>
struct BaseCube_eval {};
template<typename elem_type, typename derived>
struct BaseCube_eval<elem_type, derived, true> { typedef BaseCube_eval_Cube<elem_type, derived> result; };
template<typename elem_type, typename derived>
struct BaseCube_eval<elem_type, derived, false> { typedef BaseCube_eval_expr<elem_type, derived> result; };
//! Analog of the Base class, intended for cubes
template<typename elem_type, typename derived>
struct BaseCube
: public BaseCube_eval<elem_type, derived, is_Cube<derived>::value>::result
{
arma_inline const derived& get_ref() const;
arma_cold inline void print( const std::string extra_text = "") const;
arma_cold inline void print(std::ostream& user_stream, const std::string extra_text = "") const;
arma_cold inline void raw_print( const std::string extra_text = "") const;
arma_cold inline void raw_print(std::ostream& user_stream, const std::string extra_text = "") const;
arma_cold inline void brief_print( const std::string extra_text = "") const;
arma_cold inline void brief_print(std::ostream& user_stream, const std::string extra_text = "") const;
arma_warn_unused inline elem_type min() const;
arma_warn_unused inline elem_type max() const;
arma_warn_unused inline uword index_min() const;
arma_warn_unused inline uword index_max() const;
arma_warn_unused inline bool is_zero(const typename get_pod_type<elem_type>::result tol = 0) const;
arma_warn_unused inline bool is_empty() const;
arma_warn_unused inline bool is_finite() const;
arma_warn_unused inline bool has_inf() const;
arma_warn_unused inline bool has_nan() const;
arma_warn_unused inline bool has_nonfinite() const;
arma_warn_unused inline const CubeToMatOp<derived, op_row_as_mat> row_as_mat(const uword in_row) const;
arma_warn_unused inline const CubeToMatOp<derived, op_col_as_mat> col_as_mat(const uword in_col) const;
};
//! @}
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
//! \addtogroup BaseCube
//! @{
template<typename elem_type, typename derived>
arma_inline
const derived&
BaseCube<elem_type,derived>::get_ref() const
{
return static_cast<const derived&>(*this);
}
template<typename elem_type, typename derived>
inline
void
BaseCube<elem_type,derived>::print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
if(extra_text.length() != 0)
{
const std::streamsize orig_width = get_cout_stream().width();
get_cout_stream() << extra_text << '\n';
get_cout_stream().width(orig_width);
}
arma_ostream::print(get_cout_stream(), tmp.M, true);
}
template<typename elem_type, typename derived>
inline
void
BaseCube<elem_type,derived>::print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
if(extra_text.length() != 0)
{
const std::streamsize orig_width = user_stream.width();
user_stream << extra_text << '\n';
user_stream.width(orig_width);
}
arma_ostream::print(user_stream, tmp.M, true);
}
template<typename elem_type, typename derived>
inline
void
BaseCube<elem_type,derived>::raw_print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
if(extra_text.length() != 0)
{
const std::streamsize orig_width = get_cout_stream().width();
get_cout_stream() << extra_text << '\n';
get_cout_stream().width(orig_width);
}
arma_ostream::print(get_cout_stream(), tmp.M, false);
}
template<typename elem_type, typename derived>
inline
void
BaseCube<elem_type,derived>::raw_print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
if(extra_text.length() != 0)
{
const std::streamsize orig_width = user_stream.width();
user_stream << extra_text << '\n';
user_stream.width(orig_width);
}
arma_ostream::print(user_stream, tmp.M, false);
}
template<typename elem_type, typename derived>
inline
void
BaseCube<elem_type,derived>::brief_print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
if(extra_text.length() != 0)
{
const std::streamsize orig_width = get_cout_stream().width();
get_cout_stream() << extra_text << '\n';
get_cout_stream().width(orig_width);
}
arma_ostream::brief_print(get_cout_stream(), tmp.M);
}
template<typename elem_type, typename derived>
inline
void
BaseCube<elem_type,derived>::brief_print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
if(extra_text.length() != 0)
{
const std::streamsize orig_width = user_stream.width();
user_stream << extra_text << '\n';
user_stream.width(orig_width);
}
arma_ostream::brief_print(user_stream, tmp.M);
}
template<typename elem_type, typename derived>
inline
elem_type
BaseCube<elem_type,derived>::min() const
{
return op_min::min( (*this).get_ref() );
}
template<typename elem_type, typename derived>
inline
elem_type
BaseCube<elem_type,derived>::max() const
{
return op_max::max( (*this).get_ref() );
}
template<typename elem_type, typename derived>
inline
uword
BaseCube<elem_type,derived>::index_min() const
{
const ProxyCube<derived> P( (*this).get_ref() );
uword index = 0;
if(P.get_n_elem() == 0)
{
arma_debug_check(true, "index_min(): object has no elements");
}
else
{
op_min::min_with_index(P, index);
}
return index;
}
template<typename elem_type, typename derived>
inline
uword
BaseCube<elem_type,derived>::index_max() const
{
const ProxyCube<derived> P( (*this).get_ref() );
uword index = 0;
if(P.get_n_elem() == 0)
{
arma_debug_check(true, "index_max(): object has no elements");
}
else
{
op_max::max_with_index(P, index);
}
return index;
}
template<typename elem_type, typename derived>
inline
bool
BaseCube<elem_type,derived>::is_zero(const typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
arma_debug_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" );
if(ProxyCube<derived>::use_at || is_Cube<typename ProxyCube<derived>::stored_type>::value)
{
const unwrap_cube<derived> U( (*this).get_ref() );
return arrayops::is_zero( U.M.memptr(), U.M.n_elem, tol );
}
const ProxyCube<derived> P( (*this).get_ref() );
const uword n_elem = P.get_n_elem();
if(n_elem == 0) { return false; }
const typename ProxyCube<derived>::ea_type Pea = P.get_ea();
if(is_cx<elem_type>::yes)
{
for(uword i=0; i<n_elem; ++i)
{
const elem_type val = Pea[i];
const T val_real = access::tmp_real(val);
const T val_imag = access::tmp_imag(val);
if(eop_aux::arma_abs(val_real) > tol) { return false; }
if(eop_aux::arma_abs(val_imag) > tol) { return false; }
}
}
else // not complex
{
for(uword i=0; i < n_elem; ++i)
{
if(eop_aux::arma_abs(Pea[i]) > tol) { return false; }
}
}
return true;
}
template<typename elem_type, typename derived>
inline
bool
BaseCube<elem_type,derived>::is_empty() const
{
arma_extra_debug_sigprint();
const ProxyCube<derived> P( (*this).get_ref() );
return (P.get_n_elem() == uword(0));
}
template<typename elem_type, typename derived>
inline
bool
BaseCube<elem_type,derived>::is_finite() const
{
arma_extra_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); }
if(is_Cube<typename ProxyCube<derived>::stored_type>::value)
{
const unwrap_cube<derived> U( (*this).get_ref() );
return arrayops::is_finite( U.M.memptr(), U.M.n_elem );
}
else
{
const ProxyCube<derived> P( (*this).get_ref() );
const uword n_r = P.get_n_rows();
const uword n_c = P.get_n_cols();
const uword n_s = P.get_n_slices();
for(uword s=0; s<n_s; ++s)
for(uword c=0; c<n_c; ++c)
for(uword r=0; r<n_r; ++r)
{
if( arma_isfinite(P.at(r,c,s)) == false ) { return false; }
}
}
return true;
}
template<typename elem_type, typename derived>
inline
bool
BaseCube<elem_type,derived>::has_inf() const
{
arma_extra_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); }
if(is_Cube<typename ProxyCube<derived>::stored_type>::value)
{
const unwrap_cube<derived> U( (*this).get_ref() );
return arrayops::has_inf( U.M.memptr(), U.M.n_elem );
}
else
{
const ProxyCube<derived> P( (*this).get_ref() );
const uword n_r = P.get_n_rows();
const uword n_c = P.get_n_cols();
const uword n_s = P.get_n_slices();
for(uword s=0; s<n_s; ++s)
for(uword c=0; c<n_c; ++c)
for(uword r=0; r<n_r; ++r)
{
if(arma_isinf(P.at(r,c,s))) { return true; }
}
}
return false;
}
template<typename elem_type, typename derived>
inline
bool
BaseCube<elem_type,derived>::has_nan() const
{
arma_extra_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); }
if(is_Cube<typename ProxyCube<derived>::stored_type>::value)
{
const unwrap_cube<derived> U( (*this).get_ref() );
return arrayops::has_nan( U.M.memptr(), U.M.n_elem );
}
else
{
const ProxyCube<derived> P( (*this).get_ref() );
const uword n_r = P.get_n_rows();
const uword n_c = P.get_n_cols();
const uword n_s = P.get_n_slices();
for(uword s=0; s<n_s; ++s)
for(uword c=0; c<n_c; ++c)
for(uword r=0; r<n_r; ++r)
{
if(arma_isnan(P.at(r,c,s))) { return true; }
}
}
return false;
}
template<typename elem_type, typename derived>
inline
bool
BaseCube<elem_type,derived>::has_nonfinite() const
{
arma_extra_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); }
if(is_Cube<typename ProxyCube<derived>::stored_type>::value)
{
const unwrap_cube<derived> U( (*this).get_ref() );
return (arrayops::is_finite( U.M.memptr(), U.M.n_elem ) == false);
}
else
{
const ProxyCube<derived> P( (*this).get_ref() );
const uword n_r = P.get_n_rows();
const uword n_c = P.get_n_cols();
const uword n_s = P.get_n_slices();
for(uword s=0; s<n_s; ++s)
for(uword c=0; c<n_c; ++c)
for(uword r=0; r<n_r; ++r)
{
if(arma_isfinite(P.at(r,c,s)) == false) { return true; }
}
}
return false;
}
template<typename elem_type, typename derived>
inline
const CubeToMatOp<derived, op_row_as_mat>
BaseCube<elem_type,derived>::row_as_mat(const uword in_row) const
{
return CubeToMatOp<derived, op_row_as_mat>( (*this).get_ref(), in_row );
}
template<typename elem_type, typename derived>
inline
const CubeToMatOp<derived, op_col_as_mat>
BaseCube<elem_type,derived>::col_as_mat(const uword in_col) const
{
return CubeToMatOp<derived, op_col_as_mat>( (*this).get_ref(), in_col );
}
//
// extra functions defined in BaseCube_eval_Cube
template<typename elem_type, typename derived>
arma_inline
const derived&
BaseCube_eval_Cube<elem_type, derived>::eval() const
{
arma_extra_debug_sigprint();
return static_cast<const derived&>(*this);
}
//
// extra functions defined in BaseCube_eval_expr
template<typename elem_type, typename derived>
inline
Cube<elem_type>
BaseCube_eval_expr<elem_type, derived>::eval() const
{
arma_extra_debug_sigprint();
return Cube<elem_type>( static_cast<const derived&>(*this) );
}
//! @}
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
//! \addtogroup Base
//! @{
template<typename elem_type, typename derived>
struct Base_extra_yes
{
arma_warn_unused inline const Op<derived,op_inv_gen_default> i() const; //!< matrix inverse
arma_warn_unused inline bool is_sympd() const;
arma_warn_unused inline bool is_sympd(typename get_pod_type<elem_type>::result tol) const;
};
template<typename elem_type, typename derived>
struct Base_extra_no
{
};
template<typename elem_type, typename derived, bool condition>
struct Base_extra {};
template<typename elem_type, typename derived>
struct Base_extra<elem_type, derived, true> { typedef Base_extra_yes<elem_type, derived> result; };
template<typename elem_type, typename derived>
struct Base_extra<elem_type, derived, false> { typedef Base_extra_no<elem_type, derived> result; };
template<typename elem_type, typename derived>
struct Base_eval_Mat
{
arma_warn_unused arma_inline const derived& eval() const;
};
template<typename elem_type, typename derived>
struct Base_eval_expr
{
arma_warn_unused inline Mat<elem_type> eval() const; //!< force the immediate evaluation of a delayed expression
};
template<typename elem_type, typename derived, bool condition>
struct Base_eval {};
template<typename elem_type, typename derived>
struct Base_eval<elem_type, derived, true> { typedef Base_eval_Mat<elem_type, derived> result; };
template<typename elem_type, typename derived>
struct Base_eval<elem_type, derived, false> { typedef Base_eval_expr<elem_type, derived> result; };
template<typename derived>
struct Base_trans_cx
{
arma_warn_unused arma_inline const Op<derived,op_htrans> t() const;
arma_warn_unused arma_inline const Op<derived,op_htrans> ht() const;
arma_warn_unused arma_inline const Op<derived,op_strans> st() const; // simple transpose: no complex conjugates
};
template<typename derived>
struct Base_trans_default
{
arma_warn_unused arma_inline const Op<derived,op_htrans> t() const;
arma_warn_unused arma_inline const Op<derived,op_htrans> ht() const;
arma_warn_unused arma_inline const Op<derived,op_htrans> st() const; // return op_htrans instead of op_strans, as it's handled better by matrix multiplication code
};
template<typename derived, bool condition>
struct Base_trans {};
template<typename derived>
struct Base_trans<derived, true> { typedef Base_trans_cx<derived> result; };
template<typename derived>
struct Base_trans<derived, false> { typedef Base_trans_default<derived> result; };
//! Class for static polymorphism, modelled after the "Curiously Recurring Template Pattern" (CRTP).
//! Used for type-safe downcasting in functions that restrict their input(s) to be classes that are
//! derived from Base (eg. Mat, Op, Glue, diagview, subview).
//! A Base object can be converted to a Mat object by the unwrap class.
template<typename elem_type, typename derived>
struct Base
: public Base_extra<elem_type, derived, is_supported_blas_type<elem_type>::value>::result
, public Base_eval<elem_type, derived, is_Mat<derived>::value>::result
, public Base_trans<derived, is_cx<elem_type>::value>::result
{
arma_inline const derived& get_ref() const;
arma_cold inline void print( const std::string extra_text = "") const;
arma_cold inline void print(std::ostream& user_stream, const std::string extra_text = "") const;
arma_cold inline void raw_print( const std::string extra_text = "") const;
arma_cold inline void raw_print(std::ostream& user_stream, const std::string extra_text = "") const;
arma_cold inline void brief_print( const std::string extra_text = "") const;
arma_cold inline void brief_print(std::ostream& user_stream, const std::string extra_text = "") const;
arma_warn_unused inline elem_type min() const;
arma_warn_unused inline elem_type max() const;
inline elem_type min(uword& index_of_min_val) const;
inline elem_type max(uword& index_of_max_val) const;
inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;
arma_warn_unused inline uword index_min() const;
arma_warn_unused inline uword index_max() const;
arma_warn_unused inline bool is_symmetric() const;
arma_warn_unused inline bool is_symmetric(const typename get_pod_type<elem_type>::result tol) const;
arma_warn_unused inline bool is_hermitian() const;
arma_warn_unused inline bool is_hermitian(const typename get_pod_type<elem_type>::result tol) const;
arma_warn_unused inline bool is_zero(const typename get_pod_type<elem_type>::result tol = 0) const;
arma_warn_unused inline bool is_trimatu() const;
arma_warn_unused inline bool is_trimatl() const;
arma_warn_unused inline bool is_diagmat() const;
arma_warn_unused inline bool is_empty() const;
arma_warn_unused inline bool is_square() const;
arma_warn_unused inline bool is_vec() const;
arma_warn_unused inline bool is_colvec() const;
arma_warn_unused inline bool is_rowvec() const;
arma_warn_unused inline bool is_finite() const;
arma_warn_unused inline bool has_inf() const;
arma_warn_unused inline bool has_nan() const;
arma_warn_unused inline bool has_nonfinite() const;
arma_warn_unused inline const Op<derived,op_vectorise_col> as_col() const;
arma_warn_unused inline const Op<derived,op_vectorise_row> as_row() const;
};
//! @}
This diff is collapsed.
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
//! \addtogroup Col
//! @{
//! Class for column vectors (matrices with only one column)
template<typename eT>
class Col : public Mat<eT>
{
public:
typedef eT elem_type;
typedef typename get_pod_type<eT>::result pod_type;
static constexpr bool is_col = true;
static constexpr bool is_row = false;
static constexpr bool is_xvec = false;
inline Col();
inline Col(const Col<eT>& X);
inline explicit Col(const uword n_elem);
inline explicit Col(const uword in_rows, const uword in_cols);
inline explicit Col(const SizeMat& s);
template<bool do_zeros> inline explicit Col(const uword n_elem, const arma_initmode_indicator<do_zeros>&);
template<bool do_zeros> inline explicit Col(const uword in_rows, const uword in_cols, const arma_initmode_indicator<do_zeros>&);
template<bool do_zeros> inline explicit Col(const SizeMat& s, const arma_initmode_indicator<do_zeros>&);
template<typename fill_type> inline Col(const uword n_elem, const fill::fill_class<fill_type>& f);
template<typename fill_type> inline Col(const uword in_rows, const uword in_cols, const fill::fill_class<fill_type>& f);
template<typename fill_type> inline Col(const SizeMat& s, const fill::fill_class<fill_type>& f);
inline Col(const uword N, const fill::scalar_holder<eT> f);
inline Col(const uword in_rows, const uword in_cols, const fill::scalar_holder<eT> f);
inline Col(const SizeMat& s, const fill::scalar_holder<eT> f);
inline Col(const char* text);
inline Col& operator=(const char* text);
inline Col(const std::string& text);
inline Col& operator=(const std::string& text);
inline Col(const std::vector<eT>& x);
inline Col& operator=(const std::vector<eT>& x);
inline Col(const std::initializer_list<eT>& list);
inline Col& operator=(const std::initializer_list<eT>& list);
inline Col(Col&& m);
inline Col& operator=(Col&& m);
// inline Col(Mat<eT>&& m);
// inline Col& operator=(Mat<eT>&& m);
inline Col& operator=(const eT val);
inline Col& operator=(const Col& m);
template<typename T1> inline Col(const Base<eT,T1>& X);
template<typename T1> inline Col& operator=(const Base<eT,T1>& X);
template<typename T1> inline explicit Col(const SpBase<eT,T1>& X);
template<typename T1> inline Col& operator=(const SpBase<eT,T1>& X);
inline Col( eT* aux_mem, const uword aux_length, const bool copy_aux_mem = true, const bool strict = false);
inline Col(const eT* aux_mem, const uword aux_length);
template<typename T1, typename T2>
inline explicit Col(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
template<typename T1> inline Col(const BaseCube<eT,T1>& X);
template<typename T1> inline Col& operator=(const BaseCube<eT,T1>& X);
inline Col(const subview_cube<eT>& X);
inline Col& operator=(const subview_cube<eT>& X);
arma_frown("use braced initialiser list instead") inline mat_injector<Col> operator<<(const eT val);
arma_warn_unused arma_inline const Op<Col<eT>,op_htrans> t() const;
arma_warn_unused arma_inline const Op<Col<eT>,op_htrans> ht() const;
arma_warn_unused arma_inline const Op<Col<eT>,op_strans> st() const;
arma_warn_unused arma_inline const Op<Col<eT>,op_strans> as_row() const;
arma_inline subview_col<eT> row(const uword row_num);
arma_inline const subview_col<eT> row(const uword row_num) const;
using Mat<eT>::rows;
using Mat<eT>::operator();
arma_inline subview_col<eT> rows(const uword in_row1, const uword in_row2);
arma_inline const subview_col<eT> rows(const uword in_row1, const uword in_row2) const;
arma_inline subview_col<eT> subvec(const uword in_row1, const uword in_row2);
arma_inline const subview_col<eT> subvec(const uword in_row1, const uword in_row2) const;
arma_inline subview_col<eT> rows(const span& row_span);
arma_inline const subview_col<eT> rows(const span& row_span) const;
arma_inline subview_col<eT> subvec(const span& row_span);
arma_inline const subview_col<eT> subvec(const span& row_span) const;
arma_inline subview_col<eT> operator()(const span& row_span);
arma_inline const subview_col<eT> operator()(const span& row_span) const;
arma_inline subview_col<eT> subvec(const uword start_row, const SizeMat& s);
arma_inline const subview_col<eT> subvec(const uword start_row, const SizeMat& s) const;
arma_inline subview_col<eT> head(const uword N);
arma_inline const subview_col<eT> head(const uword N) const;
arma_inline subview_col<eT> tail(const uword N);
arma_inline const subview_col<eT> tail(const uword N) const;
arma_inline subview_col<eT> head_rows(const uword N);
arma_inline const subview_col<eT> head_rows(const uword N) const;
arma_inline subview_col<eT> tail_rows(const uword N);
arma_inline const subview_col<eT> tail_rows(const uword N) const;
inline void shed_row (const uword row_num);
inline void shed_rows(const uword in_row1, const uword in_row2);
template<typename T1> inline void shed_rows(const Base<uword, T1>& indices);
arma_deprecated inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
inline void insert_rows(const uword row_num, const uword N);
template<typename T1> inline void insert_rows(const uword row_num, const Base<eT,T1>& X);
arma_warn_unused arma_inline eT& at(const uword i);
arma_warn_unused arma_inline const eT& at(const uword i) const;
arma_warn_unused arma_inline eT& at(const uword in_row, const uword in_col);
arma_warn_unused arma_inline const eT& at(const uword in_row, const uword in_col) const;
typedef eT* row_iterator;
typedef const eT* const_row_iterator;
inline row_iterator begin_row(const uword row_num);
inline const_row_iterator begin_row(const uword row_num) const;
inline row_iterator end_row (const uword row_num);
inline const_row_iterator end_row (const uword row_num) const;
template<uword fixed_n_elem> class fixed;
protected:
inline Col(const arma_fixed_indicator&, const uword in_n_elem, const eT* in_mem);
public:
#if defined(ARMA_EXTRA_COL_PROTO)
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_PROTO)
#endif
};
template<typename eT>
template<uword fixed_n_elem>
class Col<eT>::fixed : public Col<eT>
{
private:
static constexpr bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
arma_align_mem eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
public:
typedef fixed<fixed_n_elem> Col_fixed_type;
typedef eT elem_type;
typedef typename get_pod_type<eT>::result pod_type;
static constexpr bool is_col = true;
static constexpr bool is_row = false;
static constexpr bool is_xvec = false;
static const uword n_rows; // value provided below the class definition
static const uword n_cols; // value provided below the class definition
static const uword n_elem; // value provided below the class definition
arma_inline fixed();
arma_inline fixed(const fixed<fixed_n_elem>& X);
inline fixed(const subview_cube<eT>& X);
inline fixed(const fill::scalar_holder<eT> f);
template<typename fill_type> inline fixed(const fill::fill_class<fill_type>& f);
template<typename T1> inline fixed(const Base<eT,T1>& A);
template<typename T1, typename T2> inline fixed(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
inline fixed(const eT* aux_mem);
inline fixed(const char* text);
inline fixed(const std::string& text);
template<typename T1> inline Col& operator=(const Base<eT,T1>& A);
inline Col& operator=(const eT val);
inline Col& operator=(const char* text);
inline Col& operator=(const std::string& text);
inline Col& operator=(const subview_cube<eT>& X);
using Col<eT>::operator();
inline fixed(const std::initializer_list<eT>& list);
inline Col& operator=(const std::initializer_list<eT>& list);
arma_inline Col& operator=(const fixed<fixed_n_elem>& X);
#if defined(ARMA_GOOD_COMPILER)
template<typename T1, typename eop_type> inline Col& operator=(const eOp<T1, eop_type>& X);
template<typename T1, typename T2, typename eglue_type> inline Col& operator=(const eGlue<T1, T2, eglue_type>& X);
#endif
arma_warn_unused arma_inline const Op< Col_fixed_type, op_htrans > t() const;
arma_warn_unused arma_inline const Op< Col_fixed_type, op_htrans > ht() const;
arma_warn_unused arma_inline const Op< Col_fixed_type, op_strans > st() const;
arma_warn_unused arma_inline const eT& at_alt (const uword i) const;
arma_warn_unused arma_inline eT& operator[] (const uword i);
arma_warn_unused arma_inline const eT& operator[] (const uword i) const;
arma_warn_unused arma_inline eT& at (const uword i);
arma_warn_unused arma_inline const eT& at (const uword i) const;
arma_warn_unused arma_inline eT& operator() (const uword i);
arma_warn_unused arma_inline const eT& operator() (const uword i) const;
arma_warn_unused arma_inline eT& at (const uword in_row, const uword in_col);
arma_warn_unused arma_inline const eT& at (const uword in_row, const uword in_col) const;
arma_warn_unused arma_inline eT& operator() (const uword in_row, const uword in_col);
arma_warn_unused arma_inline const eT& operator() (const uword in_row, const uword in_col) const;
arma_warn_unused arma_inline eT* memptr();
arma_warn_unused arma_inline const eT* memptr() const;
inline const Col<eT>& fill(const eT val);
inline const Col<eT>& zeros();
inline const Col<eT>& ones();
};
// these definitions are outside of the class due to bizarre C++ rules;
// C++17 has inline variables to address this shortcoming
template<typename eT>
template<uword fixed_n_elem>
const uword Col<eT>::fixed<fixed_n_elem>::n_rows = fixed_n_elem;
template<typename eT>
template<uword fixed_n_elem>
const uword Col<eT>::fixed<fixed_n_elem>::n_cols = 1u;
template<typename eT>
template<uword fixed_n_elem>
const uword Col<eT>::fixed<fixed_n_elem>::n_elem = fixed_n_elem;
//! @}
This diff is collapsed.
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
//! \addtogroup CubeToMatOp
//! @{
template<typename T1, typename op_type>
class CubeToMatOp : public Base< typename T1::elem_type, CubeToMatOp<T1, op_type> >
{
public:
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
inline explicit CubeToMatOp(const T1& in_m);
inline CubeToMatOp(const T1& in_m, const uword in_aux_uword);
inline ~CubeToMatOp();
arma_aligned const T1& m; //!< the operand; must be derived from BaseCube
arma_aligned uword aux_uword; //!< auxiliary data, uword format
static constexpr bool is_row = op_type::template traits<T1>::is_row;
static constexpr bool is_col = op_type::template traits<T1>::is_col;
static constexpr bool is_xvec = op_type::template traits<T1>::is_xvec;
};
//! @}
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
//! \addtogroup CubeToMatOp
//! @{
template<typename T1, typename op_type>
inline
CubeToMatOp<T1, op_type>::CubeToMatOp(const T1& in_m)
: m(in_m)
{
arma_extra_debug_sigprint();
}
template<typename T1, typename op_type>
inline
CubeToMatOp<T1, op_type>::CubeToMatOp(const T1& in_m, const uword in_aux_uword)
: m(in_m)
, aux_uword(in_aux_uword)
{
arma_extra_debug_sigprint();
}
template<typename T1, typename op_type>
inline
CubeToMatOp<T1, op_type>::~CubeToMatOp()
{
arma_extra_debug_sigprint();
}
//! @}
This diff is collapsed.
This diff is collapsed.
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
//! \addtogroup GenCube
//! @{
//! support class for generator functions (zeros, ones)
template<typename eT, typename gen_type>
class GenCube
: public BaseCube< eT, GenCube<eT, gen_type> >
{
public:
typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
static constexpr bool use_at = false;
static constexpr bool is_simple = (is_same_type<gen_type, gen_ones>::value) || (is_same_type<gen_type, gen_zeros>::value);
arma_aligned const uword n_rows;
arma_aligned const uword n_cols;
arma_aligned const uword n_slices;
arma_inline GenCube(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices);
arma_inline ~GenCube();
arma_inline eT operator[] (const uword i) const;
arma_inline eT at (const uword r, const uword c, const uword s) const;
arma_inline eT at_alt (const uword i) const;
inline void apply (Cube<eT>& out) const;
inline void apply_inplace_plus (Cube<eT>& out) const;
inline void apply_inplace_minus(Cube<eT>& out) const;
inline void apply_inplace_schur(Cube<eT>& out) const;
inline void apply_inplace_div (Cube<eT>& out) const;
inline void apply(subview_cube<elem_type>& out) const;
};
//! @}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment