23 #ifndef BUILDINGBLOCK_H_INCLUDED 24 #define BUILDINGBLOCK_H_INCLUDED 43 std::optional<Expr>
expand(
bool full=
false,
44 bool inplace=
false)
const override;
46 std::optional<Expr>
factor(
bool full=
false)
const override;
48 std::optional<Expr>
factor(
Expr_info expr,
bool full=
false)
const override;
50 std::optional<Expr>
getTerm()
const override;
57 Expr_info expr,
int order)
const override;
61 const Expr& newExpression)
const override;
67 inline AbstractBuildingBlock::AbstractBuildingBlock():
Abstract(){}
75 bool isReal()
const override;
77 bool isPurelyImaginary()
const override;
79 bool isComplexConjugate()
const override;
87 void setConjugated(
bool t_conjugated)
override;
89 void printProp(std::ostream& fout = std::cout)
const override;
99 void applyComplexPropertiesOn(
const Expr& expr)
const;
101 void applyComplexPropertiesOn(unique_Expr& expr)
const;
105 bool conjugated =
false;
Definition: buildingBlock.h:69
Namespace for csl library.
Definition: abreviation.h:34
std::optional< Expr > getPolynomialTerm(Expr_info expr, int order) const override
Calculates and returns the polynomial term corresponding to *this with the variable t_variable at ord...
Definition: buildingBlock.cpp:57
Abstract class from which derive all building blocks of exprs, i.e. objects not function of further e...
Definition: buildingBlock.h:34
std::optional< Expr > getTerm() const override
This function returns the same expression as *this but amputated of its numerical factor...
Definition: buildingBlock.cpp:44
std::optional< Expr > getComplexModulus() const override
Evaluates the modulus in the complex plane of the Abstract and returns it.
Definition: buildingBlock.cpp:53
std::optional< Expr > factor(bool full=false) const override
Factors the Abstract.
Definition: buildingBlock.cpp:36
Abstract()
Default Constructor.
Definition: abstract.h:92
ComplexProperty
Contains all possible complex properties of objects. Real, purely imaginary, or complex.
Definition: enum.h:127
virtual bool operator==(int t_value) const
Definition: abstract.cpp:988
std::optional< Expr > getRealPart() const override
Evaluates the real part of the Abstract and returns it.
Definition: buildingBlock.cpp:49
virtual bool commutesWith(Expr_info expr, int sign=-1) const override
Tells if the object commutes with expr.
Definition: buildingBlock.cpp:75
Root class of the inheritance tree of abstracts.
Definition: abstract.h:76
std::optional< Expr > expand(bool full=false, bool inplace=false) const override
Develops the Abstract.
Definition: buildingBlock.cpp:32
virtual Expr getImaginaryPart() const
Evaluates the imaginary part of the Abstract and returns it.
Definition: abstract.cpp:667
Base classes for all exprs in the program.
std::optional< Expr > findSubExpression(Expr_info subExpression, const Expr &newExpression) const override
Searches a sub-expression and replaces it.
Definition: buildingBlock.cpp:66
virtual std::optional< Expr > getComplexConjugate() const
Calculates and returns the complex conjugate of the expression.
Definition: abstract.cpp:682
bool isBuildingBlock() const override
Tells if the expression is a Building Block or not.
Definition: buildingBlock.h:39
Expression type/.
Definition: abstract.h:1573