Skip to content

Commit

Permalink
fix some inconsistencies in formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Radonirinaunimi committed Jun 5, 2021
1 parent 3904634 commit 5d5f0b8
Show file tree
Hide file tree
Showing 20 changed files with 912 additions and 854 deletions.
79 changes: 56 additions & 23 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
Expand All @@ -18,12 +18,12 @@ AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
Expand Down Expand Up @@ -57,33 +57,36 @@ BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
- Regex: '^<.*'
Priority: 2
SortPriority: 0
- Regex: '.*'
Priority: 1
Priority: 3
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
Expand All @@ -93,25 +96,55 @@ IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
Expand All @@ -126,15 +159,15 @@ SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
Standard: Auto
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Run clang-format Linter

on:
pull_request:
push:
branches:
- main
- develop
workflow_dispatch:

jobs:
Expand All @@ -16,7 +19,7 @@ jobs:
extensions: 'h,cpp'
clangFormatVersion: 12
inplace: True
style: llvm
style: google
- uses: EndBug/add-and-commit@v4
with:
default_author: github_actions
Expand Down
19 changes: 9 additions & 10 deletions dSigmadpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
* =====================================================================================
*/

#include <stdio.h>
#include <stdlib.h>

#include <exception>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>

Expand Down Expand Up @@ -76,10 +77,8 @@ int main(int argc, char *argv[]) {
"_combined_aspt.dat"};

try {
if (order < 0 || order > 1)
throw err_message();
if (channel < 0 || channel > 5)
throw err_message();
if (order < 0 || order > 1) throw err_message();
if (channel < 0 || channel > 5) throw err_message();
filename += ord_fixod[order];
filename += par_chanl[channel];
filename += matsch[scheme];
Expand All @@ -90,14 +89,14 @@ int main(int argc, char *argv[]) {

// Factors for Born cross-section
double factor;
double gf = 1.16637e-5; // Fermi Constant
double gevpb = 3.8937966e8; // GeV to pb
double gf = 1.16637e-5; // Fermi Constant
double gevpb = 3.8937966e8; // GeV to pb

if (inorm == 1) {
std::cout << "ERROR in inorm!" << std::endl;
exit(EXIT_FAILURE); // TODO: complete implementation!
exit(EXIT_FAILURE); // TODO: complete implementation!
} else if (inorm == 0) {
factor = gf / 288. / M_PI / sqrt(2.); // large-top mass limit
factor = gf / 288. / M_PI / sqrt(2.); // large-top mass limit
} else {
std::cout << "ERROR in inorm!" << std::endl;
exit(EXIT_FAILURE);
Expand Down
19 changes: 9 additions & 10 deletions dSigmadptN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
* =====================================================================================
*/

#include <stdio.h>
#include <stdlib.h>

#include <exception>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>

Expand Down Expand Up @@ -73,10 +74,8 @@ int main(int argc, char *argv[]) {
"_combined_asN.dat"};

try {
if (order < 0 || order > 1)
throw err_message();
if (channel < 0 || channel > 5)
throw err_message();
if (order < 0 || order > 1) throw err_message();
if (channel < 0 || channel > 5) throw err_message();
filename += ord_fixod[order];
filename += par_chanl[channel];
filename += matsch[scheme];
Expand All @@ -87,14 +86,14 @@ int main(int argc, char *argv[]) {

// Factors for Born cross-section
double factor;
double gf = 1.16637e-5; // Fermi Constant
double gevpb = 3.8937966e8; // GeV to pb
double gf = 1.16637e-5; // Fermi Constant
double gevpb = 3.8937966e8; // GeV to pb

if (inorm == 1) {
std::cout << "ERROR in inorm!" << std::endl;
exit(EXIT_FAILURE); // TODO: complete implementation!
exit(EXIT_FAILURE); // TODO: complete implementation!
} else if (inorm == 0) {
factor = gf / 288. / M_PI / sqrt(2.); // large-top mass limit
factor = gf / 288. / M_PI / sqrt(2.); // large-top mass limit
} else {
std::cout << "ERROR in inorm!" << std::endl;
exit(EXIT_FAILURE);
Expand Down
12 changes: 6 additions & 6 deletions include/AnomalousDim.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#pragma once

#include <cmath>
#include <complex>
#include <gsl/gsl_integration.h>
#include <gsl/gsl_math.h>
#include <iostream>
#include <stdio.h>

#include <cmath>
#include <complex>
#include <iostream>

#include "./ComplexDefs.h"
#include "./HarmonicSum.h"

#include "higgs-fo/params.h"

using namespace std;
Expand All @@ -26,7 +26,7 @@ struct gamma1sums {
};

class AnomDimensions {
public:
public:
AnomDimensions(void *params);
virtual ~AnomDimensions();

Expand All @@ -43,7 +43,7 @@ class AnomDimensions {
long double _NN;
};

private:
private:
HSum HAP;
gamma1sums g1s;

Expand Down
10 changes: 5 additions & 5 deletions include/CombinedRes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@

#pragma once

#include <cmath>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#include <cmath>
#include <iostream>
#include <string>
#include <vector>

#include "./ComplexDefs.h"
#include "./SmallptExp.h"
#include "./ThresExp.h"

#include "higgs-fo/partonic.h"

class CombinedRes {
public:
public:
CombinedRes(int order, int channel, std::string pdfname, void *params);
virtual ~CombinedRes();

// Attribute that compute the expanded results
std::complex<long double> CombinedResExpr(std::complex<long double> N,
long double pt, int scheme);

private:
private:
int ORD, EXACT_ORD;
/* long double LF, LR, LQ; */
long double QS2, MH2, MUF2, MUR2;
Expand Down
9 changes: 5 additions & 4 deletions include/ComplexDefs.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#pragma once

#include <complex>
#include <complex_bessel.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_sf_dilog.h>
#include <gsl/gsl_sf_gamma.h>
#include <gsl/gsl_sf_log.h>
#include <gsl/gsl_sf_result.h>
#include <gsl/gsl_sf_zeta.h>

#include <complex>
#include <iostream>
#include <numeric>
#include <vector>
Expand Down Expand Up @@ -68,9 +69,9 @@ std::complex<long double> operator*(const unsigned int n,
const std::complex<long double> &z);
std::complex<long double> operator/(const unsigned int n,
const std::complex<long double> &z);
std::complex<long double>
operator*(const std::vector<std::complex<long double>> &c1,
const std::vector<std::complex<long double>> &c2);
std::complex<long double> operator*(
const std::vector<std::complex<long double>> &c1,
const std::vector<std::complex<long double>> &c2);

bool operator==(const std::complex<long double> &z, const int n);
bool operator!=(const std::complex<long double> &z, const int n);
Expand Down
Loading

0 comments on commit 5d5f0b8

Please sign in to comment.