Skip to content

Commit

Permalink
Simplify partition functions
Browse files Browse the repository at this point in the history
  • Loading branch information
riclarsson committed Jan 2, 2025
1 parent 6994c1b commit 9e8629c
Show file tree
Hide file tree
Showing 9 changed files with 628 additions and 553 deletions.
2 changes: 1 addition & 1 deletion src/partfun/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target_include_directories(partfun_generator PRIVATE ${ARTS_SOURCE_DIR}/src)

file(GLOB_RECURSE partfun_xml_files LIST_DIRECTORIES FALSE RELATIVE ${ARTS_PARTFUN_DATA_PATH} "*.xml")
set(partfun_cpp_files ${partfun_xml_files})
list(TRANSFORM partfun_cpp_files REPLACE ".xml" ".cc")
list(TRANSFORM partfun_cpp_files REPLACE ".xml" ".cpp")
list(TRANSFORM partfun_xml_files PREPEND "${ARTS_PARTFUN_DATA_PATH}/")

# Generate auto_partfun.h for the ARTS interface
Expand Down
32 changes: 32 additions & 0 deletions src/partfun/data/Ar-8.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! auto-generated file

#include <configtypes.h>

#include <array>

inline constexpr std::array<Numeric, 4> coeffs{ 1, 0, 0, 0 };


Numeric /Users/richard/Work/arts/src/partfun/data/Ar8(Numeric T) noexcept {
Numeric result = coeffs[0];
Numeric TN = 1.0;

for (int i = 1; i < 4; i++) {
TN *= T;
result += TN * c;
}

return result;
}

Numeric d/Users/richard/Work/arts/src/partfun/data/Ar8(Numeric T) noexcept {
Numeric result = coeffs[1];
Numeric TN = 1.0;

for (int i = 2; i < 4; i++) {
TN *= T;
result += static_cast<Numeric>(i) * TN * coeffs[i];
}

return result;
}
Loading

0 comments on commit 9e8629c

Please sign in to comment.