From eda5bc26f44ee9a6f83dcf8c91f17296d7fc509d Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 12 Feb 2024 14:52:43 +0100 Subject: Move into version control --- .../include/armadillo_bits/subview_each_bones.hpp | 166 +++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 src/armadillo/include/armadillo_bits/subview_each_bones.hpp (limited to 'src/armadillo/include/armadillo_bits/subview_each_bones.hpp') diff --git a/src/armadillo/include/armadillo_bits/subview_each_bones.hpp b/src/armadillo/include/armadillo_bits/subview_each_bones.hpp new file mode 100644 index 0000000..dcb58cd --- /dev/null +++ b/src/armadillo/include/armadillo_bits/subview_each_bones.hpp @@ -0,0 +1,166 @@ +// 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 subview_each +//! @{ + + + +template +class subview_each_common + { + public: + + typedef typename parent::elem_type eT; + + const parent& P; + + template + inline void check_size(const Mat& A) const; + + + protected: + + arma_inline subview_each_common(const parent& in_P); + inline subview_each_common() = delete; + + arma_inline const Mat& get_mat_ref_helper(const Mat & X) const; + arma_inline const Mat& get_mat_ref_helper(const subview& X) const; + + arma_inline const Mat& get_mat_ref() const; + + template + arma_cold inline const std::string incompat_size_string(const Mat& A) const; + }; + + + + +template +class subview_each1 : public subview_each_common + { + protected: + + arma_inline subview_each1(const parent& in_P); + + + public: + + typedef typename parent::elem_type eT; + + inline ~subview_each1(); + inline subview_each1() = delete; + + // deliberately returning void + template inline void operator= (const Base& x); + template inline void operator+= (const Base& x); + template inline void operator-= (const Base& x); + template inline void operator%= (const Base& x); + template inline void operator/= (const Base& x); + + + friend class Mat; + friend class subview; + }; + + + +template +class subview_each2 : public subview_each_common + { + protected: + + inline subview_each2(const parent& in_P, const Base& in_indices); + + + public: + + const Base& base_indices; + + typedef typename parent::elem_type eT; + + inline void check_indices(const Mat& indices) const; + + inline ~subview_each2(); + inline subview_each2() = delete; + + // deliberately returning void + template inline void operator= (const Base& x); + template inline void operator+= (const Base& x); + template inline void operator-= (const Base& x); + template inline void operator%= (const Base& x); + template inline void operator/= (const Base& x); + + + friend class Mat; + friend class subview; + }; + + + +class subview_each1_aux + { + public: + + template + static inline Mat operator_plus(const subview_each1& X, const Base& Y); + + template + static inline Mat operator_minus(const subview_each1& X, const Base& Y); + + template + static inline Mat operator_minus(const Base& X, const subview_each1& Y); + + template + static inline Mat operator_schur(const subview_each1& X, const Base& Y); + + template + static inline Mat operator_div(const subview_each1& X,const Base& Y); + + template + static inline Mat operator_div(const Base& X, const subview_each1& Y); + }; + + + +class subview_each2_aux + { + public: + + template + static inline Mat operator_plus(const subview_each2& X, const Base& Y); + + template + static inline Mat operator_minus(const subview_each2& X, const Base& Y); + + template + static inline Mat operator_minus(const Base& X, const subview_each2& Y); + + template + static inline Mat operator_schur(const subview_each2& X, const Base& Y); + + template + static inline Mat operator_div(const subview_each2& X, const Base& Y); + + template + static inline Mat operator_div(const Base& X, const subview_each2& Y); + }; + + + +//! @} -- cgit v1.2.1