Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alvarez, Gonzalo
PsimagLite
Commits
6cc1abc9
Commit
6cc1abc9
authored
Nov 02, 2020
by
Alvarez, Gonzalo
Browse files
CanonicalExpression: do not throw on empty result
parent
493f3cb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/CanonicalExpression.h
View file @
6cc1abc9
...
...
@@ -21,7 +21,7 @@ public:
:
itemSpec_
(
itemSpec
)
{}
void
operator
()(
ResultType
&
result
,
bool
operator
()(
ResultType
&
result
,
String
expr
,
const
ResultType
&
resultEmpty
,
AuxiliaryType
&
aux
)
const
...
...
@@ -35,7 +35,9 @@ public:
for
(
SizeType
i
=
0
;
i
<
numberOfTerms
;
++
i
)
{
ResultType
term
=
resultEmpty
;
procCanonicalTerm
(
term
,
quasiCanonical
,
i
,
aux
);
bool
isNotEmpty
=
procCanonicalTerm
(
term
,
quasiCanonical
,
i
,
aux
);
if
(
!
isNotEmpty
)
continue
;
if
(
!
ItemSpecType
::
metaEqual
(
term
,
result
))
err
(
"CanonicalExpression: metas not equal
\n
"
);
...
...
@@ -45,13 +47,12 @@ public:
result
+=
term
;
}
if
(
ItemSpecType
::
isEmpty
(
result
))
err
(
"CanonicalExpression: expression result is empty
\n
"
);
return
(
ItemSpecType
::
isEmpty
(
result
))
?
false
:
true
;
}
private:
void
procCanonicalTerm
(
ResultType
&
term
,
bool
procCanonicalTerm
(
ResultType
&
term
,
QuasiCanonicalType
&
quasiCanonical
,
SizeType
ind
,
AuxiliaryType
&
aux
)
const
...
...
@@ -66,9 +67,10 @@ private:
}
if
(
ItemSpecType
::
isEmpty
(
term
))
err
(
"CanonicalExpression: term result is empty
\n
"
)
;
return
false
;
term
*=
factor
;
return
true
;
}
void
procCanonicalFactor
(
ResultType
&
prev
,
...
...
src/Version.h
View file @
6cc1abc9
#ifndef PSIMAGLITE_VERSION
#define PSIMAGLITE_VERSION "2.7
4
"
#define PSIMAGLITE_VERSION "2.7
5
"
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment