Exemplo n.º 1
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Or (lhs || rhs).
 /// </summary>
 public static bool2 Or(bool lhs, bool2 rhs) => new bool2(lhs || rhs.x, lhs || rhs.y);
Exemplo n.º 2
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Nor (!(lhs || rhs)).
 /// </summary>
 public static bool2 Nor(bool2 lhs, bool rhs) => new bool2(!(lhs.x || rhs), !(lhs.y || rhs));
Exemplo n.º 3
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Nand (!(lhs &amp;&amp; rhs)).
 /// </summary>
 public static bool2 Nand(bool lhs, bool2 rhs) => new bool2(!(lhs && rhs.x), !(lhs && rhs.y));
Exemplo n.º 4
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Or (lhs || rhs).
 /// </summary>
 public static bool2 Or(bool2 lhs, bool rhs) => new bool2(lhs.x || rhs, lhs.y || rhs);
Exemplo n.º 5
0
 /// <summary>
 /// Tries to convert the string representation of the vector into a vector representation (using ', ' as a separator), returns false if string was invalid.
 /// </summary>
 public static bool TryParse(string s, out bool2 result) => TryParse(s, ", ", out result);
Exemplo n.º 6
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Nand (!(lhs &amp;&amp; rhs)).
 /// </summary>
 public static bool2 Nand(bool2 lhs, bool rhs) => new bool2(!(lhs.x && rhs), !(lhs.y && rhs));
Exemplo n.º 7
0
 /// <summary>
 /// Returns a bool2 from component-wise application of And (lhs &amp;&amp; rhs).
 /// </summary>
 public static bool2 And(bool2 lhs, bool rhs) => new bool2(lhs.x && rhs, lhs.y && rhs);
Exemplo n.º 8
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Xnor (lhs == rhs).
 /// </summary>
 public static bool2 Xnor(bool2 lhs, bool rhs) => new bool2(lhs.x == rhs, lhs.y == rhs);
Exemplo n.º 9
0
 /// <summary>
 /// Returns a bool2 from component-wise application of NotEqual (lhs != rhs).
 /// </summary>
 public static bool2 NotEqual(bool lhs, bool2 rhs) => new bool2(lhs != rhs.x, lhs != rhs.y);
Exemplo n.º 10
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Not (!v).
 /// </summary>
 public static bool2 Not(bool2 v) => new bool2(!v.x, !v.y);
Exemplo n.º 11
0
 /// <summary>
 /// Returns a bool2 from component-wise application of NotEqual (lhs != rhs).
 /// </summary>
 public static bool2 NotEqual(bool2 lhs, bool rhs) => new bool2(lhs.x != rhs, lhs.y != rhs);
Exemplo n.º 12
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Equal (lhs == rhs).
 /// </summary>
 public static bool2 Equal(bool lhs, bool2 rhs) => new bool2(lhs == rhs.x, lhs == rhs.y);
Exemplo n.º 13
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Equal (lhs == rhs).
 /// </summary>
 public static bool2 Equal(bool2 lhs, bool rhs) => new bool2(lhs.x == rhs, lhs.y == rhs);
Exemplo n.º 14
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Nor (!(lhs || rhs)).
 /// </summary>
 public static bool2 Nor(bool lhs, bool2 rhs) => new bool2(!(lhs || rhs.x), !(lhs || rhs.y));
Exemplo n.º 15
0
 /// <summary>
 /// Returns a bool2 from component-wise application of And (lhs &amp;&amp; rhs).
 /// </summary>
 public static bool2 And(bool lhs, bool2 rhs) => new bool2(lhs && rhs.x, lhs && rhs.y);
Exemplo n.º 16
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Xor (lhs != rhs).
 /// </summary>
 public static bool2 Xor(bool2 lhs, bool rhs) => new bool2(lhs.x != rhs, lhs.y != rhs);
Exemplo n.º 17
0
 /// <summary>
 /// from-vector constructor
 /// </summary>
 public bool2(bool2 v)
 {
     this.x = v.x;
     this.y = v.y;
 }
Exemplo n.º 18
0
 /// <summary>
 /// Returns a bool2 from component-wise application of Xnor (lhs == rhs).
 /// </summary>
 public static bool2 Xnor(bool lhs, bool2 rhs) => new bool2(lhs == rhs.x, lhs == rhs.y);
Exemplo n.º 19
0
 /// <summary>
 /// Returns true iff this equals rhs component-wise.
 /// </summary>
 public bool Equals(bool2 rhs) => (x.Equals(rhs.x) && y.Equals(rhs.y));