26Kernel::Logger logger(
"Algebra");
136 std::pair<Acomp, Acomp> QR = Tf.
algDiv(D.F);
137 if (!QR.first.isNull() && !QR.second.isNull()) {
141 return std::pair<Algebra, Algebra>(Q, R);
156 const auto lenOut =
static_cast<int>(Out.length());
158 std::ostringstream cx;
159 for (
int i = 0; i < lenOut; i++) {
160 if (islower(Out[i]) || isupper(Out[i])) {
164 logger.error() <<
"SurfMap size == " <<
SurfMap.size() <<
'\n';
168 if (Out[i + 1] ==
'\'')
169 cx <<
" -" << vc->first;
171 cx <<
" " << vc->first;
172 }
else if (Out[i] ==
'+') {
189 Out <<
"F == " << F.display() <<
'\n';
208 std::ostringstream cx;
209 std::string nLiteral =
"a";
213 while (ipt <
static_cast<int>(A.length())) {
215 if (A[ipt] ==
'(' || A[ipt] ==
')') {
218 }
else if (A[ipt] ==
'-' || isdigit(A[ipt])) {
232 nLiteral[0] = (nLiteral[0] ==
'z') ?
'A' :
static_cast<char>(
static_cast<int>(nLiteral[0]) + 1);
233 bigFlag = (nLiteral[0] ==
'Z') ? 1 : 0;
235 std::ostringstream lcx;
236 lcx <<
"%" << bigFlag;
250 throw std::invalid_argument(
"Algebra::setFunction: ncount==0");
252 }
else if (A[ipt] ==
':') {
255 }
else if (A[ipt] ==
'#') {
276 std::string::size_type pos;
277 while ((pos = Ln.find(
' ')) != std::string::npos)
282 logger.error() <<
"Algebra String Error" << A <<
'\n';
308 std::map<int, int> Lit;
310 return static_cast<int>(Lit.size());
321 return F.logicalEqual(A.F);
Holds a state point in the decision tree.
void getLiterals(std::map< int, int > &) const
Get literals (+/- different)
std::string display() const
Pretty print statment.
std::pair< Acomp, Acomp > algDiv(const Acomp &)
Carry out Algebric division.
void complement()
Take complement of component.
void setString(const std::string &)
Processes a line of type abc'+efg.
Computes Boolean algebra for simplification.
std::pair< Algebra, Algebra > algDiv(const Algebra &) const
Divide by D algebrically.
int setFunctionObjStr(const std::string &)
Fill the algebra (AComp) with an object given an MCNPX String.
std::string writeMCNPX() const
Writes out the string in terms of surface numbers for MCNPX.
int setFunction(const std::string &)
Set the function using a basic string (abc etc)
int countLiterals() const
Count the number of different literals in the algebraic function Does this by generating the map of l...
Algebra & operator+=(const Algebra &)
Adds this by M algebrically.
bool operator==(const Algebra &) const
Equality operator.
int logicalEqual(const Algebra &) const
Calculate if two functions are logically equivilent (exhaustive search)
void Complement()
Takes the complement of the algebric function.
Algebra operator+(const Algebra &) const
Addition operator (or construction)
std::ostream & write(std::ostream &) const
Output function.
bool operator!=(const Algebra &) const
Inequality operator.
std::string display() const
Displays the algebra string.
Algebra & operator*=(const Algebra &)
Multiplies this by M algebrically.
Algebra operator*(const Algebra &) const
Addition operator (and construction)
std::map< int, std::string > SurfMap
Internal surface map.
Exception for when an item is not found in a collection.
Functor quick write out of a map.
Functor using second value as equal.
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
int convPartNum(const std::string &A, T &out)
Takes a character string and evaluates the first [typename T] object.