Пример #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);
Пример #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));
Пример #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));
Пример #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);
Пример #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);
Пример #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));
Пример #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);
Пример #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);
Пример #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);
Пример #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);
Пример #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);
Пример #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);
Пример #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);
Пример #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));
Пример #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);
Пример #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);
Пример #17
0
 /// <summary>
 /// from-vector constructor
 /// </summary>
 public bool2(bool2 v)
 {
     this.x = v.x;
     this.y = v.y;
 }
Пример #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);
Пример #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));