Skip to content

Commit 54c2d0d

Browse files
committed
Merge branch 'cleanup' into 'main'
Fix commandline help. Add missing concepts. Add a single source header include for the framework. See merge request m4c/graph_framework!83
2 parents 58cf971 + f3bf265 commit 54c2d0d

File tree

10 files changed

+72
-24
lines changed

10 files changed

+72
-24
lines changed

graph_framework.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@
393393
C7CEA0052948EB0F00F61D09 /* cuda_context.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = cuda_context.hpp; sourceTree = "<group>"; };
394394
C7D12D992DBAB31F00925420 /* random.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = random.hpp; sourceTree = "<group>"; };
395395
C7D3C5B02C654AD3008AD8C6 /* efit_test.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = efit_test.cpp; sourceTree = "<group>"; };
396+
C7D453872EBFD05D00A828DB /* graph_framework.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = graph_framework.hpp; sourceTree = "<group>"; };
396397
C7DC9EE02E39768300524F6F /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
397398
C7DC9EE12E39768300524F6F /* graph_c_binding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = graph_c_binding.h; sourceTree = "<group>"; };
398399
C7DC9EE22E39768300524F6F /* graph_c_binding.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = graph_c_binding.cpp; sourceTree = "<group>"; };
@@ -687,6 +688,7 @@
687688
isa = PBXGroup;
688689
children = (
689690
C7931E7028073BE70033B488 /* CMakeLists.txt */,
691+
C7D453872EBFD05D00A828DB /* graph_framework.hpp */,
690692
C79141AE22DA9C3000E0BA0D /* node.hpp */,
691693
C72358F52C4027A10084A489 /* commandline_parser.hpp */,
692694
C70B705629F4F86A00098AA0 /* piecewise.hpp */,
@@ -1176,7 +1178,7 @@
11761178
isa = PBXProject;
11771179
attributes = {
11781180
BuildIndependentTargetsInParallel = YES;
1179-
LastUpgradeCheck = 1640;
1181+
LastUpgradeCheck = 2610;
11801182
ORGANIZATIONNAME = "Cianciosa, Mark R.";
11811183
TargetAttributes = {
11821184
C7170CB82C66A10D003274E2 = {
@@ -1952,6 +1954,7 @@
19521954
/usr/local/lib,
19531955
);
19541956
SDKROOT = macosx;
1957+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
19551958
SYSTEM_HEADER_SEARCH_PATHS = "";
19561959
USER_HEADER_SEARCH_PATHS = (
19571960
LLVM/llvm/include,
@@ -2120,6 +2123,7 @@
21202123
/usr/local/lib,
21212124
);
21222125
SDKROOT = macosx;
2126+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
21232127
SYSTEM_HEADER_SEARCH_PATHS = "";
21242128
USER_HEADER_SEARCH_PATHS = (
21252129
LLVM/llvm/include,

graph_framework.xcodeproj/xcshareddata/xcschemes/arithmetic_test.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1640"
3+
LastUpgradeVersion = "2610"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

graph_framework.xcodeproj/xcshareddata/xcschemes/graph_driver.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1640"
3+
LastUpgradeVersion = "2610"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

graph_framework.xcodeproj/xcshareddata/xcschemes/jit_test.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1640"
3+
LastUpgradeVersion = "2610"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

graph_framework.xcodeproj/xcshareddata/xcschemes/math_test.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1640"
3+
LastUpgradeVersion = "2610"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

graph_framework.xcodeproj/xcshareddata/xcschemes/physics_test.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1640"
3+
LastUpgradeVersion = "2610"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

graph_framework/commandline_parser.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace commandline {
3939
static std::string_view take_end(const char *string,
4040
const char character) {
4141
std::string_view view(string);
42-
return view.substr(view.find_last_of('/') + 1);
42+
return view.substr(view.find_last_of(character) + 1);
4343
}
4444

4545
public:
@@ -48,9 +48,7 @@ namespace commandline {
4848
//------------------------------------------------------------------------------
4949
parser(const char *name) :
5050
command(take_end(name, '/')) {
51-
options.emplace(std::make_pair("help",
52-
std::make_pair(false,
53-
"Show this help.")));
51+
options.try_emplace("help", false, "Show this help.");
5452
}
5553

5654
//------------------------------------------------------------------------------
@@ -139,7 +137,7 @@ namespace commandline {
139137
}
140138

141139
if (is_option_set("help")) {
142-
show_help(std::string(argv[0]));
140+
show_help(command);
143141
}
144142
}
145143

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//------------------------------------------------------------------------------
2+
/// @file graph_framework.hpp
3+
/// @brief Single include header for the entire framework.
4+
//------------------------------------------------------------------------------
5+
6+
#ifndef graph_framework_h
7+
#define graph_framework_h
8+
9+
#include "absorption.hpp"
10+
#include "arithmetic.hpp"
11+
#include "backend.hpp"
12+
#include "commandline_parser.hpp"
13+
#include "cpu_context.hpp"
14+
#include "dispersion.hpp"
15+
#include "equilibrium.hpp"
16+
#include "jit.hpp"
17+
#include "math.hpp"
18+
#include "newton.hpp"
19+
#include "node.hpp"
20+
#include "output.hpp"
21+
#include "piecewise.hpp"
22+
#include "random.hpp"
23+
#include "register.hpp"
24+
#include "solver.hpp"
25+
#include "special_functions.hpp"
26+
#include "timing.hpp"
27+
#include "trigonometry.hpp"
28+
#include "vector.hpp"
29+
#include "workflow.hpp"
30+
31+
#ifdef USE_CUDA
32+
#include "cuda_context.hpp"
33+
#endif
34+
#ifdef USE_METAL
35+
#include "metal_context.hpp"
36+
#endif
37+
38+
#endif /* graph_framework_h */

graph_framework/special_functions.hpp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,11 @@ namespace special {
519519
///
520520
/// @returns 1/sqrt(pi)
521521
//------------------------------------------------------------------------------
522+
#if __cplusplus >= 202002L
523+
template<std::floating_point T>
524+
#else
522525
template<typename T>
526+
#endif
523527
T isqpi() {
524528
return static_cast<T> (1)/sqrt(static_cast<T> (M_PI));
525529
}
@@ -1461,20 +1465,24 @@ namespace special {
14611465
/// @param[in] y imaginary argument.
14621466
/// @returns erf(x+iy)
14631467
//------------------------------------------------------------------------------
1468+
#if __cplusplus >= 202002L
1469+
template<std::floating_point T>
1470+
#else
14641471
template<typename T>
1472+
#endif
14651473
complex_type<T> taylor_erfi(const T x, const T y) {
1466-
const T x2 = sq(x);
1467-
const T y2 = sq(y);
1468-
const T expy2 = exp(y2);
1469-
return expy2*complex_type<T> (x*(static_cast<T> (1.1283791670955125739) -
1470-
x2*(static_cast<T> (0.37612638903183752464) +
1471-
static_cast<T> (0.75225277806367504925)*y2) +
1472-
x2*x2*(static_cast<T> (0.11283791670955125739) +
1473-
y2*(static_cast<T> (0.45135166683820502956) +
1474-
static_cast<T> (0.15045055561273500986)*y2))),
1475-
(w_im(y) - x2*y*(static_cast<T> (1.1283791670955125739) -
1476-
x2*(static_cast<T> (0.56418958354775628695) +
1477-
static_cast<T> (0.37612638903183752464)*y2))));
1474+
const T x2 = sq(x);
1475+
const T y2 = sq(y);
1476+
const T expy2 = exp(y2);
1477+
return expy2*complex_type<T> (x*(static_cast<T> (1.1283791670955125739) -
1478+
x2*(static_cast<T> (0.37612638903183752464) +
1479+
static_cast<T> (0.75225277806367504925)*y2) +
1480+
x2*x2*(static_cast<T> (0.11283791670955125739) +
1481+
y2*(static_cast<T> (0.45135166683820502956) +
1482+
static_cast<T> (0.15045055561273500986)*y2))),
1483+
(w_im(y) - x2*y*(static_cast<T> (1.1283791670955125739) -
1484+
x2*(static_cast<T> (0.56418958354775628695) +
1485+
static_cast<T> (0.37612638903183752464)*y2))));
14781486
}
14791487

14801488
//------------------------------------------------------------------------------

graph_playground/xplayground.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// @file xplayground.cpp
33
/// @brief A playground area for testing example programs.
44
//------------------------------------------------------------------------------
5-
#include "../graph_framework/jit.hpp"
5+
#include "../graph_framework/graph_framework.hpp"
66

77
//------------------------------------------------------------------------------
88
/// @brief Main program of the playground.

0 commit comments

Comments
 (0)