diff --git a/CMakeLists.txt b/CMakeLists.txt index fb5a89f..9499092 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,13 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) project(cnorxz) # LIB VERSION -set(VERSION_PART "pre") -set(VERSION_TAG_HASH "6857e3fc7d0af25db3a925791d1cabc6342b930a") +set(V_MAJOR 0) +set(V_MINOR 0) +set(V_PATCH 0) +set(VERSION "${V_MAJOR}.${V_MINOR}.${V_PATCH}") # OPTIONS @@ -20,21 +22,13 @@ include(cmake/check_avx.cmake) execute_process(COMMAND bash "-c" "git rev-parse HEAD" OUTPUT_VARIABLE GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND bash "-c" "git rev-parse --abbrev-ref HEAD" OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE) -# BUILD / CHECK VERSION STRING +# BUILD VERSION STRING -message(STATUS "${GIT_HASH}") -message(STATUS "${VERSION_PART}") -message(STATUS "${VERSION_TAG_HASH}") -set(VERSION "${VERSION_PART}") +message(STATUS "git hash = ${GIT_HASH}") +message(STATUS "git branch = ${GIT_BRANCH}") if(NOT ("${GIT_BRANCH}" EQUAL "release")) - if(NOT ("${GIT_HASH}" EQUAL "${VERSION_TAG_HASH}")) - string(SUBSTRING ${GIT_HASH} 0 7 GIT_HASH_SHORT) - set(VERSION "${VERSION}-${GIT_BRANCH}-${GIT_HASH_SHORT}") - endif() -else() - if(NOT ("${GIT_HASH}" EQUAL "${VERSION_TAG_HASH}")) - message(FATAL_ERROR "version mash-up, do not use, contact maintainer") - endif() + string(SUBSTRING ${GIT_HASH} 0 7 GIT_HASH_SHORT) + set(VERSION "${VERSION}-${GIT_BRANCH}-${GIT_HASH_SHORT}") endif() message(STATUS "version = ${VERSION}") diff --git a/README.md b/README.md index 19c0247..4cc1039 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ -# Container with Native Operation Routines by XZ (CNORXZ) +# Container with Native Operation Routines and Expressions (CNORXZ) + +(as always, the name was there before the acronym) ![Image](./cnorxz_logo.png) ## Description -This library provides a framework for handling multi dimensional containers, their meta data, and several kinds of operations on one or more of them. +This library provides a framework for handling multi dimensional data containers (arrays or array-like types), their meta data, and several kinds of operations on one or more of them. ## Build instructions @@ -72,5 +74,75 @@ Finally, there are the container classes (arrays), which are derived from `CArra #### Expressions and Operations +In the context of this library, *expressions* are classes representing an expression that is supposed to be executed at given points during an iteration proceedure that involves one or more indexed quantities. Each expression type must fulfill the following requirements: + +* There must be an implementation of `operator()` taking a multi-position argument indicating the position for the current iteration of each involved object according to its indices. The function can have an expression defined return value, which can be further processed. + +* There must be an implementation of `rootSteps()` taking an index ID as argument. The function should return jump sizes for each involved object corresponding to the given index. + +Each expression `Xpr` should be derived from the class `XprInterface`, where `Xpr` is a recurring template argument (static polymorphism). + +There are two important expression types: + +* *For* expressions: They represent a for loop over a given index. + +* *Operations*: They correspond to one or more indexed array types and given operation on or between them. If an operation handles nothing but the access to one single array, it is called *Operation* *Root*. + +Example: +```cpp +#include "cnroxz.h" + +using namespace CNORZX; + +RangePtr r = CRangeFactory(3).create(); // [0,1,2] +RangePtr s = CRangeFactory(5).create(); // [0,1,2,3,4] +RangePtr t = URangeFactory(Vector{4,5,6}).create(); // [4,5,6] +i = std::make_shared(r); +j = std::make_shared(s); +k = std::make_shared>(t); + +MArray a(r*s*t); // 3-dim array, dimensions = [3,5,3], size = 45 +MArray b(r*t); // 2-dim array, dimensions = [3,3], size = 9 +MArray c(s*t); // 2-dim array, dimensions = [3,5], size = 15 + +// set array element values of a,b,c here... + +c(j*k) += ( a(i*j*k) * b(j*k) * xpr(k) ).c(i); + +/* Explanation of the above line: + +c(j*k), a(i*j*k), b(j*k) and xpr(k) are operation roots, i.e. +they manage access to the arrays c,a,b and the meta data space of index k + +The operations between the operation roots are also operations in the +sense of this nomenclature, i.e. a(i*j*k) * b(j*k) is again an operation. + +The operation member function c() creates contraction, i.e. a for loop +over the given index (i). If no further functions are specified, the values +returned by the underlying operations are summed up for equivalent index +combinations. + +The += invokes a for loop over the indices on the l.h.s.. The values returned +by the expression on the r.h.s. are added to the l.h.s. Something similar could be done +with a = operator. Then the values would just be assigned instead of added. + +*/ + +// Equivalent C-stype for loop (if a,b,c were C-style arrays): + +for(size_t j = 0; j < s; ++j){ + for(size_t k = 0; k < t; ++k){ + int kv = k+4; + double x = 0; + // the contraction part: + for(size_t i = 0; i < r; ++i){ + x += a[i*s*t+j*t+k] * b[j*t+k] * kv; + } + c[j*t+k] += x; + } +} + +``` + ... diff --git a/TODO b/TODO index f76be28..e5eaef7 100644 --- a/TODO +++ b/TODO @@ -1,19 +1,14 @@ -include/operation/op_types.cc.h@173: "build and execute assign expression forwarding outer index" [long] -include/operation/op_types.cc.h@446: "TODO: implement ifor with func arg" [long] -include/array/array_base.cc.h@35: "TODO: check if container format is trivial" [check] -include/array/array_base.cc.h@120: "TODO: check if container format is trivial" [check] -include/array/array_base.cc.h@164: "check further compatibility of index/range format" [check] -include/array/array_base.cc.h@319: "check further compatibility of index/range format" [check] -include/base/dtype.cc.h@23: "for tuple use vector" [comment] -include/ranges/index_base.cc.h@110: "if this assert never applies, remove mPtrId (-> Defaults)" [long] -include/ranges/mrange.cc.h@633: "TODO: ZRange (meta and index pos static!)" [long] -include/ranges/urange.cc.h@366: "else general transform using DType (better than nothing), to be implemented" [urgent] -include/ranges/urange.cc.h@430: "else general transform using DType (better than nothing), to be implemented" [urgent] -include/xpr/for.cc.h@314: "check for write access" [check] -include/ranges/srange.cc.h@292: "TODO: check for selected static sizes of SRange -> return SRange" [long] -lib/ranges/crange.cc@114: "preliminary solution (TODO: implement xpr that simply returns PosT value)" [long] - -opt/hdf5/lib/h5_group.cc@166: "IMPLEMENT" [urgent] -opt/hdf5/include/h5_group.cc.h@34: "not implemented" [urgent] -opt/hdf5/lib/h5_table.cc@127: "not implemented" [urgent] +include/operation/op_types.cc.h@225: "build and execute assign expression forwarding outer index" +include/operation/op_types.cc.h@498: "implement ifor with func arg" +opt/hdf5/include/h5_content_base.h@23: "IO save error handling" +opt/hdf5/lib/h5_dataset.cc@124: "all sub-ranges explicity" +lib/ranges/crange.cc@94: "preliminary solution (TODO: implement xpr that simply returns PosT value)" +include/ranges/srange.cc.h@307: "check for selected static sizes of SRange -> return SRange" +include/xpr/for.cc.h@324: "check for write access" +include/base/dtype.cc.h@23: "for tuple use vector" +include/ranges/urange.cc.h@384: "else general transform using DType (better than nothing), to be implemented" +include/ranges/urange.cc.h@448: "else general transform using DType (better than nothing), to be implemented" +include/array/array_base.cc.h@184: "check further compatibility of index/range format" +include/array/array_base.cc.h@376: "check further compatibility of index/range format" +include/ranges/index_base.cc.h@109: "if this assert never applies, remove mPtrId (-> Defaults)" diff --git a/cnorxz_logo.png b/cnorxz_logo.png index 757ce6c..008dbeb 100644 Binary files a/cnorxz_logo.png and b/cnorxz_logo.png differ diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index d54e1f3..38e3958 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -54,14 +54,14 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "Container with Native Operation Routines (by XZ)" +PROJECT_BRIEF = "Container with Native Operation Routines and Expressions" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = "cnorxz_logo_mini.png" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -518,7 +518,7 @@ TIMESTAMP = NO # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. @@ -542,7 +542,7 @@ EXTRACT_PACKAGE = NO # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, @@ -1269,7 +1269,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = "header.html" # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1319,7 +1319,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = "cnorxz_logo_mini.png" # The HTML_COLORSTYLE tag can be used to specify if the generated HTML output # should be rendered with a dark or light theme. diff --git a/doc/doxy/cnorxz_logo_mini.png b/doc/doxy/cnorxz_logo_mini.png new file mode 100644 index 0000000..9c974fe Binary files /dev/null and b/doc/doxy/cnorxz_logo_mini.png differ diff --git a/doc/doxy/header.html b/doc/doxy/header.html new file mode 100644 index 0000000..8fed2ba --- /dev/null +++ b/doc/doxy/header.html @@ -0,0 +1,36 @@ + + + + + + + +CNORXZ: Container with Native Operation Routines and Expressions (CNORXZ) + + + + + + + + + + + + +
+
+ + + + + + + +
+
CNORXZ +
+
Container with Native Operation Routines and Expressions
+
+
+ diff --git a/src/bin/config.cc b/src/bin/config.cc index ad18459..7cf47bd 100644 --- a/src/bin/config.cc +++ b/src/bin/config.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file bin/config.cc + @brief Program for printing cnorxz configurations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include #include diff --git a/src/include/array/aindex.cc.h b/src/include/array/aindex.cc.h index ac45c4a..e28c257 100644 --- a/src/include/array/aindex.cc.h +++ b/src/include/array/aindex.cc.h @@ -2,10 +2,9 @@ /** @file include/array/aindex.cc.h - @brief ... + @brief Array index template implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/array/aindex.h b/src/include/array/aindex.h index 0352376..7f7a411 100644 --- a/src/include/array/aindex.h +++ b/src/include/array/aindex.h @@ -2,10 +2,9 @@ /** @file include/array/aindex.h - @brief ... + @brief Array index declaration. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/array/array.cc.h b/src/include/array/array.cc.h index 1a90b0b..69566f7 100644 --- a/src/include/array/array.cc.h +++ b/src/include/array/array.cc.h @@ -2,10 +2,9 @@ /** @file include/array/array.cc.h - @brief ... + @brief Array main header for template implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/array/array.h b/src/include/array/array.h index d1a7358..4d7c23a 100644 --- a/src/include/array/array.h +++ b/src/include/array/array.h @@ -2,10 +2,9 @@ /** @file include/array/array.h - @brief ... + @brief Array main header. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/array/array_base.cc.h b/src/include/array/array_base.cc.h index ae1218f..dcc1779 100644 --- a/src/include/array/array_base.cc.h +++ b/src/include/array/array_base.cc.h @@ -2,10 +2,9 @@ /** @file include/array/array_base.cc.h - @brief ... + @brief Array base class template implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ @@ -182,7 +181,6 @@ namespace CNORXZ typename CArrayBase::const_iterator CArrayBase::itLexSave(const Acc& acc) const { CXZ_ASSERT(acc.lex() < this->size(), "index out of range"); - //CXZ_ASSERT(false, "IMPLEMENT CHECKS!!"); // check further compatibility of index/range format!!! return begin() + acc.lex(); } @@ -375,7 +373,6 @@ namespace CNORXZ typename ArrayBase::iterator ArrayBase::itLexSave(const Acc& acc) { CXZ_ASSERT(acc.lex() < this->size(), "index out of range"); - //CXZ_ASSERT(false, "IMPLEMENT CHECKS!!"); // check further compatibility of index/range format!!! return begin() + acc.lex(); } diff --git a/src/include/array/array_base.h b/src/include/array/array_base.h index f74f83b..9e3ad07 100644 --- a/src/include/array/array_base.h +++ b/src/include/array/array_base.h @@ -2,10 +2,9 @@ /** @file include/array/array_base.h - @brief ... + @brief Array base class declarations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/array/marray.cc.h b/src/include/array/marray.cc.h index 3ea3923..d60b07d 100644 --- a/src/include/array/marray.cc.h +++ b/src/include/array/marray.cc.h @@ -2,10 +2,9 @@ /** @file include/array/marray.cc.h - @brief ... + @brief MArray implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/array/marray.h b/src/include/array/marray.h index 9445ec7..384cacb 100644 --- a/src/include/array/marray.h +++ b/src/include/array/marray.h @@ -2,10 +2,9 @@ /** @file include/array/marray.h - @brief ... + @brief MArray declarations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/array/slice.cc.h b/src/include/array/slice.cc.h index 1dca0cf..95131b9 100644 --- a/src/include/array/slice.cc.h +++ b/src/include/array/slice.cc.h @@ -2,10 +2,9 @@ /** @file include/array/slice.cc.h - @brief ... + @brief Slice implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/array/slice.h b/src/include/array/slice.h index a636b1a..fab06da 100644 --- a/src/include/array/slice.h +++ b/src/include/array/slice.h @@ -2,10 +2,9 @@ /** @file include/array/slice.h - @brief ... + @brief Slice declarations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/base/config.h b/src/include/base/config.h index a4224e8..63a9871 100644 --- a/src/include/base/config.h +++ b/src/include/base/config.h @@ -2,11 +2,11 @@ /** @file include/base/config.h - @brief runtime config functions + @brief Runtime config functions declarations. - Declare functions returning version and configuration infos + Declare functions returning version and configuration infos. - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/base/to_string.h b/src/include/base/to_string.h index 1b00959..96c368a 100644 --- a/src/include/base/to_string.h +++ b/src/include/base/to_string.h @@ -2,9 +2,9 @@ /** @file include/base/to_string.h - @brief String converter + @brief String converter declarations. - Declaration of functions that convert a given object/type to a string + Declaration of functions that convert a given object/type to a string. Copyright (c) 2022 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de diff --git a/src/include/base/types.h b/src/include/base/types.h index 77dbc98..9ba70d3 100644 --- a/src/include/base/types.h +++ b/src/include/base/types.h @@ -84,7 +84,7 @@ namespace CNORXZ | library types | +===================*/ - /*** + /* Naming Prefixes: D = Y = Dynamic V = X = Virtual @@ -100,7 +100,7 @@ namespace CNORXZ A = (const) Array B = (mutable) Array F = Functional, Map,... - ***/ + */ // default template parameter class None {}; diff --git a/src/include/base/uuid.h b/src/include/base/uuid.h index df8da17..6bca169 100644 --- a/src/include/base/uuid.h +++ b/src/include/base/uuid.h @@ -2,7 +2,7 @@ /** @file include/base/uuid.h - @brief uuid implementation + @brief cnorxz uuid declaration. Copyright (c) 2022 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de diff --git a/src/include/cnorxz.cc.h b/src/include/cnorxz.cc.h index 46e5a5c..fdafce4 100644 --- a/src/include/cnorxz.cc.h +++ b/src/include/cnorxz.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/cnorxz.cc.h + @brief cnorxz main template header + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "base/base.cc.h" #include "memory/memory.cc.h" diff --git a/src/include/memory/allocator.cc.h b/src/include/memory/allocator.cc.h index 352eb9c..2e50105 100644 --- a/src/include/memory/allocator.cc.h +++ b/src/include/memory/allocator.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/memory/allocator.cc.h + @brief Allocator template member function implementation + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_allocator_cc_h__ #define __cxz_allocator_cc_h__ diff --git a/src/include/memory/allocator.h b/src/include/memory/allocator.h index 92be7f3..bc90139 100644 --- a/src/include/memory/allocator.h +++ b/src/include/memory/allocator.h @@ -1,11 +1,10 @@ // -*- C++ -*- /** - @file include/memory/memcount.h - @brief ... + @file include/memory/allocator.h + @brief Allocator declaration - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/memory/memcount.h b/src/include/memory/memcount.h index f69c261..6dc9268 100644 --- a/src/include/memory/memcount.h +++ b/src/include/memory/memcount.h @@ -2,10 +2,9 @@ /** @file include/memory/memcount.h - @brief ... + @brief MemCount declaration. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/memory/memory.cc.h b/src/include/memory/memory.cc.h index 19a1181..82ffc2f 100644 --- a/src/include/memory/memory.cc.h +++ b/src/include/memory/memory.cc.h @@ -2,10 +2,9 @@ /** @file include/memory/memory.cc.h - @brief ... + @brief Memory template implementations main header. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/memory/memory.h b/src/include/memory/memory.h index 6f1ec8c..85be208 100644 --- a/src/include/memory/memory.h +++ b/src/include/memory/memory.h @@ -2,10 +2,9 @@ /** @file include/memory/memory.h - @brief ... + @brief Memory main heade. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/operation/basic_operations.cc.h b/src/include/operation/basic_operations.cc.h index 9e8d3b5..49d937c 100644 --- a/src/include/operation/basic_operations.cc.h +++ b/src/include/operation/basic_operations.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/basic_operations.cc.h + @brief Basic operations implementation + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_basic_operations_cc_h__ #define __cxz_basic_operations_cc_h__ @@ -6,9 +16,9 @@ namespace CNORXZ { - /************************************ - * standard operatrions (unary) * - ************************************/ + /*==================================+ + | standard operatrions (unary) | + +==================================*/ template constexpr decltype(auto) minus(const COpInterface& op) @@ -16,9 +26,9 @@ namespace CNORXZ return operation( [](const auto& a) { return -a; }, op.THIS() ); } - /************************************* - * standard operatrions (binary) * - *************************************/ + /*===================================+ + | standard operatrions (binary) | + +===================================*/ template constexpr decltype(auto) plus(const COpInterface& op1, const COpInterface& op2) @@ -55,9 +65,9 @@ namespace CNORXZ op1.THIS(), op2.THIS() ); } - /***************************************** - * operators for standard operations * - *****************************************/ + /*=======================================+ + | operators for standard operations | + +=======================================*/ template constexpr decltype(auto) operator-(const COpInterface& op) diff --git a/src/include/operation/basic_operations.h b/src/include/operation/basic_operations.h index 150e183..8301fbe 100644 --- a/src/include/operation/basic_operations.h +++ b/src/include/operation/basic_operations.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/basic_operations.h + @brief Basic operations declaration + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_basic_operations_h__ #define __cxz_basic_operations_h__ diff --git a/src/include/operation/extensions/avx.cc.h b/src/include/operation/extensions/avx.cc.h index 4660b52..88c0020 100644 --- a/src/include/operation/extensions/avx.cc.h +++ b/src/include/operation/extensions/avx.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/extensions/avx.cc.h + @brief Register type implementaions for AVX. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_avx_cc_h__ #define __cxz_avx_cc_h__ @@ -6,9 +16,9 @@ namespace CNORXZ { - /*********************** - * PlusCC / PlusCX * - ***********************/ + /*=====================+ + | PlusCC / PlusCX | + +=====================*/ inline decltype(auto) PlusCC::eval(const Consecutive& a, @@ -70,9 +80,9 @@ namespace CNORXZ return o; } - /************************* - * MinusCC / MinusCX * - *************************/ + /*=======================+ + | MinusCC / MinusCX | + +=======================*/ inline decltype(auto) MinusCC::eval(const Consecutive& a, @@ -134,9 +144,9 @@ namespace CNORXZ return o; } - /*********************************** - * MultipliesCC / MultipliesCX * - ***********************************/ + /*=================================+ + | MultipliesCC / MultipliesCX | + +=================================*/ inline decltype(auto) MultipliesCC::eval(const Consecutive& a, @@ -200,9 +210,9 @@ namespace CNORXZ } - /***************************** - * DividesCC / DividesCX * - *****************************/ + /*===========================+ + | DividesCC / DividesCX | + +===========================*/ inline decltype(auto) DividesCC::eval(const Consecutive& a, diff --git a/src/include/operation/extensions/avx.h b/src/include/operation/extensions/avx.h index 20e3f52..af735f5 100644 --- a/src/include/operation/extensions/avx.h +++ b/src/include/operation/extensions/avx.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/extensions/avx.h + @brief Register type specialization for AVX. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_avx_h__ #define __cxz_avx_h__ diff --git a/src/include/operation/extensions/extensions.cc.h b/src/include/operation/extensions/extensions.cc.h index 1bdc7d9..9f64c25 100644 --- a/src/include/operation/extensions/extensions.cc.h +++ b/src/include/operation/extensions/extensions.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/extensions/extensions.cc.h + @brief Operation extensions template implementations main header. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_extensions_cc_h__ #define __cxz_extensions_cc_h__ diff --git a/src/include/operation/extensions/extensions.h b/src/include/operation/extensions/extensions.h index 8a52a6b..f750641 100644 --- a/src/include/operation/extensions/extensions.h +++ b/src/include/operation/extensions/extensions.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/extensions/extensions.h + @brief Operation extensions main header. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_extensions_h__ #define __cxz_extensions_h__ diff --git a/src/include/operation/extensions/reg.cc.h b/src/include/operation/extensions/reg.cc.h index 73560b9..f3d85fb 100644 --- a/src/include/operation/extensions/reg.cc.h +++ b/src/include/operation/extensions/reg.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/extensions/reg.cc.h + @brief Register type template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_reg_cc_h__ #define __cxz_reg_cc_h__ @@ -110,9 +120,9 @@ namespace CNORXZ return consecFuncAI(f, dst, args..., std::make_index_sequence{}); } - /****************************** - * basic operations: plus * - ******************************/ + /*============================+ + | basic operations: plus | + +============================*/ template constexpr decltype(auto) @@ -146,9 +156,9 @@ namespace CNORXZ return consecFuncA( [](auto& x, const auto& y) { return x += y; }, o, a ); } - /******************************* - * basic operations: minus * - *******************************/ + /*=============================+ + | basic operations: minus | + +=============================*/ template constexpr decltype(auto) MinusCC::eval(const Consecutive& a, const Consecutive& b) @@ -180,9 +190,9 @@ namespace CNORXZ return consecFuncA( [](auto& x, const auto& y) { return x -= y; }, o, a ); } - /*********************************** - * basic operations: muliplies * - ***********************************/ + /*=================================+ + | basic operations: muliplies | + +=================================*/ template constexpr decltype(auto) MultipliesCC::eval(const Consecutive& a, const Consecutive& b) @@ -214,9 +224,9 @@ namespace CNORXZ return consecFuncA( [](const auto& x, const auto& y) { return x *= y; }, o, a ); } - /********************************* - * basic operations: divides * - *********************************/ + /*===============================+ + | basic operations: divides | + +===============================*/ template constexpr decltype(auto) DividesCC::eval(const Consecutive& a, const Consecutive& b) diff --git a/src/include/operation/extensions/reg.h b/src/include/operation/extensions/reg.h index f03b848..8cbf699 100644 --- a/src/include/operation/extensions/reg.h +++ b/src/include/operation/extensions/reg.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/extensions/reg.h + @brief Register type declaration. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_reg_h__ #define __cxz_reg_h__ @@ -33,9 +43,9 @@ namespace CNORXZ template struct consecutive_size> { static constexpr SizeT value = N; }; - /**************************************** - * consecutive generating functions * - ****************************************/ + /*======================================+ + | consecutive generating functions | + +======================================*/ template inline decltype(auto) vregi(const T* d, const EPosT& pos, std::index_sequence is); @@ -46,9 +56,9 @@ namespace CNORXZ template inline decltype(auto) vreg(T* d, const EPosT& pos); - /****************** - * ConsecFunc * - ******************/ + /*================+ + | ConsecFunc | + +================*/ template constexpr decltype(auto) consecGet(const T& a); @@ -76,9 +86,9 @@ namespace CNORXZ template constexpr Dst& consecFuncA(const F& f, Dst& dst, const Args&... args); - /****************************** - * basic operations: plus * - ******************************/ + /*============================+ + | basic operations: plus | + +============================*/ template struct PlusCC @@ -123,9 +133,9 @@ namespace CNORXZ constexpr Consecutive& operator+=(Consecutive& o, const U& a) { return PlusCX::aeval(o,a); } - /******************************* - * basic operations: minus * - *******************************/ + /*=============================+ + | basic operations: minus | + +=============================*/ template struct MinusCC @@ -170,9 +180,9 @@ namespace CNORXZ constexpr Consecutive& operator-=(Consecutive& o, const U& a) { return MinusCX::eval(o,a); } - /*********************************** - * basic operations: muliplies * - ***********************************/ + /*=================================+ + | basic operations: muliplies | + +=================================*/ template struct MultipliesCC @@ -217,9 +227,9 @@ namespace CNORXZ constexpr Consecutive& operator*=(Consecutive& o, const U& a) { return MultipliesCX::eval(o,a); } - /********************************* - * basic operations: divides * - *********************************/ + /*===============================+ + | basic operations: divides | + +===============================*/ template struct DividesCC diff --git a/src/include/operation/op_types.cc.h b/src/include/operation/op_types.cc.h index 1dc514f..6ae55fd 100644 --- a/src/include/operation/op_types.cc.h +++ b/src/include/operation/op_types.cc.h @@ -1,9 +1,18 @@ +// -*- C++ -*- +/** + + @file include/operation/op_types.cc.h + @brief Operation types template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_op_types_cc_h__ #define __cxz_op_types_cc_h__ #include "op_types.h" -//#include "xpr/xpr.h" #include "op_utility.h" #include "extensions/extensions.h" diff --git a/src/include/operation/op_types.h b/src/include/operation/op_types.h index ce0fa4a..addb020 100644 --- a/src/include/operation/op_types.h +++ b/src/include/operation/op_types.h @@ -1,4 +1,13 @@ // -*- C++ -*- +/** + + @file include/operation/op_types.h + @brief Operation types declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_op_types_h__ #define __cxz_op_types_h__ diff --git a/src/include/operation/op_utility.cc.h b/src/include/operation/op_utility.cc.h index ed8fa45..62f9b3d 100644 --- a/src/include/operation/op_utility.cc.h +++ b/src/include/operation/op_utility.cc.h @@ -1,10 +1,19 @@ +// -*- C++ -*- +/** + + @file include/operation/op_utility.cc.h + @brief Operation utilities template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_op_utility_cc_h__ #define __cxz_op_utility_cc_h__ #include "op_utility.h" #include "xpr/pos_type.h" -//#include "operation/op_types.h" namespace CNORXZ { diff --git a/src/include/operation/op_utility.h b/src/include/operation/op_utility.h index dfabab4..94925c9 100644 --- a/src/include/operation/op_utility.h +++ b/src/include/operation/op_utility.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/op_utility.h + @brief Operation utilities declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_op_utility_h__ #define __cxz_op_utility_h__ diff --git a/src/include/operation/operation.cc.h b/src/include/operation/operation.cc.h index b1dd93c..0db4893 100644 --- a/src/include/operation/operation.cc.h +++ b/src/include/operation/operation.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/operation.cc.h + @brief Operation main header for template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "op_types.cc.h" #include "op_utility.cc.h" diff --git a/src/include/operation/operation.h b/src/include/operation/operation.h index 1e560d9..3669206 100644 --- a/src/include/operation/operation.h +++ b/src/include/operation/operation.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/operation/operation.h + @brief Operation main header. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "op_types.h" #include "op_utility.h" diff --git a/src/include/ranges/crange.cc.h b/src/include/ranges/crange.cc.h index 6a8e3be..843b90b 100644 --- a/src/include/ranges/crange.cc.h +++ b/src/include/ranges/crange.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/crange.cc.h - @brief ... + @brief CRange and CIndex template implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/ranges/dindex.cc.h b/src/include/ranges/dindex.cc.h index f752bed..91668b6 100644 --- a/src/include/ranges/dindex.cc.h +++ b/src/include/ranges/dindex.cc.h @@ -2,8 +2,7 @@ /** @file include/ranges/dindex.cc.h - @brief ... - + @brief Dynamic index template implementations. Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de diff --git a/src/include/ranges/dindex.h b/src/include/ranges/dindex.h index 0408cc2..f70a56c 100644 --- a/src/include/ranges/dindex.h +++ b/src/include/ranges/dindex.h @@ -2,7 +2,7 @@ /** @file include/ranges/dindex.h - @brief DIndex declaration + @brief Dynamic index declaration. Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de diff --git a/src/include/ranges/eindex.cc.h b/src/include/ranges/eindex.cc.h index e0c31c1..a48a8c3 100644 --- a/src/include/ranges/eindex.cc.h +++ b/src/include/ranges/eindex.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/eindex.cc.h - @brief ... + @brief Extension index implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/ranges/eindex.h b/src/include/ranges/eindex.h index f7e2c81..a0e1e3e 100644 --- a/src/include/ranges/eindex.h +++ b/src/include/ranges/eindex.h @@ -2,8 +2,7 @@ /** @file include/ranges/eindex.h - @brief ... - + @brief Extension index declaration. Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de diff --git a/src/include/ranges/index_base.cc.h b/src/include/ranges/index_base.cc.h index 4ba1774..c037b54 100644 --- a/src/include/ranges/index_base.cc.h +++ b/src/include/ranges/index_base.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/index_base.cc.h - @brief ... + @brief Index base template implementation. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ @@ -17,9 +16,9 @@ namespace CNORXZ { - /********************** - * IndexInterface * - **********************/ + /*====================+ + | IndexInterface | + +====================*/ template IndexInterface::IndexInterface() @@ -113,9 +112,9 @@ namespace CNORXZ } - /**************************** - * Non-member functions * - ****************************/ + /*==========================+ + | Non-member functions | + +==========================*/ template IndexPtr& operator++(const IndexPtr& i) diff --git a/src/include/ranges/index_base.h b/src/include/ranges/index_base.h index e13b027..e9ca374 100644 --- a/src/include/ranges/index_base.h +++ b/src/include/ranges/index_base.h @@ -2,10 +2,9 @@ /** @file include/ranges/index_base.h - @brief ... + @brief Index base declaration. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ @@ -28,7 +27,7 @@ namespace CNORXZ all indices are supposed to be derived from the corresponding template instance - Indices are act as iterators over parameter spaces (ranges) and/or + Indices act as iterators over parameter spaces (ranges) and/or the containers (arrays) defined on them Moreover, indices are used to define operations on the diff --git a/src/include/ranges/index_format.cc.h b/src/include/ranges/index_format.cc.h index b5fa845..7acf07c 100644 --- a/src/include/ranges/index_format.cc.h +++ b/src/include/ranges/index_format.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/index_format.cc.h - @brief ... + @brief Index formats implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ @@ -17,9 +16,9 @@ namespace CNORXZ { - /*************** - * MFormat * - ***************/ + /*=============+ + | MFormat | + +=============*/ template constexpr MFormat::MFormat(const Arr& b) : @@ -61,9 +60,9 @@ namespace CNORXZ } - /**************** - * GMFormat * - ****************/ + /*==============+ + | GMFormat | + +==============*/ template constexpr GMFormat::GMFormat(const Tuple& b) : @@ -115,9 +114,9 @@ namespace CNORXZ return GMFormat(std::move(std::make_tuple(ps...))); } - /*************** - * YFormat * - ***************/ + /*=============+ + | YFormat | + +=============*/ template YFormat::YFormat(const FormatT& f) : mB(f.size()) diff --git a/src/include/ranges/index_format.h b/src/include/ranges/index_format.h index f67ae74..45e2b1d 100644 --- a/src/include/ranges/index_format.h +++ b/src/include/ranges/index_format.h @@ -2,8 +2,7 @@ /** @file include/ranges/index_format.h - @brief ... - + @brief Index formats declaration. Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de diff --git a/src/include/ranges/index_mul.cc.h b/src/include/ranges/index_mul.cc.h index 0395560..dbc1e7a 100644 --- a/src/include/ranges/index_mul.cc.h +++ b/src/include/ranges/index_mul.cc.h @@ -2,8 +2,7 @@ /** @file include/ranges/index_mul.cc.h - @brief ... - + @brief Index multiplication template implementation. Copyright (c) 2022 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de @@ -18,9 +17,9 @@ namespace CNORXZ { - /********************* - * MIndexSptrMul * - *********************/ + /*===================+ + | MIndexSptrMul | + +===================*/ template decltype(auto) MIndexSptrMul::evalMX(const Sptr>& a, @@ -52,9 +51,9 @@ namespace CNORXZ } - /***************** - * operator* * - *****************/ + /*===============+ + | operator* | + +===============*/ template inline decltype(auto) operator*(const IndexInterface& a, @@ -122,9 +121,9 @@ namespace CNORXZ return a.mul(b); } - /*************** - * iptrMul * - ***************/ + /*=============+ + | iptrMul | + +=============*/ template decltype(auto) iptrMul(const Sptr& a, const Sptr& b) diff --git a/src/include/ranges/index_pack.cc.h b/src/include/ranges/index_pack.cc.h index f8b05f5..c8be6aa 100644 --- a/src/include/ranges/index_pack.cc.h +++ b/src/include/ranges/index_pack.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/index_pack.cc.h - @brief ... + @brief Index pack template implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ @@ -17,9 +16,9 @@ namespace CNORXZ { - /************* - * SPack * - *************/ + /*===========+ + | SPack | + +===========*/ template constexpr SPack::SPack(const Sptr&... is) : @@ -96,9 +95,9 @@ namespace CNORXZ return lex(); } - /************************** - * SPack (non-member) * - **************************/ + /*========================+ + | SPack (non-member) | + +========================*/ template constexpr decltype(auto) spack(const Indices&... inds) @@ -114,9 +113,9 @@ namespace CNORXZ return SPack( inds... ); } - /************* - * DPack * - *************/ + /*===========+ + | DPack | + +===========*/ template DPack::DPack(const SPack& p) : @@ -127,9 +126,9 @@ namespace CNORXZ {} - /************************** - * DPack (non-member) * - **************************/ + /*========================+ + | DPack (non-member) | + +========================*/ template DPack dpack(const Indices&... inds) diff --git a/src/include/ranges/index_pack.h b/src/include/ranges/index_pack.h index aab655d..ab7b02a 100644 --- a/src/include/ranges/index_pack.h +++ b/src/include/ranges/index_pack.h @@ -2,7 +2,7 @@ /** @file include/ranges/index_pack.h - @brief Index pack declaration + @brief Index pack declarations. Index packs are sets of indices. In contrast to multi-indices like (G)MIndex or YIndex, there is no format that can be used to determine @@ -10,7 +10,7 @@ Nevertheless, a function pos() is implemented, which just returns the same value as lex(). - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/ranges/lindex.cc.h b/src/include/ranges/lindex.cc.h index 4dc5dab..5ec5342 100644 --- a/src/include/ranges/lindex.cc.h +++ b/src/include/ranges/lindex.cc.h @@ -2,8 +2,7 @@ /** @file include/ranges/lindex.cc.h - @brief ... - + @brief LIndex implementations. Copyright (c) 2022 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de diff --git a/src/include/ranges/range_base.cc.h b/src/include/ranges/range_base.cc.h index 779d871..d354056 100644 --- a/src/include/ranges/range_base.cc.h +++ b/src/include/ranges/range_base.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/range_base.cc.h - @brief ... + @brief RangeBase template implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/ranges/range_base.h b/src/include/ranges/range_base.h index 0ca0037..308f07d 100644 --- a/src/include/ranges/range_base.h +++ b/src/include/ranges/range_base.h @@ -2,12 +2,12 @@ /** @file include/ranges/range_base.h - @brief RangeBase declaration + @brief RangeBase declaration. Include basic headers containing defintions and macros used throughout this library - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/ranges/ranges.cc.h b/src/include/ranges/ranges.cc.h index 9f4f18f..5110bca 100644 --- a/src/include/ranges/ranges.cc.h +++ b/src/include/ranges/ranges.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/ranges.cc.h - @brief ... + @brief Ranges template implementation main header - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/include/ranges/srange.cc.h b/src/include/ranges/srange.cc.h index a5e9e55..7c9dfde 100644 --- a/src/include/ranges/srange.cc.h +++ b/src/include/ranges/srange.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/srange.cc.h - @brief ... + @brief SRange, SRangeFactory and SIndex implementation. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ @@ -18,9 +17,9 @@ namespace CNORXZ { - /************** - * SIndex * - **************/ + /*============+ + | SIndex | + +============*/ template SIndex::SIndex(const RangePtr& range, SizeT pos) : @@ -213,9 +212,9 @@ namespace CNORXZ } - /********************* - * SRangeFactory * - *********************/ + /*===================+ + | SRangeFactory | + +===================*/ template SRangeFactory::SRangeFactory(const Arr& space) : @@ -248,9 +247,9 @@ namespace CNORXZ } } - /************** - * SRange * - **************/ + /*============+ + | SRange | + +============*/ template SRange::SRange(const Arr& space) : @@ -338,9 +337,9 @@ namespace CNORXZ return Vector { this->id() }; } - /******************* - * Range Casts * - *******************/ + /*=================+ + | Range Casts | + +=================*/ template Sptr> RangeCast>::func(const RangePtr& r) diff --git a/src/include/ranges/urange.cc.h b/src/include/ranges/urange.cc.h index 603d096..7b868b5 100644 --- a/src/include/ranges/urange.cc.h +++ b/src/include/ranges/urange.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/urange.cc.h - @brief ... + @brief URange, URangeFactory and UIndex implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ @@ -25,9 +24,9 @@ namespace CNORXZ { - /***************** - * UIndex * - *****************/ + /*===============+ + | UIndex | + +===============*/ template UIndex::UIndex(const RangePtr& range, SizeT pos) : @@ -222,9 +221,9 @@ namespace CNORXZ return iptrMul(a, b); } - /********************** - * URangeFactory * - **********************/ + /*====================+ + | URangeFactory | + +====================*/ template URangeFactory::URangeFactory(const Vector& space) : @@ -257,9 +256,9 @@ namespace CNORXZ } } - /*************** - * URange * - ***************/ + /*=============+ + | URange | + +=============*/ template URange::URange(const Vector& space) : @@ -350,9 +349,9 @@ namespace CNORXZ return Vector { this->id() }; } - /******************* - * Range Casts * - *******************/ + /*=================+ + | Range Casts | + +=================*/ template struct URangeCast diff --git a/src/include/ranges/xindex.cc.h b/src/include/ranges/xindex.cc.h index ff5db88..f72e7c2 100644 --- a/src/include/ranges/xindex.cc.h +++ b/src/include/ranges/xindex.cc.h @@ -2,10 +2,9 @@ /** @file include/ranges/xindex.cc.h - @brief ... + @brief XIndexBase and XIndex template implementations. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ @@ -18,9 +17,9 @@ namespace CNORXZ { - /************** - * XIndex * - **************/ + /*============+ + | XIndex | + +============*/ template XIndex::XIndex(const IndexPtr& i) : diff --git a/src/include/xpr/buf_xpr.cc.h b/src/include/xpr/buf_xpr.cc.h index cac20ec..ff2d667 100644 --- a/src/include/xpr/buf_xpr.cc.h +++ b/src/include/xpr/buf_xpr.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/buf_xpr.cc.h + @brief Buffer xpression template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "buf_xpr.h" diff --git a/src/include/xpr/buf_xpr.h b/src/include/xpr/buf_xpr.h index cd0b51f..d960c69 100644 --- a/src/include/xpr/buf_xpr.h +++ b/src/include/xpr/buf_xpr.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/buf_xpr.h + @brief Buffer xpression declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "xpr_base.h" diff --git a/src/include/xpr/for.cc.h b/src/include/xpr/for.cc.h index 493c035..5b95eb5 100644 --- a/src/include/xpr/for.cc.h +++ b/src/include/xpr/for.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/for.cc.h + @brief For expressions template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_for_cc_h__ #define __cxz_for_cc_h__ @@ -9,9 +19,9 @@ namespace CNORXZ { - /*********** - * For * - ***********/ + /*=========+ + | For | + +=========*/ template constexpr For::For(SizeT size, const IndexId& id, const Xpr& xpr, F&& f) : @@ -73,9 +83,9 @@ namespace CNORXZ return mXpr.rootSteps(id); } - /************************ - * For (non-member) * - ************************/ + /*======================+ + | For (non-member) | + +======================*/ template constexpr decltype(auto) mkFor(SizeT size, const IndexId& id, const Xpr& xpr, F&& f) @@ -89,9 +99,9 @@ namespace CNORXZ return For(size, id, xpr, NoF {}); } - /************ - * SFor * - ************/ + /*==========+ + | SFor | + +==========*/ template constexpr SFor::SFor(const IndexId& id, const Xpr& xpr, F&& f) : @@ -193,9 +203,9 @@ namespace CNORXZ return; } - /************************* - * SFor (non-member) * - *************************/ + /*=======================+ + | SFor (non-member) | + +=======================*/ template constexpr decltype(auto) mkSFor(const IndexId& id, const Xpr& xpr, F&& f) @@ -209,9 +219,9 @@ namespace CNORXZ return SFor(id, xpr, NoF {}); } - /************ - * PFor * - ************/ + /*==========+ + | PFor | + +==========*/ template constexpr PFor::PFor(SizeT size, const IndexId& id1, const IndexId& id2, @@ -281,9 +291,9 @@ namespace CNORXZ return mXpr.rootSteps(id); } - /************************* - * PFor (non-member) * - *************************/ + /*=======================+ + | PFor (non-member) | + +=======================*/ template constexpr decltype(auto) mkPFor(SizeT size, const IndexId& id1, const IndexId& id2, @@ -299,9 +309,9 @@ namespace CNORXZ return PFor(size, id1, id2, xpr, NoF {}); } - /************ - * TFor * - ************/ + /*==========+ + | TFor | + +==========*/ template constexpr TFor::TFor(SizeT size, const IndexId& id, const Xpr& xpr, F&& f) : @@ -389,9 +399,9 @@ namespace CNORXZ } - /************ - * EFor * - ************/ + /*==========+ + | EFor | + +==========*/ template constexpr EFor::EFor(const IndexId& id, const Xpr& xpr, F&& f) : diff --git a/src/include/xpr/for.h b/src/include/xpr/for.h index ea56ade..a12e7bb 100644 --- a/src/include/xpr/for.h +++ b/src/include/xpr/for.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/for.h + @brief For expressions declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_for_h__ #define __cxz_for_h__ diff --git a/src/include/xpr/func.cc.h b/src/include/xpr/func.cc.h index e290251..f1b6b89 100644 --- a/src/include/xpr/func.cc.h +++ b/src/include/xpr/func.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/func.cc.h + @brief Special function objects implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_func_cc_h__ #define __cxz_func_cc_h__ diff --git a/src/include/xpr/func.h b/src/include/xpr/func.h index 5160674..206e843 100644 --- a/src/include/xpr/func.h +++ b/src/include/xpr/func.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/func.h + @brief Special function objects declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_func_h__ #define __cxz_func_h__ diff --git a/src/include/xpr/index_id.cc.h b/src/include/xpr/index_id.cc.h index 09eaddb..b730036 100644 --- a/src/include/xpr/index_id.cc.h +++ b/src/include/xpr/index_id.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/index_id.cc.h + @brief Index ID type template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_index_id_cc_h__ #define __cxz_index_id_cc_h__ diff --git a/src/include/xpr/index_id.h b/src/include/xpr/index_id.h index ed61d68..3cc7ae0 100644 --- a/src/include/xpr/index_id.h +++ b/src/include/xpr/index_id.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/index_id.h + @brief Index ID type declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_index_id_h__ #define __cxz_index_id_h__ diff --git a/src/include/xpr/pos_type.cc.h b/src/include/xpr/pos_type.cc.h index 77f6b92..7fead30 100644 --- a/src/include/xpr/pos_type.cc.h +++ b/src/include/xpr/pos_type.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/pos_type.cc.h + @brief Position types template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_pos_type_cc_h__ #define __cxz_pos_type_cc_h__ @@ -8,9 +18,9 @@ namespace CNORXZ { - /************ - * SPos * - ************/ + /*==========+ + | SPos | + +==========*/ template constexpr SizeT SPos::size() const @@ -106,9 +116,9 @@ namespace CNORXZ return val(); } - /************ - * UPos * - ************/ + /*==========+ + | UPos | + +==========*/ constexpr UPos::UPos(SizeT ext) : mExt(ext) {} @@ -173,9 +183,9 @@ namespace CNORXZ return val(); } - /************ - * FPos * - ************/ + /*==========+ + | FPos | + +==========*/ inline FPos::FPos(SizeT ext, const SizeT* map) : mExt(ext), mMap(map) {} @@ -224,9 +234,9 @@ namespace CNORXZ return val(); } - /************* - * SFPos * - *************/ + /*===========+ + | SFPos | + +===========*/ template Arr SFPos::sMs = { Ms... }; @@ -310,9 +320,9 @@ namespace CNORXZ return val(); } - /************ - * MPos * - ************/ + /*==========+ + | MPos | + +==========*/ template constexpr MPos::MPos() @@ -401,9 +411,9 @@ namespace CNORXZ return extend(a); } - /************ - * DPos * - ************/ + /*==========+ + | DPos | + +==========*/ inline DPos::DPos(Uptr&& a) : ObjHandle(std::forward>(a)) @@ -506,9 +516,9 @@ namespace CNORXZ return val(); } - /*************** - * DPosRef * - ***************/ + /*=============+ + | DPosRef | + +=============*/ inline DPosRef::DPosRef(const VPosBase* p) : mP(p) {} @@ -587,9 +597,9 @@ namespace CNORXZ return val(); } - /************ - * EPos * - ************/ + /*==========+ + | EPos | + +==========*/ template constexpr EPos::EPos(const BPosT& b, const OPosTs&... os) : @@ -679,9 +689,9 @@ namespace CNORXZ return OEPosT(BPosT::next(), std::get(mP).next()...); } - /********************************* - * Traits and Helper-Classes * - *********************************/ + /*===============================+ + | Traits and Helper-Classes | + +===============================*/ template decltype(auto) MkEPos::mk(const BPosT& a, const OPosT& b) diff --git a/src/include/xpr/pos_type.h b/src/include/xpr/pos_type.h index 5515407..09f300e 100644 --- a/src/include/xpr/pos_type.h +++ b/src/include/xpr/pos_type.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/pos_type.h + @brief Position types declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_pos_type_h__ #define __cxz_pos_type_h__ @@ -296,9 +306,9 @@ namespace CNORXZ constexpr decltype(auto) get() const; }; - /********************************* - * Traits and Helper-Classes * - *********************************/ + /*===============================+ + | Traits and Helper-Classes | + +===============================*/ template struct is_pos_type { CXZ_CVAL_FALSE; }; @@ -370,9 +380,9 @@ namespace CNORXZ template decltype(auto) mkiEPos(const BPosT& a, const OPosT& b, std::index_sequence is); - /************************************************** - * Traits and Helper-Classes: Specializations * - **************************************************/ + /*================================================+ + | Traits and Helper-Classes: Specializations | + +================================================*/ template struct is_pos_type> { CXZ_CVAL_TRUE; }; template struct is_scalar_pos_type> { CXZ_CVAL_TRUE; }; diff --git a/src/include/xpr/vpos_type.cc.h b/src/include/xpr/vpos_type.cc.h index 19ebb9a..bb80df1 100644 --- a/src/include/xpr/vpos_type.cc.h +++ b/src/include/xpr/vpos_type.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/vpos_type.cc.h + @brief Dynamic position types template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_vpos_type_cc_h__ #define __cxz_vpos_type_cc_h__ @@ -7,9 +17,9 @@ namespace CNORXZ { - /************ - * VPos * - ************/ + /*==========+ + | VPos | + +==========*/ template VPos::VPos(const PosT& a) : @@ -67,9 +77,9 @@ namespace CNORXZ return std::make_unique>( (*this)(UPos(a->vval())) ); } - /****************** - * VPos * - ******************/ + /*================+ + | VPos | + +================*/ template VPos>::VPos(const VPos& a) : @@ -158,9 +168,9 @@ namespace CNORXZ return std::make_unique>( (*this)(UPos(a->vval())) ); } - /*************** - * VPosRef * - ***************/ + /*=============+ + | VPosRef | + +=============*/ template VPosRef::VPosRef(const PosT* c) : @@ -218,9 +228,9 @@ namespace CNORXZ return std::make_unique>( (*mC)(UPos(a->vval())) ); } - /********************* - * VPosRef * - *********************/ + /*===================+ + | VPosRef | + +===================*/ template VPosRef>::VPosRef(const MPos* c) : @@ -288,9 +298,9 @@ namespace CNORXZ return std::make_unique>( (*mC)(UPos(a->vval())) ); } - /******************* - * PosFromVPos * - *******************/ + /*=================+ + | PosFromVPos | + +=================*/ template inline decltype(auto) PosFromVPos::make(const VPosBase* a) diff --git a/src/include/xpr/vpos_type.h b/src/include/xpr/vpos_type.h index 064cb85..985c018 100644 --- a/src/include/xpr/vpos_type.h +++ b/src/include/xpr/vpos_type.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/vpos_type.h + @brief Dynamic position types declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_vpos_type_h__ #define __cxz_vpos_type_h__ diff --git a/src/include/xpr/xpr.cc.h b/src/include/xpr/xpr.cc.h index dd8a5d6..87f3dc4 100644 --- a/src/include/xpr/xpr.cc.h +++ b/src/include/xpr/xpr.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/xpr.cc.h + @brief Xpression template implementations main header. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "vpos_type.cc.h" #include "pos_type.cc.h" diff --git a/src/include/xpr/xpr.h b/src/include/xpr/xpr.h index 063a8bd..c98a825 100644 --- a/src/include/xpr/xpr.h +++ b/src/include/xpr/xpr.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/xpr.h + @brief Xpression main header. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "vpos_type.h" #include "pos_type.h" diff --git a/src/include/xpr/xpr_base.cc.h b/src/include/xpr/xpr_base.cc.h index dcc24c5..f51afa2 100644 --- a/src/include/xpr/xpr_base.cc.h +++ b/src/include/xpr/xpr_base.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/xpr_base.cc.h + @brief Xpression base template implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_xpr_base_cc_h__ #define __cxz_xpr_base_cc_h__ @@ -7,9 +17,9 @@ namespace CNORXZ { - /************ - * VXpr * - ************/ + /*==========+ + | VXpr | + +==========*/ template VXpr::VXpr(const XprInterface& a) : @@ -40,9 +50,9 @@ namespace CNORXZ return DPos(this->rootSteps(id)); } - /************ - * DXpr * - ************/ + /*==========+ + | DXpr | + +==========*/ template template diff --git a/src/include/xpr/xpr_base.h b/src/include/xpr/xpr_base.h index 05e7f8b..a25cdee 100644 --- a/src/include/xpr/xpr_base.h +++ b/src/include/xpr/xpr_base.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file include/xpr/xpr_base.h + @brief Xpression base declarations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __cxz_xpr_base_h__ #define __cxz_xpr_base_h__ diff --git a/src/lib/base/config.cc b/src/lib/base/config.cc index f13756a..a502939 100644 --- a/src/lib/base/config.cc +++ b/src/lib/base/config.cc @@ -1,3 +1,15 @@ +// -*- C++ -*- +/** + + @file lib/base/config.cc + @brief Runtime config functions implementations. + + Declare functions returning version and configuration infos. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "base/config.h" diff --git a/src/lib/base/to_string.cc b/src/lib/base/to_string.cc index 8289ffc..53fe25e 100644 --- a/src/lib/base/to_string.cc +++ b/src/lib/base/to_string.cc @@ -1,3 +1,15 @@ +// -*- C++ -*- +/** + + @file lib/base/to_string.cc + @brief String converter implementations. + + Declaration of functions that convert a given object/type to a string. + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "base/base.h" diff --git a/src/lib/base/uuid.cc b/src/lib/base/uuid.cc index 7ecbced..c2b4e2c 100644 --- a/src/lib/base/uuid.cc +++ b/src/lib/base/uuid.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file lib/base/uuid.cc + @brief cnorxz uuid implementation. + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include #include diff --git a/src/lib/memory/memcount.cc b/src/lib/memory/memcount.cc index 7ca0ebb..2332efe 100644 --- a/src/lib/memory/memcount.cc +++ b/src/lib/memory/memcount.cc @@ -2,10 +2,9 @@ /** @file lib/memory/memcount.cc - @brief ... + @brief Implementation of MemCount member functions. - - Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Copyright (c) 2024 Christian Zimmermann. All rights reserved. Mail: chizeta@f3l.de **/ diff --git a/src/lib/ranges/crange.cc b/src/lib/ranges/crange.cc index cf6ec9e..9b797d3 100644 --- a/src/lib/ranges/crange.cc +++ b/src/lib/ranges/crange.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file lib/ranges/crange.cc + @brief CRange and CIndex member function implementation. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "ranges/ranges.h" #include "ranges/prange.h" diff --git a/src/lib/ranges/dindex.cc b/src/lib/ranges/dindex.cc index c1dc73a..1e85da4 100644 --- a/src/lib/ranges/dindex.cc +++ b/src/lib/ranges/dindex.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file lib/ranges/dindex.cc + @brief DIndex implementation. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "ranges/ranges.h" diff --git a/src/lib/ranges/index_format.cc b/src/lib/ranges/index_format.cc index 36580da..746ed8c 100644 --- a/src/lib/ranges/index_format.cc +++ b/src/lib/ranges/index_format.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file lib/ranges/index_format.cc + @brief Index formats implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "ranges/index_format.h" diff --git a/src/lib/ranges/index_pack.cc b/src/lib/ranges/index_pack.cc index 5ed6bc2..5e66ee1 100644 --- a/src/lib/ranges/index_pack.cc +++ b/src/lib/ranges/index_pack.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file lib/ranges/index_pack.cc + @brief Index pack implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "ranges/ranges.h" diff --git a/src/lib/ranges/range_base.cc b/src/lib/ranges/range_base.cc index a90369b..eb20116 100644 --- a/src/lib/ranges/range_base.cc +++ b/src/lib/ranges/range_base.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file lib/ranges/range_base.cc + @brief RangeBase implementation. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "ranges/ranges.h" #include "array/array.h" @@ -5,9 +15,9 @@ namespace CNORXZ { - /************************* - * RangeFactoryBase * - *************************/ + /*=======================+ + | RangeFactoryBase | + +=======================*/ Map,RangePtr>> RangeFactoryBase::sCreated; @@ -46,9 +56,9 @@ namespace CNORXZ return rx; } - /****************** - * RangeBase * - ******************/ + /*================+ + | RangeBase | + +================*/ RangeBase::RangeBase() { @@ -91,9 +101,9 @@ namespace CNORXZ return this->index(this->size()); } - /**************************** - * Non-member functions * - ****************************/ + /*==========================+ + | Non-member functions | + +==========================*/ RangePack::operator RangePtr() const { diff --git a/src/lib/ranges/yrange.cc b/src/lib/ranges/yrange.cc index b456995..4a4ac16 100644 --- a/src/lib/ranges/yrange.cc +++ b/src/lib/ranges/yrange.cc @@ -1,12 +1,22 @@ +// -*- C++ -*- +/** + + @file lib/ranges/yrange.cc + @brief YRange and YIndex implementations. + + Copyright (c) 2022 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "ranges/ranges.h" #include "array/array.h" namespace CNORXZ { - /************************* - * YIndex (private) * - *************************/ + /*=======================+ + | YIndex (private) | + +=======================*/ inline DPack YIndex::mkIndices() const { @@ -120,9 +130,9 @@ namespace CNORXZ } - /*************** - * YIndex * - ***************/ + /*=============+ + | YIndex | + +=============*/ YIndex::YIndex(const YIndex& i) : IndexInterface>(i), @@ -507,9 +517,9 @@ namespace CNORXZ } - /**************************** - * non-member functions * - ****************************/ + /*==========================+ + | non-member functions | + +==========================*/ YIndex yindex(const DPack& pack) { @@ -531,9 +541,9 @@ namespace CNORXZ return std::make_shared(is); } - /********************** - * YRangeFactory * - **********************/ + /*====================+ + | YRangeFactory | + +====================*/ YRangeFactory::YRangeFactory(const Vector& rvec) : mRVec(rvec) {} @@ -560,9 +570,9 @@ namespace CNORXZ } } - /*************** - * YRange * - ***************/ + /*=============+ + | YRange | + +=============*/ RangePtr YRange::sub(SizeT i) const { @@ -649,18 +659,18 @@ namespace CNORXZ YRange::YRange(Vector&& rvec) : mRVec(std::forward>(rvec)) {} - /**************************** - * non-member functions * - ****************************/ + /*==========================+ + | non-member functions | + +==========================*/ RangePtr yrange(const Vector& rs) { return YRangeFactory(rs).create(); } - /******************* - * Range Casts * - *******************/ + /*=================+ + | Range Casts | + +=================*/ Sptr RangeCast::func(const RangePtr& r) { diff --git a/src/opt/cereal/include/cer_array.cc.h b/src/opt/cereal/include/cer_array.cc.h index 35f5c6d..076c658 100644 --- a/src/opt/cereal/include/cer_array.cc.h +++ b/src/opt/cereal/include/cer_array.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/cer_array.cc.h + @brief Load and save implementation for MArray. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_cereal_array_cc_h__ #define __cxz_cereal_array_cc_h__ @@ -23,7 +33,6 @@ namespace CNORXZ { CXZ_ASSERT(version == 1u, "format version = " << version << " not supported"); cer::save_load(ar, "range", AB::mRange); - //ar(cereal::make_nvp("range", AB::mRange)); ar(cereal::make_nvp("data", mCont)); } } diff --git a/src/opt/cereal/include/cer_base.h b/src/opt/cereal/include/cer_base.h index 97710f9..127de76 100644 --- a/src/opt/cereal/include/cer_base.h +++ b/src/opt/cereal/include/cer_base.h @@ -1,19 +1,35 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/cer_base.h + @brief CNORXZ Cereal basic types declaration. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_cer_base_h__ #define __cxz_cer_base_h__ -#define CXZ_CEREAL_FORMAT_VERION 1u +#define CXZ_CEREAL_FORMAT_VERION 1u /**< CNORXZ specific cereal format version. */ namespace CNORXZ { namespace cer { + /** **** + Archive format enum class. + */ enum class Format { BINARY = 1u, JSON = 2u, XML = 3u }; + /** **** + Content type enum class. + */ enum class ContentType { ARRAY = 1u, MAP = 2u diff --git a/src/opt/cereal/include/cer_header.cc.h b/src/opt/cereal/include/cer_header.cc.h index 64dcd2a..408cfd9 100644 --- a/src/opt/cereal/include/cer_header.cc.h +++ b/src/opt/cereal/include/cer_header.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/cer_header.cc.h + @brief Load and save implementation for CNORXZ cereal data header. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_cereal_header_cc_h__ #define __cxz_cereal_header_cc_h__ diff --git a/src/opt/cereal/include/cer_header.h b/src/opt/cereal/include/cer_header.h index be677a1..946c2a8 100644 --- a/src/opt/cereal/include/cer_header.h +++ b/src/opt/cereal/include/cer_header.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/cer_header.h + @brief CNORXZ Cereal data header declaration. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_cereal_header_h__ #define __cxz_cereal_header_h__ @@ -9,13 +19,19 @@ namespace CNORXZ { namespace cer { + /** **** + Cereal data header struct. + */ struct Header { - String version; - String commit; - ContentType content; + String version; /**< CNORXZ version. */ + String commit; /**< CNORXZ git commit. */ + ContentType content; /**< Content type. */ }; + /** Create header. + @param content Content type. + */ inline Header mkHeader(const ContentType content) { Header o; @@ -24,10 +40,20 @@ namespace CNORXZ o.content = content; return o; } - + + /** Serialze header, store in archive. + @param ar Target archive. + @param h Input header. + @param version Version. + */ template void save(Archive& ar, const Header& h, const std::uint32_t version); + /** Deserialze header from archive. + @param ar Source archive. + @param h Target header reference. + @param version Version. + */ template void load(Archive& ar, Header& h, const std::uint32_t version); diff --git a/src/opt/cereal/include/cer_ranges.cc.h b/src/opt/cereal/include/cer_ranges.cc.h index ea2748e..4f23494 100644 --- a/src/opt/cereal/include/cer_ranges.cc.h +++ b/src/opt/cereal/include/cer_ranges.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/cer_ranges.cc.h + @brief Load and save implementation for cnorxz ranges. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_cereal_ranges_cc_h__ #define __cxz_cereal_ranges_cc_h__ @@ -12,9 +22,9 @@ namespace CNORXZ { - /************** - * save * - **************/ + /*============+ + | save | + +============*/ template void save(Archive& ar, const Uuid& id) @@ -51,9 +61,9 @@ namespace CNORXZ ar(cereal::make_nvp("sub", mRVec)); } - /************** - * load * - **************/ + /*============+ + | load | + +============*/ template void load(Archive& ar, Uuid& id) diff --git a/src/opt/cereal/include/cer_type_register.cc.h b/src/opt/cereal/include/cer_type_register.cc.h index 7e4ae5c..4c3ba4f 100644 --- a/src/opt/cereal/include/cer_type_register.cc.h +++ b/src/opt/cereal/include/cer_type_register.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/cer_type_register.cc.h + @brief Register CNORXZ cereal types. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_cereal_type_register_cc_h__ #define __cxz_cereal_type_register_cc_h__ diff --git a/src/opt/cereal/include/cnorxz_cereal.h b/src/opt/cereal/include/cnorxz_cereal.h index 5d58780..d7410c2 100644 --- a/src/opt/cereal/include/cnorxz_cereal.h +++ b/src/opt/cereal/include/cnorxz_cereal.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/cnorxz_cereal.h + @brief CNORXZ Cereal main header + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #include "cer_base.h" #include "cer_header.h" diff --git a/src/opt/cereal/include/range_save_load.cc.h b/src/opt/cereal/include/range_save_load.cc.h index db6917c..e568257 100644 --- a/src/opt/cereal/include/range_save_load.cc.h +++ b/src/opt/cereal/include/range_save_load.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/range_save_load.cc.h + @brief CNORXZ Cereal range save load implementation. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __range_save_load_cc_h__ #define __range_save_load_cc_h__ diff --git a/src/opt/cereal/include/range_save_load.h b/src/opt/cereal/include/range_save_load.h index a60f0f6..5ef60bc 100644 --- a/src/opt/cereal/include/range_save_load.h +++ b/src/opt/cereal/include/range_save_load.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/range_save_load.h + @brief CNORXZ Cereal range save load declaration. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __range_save_load_h__ #define __range_save_load_h__ @@ -8,8 +18,14 @@ namespace CNORXZ { namespace cer { - // use this function to register the range in the map of the range factories - // (otherwise there might be more than one instance of the same range) + /** Deserialize and register range from cereal archive. + Always use this function to load ranges from archives so that it is + registered in the map of the range factories. Otherwise there might be more + than one instance of the same range. + @param ar Archive to read from. + @param name Archive key. + @param r Target range pointer. + */ template RangePtr save_load(Archive& ar, const String& name, RangePtr& r); } diff --git a/src/opt/cereal/include/utilities.cc.h b/src/opt/cereal/include/utilities.cc.h index 790d3ae..678231d 100644 --- a/src/opt/cereal/include/utilities.cc.h +++ b/src/opt/cereal/include/utilities.cc.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/utilities.cc.h + @brief CNORXZ Cereal utilities implementation. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_cereal_utilities_cc_h__ #define __cxz_cereal_utilities_cc_h__ diff --git a/src/opt/cereal/include/utilities.h b/src/opt/cereal/include/utilities.h index e8e8750..6a7a0bf 100644 --- a/src/opt/cereal/include/utilities.h +++ b/src/opt/cereal/include/utilities.h @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/include/utilities.h + @brief CNORXZ Cereal utilities declaration. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #ifndef __cxz_cereal_utilities_h__ #define __cxz_cereal_utilities_h__ @@ -14,68 +24,141 @@ namespace CNORXZ { namespace cer { - + /** **** + Output archive type trait. + @tparam F Format enum. + */ template struct OutputFormatMap {}; + /** Output archive for binary format. */ template <> struct OutputFormatMap - { typedef cereal::BinaryOutputArchive type; }; + { typedef cereal::BinaryOutputArchive type; /**< archive type. */ }; + /** Output archive for json format. */ template <> struct OutputFormatMap - { typedef cereal::JSONOutputArchive type; }; + { typedef cereal::JSONOutputArchive type; /**< archive type. */ }; + /** Output archive for xml format. */ template <> struct OutputFormatMap - { typedef cereal::XMLOutputArchive type; }; + { typedef cereal::XMLOutputArchive type; /**< archive type. */ }; + /** **** + Input archive type trait. + @tparam F Format enum. + */ template struct InputFormatMap {}; + /** Input archive for binary format. */ template <> struct InputFormatMap - { typedef cereal::BinaryInputArchive type; }; + { typedef cereal::BinaryInputArchive type; /**< archive type. */ }; + /** Input archive for json format. */ template <> struct InputFormatMap - { typedef cereal::JSONInputArchive type; }; + { typedef cereal::JSONInputArchive type; /**< archive type. */ }; + /** Input archive for xml format. */ template <> struct InputFormatMap - { typedef cereal::XMLInputArchive type; }; + { typedef cereal::XMLInputArchive type; /**< archive type. */ }; + /** Serialize MArray to stream + @tparam F Format enum class [BINARY,JSON,XML]. + @tparam T Array element value type. + @param os Output stream. + @param data Array to be serialized. + */ template void write(std::ostream& os, const MArray& data); + /** Deserialize MArray from stream + @tparam F Format enum class [BINARY,JSON,XML]. + @tparam T Array element value type. + @param is Input stream. + @param data Target array. + */ template void read(std::istream& is, MArray& data); + /** Serialize MArray and write to file. + @tparam F Format enum class [BINARY,JSON,XML]. + @tparam T Array element value type. + @param name File name. + @param data Array to be saved. + */ template void writeFile(const String& name, const MArray& data); + /** Read and deserialize MArray from cereal compatibel file. + @tparam F Format enum class [BINARY,JSON,XML]. + @tparam T Array element value type. + @param name File name. + @param data target array. + */ template void readFile(const String& name, MArray& data); + /** Serialize MArray and write to binary file. + @tparam T Array element value type. + @param name File name. + @param data Array to be saved. + */ template - void writeBINARYFile(const String& name, const MArray& data) { writeFile(name, data); } + inline void writeBINARYFile(const String& name, const MArray& data) + { writeFile(name, data); } + /** Read and deserialize MArray from cereal compatibel binary file. + @tparam T Array element value type. + @param name File name. + @param data target array. + */ template - void readBINARYFile(const String& name, MArray& data) { readFile(name, data); } + inline void readBINARYFile(const String& name, MArray& data) + { readFile(name, data); } + /** Serialize MArray and write to json file. + @tparam T Array element value type. + @param name File name. + @param data Array to be saved. + */ template - void writeJSONFile(const String& name, const MArray& data) { writeFile(name, data); } + inline void writeJSONFile(const String& name, const MArray& data) + { writeFile(name, data); } + /** Read and deserialize MArray from cereal compatibel json file. + @tparam T Array element value type. + @param name File name. + @param data target array. + */ template - void readJSONFile(const String& name, MArray& data) { readFile(name, data); } + inline void readJSONFile(const String& name, MArray& data) + { readFile(name, data); } + /** Serialize MArray and write to xml file. + @tparam T Array element value type. + @param name File name. + @param data Array to be saved. + */ template - void writeXMLFile(const String& name, const MArray& data) { writeFile(name, data); } + inline void writeXMLFile(const String& name, const MArray& data) + { writeFile(name, data); } + /** Read and deserialize MArray from cereal compatibel xml file. + @tparam T Array element value type. + @param name File name. + @param data target array. + */ template - void readXMLFile(const String& name, MArray& data) { readFile(name, data); } + inline void readXMLFile(const String& name, MArray& data) + { readFile(name, data); } } } diff --git a/src/opt/cereal/tests/cereal_unit_test.cc b/src/opt/cereal/tests/cereal_unit_test.cc index 1fc1039..ac0a551 100644 --- a/src/opt/cereal/tests/cereal_unit_test.cc +++ b/src/opt/cereal/tests/cereal_unit_test.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/cereal/tests/cereal_unit_test.cc + @brief cnorxz cereal unit tests. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include #include diff --git a/src/opt/hdf5/include/h5_dataset.cc.h b/src/opt/hdf5/include/h5_dataset.cc.h index 9c4aaeb..5ce17ea 100644 --- a/src/opt/hdf5/include/h5_dataset.cc.h +++ b/src/opt/hdf5/include/h5_dataset.cc.h @@ -34,7 +34,7 @@ namespace CNORXZ H5Sclose(memspace); } else { - CXZ_ERROR("IMPLEMENT!!!"); + CXZ_ERROR("Got array type with non-trivial format; non-contiguous data formats are not supported yet!"); } return *this; } diff --git a/src/opt/hdf5/include/h5_type_id.cc.h b/src/opt/hdf5/include/h5_type_id.cc.h index b7624bd..e890eb2 100644 --- a/src/opt/hdf5/include/h5_type_id.cc.h +++ b/src/opt/hdf5/include/h5_type_id.cc.h @@ -1,7 +1,7 @@ // -*- C++ -*- /** - @file opt/hdf5/include/h5_type_id.h + @file opt/hdf5/include/h5_type_id.cc.h @brief TypeId template implementation. Copyright (c) 2024 Christian Zimmermann. All rights reserved. diff --git a/src/opt/hdf5/include/h5_types.h b/src/opt/hdf5/include/h5_types.h index 46beb8d..2437e9f 100644 --- a/src/opt/hdf5/include/h5_types.h +++ b/src/opt/hdf5/include/h5_types.h @@ -1,7 +1,7 @@ // -*- C++ -*- /** - @file opt/hdf5/include/types.h + @file opt/hdf5/include/h5_types.h @brief Declaration of hdf5 related library types This file contains the declaration of all hdf5 related library types diff --git a/src/opt/hdf5/lib/h5_dataset.cc b/src/opt/hdf5/lib/h5_dataset.cc index 1fbfe72..a3ef41d 100644 --- a/src/opt/hdf5/lib/h5_dataset.cc +++ b/src/opt/hdf5/lib/h5_dataset.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/hdf5/lib/h5_dataset.cc + @brief Dataset implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #include "h5_dataset.h" diff --git a/src/opt/hdf5/lib/h5_file.cc b/src/opt/hdf5/lib/h5_file.cc index fe42fa5..0730786 100644 --- a/src/opt/hdf5/lib/h5_file.cc +++ b/src/opt/hdf5/lib/h5_file.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/hdf5/lib/h5_file.cc + @brief Group implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #include "h5_file.h" #include diff --git a/src/opt/hdf5/lib/h5_group.cc b/src/opt/hdf5/lib/h5_group.cc index 7728b95..37f8bc3 100644 --- a/src/opt/hdf5/lib/h5_group.cc +++ b/src/opt/hdf5/lib/h5_group.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/hdf5/lib/h5_group.cc + @brief Group implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #include "h5_group.h" #include "h5_table.h" @@ -133,11 +143,13 @@ namespace CNORXZ return *this; } + /** @cond 0 */ struct InitContData { const ContentBase* parent; BIndex index; }; + /** @endcond */ static herr_t addName(hid_t id, const char* name, const H5L_info_t* info, void* x) { diff --git a/src/opt/hdf5/lib/h5_table.cc b/src/opt/hdf5/lib/h5_table.cc index 268e8b3..1ac7fa5 100644 --- a/src/opt/hdf5/lib/h5_table.cc +++ b/src/opt/hdf5/lib/h5_table.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/hdf5/lib/h5_table.cc + @brief Table implementations. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + + **/ #include #include "h5_table.h" diff --git a/src/opt/hdf5/tests/h5_basic_unit_test.cc b/src/opt/hdf5/tests/h5_basic_unit_test.cc index 41399b7..e589556 100644 --- a/src/opt/hdf5/tests/h5_basic_unit_test.cc +++ b/src/opt/hdf5/tests/h5_basic_unit_test.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file opt/hdf5/tests/h5_basic_unit_test.cc + @brief cnorxz hdf5 basic unit tests. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include #include diff --git a/src/tests/index_format_test.cc b/src/tests/index_format_test.cc index e747d5f..4e33128 100644 --- a/src/tests/index_format_test.cc +++ b/src/tests/index_format_test.cc @@ -1,10 +1,19 @@ +// -*- C++ -*- +/** + + @file tests/index_format_test.cc + @brief Index format unit tests. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include #include #include "gtest/gtest.h" -//#include "cnorxz.h" #include "ranges/ranges.h" #include "array/array.h" diff --git a/src/tests/marray_unit_test.cc b/src/tests/marray_unit_test.cc index a565438..7550f25 100644 --- a/src/tests/marray_unit_test.cc +++ b/src/tests/marray_unit_test.cc @@ -1,4 +1,13 @@ // -*- C++ -*- +/** + + @file tests/marray_unit_test.cc + @brief MArray unit tests. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include #include diff --git a/src/tests/op_perf_test.cc b/src/tests/op_perf_test.cc deleted file mode 100644 index 6c8bf50..0000000 --- a/src/tests/op_perf_test.cc +++ /dev/null @@ -1,304 +0,0 @@ -// -*- C++ -*- - -#include -#include -#include - -#include "cnorxz.h" -#include "conversions.h" - -#include -#include -#include - -#define ONLY_SPIN - -namespace MAT = CNORXZ; - -namespace { - - double xround(double arg) - { - return roundf(arg * 100000.) / 100000.; - } - - using namespace MAT; - - template - void swapFactory(std::shared_ptr& fptr) - { - auto nptr = std::make_shared(); - fptr = nptr; - } - - template - void swapFactory(std::shared_ptr& fptr, std::initializer_list ilist) - { - vector tmp = ilist; - auto nptr = std::make_shared( tmp ); - fptr = nptr; - } - - template - void swapFactory(std::shared_ptr& fptr, vector& ilist) - { - vector tmp = ilist; - auto nptr = std::make_shared( tmp ); - fptr = nptr; - } - - - template - void swapMFactory(std::shared_ptr& fptr, const Rs&... rs) - { - auto nptr = std::make_shared( rs... ); - fptr = nptr; - } - - template - auto mkt(Ts&&... ts) -> decltype(std::make_tuple(ts...)) - { - return std::make_tuple(ts...); - } - - template - auto mkts(Ts&&... ts) -> decltype(std::make_tuple(ts...)) - { - return std::make_tuple(static_cast( ts )...); - } -#ifndef ONLY_SPIN - class OpTest_Performance - { - public: - - typedef SingleRangeFactory SRF; - typedef SRF::oType SRange; - - typedef MultiRangeFactory MRF; - typedef MRF::oType MRange; - - OpTest_Performance() - { - - vector initvec1(vs1); - cv1.resize(vs1); - for(size_t i = 0; i != vs1; ++i){ - initvec1[i] = i; - cv1[i] = sqrt( static_cast(i)*0.53 ); - } - - vector initvec2(vs2); - cv2.resize(vs2*vs1); - for(size_t i = 0; i != vs2; ++i){ - initvec2[i] = i; - for(size_t j = 0; j != vs1; ++j){ - cv2[i*vs1 + j] = static_cast(i) * sin(static_cast(j)*0.4); - } - } - - swapFactory(rfbptr, initvec1); - sr1ptr = std::dynamic_pointer_cast(rfbptr->create()); - - swapFactory(rfbptr, initvec2); - sr2ptr = std::dynamic_pointer_cast(rfbptr->create()); - - swapMFactory(rfbptr, sr2ptr, sr1ptr); - mrptr = std::dynamic_pointer_cast(rfbptr->create()); - } - - void PCheck(); - - - private: - //const size_t vs1 = 10000; - //const size_t vs2 = 1000; - const size_t vs1 = 4000; - const size_t vs2 = 2500; - - std::shared_ptr rfbptr; - std::shared_ptr sr1ptr; - std::shared_ptr sr2ptr; - std::shared_ptr mrptr; - - vector cv1; - vector cv2; - }; -#endif - class OpTest_Spin - { - public: - - typedef ClassicRF CRF; - typedef ClassicRange CR; - - typedef SpinRF SRF; - typedef SpinRange SR; - typedef MultiRangeFactory SR8F; - typedef SR8F::oType SR8; - - static const size_t os = 3000; - static const size_t is = 65536; - static const size_t s = is*os; - - OpTest_Spin() - { - data.resize(is); - for(size_t i = 0; i != is; ++i){ - double arg = static_cast( i - s ) - 0.1; - data[i] = sin(arg); - //VCHECK(data[i]); - } - SRF f; - sr = std::dynamic_pointer_cast(f.create()); - CRF cf(os); - cr = std::dynamic_pointer_cast(cf.create()); - } - - void contract(); - - private: - - vector data; - std::shared_ptr sr; - std::shared_ptr cr; - }; - - void OpTest_Spin::contract() - { - Array ma( sr, sr, sr, sr, sr, sr, sr, sr, data); - Array res1( cr, sr, sr ); - - auto ii = MAT::getIndex(cr); - auto jj = MAT::getIndex(cr); - auto alpha = MAT::getIndex(); - auto beta = MAT::getIndex(); - auto gamma = MAT::getIndex(); - auto delta = MAT::getIndex(); - auto deltap = MAT::getIndex(); - //auto deltap = MAT::getIndex>(); - - auto mix = MAT::mkMIndex( jj, alpha, beta, gamma ); - - - vector vres(4*4*os); - for(size_t d = 0; d != 4; ++d){ - for(size_t p = 0; p != 4; ++p){ - const size_t tidx = d*4 + p; - vres[tidx] = 0.; - } - } - auto begin2 = std::chrono::system_clock::now(); - double* vrptr = vres.data(); - double* dptr = data.data(); - for(size_t i = 0; i != os; ++i){ - for(size_t d = 0; d != 4; ++d){ - for(size_t j = 0; j != os; ++j) { - for(size_t a = 0; a != 4; ++a){ - for(size_t b = 0; b != 4; ++b){ - for(size_t c = 0; c != 4; ++c){ - const size_t tidx = i*4*4 + d*4; - const size_t sidx = /*i*65536 +*/ d*4*4*4*4*4*4*4 + a*5*4*4*4*4*4 + b*5*4*4*4 + c*5*4; - double* xvrptr = vrptr + tidx; - double* xdptr = dptr + sidx; -#pragma omp simd aligned(xvrptr, xdptr: 32) - for(int p = 0; p < 4; p++){ - xvrptr[p] += xdptr[p]; - } - } - } - } - } - } - } - auto end2 = std::chrono::system_clock::now(); - std::cout << "vector - for loop time: " << std::chrono::duration(end2-begin2).count() - << std::endl; - - - auto begin = std::chrono::system_clock::now(); - //for(size_t i = 0; i != os; ++i){ - res1(ii ,delta, deltap).par() += ma(delta, alpha, alpha, beta, beta, gamma, gamma, deltap).c(mix); - //tcast(res1)(ii ,delta, deltap).par() += tcast(ma)(delta, alpha, alpha, beta, beta, gamma, gamma, deltap).c(mix); - //} - auto end = std::chrono::system_clock::now(); - std::cout << "Array time: " << std::chrono::duration(end-begin).count() - << std::endl; - - assert( xround(res1.at(mkts(0,0,0))) == xround(vres[0]) ); - assert( xround(res1.at(mkts(0,0,1))) == xround(vres[1]) ); - assert( xround(res1.at(mkts(0,0,2))) == xround(vres[2]) ); - assert( xround(res1.at(mkts(0,0,3))) == xround(vres[3]) ); - - assert( xround(res1.at(mkts(0,1,0))) == xround(vres[4]) ); - assert( xround(res1.at(mkts(0,1,1))) == xround(vres[5]) ); - assert( xround(res1.at(mkts(0,1,2))) == xround(vres[6]) ); - assert( xround(res1.at(mkts(0,1,3))) == xround(vres[7]) ); - - assert( xround(res1.at(mkts(0,2,0))) == xround(vres[8]) ); - assert( xround(res1.at(mkts(0,2,1))) == xround(vres[9]) ); - assert( xround(res1.at(mkts(0,2,2))) == xround(vres[10]) ); - assert( xround(res1.at(mkts(0,2,3))) == xround(vres[11]) ); - - assert( xround(res1.at(mkts(0,3,0))) == xround(vres[12]) ); - assert( xround(res1.at(mkts(0,3,1))) == xround(vres[13]) ); - assert( xround(res1.at(mkts(0,3,2))) == xround(vres[14]) ); - assert( xround(res1.at(mkts(0,3,3))) == xround(vres[15]) ); - - std::cout << "ratio: " - << std::chrono::duration(end-begin).count() / std::chrono::duration(end2-begin2).count() - << std::endl; - } -#ifndef ONLY_SPIN - void OpTest_Performance::PCheck() - { - Array ma2(mrptr, cv2); - Array ma1(sr1ptr, cv1); - Array res(mrptr); - - auto si1 = MAT::getIndex(sr1ptr); - auto si2 = MAT::getIndex(sr2ptr); - auto mi = MAT::getIndex(mrptr); - (*mi)(si2, si1); - - std::clock_t begin = std::clock(); - - res(mi) = ma2(mi) * ma1(si1); - - std::clock_t end = std::clock(); - std::cout << "Array time: " << static_cast( end - begin ) / CLOCKS_PER_SEC - << std::endl; - - vector res2(vs1*vs2); - std::clock_t begin2 = std::clock(); - - for(size_t i = 0; i != vs2; ++i){ - for(size_t j = 0; j != vs1; ++j){ - res2[i*vs1 + j] = cv1[j] * cv2[i*vs1 + j]; - } - } - - std::clock_t end2 = std::clock(); - std::cout << "vector - for loop time: " << static_cast( end2 - begin2 ) / CLOCKS_PER_SEC - << std::endl; - - std::cout << "ratio: " << static_cast( end - begin ) / static_cast( end2 - begin2 ) << std::endl; - - assert( xround( res.at(mkt(7,9)) ) == xround(res2[7*vs1 + 9]) ); - //assert( xround( res.at(mkt(700,900)) ) == xround(res2[700*vs1 + 900]) ); - - } -#endif -} // anonymous namspace - -int main(int argc, char** argv) -{ -#ifndef ONLY_SPIN - OpTest_Performance pt; - pt.PCheck(); -#endif - OpTest_Spin st; - st.contract(); - - - return 0; -} diff --git a/src/tests/operation_unit_test.cc b/src/tests/operation_unit_test.cc index 8a4e532..5812f02 100644 --- a/src/tests/operation_unit_test.cc +++ b/src/tests/operation_unit_test.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file tests/operation_unit_test.cc + @brief Operation unit tests. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include #include diff --git a/src/tests/range_unit_test.cc b/src/tests/range_unit_test.cc index 4ac711e..4a56139 100644 --- a/src/tests/range_unit_test.cc +++ b/src/tests/range_unit_test.cc @@ -1,10 +1,19 @@ +// -*- C++ -*- +/** + + @file tests/range_unit_test.cc + @brief Range unit tests. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include #include #include "gtest/gtest.h" -//#include "cnorxz.h" #include "ranges/ranges.h" #include "array/array.h" diff --git a/src/tests/test_numbers.cc b/src/tests/test_numbers.cc index 81b1240..cdef0f4 100644 --- a/src/tests/test_numbers.cc +++ b/src/tests/test_numbers.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file tests/test_numbers.cc + @brief Test numbers instanciation. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "test_numbers.h" @@ -5,6 +15,8 @@ namespace CNORXZ { namespace Test { + /** @cond 0 */ Vector Numbers::sCont; + /** @endcond */ } } diff --git a/src/tests/test_numbers.h b/src/tests/test_numbers.h index 2a66357..05d9cc7 100644 --- a/src/tests/test_numbers.h +++ b/src/tests/test_numbers.h @@ -1,16 +1,25 @@ +// -*- C++ -*- +/** + + @file tests/test_numbers.h + @brief Test numbers utilities. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #ifndef __test_numbers_h__ #define __test_numbers_h__ #include -//#include "base/types.h" -//#include "base/assert.h" #include "base/base.h" namespace CNORXZ { namespace Test { + /** @cond 0 */ class Numbers { private: @@ -51,6 +60,7 @@ namespace CNORXZ return Vector(b,e); } }; + /** @endcond */ } } diff --git a/src/tests/xpr_unit_test.cc b/src/tests/xpr_unit_test.cc index 8e72fec..567ff8d 100644 --- a/src/tests/xpr_unit_test.cc +++ b/src/tests/xpr_unit_test.cc @@ -1,3 +1,13 @@ +// -*- C++ -*- +/** + + @file tests/xpr_unit_test.cc + @brief Xpression unit tests. + + Copyright (c) 2024 Christian Zimmermann. All rights reserved. + Mail: chizeta@f3l.de + +**/ #include "gtest/gtest.h"