Mantid
|
Computes Boolean algebra for simplification. More...
#include <Algebra.h>
Public Member Functions | |
std::pair< Algebra, Algebra > | algDiv (const Algebra &) const |
Divide by D algebrically. More... | |
Algebra () | |
Constructor. More... | |
void | Complement () |
Takes the complement of the algebric function. More... | |
int | countLiterals () const |
Count the number of different literals in the algebraic function Does this by generating the map of literals. More... | |
std::string | display () const |
Displays the algebra string. More... | |
const Acomp & | getComp () const |
Accessor. More... | |
int | logicalEqual (const Algebra &) const |
Calculate if two functions are logically equivilent (exhaustive search) More... | |
void | makeCNF () |
assessor to makeCNFobj More... | |
void | makeDNF () |
assessor to makeDNFobj More... | |
bool | operator!= (const Algebra &) const |
Inequality operator. More... | |
Algebra | operator* (const Algebra &) const |
Addition operator (and construction) More... | |
Algebra & | operator*= (const Algebra &) |
Multiplies this by M algebrically. More... | |
Algebra | operator+ (const Algebra &) const |
Addition operator (or construction) More... | |
Algebra & | operator+= (const Algebra &) |
Adds this by M algebrically. More... | |
bool | operator== (const Algebra &) const |
Equality operator. More... | |
int | setFunction (const Acomp &) |
Set the function using a toplevel Acomp. More... | |
int | setFunction (const std::string &) |
Set the function using a basic string (abc etc) More... | |
int | setFunctionObjStr (const std::string &) |
Fill the algebra (AComp) with an object given an MCNPX String. More... | |
std::ostream & | write (std::ostream &) const |
Output function. More... | |
std::string | writeMCNPX () const |
Writes out the string in terms of surface numbers for MCNPX. More... | |
Private Attributes | |
Acomp | F |
Factor. More... | |
std::map< int, std::string > | SurfMap |
Internal surface map. More... | |
Computes Boolean algebra for simplification.
A leveled algebra class for each level of factorisation.
Mantid::Geometry::Algebra::Algebra | ( | ) |
Constructor.
Definition at line 41 of file Algebra.cpp.
Divide by D algebrically.
D | :: Divisor |
Definition at line 125 of file Algebra.cpp.
References Mantid::Geometry::Acomp::algDiv(), and setFunction().
void Mantid::Geometry::Algebra::Complement | ( | ) |
Takes the complement of the algebric function.
Definition at line 116 of file Algebra.cpp.
References Mantid::Geometry::Acomp::complement(), and F.
int Mantid::Geometry::Algebra::countLiterals | ( | ) | const |
Count the number of different literals in the algebraic function Does this by generating the map of literals.
Definition at line 300 of file Algebra.cpp.
References F, and Mantid::Geometry::Acomp::getLiterals().
std::string Mantid::Geometry::Algebra::display | ( | ) | const |
Displays the algebra string.
Definition at line 194 of file Algebra.cpp.
References Mantid::Geometry::Acomp::display(), and F.
Referenced by Mantid::Geometry::operator<<().
|
inline |
int Mantid::Geometry::Algebra::logicalEqual | ( | const Algebra & | A | ) | const |
Calculate if two functions are logically equivilent (exhaustive search)
A | :: Algrebra to testg |
Definition at line 313 of file Algebra.cpp.
|
inline |
assessor to makeCNFobj
Definition at line 51 of file Algebra.h.
References Mantid::Geometry::Acomp::makeCNFobject().
|
inline |
assessor to makeDNFobj
Definition at line 50 of file Algebra.h.
References Mantid::Geometry::Acomp::makeDNFobject().
bool Mantid::Geometry::Algebra::operator!= | ( | const Algebra & | A | ) | const |
Inequality operator.
A | :: object to compary |
Definition at line 60 of file Algebra.cpp.
Addition operator (and construction)
M | :: Algebra to multiply (and) |
Definition at line 104 of file Algebra.cpp.
Multiplies this by M algebrically.
M | :: Algebric object to multiply by |
Definition at line 81 of file Algebra.cpp.
References F.
Addition operator (or construction)
M | :: Algebra to add |
Definition at line 92 of file Algebra.cpp.
Adds this by M algebrically.
M | :: Algebric object to add |
Definition at line 70 of file Algebra.cpp.
References F.
bool Mantid::Geometry::Algebra::operator== | ( | const Algebra & | A | ) | const |
Equality operator.
A | :: object to compary |
Definition at line 48 of file Algebra.cpp.
int Mantid::Geometry::Algebra::setFunction | ( | const Acomp & | A | ) |
Set the function using a toplevel Acomp.
A | :: Acomp to be copied to F. |
Definition at line 288 of file Algebra.cpp.
References F.
int Mantid::Geometry::Algebra::setFunction | ( | const std::string & | A | ) |
Set the function using a basic string (abc etc)
A | :: String to use for the function |
1 | Error |
0 | on success |
Definition at line 265 of file Algebra.cpp.
References F, and Mantid::Geometry::Acomp::setString().
Referenced by algDiv(), and setFunctionObjStr().
int Mantid::Geometry::Algebra::setFunctionObjStr | ( | const std::string & | A | ) |
Fill the algebra (AComp) with an object given an MCNPX String.
The string type is of 3 : 5 : 6 -4 #( xx )
A | :: string to process (stripped of id,density etc) |
-1 | :: Failure |
0 | :: Success |
Definition at line 196 of file Algebra.cpp.
References Mantid::Kernel::Strings::convPartNum(), setFunction(), and SurfMap.
std::ostream & Mantid::Geometry::Algebra::write | ( | std::ostream & | Out | ) | const |
Output function.
Out | :: Ostream to write out |
Definition at line 182 of file Algebra.cpp.
std::string Mantid::Geometry::Algebra::writeMCNPX | ( | ) | const |
Writes out the string in terms of surface numbers for MCNPX.
Note the ugly use of valEqual to find the cell since the SrufMap is the wrong way round. This also has the problem that Algebra uses intersection as master but MCNPX uses union
Definition at line 144 of file Algebra.cpp.
References Mantid::Geometry::Acomp::display(), F, and SurfMap.
|
private |
Factor.
Definition at line 33 of file Algebra.h.
Referenced by Complement(), countLiterals(), display(), operator*=(), operator+=(), setFunction(), and writeMCNPX().
|
private |
Internal surface map.
Definition at line 32 of file Algebra.h.
Referenced by setFunctionObjStr(), and writeMCNPX().