Пример #1
0
    def all(self):
        """Test whether all element not equal zero.

        Returns:
            bool: True if all elements are not equal zero, False otherwise.

        """
        ret = ti.cmp_ne(self.entries[0], 0)
        for i in range(1, len(self.entries)):
            ret = ret + ti.cmp_ne(self.entries[i], 0)
        return -ti.cmp_eq(ret, -len(self.entries))
Пример #2
0
 def all(self):
     import taichi as ti
     ret = ti.cmp_ne(self.entries[0], 0)
     for i in range(1, len(self.entries)):
         ret = ret + ti.cmp_ne(self.entries[i], 0)
     return -ti.cmp_eq(ret, -len(self.entries))
Пример #3
0
 def __ne__(self, other):
     import taichi as ti
     return ti.cmp_ne(self, other)
Пример #4
0
 def __ne__(self, other):
     _taichi_skip_traceback = 1
     return ti.cmp_ne(self, other)
Пример #5
0
 def any(self):
     ret = ti.cmp_ne(self.entries[0], 0)
     for i in range(1, len(self.entries)):
         ret = ret + ti.cmp_ne(self.entries[i], 0)
     return -ti.cmp_lt(ret, 0)
Пример #6
0
 def __ne__(self, other):
     import taichi as ti
     _taichi_skip_traceback = 1
     return ti.cmp_ne(self, other)