Skip to content

Commit

Permalink
Merge pull request #47 from SpM-lab/terasaki/format-code
Browse files Browse the repository at this point in the history
Format code
  • Loading branch information
terasakisatoshi authored Dec 11, 2024
2 parents 271ad56 + ad7cbc5 commit 3a2c895
Show file tree
Hide file tree
Showing 22 changed files with 3,187 additions and 2,855 deletions.
30 changes: 30 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use stuff
IndentWidth: 4
UseTab: Never
ColumnLimit: 80

BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: false
AfterFunction: true
AfterStruct: true
AfterControlStatement: false
AfterEnum: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false

AlwaysBreakTemplateDeclarations: true

AccessModifierOffset: -4
IndentCaseLabels: false

AllowShortIfStatementsOnASingleLine: false

ConstructorInitializerAllOnOneLineOrOnePerLine: true

SpaceInEmptyBlock: true
SpaceAfterCStyleCast: false
43 changes: 25 additions & 18 deletions include/sparseir/_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,55 @@

#include "xprec/ddouble.hpp"


namespace sparseir {
// General case
template<typename T>
inline T sqrt_impl(const T& x) {
template <typename T>
inline T sqrt_impl(const T &x)
{
return std::sqrt(x);
}

// Specialization for DDouble
template<>
inline xprec::DDouble sqrt_impl(const xprec::DDouble& x) {
template <>
inline xprec::DDouble sqrt_impl(const xprec::DDouble &x)
{
return xprec::sqrt(x);
}

template<typename T >
inline T cosh_impl(const T& x) {
template <typename T>
inline T cosh_impl(const T &x)
{
return std::cosh(x);
}

template<>
inline xprec::DDouble cosh_impl(const xprec::DDouble& x) {
template <>
inline xprec::DDouble cosh_impl(const xprec::DDouble &x)
{
return xprec::cosh(x);
}

template<typename T>
inline T sinh_impl(const T& x) {
template <typename T>
inline T sinh_impl(const T &x)
{
return std::sinh(x);
}

template<>
inline xprec::DDouble sinh_impl(const xprec::DDouble& x) {
template <>
inline xprec::DDouble sinh_impl(const xprec::DDouble &x)
{
return xprec::sinh(x);
}

template<typename T>
inline T exp_impl(const T& x) {
template <typename T>
inline T exp_impl(const T &x)
{
return std::exp(x);
}

template<>
inline xprec::DDouble exp_impl(const xprec::DDouble& x) {
template <>
inline xprec::DDouble exp_impl(const xprec::DDouble &x)
{
return xprec::exp(x);
}

}
} // namespace sparseir
Loading

0 comments on commit 3a2c895

Please sign in to comment.