Commit 9dd38a27 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

Predicates: documentation updated

parent ca37a5fb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -29,12 +29,12 @@ namespace PsimagLite {

 where SimplePredicate is of the form
 word operator word
 where operator is in {==, <, >, <=, >=, %}
 with the expected meaning, and % means divisible by.
 So l%2 means that the simple predicate is true if l is divisible by 2.
 where operator is in {==, <, >, <=, >=, %%}
 with the expected meaning, and %% means divisible by.
 So l%%2 means that the simple predicate is true if l is divisible by 2.

 From this rules, the list of items
 M=2,l%2;l!=0,l>=7,l<11
 M=2,l%%2;l!=0,l>=7,l<11
 will set M=2 and define a predicate that is true if l
 is in the set {2, 4, 6, 7, 8, 9, 10, 12, 14, 16, 18 ...}
 and false otherwise.
+4 −4
Original line number Diff line number Diff line
@@ -7,9 +7,9 @@
/* PSIDOC PredicateSimple
 PredicateSimple is of the form
 word operator word
 where operator is in {==, <, >, <=, >=, %}
 with the usual meaning, and % means divisible by.
 So l%2 means that the simple predicate is true if l is divisible by 2.
 where operator is in {==, <, >, <=, >=, %%}
 with the usual meaning, and %% means divisible by.
 So l%%2 means that the simple predicate is true if l is divisible by 2.
 */
namespace PsimagLite {

@@ -70,7 +70,7 @@ private:
	template<typename T>
	static bool compareOnOp(T lv, String op, T rv)
	{
		// {==, <, >, <=, >=, %}
		// {==, <, >, <=, >=, %%}
		// If you add something here, add it also to PredicateSimple.cpp
		if (op == "==")
			return (lv == rv);