Skip to content

Commit 4ff2ea4

Browse files
committed
includes reordered
1 parent cb576f8 commit 4ff2ea4

File tree

24 files changed

+131
-98
lines changed

24 files changed

+131
-98
lines changed

.clang-format

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
---
33
Language: Cpp
44
BasedOnStyle: LLVM
5+
SortIncludes: true
6+
IncludeBlocks: Regroup
57
AccessModifierOffset: -4
68
AlignConsecutiveAssignments: false
79
AlignConsecutiveDeclarations: false

modules/cli/include/handlers/handlers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ typedef struct
1010
int (*handle)(int argc, char *argv[]);
1111
} Handler;
1212

13-
#endif //HANDLERS_H
13+
#endif // HANDLERS_H

modules/cli/include/handlers/help.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
Handler create_help_handler();
66

7-
#endif //HELP_H
7+
#endif // HELP_H

modules/cli/include/handlers/solve.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
Handler create_solve_handler();
88

9-
#endif //SOLVE_H
9+
#endif // SOLVE_H

modules/cli/include/handlers/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
Handler create_version_handler();
66

7-
#endif //VERSION_H
7+
#endif // VERSION_H

modules/cli/include/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
#define VERSION "0.1.0"
99

10-
#endif //MAIN_H
10+
#endif // MAIN_H

modules/cli/src/handlers/help.c

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <stdio.h>
2+
23
#include "handlers/handlers.h"
34

45
int handle_help(int argc, char *argv[]);
@@ -12,25 +13,30 @@ Handler create_help_handler()
1213

1314
int handle_help(int argc, char *argv[])
1415
{
15-
const char* help_message =
16-
"- [ Commands ] -\n"
17-
"\n"
18-
" Command | Description \n"
19-
"==========+======================================================================\n"
20-
" solve | Solves the given problem with the given configuration and data \n"
21-
" version | Displays the current version of the tool \n"
22-
" help | Displays this help message \n"
23-
"\n"
24-
"- [ Solve command options ] -\n"
25-
"\n"
26-
" Options Short | Type | Description | Default value |Example\n"
27-
" =================+======+=================================================================+=================+=====================================\n"
28-
" -c | Str | Path to the cuqdyn xml config file | |-c config/cuqdyn_conf.xml\n"
29-
" -s | Str | Path to the sacess library xml config file | |-s config/sacess_library_conf.xml\n"
30-
" -d | Str | Path to the data file (Supports text and .mat files) | |-d data/lotka_volterra.txt\n"
31-
" -o | Str | Defines the output folder for the results | output/ |-o output\n"
32-
"\n"
33-
"Usage: %s <command> [options]...\n";
16+
const char *help_message = "- [ Commands ] -\n"
17+
"\n"
18+
" Command | Description \n"
19+
"==========+======================================================================\n"
20+
" solve | Solves the given problem with the given configuration and data \n"
21+
" version | Displays the current version of the tool \n"
22+
" help | Displays this help message \n"
23+
"\n"
24+
"- [ Solve command options ] -\n"
25+
"\n"
26+
" Options Short | Type | Description "
27+
" | Default value |Example\n"
28+
" =================+======+============================================================="
29+
"====+=================+=====================================\n"
30+
" -c | Str | Path to the cuqdyn xml config file "
31+
" | |-c config/cuqdyn_conf.xml\n"
32+
" -s | Str | Path to the sacess library xml config file "
33+
" | |-s config/sacess_library_conf.xml\n"
34+
" -d | Str | Path to the data file (Supports text and .mat files) "
35+
" | |-d data/lotka_volterra.txt\n"
36+
" -o | Str | Defines the output folder for the results "
37+
" | output/ |-o output\n"
38+
"\n"
39+
"Usage: %s <command> [options]...\n";
3440

3541

3642
printf(help_message, argv[0]);

modules/cli/src/handlers/solve.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
#include <nvector/nvector_serial.h>
2-
#include <stdio.h>
3-
#include <unistd.h>
4-
5-
#include "handlers/handlers.h"
61
#include "handlers/solve.h"
72

83
#include <config.h>
4+
#include <nvector/nvector_serial.h>
5+
#include <stdio.h>
96
#include <stdlib.h>
107
#include <string.h>
118
#include <sunmatrix/sunmatrix_dense.h>
9+
#include <unistd.h>
1210

13-
#include "functions.h"
1411
#include "cuqdyn.h"
12+
#include "functions.h"
13+
#include "handlers/handlers.h"
1514

1615
#if defined(MPI) || defined(MPI2)
1716
#include <mpi.h>

modules/cli/src/handlers/version.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ Handler create_version_handler()
1515

1616
int handle_version(int argc, char *argv[])
1717
{
18-
const char *help_message = "- [Version] -\n"
19-
"cli %s — Command line interface for the CUQDYN algorithm (by Borja Castellano)\n"
20-
"cuqdyn-c %s — C implementation of the CUQDYN algorithm (by Borja Castellano)\n"
21-
"sacess %s — C implementation of the Scatter Search algorithm\n";
18+
const char *help_message =
19+
"- [Version] -\n"
20+
"cli %s — Command line interface for the CUQDYN algorithm (by Borja Castellano)\n"
21+
"cuqdyn-c %s — C implementation of the CUQDYN algorithm (by Borja Castellano)\n"
22+
"sacess %s — C implementation of the Scatter Search algorithm\n";
2223

2324
return printf(help_message, CLI_VERSION, CUQDYN_C_VERSION, SACESS_C_VERSION);
2425
}

modules/cuqdyn-c/include/config.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ typedef struct
1313
{
1414
int y_count;
1515
int p_count;
16-
char** exprs;
16+
char **exprs;
1717
} OdeExpr;
1818

1919
typedef struct
2020
{
2121
int len;
22-
double* array;
22+
double *array;
2323
} Y0;
2424

2525
typedef struct
2626
{
2727
int count;
28-
char** exprs;
28+
char **exprs;
2929
} StatesTransformer;
3030

3131
typedef struct
@@ -36,12 +36,12 @@ typedef struct
3636
StatesTransformer states_transformer;
3737
} CuqdynConf;
3838

39-
typedef void* CuqDynContext;
39+
typedef void *CuqDynContext;
4040

4141
CuqDynContext init_cuqdyn_context_from_file(const char *filename);
4242
CuqDynContext get_cuqdyn_context();
4343

4444
extern CuqdynConf *get_cuqdyn_conf(CuqDynContext context);
4545
extern void destroy_cuqdyn_context(CuqDynContext context);
4646

47-
#endif //CONFIG_H
47+
#endif // CONFIG_H

0 commit comments

Comments
 (0)