Checks if the input vector is a zero vector.

    :param vector_in: input vector
    :type vector_in: list, tuple
    :param tol: tolerance value
    :type tol: float
    :return: True if the input vector is zero, False otherwise
    :rtype: bool
359235
def vector_is_zero(vector_in, tol=10e-8):
    
    if not isinstance(vector_in, (list, tuple)):
        raise TypeError("Input vector must be a list or a tuple")

    res = [False for _ in range(len(vector_in))]
    for idx in range(len(vector_in)):
        if abs(vector_in[idx]) < tol:
            res[idx] = True
    return all(res)
979571
final boolean is(ScalarAttributeType scalarAttributeType, Vector vector) {
        return param(0) != null && param(0).is(scalarAttributeType) && is(vector);
    }
680294
def isvector_or_scalar(a):
    
    try:
        return a.size and a.ndim-a.shape.count(1) <= 1
    except:
        return False
780303
def is_voigt_symmetric(self, tol=1e-6):
        
        transpose_pieces = [[[0 for i in range(self.rank % 2)]]]
        transpose_pieces += [[range(j, j + 2)] for j in
                             range(self.rank % 2, self.rank, 2)]
        for n in range(self.rank % 2, len(transpose_pieces)):
            if len(transpose_pieces[n][0]) == 2:
                transpose_pieces[n] += [transpose_pieces[n][0][::-1]]
        for trans_seq in itertools.product(*transpose_pieces):
            trans_seq = list(itertools.chain(*trans_seq))
            if (self - self.transpose(trans_seq) > tol).any():
                return False
        return True
1104922
def validate(self, instance, value):
        """"""

        value = super(BaseVector, self).validate(instance, value)

        if self.length is not None:
            try:
                value.length = self._length_array(value)
            except ZeroDivisionError:
                self.error(
                    instance, value,
                    error_class=ZeroDivValidationError,
                    extra='The vector must have a length specified.'
                )
        return value
946441
def clean_with_zeros(self,x):
        
        x[~np.any(np.isnan(x) | np.isinf(x),axis=1)] = 0
        return x
1363480
def zero(self):
        
        return self.element(np.zeros(self.shape, dtype=self.dtype,
                                     order=self.default_order))
530332
function equalVectors (x1, y1, x2, y2, tol) {
  tol = tol || 0
  return Math.abs(x1 - x2) < tol && Math.abs(y1 - y2) < tol
}
1204839
public static boolean isHermitian(ZMatrixRMaj Q , double tol ) {
        if( Q.numCols != Q.numRows )
            return false;

        Complex_F64 a = new Complex_F64();
        Complex_F64 b = new Complex_F64();

        for( int i = 0; i < Q.numCols; i++ ) {
            for( int j = i; j < Q.numCols; j++ ) {
                Q.get(i,j,a);
                Q.get(j,i,b);

                if( Math.abs(a.real-b.real)>tol)
                    return false;
                if( Math.abs(a.imaginary+b.imaginary)>tol)
                    return false;
            }
        }

        return true;
    }
870502
def _equals(v1_indices, v1_values, v2_indices, v2_values):
        
        v1_size = len(v1_values)
        v2_size = len(v2_values)
        k1 = 0
        k2 = 0
        all_equal = True
        while all_equal:
            while k1 < v1_size and v1_values[k1] == 0:
                k1 += 1
            while k2 < v2_size and v2_values[k2] == 0:
                k2 += 1

            if k1 >= v1_size or k2 >= v2_size:
                return k1 >= v1_size and k2 >= v2_size

            all_equal = v1_indices[k1] == v2_indices[k2] and v1_values[k1] == v2_values[k2]
            k1 += 1
            k2 += 1
        return all_equal
736908
def zero_handling(x):
    
    return np.where(x == 0, np.finfo(float).eps, x)
1188618
def is_same_vectors(self, vec_set1, vec_set2):
        
        if (np.absolute(rel_strain(vec_set1[0], vec_set2[0])) >
                self.max_length_tol):
            return False
        elif (np.absolute(rel_strain(vec_set1[1], vec_set2[1])) >
                  self.max_length_tol):
            return False
        elif (np.absolute(rel_angle(vec_set1, vec_set2)) >
                  self.max_angle_tol):
            return False
        else:
            return True
115837
def get_input_vector(self, ind):
        
        dim = self.get_dimension()
        b = fasttext.Vector(dim)
        self.f.getInputVector(b, ind)
        return np.array(b)
467486
def vector_check(vector):
    
    for i in vector:
        if isinstance(i, int) is False:
            return False
        if i < 0:
            return False
    return True
467631
public boolean isScaleAndShift(double tol) {
		return xy * xy + yx * yx < (xx * xx + yy * yy) * tol;
	}
787800
def tokprob(self, tok, nonT):
        

        p = self._T.get(tok, 0) / float(self._T.get(nonT, 1))
        if not p:
            p = MIN_PROB
        return p
606774
def vector_cross(vector1, vector2):
    
    try:
        if vector1 is None or len(vector1) == 0 or vector2 is None or len(vector2) == 0:
            raise ValueError("Input vectors cannot be empty")
    except TypeError as e:
        print("An error occurred: {}".format(e.args[-1]))
        raise TypeError("Input must be a list or tuple")
    except Exception:
        raise

    if not 1 < len(vector1) <= 3 or not 1 < len(vector2) <= 3:
        raise ValueError("The input vectors should contain 2 or 3 elements")

    # Convert 2-D to 3-D, if necessary
    if len(vector1) == 2:
        v1 = [float(v) for v in vector1] + [0.0]
    else:
        v1 = vector1

    if len(vector2) == 2:
        v2 = [float(v) for v in vector2] + [0.0]
    else:
        v2 = vector2

    # Compute cross product
    vector_out = [(v1[1] * v2[2]) - (v1[2] * v2[1]),
                  (v1[2] * v2[0]) - (v1[0] * v2[2]),
                  (v1[0] * v2[1]) - (v1[1] * v2[0])]

    # Return the cross product of the input vectors
    return vector_out