Commit 64dfaa77 by Mark Olesen

STYLE: eliminate complex constants that are duplications of pTraits

```- eg pTraits<complex>::zero, pTraits<complex>::one instead.
This is consistent with other primitives such as scalar, label etc.```
parent bb4932c5
 ... ... @@ -48,8 +48,8 @@ int main(int argc, char *argv[]) { Info<< "complex() : " << complex() << nl << "complex(zero) : " << complex(Zero) << nl << "complex::zero : " << complex::zero << nl << "complex::one : " << complex::one << nl << "pTraits::zero : " << pTraits::zero << nl << "pTraits::one : " << pTraits::one << nl << "complex(scalar) : " << complex(3.14519) << nl << nl; ... ... @@ -57,7 +57,6 @@ int main(int argc, char *argv[]) Info<< "std::complex : " << c1 << nl; Info<< "sin: " << std::sin(c1) << nl; Info<< "complexVector::zero : " << complexVector::zero << nl << "complexVector::one : " << complexVector::one << nl << nl; ... ... @@ -120,7 +119,7 @@ int main(int argc, char *argv[]) Info<< nl << "Elementary complex arithmetic operations:" << nl; { complex a (6, 1); complex a(6, 1); complex b = a; Info << "Compound assignment operations:" << nl; ... ... @@ -160,13 +159,12 @@ int main(int argc, char *argv[]) // Scalar division b = 1.0/b; Info<< "1/b (elementwise division):" << tab << b << nl; } } Info<< nl << "Other mathematical expressions:" << nl; { complex a (4.3, -3.14); complex b (0, -4.3); complex a(4.3, -3.14); complex b(0, -4.3); Info<< "a=" << a << tab << "b=" << b << nl; ... ...
 ... ... @@ -44,37 +44,37 @@ const char* const Foam::complexVector::vsType::componentNames[] = template<> const Foam::complexVector Foam::complexVector::vsType::zero ( complexVector::uniform(complex::zero) complexVector::uniform(pTraits::zero) ); template<> const Foam::complexVector Foam::complexVector::vsType::one ( complexVector::uniform(complex::one) complexVector::uniform(pTraits::one) ); template<> const Foam::complexVector Foam::complexVector::vsType::max ( complexVector::uniform(complex(VGREAT, VGREAT)) complexVector::uniform(pTraits::max) ); template<> const Foam::complexVector Foam::complexVector::vsType::min ( complexVector::uniform(complex(-VGREAT, -VGREAT)) complexVector::uniform(pTraits::min) ); template<> const Foam::complexVector Foam::complexVector::vsType::rootMax ( complexVector::uniform(complex(ROOTVGREAT, ROOTVGREAT)) complexVector::uniform(pTraits::rootMax) ); template<> const Foam::complexVector Foam::complexVector::vsType::rootMin ( complexVector::uniform(complex(-ROOTVGREAT, -ROOTVGREAT)) complexVector::uniform(pTraits::rootMin) ); ... ...
 ... ... @@ -30,12 +30,6 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const Foam::complex Foam::complex::zero(0, 0); const Foam::complex Foam::complex::one(1, 0); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // const char* const Foam::pTraits::typeName = "complex"; const char* const Foam::pTraits::componentNames[] = {"re", "im"}; ... ...
 ... ... @@ -85,22 +85,6 @@ class complex public: //- Component type typedef complex cmptType; // Static Data Members //- The type name is "complex" static constexpr const char* const typeName = "complex"; //- A complex zero (0,0) static const complex zero; //- A complex one (1,0) static const complex one; // Constructors //- Construct null as zero-initialized ... ... @@ -273,12 +257,13 @@ public: static const char* const typeName; static const char* const componentNames[]; static const complex zero; static const complex one; static const complex max; static const complex min; static const complex rootMax; static const complex rootMin; static const complex zero; //!< complex (0,0) static const complex one; //!< complex (1,0) static const complex min; //!< complex (-VGREAT,-VGREAT) static const complex max; //!< complex (VGREAT,VGREAT) static const complex rootMin; //!< complex (-ROOTVGREAT, -ROOTVGREAT) static const complex rootMax; //!< complex (ROOTVGREAT, ROOTVGREAT) // Constructors ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!