def METHOD_NAME(X, w):
    res = 0
    # LOGGER.debug("_one_dimension_dot, len of w: {}, len of X: {}".format(len(w), len(X)))
    # If all weights are in one single IPCL encrypted number
    if paillier_check.is_single_ipcl_encrypted_number(w):
        if isinstance(X, csr_matrix):
            res = w.item(0).dot(X.data)
        else:
            res = w.item(0).dot(X)
        return res
    if isinstance(X, csr_matrix):
        for idx, value in zip(X.indices, X.data):
            res += value * w[idx]
    else:
        for i in range(len(X)):
            if np.fabs(X[i]) < 1e-5:
                continue
            res += w[i] * X[i]
    if res == 0:
        if paillier_check.is_paillier_encrypted_number(w[0]):
            res = 0 * w[0]
    return res