From 7487929bfc1881e3962dd8e79253efe22670a8c6 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Sun, 5 Nov 2023 16:27:36 +0100 Subject: [PATCH] add comment header to include/array files --- src/include/array/aindex.cc.h | 11 +++ src/include/array/aindex.h | 11 +++ src/include/array/array.cc.h | 12 ++- src/include/array/array.h | 12 ++- src/include/array/array_base.cc.h | 11 +++ src/include/array/array_base.h | 11 +++ src/include/array/functional_array.cc.h | 99 ------------------------- src/include/array/functional_array.h | 61 --------------- src/include/array/marray.cc.h | 11 +++ src/include/array/marray.h | 11 +++ src/include/array/slice.cc.h | 11 +++ src/include/array/slice.h | 11 +++ 12 files changed, 110 insertions(+), 162 deletions(-) delete mode 100644 src/include/array/functional_array.cc.h delete mode 100644 src/include/array/functional_array.h diff --git a/src/include/array/aindex.cc.h b/src/include/array/aindex.cc.h index 201a51b..ac45c4a 100644 --- a/src/include/array/aindex.cc.h +++ b/src/include/array/aindex.cc.h @@ -1,3 +1,14 @@ +// -*- C++ -*- +/** + + @file include/array/aindex.cc.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_aindex_cc_h__ #define __cxz_aindex_cc_h__ diff --git a/src/include/array/aindex.h b/src/include/array/aindex.h index 8a1e2fb..0352376 100644 --- a/src/include/array/aindex.h +++ b/src/include/array/aindex.h @@ -1,3 +1,14 @@ +// -*- C++ -*- +/** + + @file include/array/aindex.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_aindex_h__ #define __cxz_aindex_h__ diff --git a/src/include/array/array.cc.h b/src/include/array/array.cc.h index dd01178..1a90b0b 100644 --- a/src/include/array/array.cc.h +++ b/src/include/array/array.cc.h @@ -1,6 +1,16 @@ +// -*- C++ -*- +/** + + @file include/array/array.cc.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "array_base.cc.h" #include "marray.cc.h" #include "aindex.cc.h" #include "slice.cc.h" -//#include "functional_array.cc.h" diff --git a/src/include/array/array.h b/src/include/array/array.h index b8d0a21..d1a7358 100644 --- a/src/include/array/array.h +++ b/src/include/array/array.h @@ -1,8 +1,18 @@ +// -*- C++ -*- +/** + + @file include/array/array.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "array_base.h" #include "marray.h" #include "aindex.h" #include "slice.h" -//#include "functional_array.h" #include "array.cc.h" diff --git a/src/include/array/array_base.cc.h b/src/include/array/array_base.cc.h index 0f5a11d..80ce363 100644 --- a/src/include/array/array_base.cc.h +++ b/src/include/array/array_base.cc.h @@ -1,3 +1,14 @@ +// -*- C++ -*- +/** + + @file include/array/array_base.cc.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_array_base_cc_h__ #define __cxz_array_base_cc_h__ diff --git a/src/include/array/array_base.h b/src/include/array/array_base.h index 971a08f..9d67752 100644 --- a/src/include/array/array_base.h +++ b/src/include/array/array_base.h @@ -1,3 +1,14 @@ +// -*- C++ -*- +/** + + @file include/array/array_base.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_array_base_h__ #define __cxz_array_base_h__ diff --git a/src/include/array/functional_array.cc.h b/src/include/array/functional_array.cc.h deleted file mode 100644 index 01520cd..0000000 --- a/src/include/array/functional_array.cc.h +++ /dev/null @@ -1,99 +0,0 @@ - -#include "functional_array.h" - -namespace CNORXZ -{ - - - /**************************** - * FunctionalArray * - ****************************/ - - template - FunctionalArray::FunctionalArray(const std::shared_ptr&... ranges, - const std::shared_ptr& func) : - ArrayBase(ranges...), mFunc(func) {} - - template - FunctionalArray::FunctionalArray(const std::shared_ptr&... ranges) : - ArrayBase(ranges...) {} - - template - FunctionalArray::FunctionalArray(const typename CRange::Space& space) : - ArrayBase(space) {} - - template - FunctionalArray::FunctionalArray(const typename CRange::Space& space, - const std::shared_ptr& func) : - ArrayBase(space), mFunc(func) {} - - - template - const T& FunctionalArray::operator[](const IndexType& i) const - { - if constexpr(Function::FISSTATIC){ - mVal = Function::apply(i.meta()); - } - else { - mVal = (*mFunc)(i.meta()); - } - return mVal; - } - - template - const T& FunctionalArray::at(const typename CRange::IndexType::MetaType& meta) const - { - if constexpr(Function::FISSTATIC){ - mVal = Function::apply(meta); - } - else { - mVal = (*mFunc)(meta); - } - return mVal; - } - - template - const T* FunctionalArray::data() const - { - return &mVal; - } - - template - bool FunctionalArray::isConst() const - { - return true; - } - - template - bool FunctionalArray::isSlice() const - { - return false; - } - - template - std::shared_ptr > FunctionalArray::anonymous(bool slice) const - { - assert(0); // think about it carefully - return nullptr; - } - - template - ConstOperationRoot FunctionalArray:: - operator()(const std::shared_ptr&... inds) const - { - if(not mMaPtr){ - mMaPtr = std::make_shared( MAB::mRange->space() ); - (*mMaPtr)(inds...) = exec(inds...); - } - return ConstOperationRoot( *mMaPtr, inds... ); - } - - template - auto FunctionalArray:: - exec(const std::shared_ptr&... inds) const - -> Operation...> - { - return mkOperation( mFunc, MetaOperationRoot( inds ) ... ); - } - -} // namespace CNORXZ diff --git a/src/include/array/functional_array.h b/src/include/array/functional_array.h deleted file mode 100644 index b8df149..0000000 --- a/src/include/array/functional_array.h +++ /dev/null @@ -1,61 +0,0 @@ - -#ifndef __cxz_functional_array__ -#define __cxz_functional_array__ - -#include "cxz_array_base.h" -#include "slice.h" - -namespace CNORXZ -{ - - template - class FunctionalArray : public ArrayBase - { - public: - - typedef ContainerRange CRange; - typedef ArrayBase MAB; - typedef ConstContainerIndex IndexType; - typedef Array MAType; - typedef T value_type; - - private: - mutable T mVal; - std::shared_ptr mFunc; - - mutable std::shared_ptr mMaPtr; - - public: - - DEFAULT_MEMBERS(FunctionalArray); - FunctionalArray(const std::shared_ptr&... ranges, const std::shared_ptr& func); - FunctionalArray(const std::shared_ptr&... ranges); - FunctionalArray(const typename CRange::Space& space); - FunctionalArray(const typename CRange::Space& space, const std::shared_ptr& func); - - virtual const T& operator[](const IndexType& i) const override; - virtual const T& at(const typename CRange::IndexType::MetaType& meta) const override; - virtual const T* data() const override; - - virtual bool isConst() const override; - virtual bool isSlice() const override; - - virtual std::shared_ptr > anonymous(bool slice = false) const override; - - auto exec(const std::shared_ptr&... inds) const - -> Operation...>; - - virtual ConstOperationRoot - operator()(const std::shared_ptr&... inds) const override; - - }; - - -} // namespace CNORXZ - -/* ========================= * - * --- TEMPLATE CODE --- * - * ========================= */ - - -#endif diff --git a/src/include/array/marray.cc.h b/src/include/array/marray.cc.h index 3155c72..591ce8e 100644 --- a/src/include/array/marray.cc.h +++ b/src/include/array/marray.cc.h @@ -1,3 +1,14 @@ +// -*- C++ -*- +/** + + @file include/array/marray.cc.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_marray_cc_h__ #define __cxz_marray_cc_h__ diff --git a/src/include/array/marray.h b/src/include/array/marray.h index 1c418c2..1f561ea 100644 --- a/src/include/array/marray.h +++ b/src/include/array/marray.h @@ -1,3 +1,14 @@ +// -*- C++ -*- +/** + + @file include/array/marray.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_marray_h__ #define __cxz_marray_h__ diff --git a/src/include/array/slice.cc.h b/src/include/array/slice.cc.h index 53078f3..a1df1d0 100644 --- a/src/include/array/slice.cc.h +++ b/src/include/array/slice.cc.h @@ -1,3 +1,14 @@ +// -*- C++ -*- +/** + + @file include/array/slice.cc.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_slice_cc_h__ #define __cxz_slice_cc_h__ diff --git a/src/include/array/slice.h b/src/include/array/slice.h index 6be5f53..9959dc8 100644 --- a/src/include/array/slice.h +++ b/src/include/array/slice.h @@ -1,3 +1,14 @@ +// -*- C++ -*- +/** + + @file include/array/slice.h + @brief ... + + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_slice_h__ #define __cxz_slice_h__