<commit_before>/*
    Copyright (C) 2012 <NAME>
    Copyright (C) 2013 <NAME>

    This file is part of FLINT.

    FLINT is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License (LGPL) as published
    by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.  See <http://www.gnu.org/licenses/>.
*/

#ifdef T

#include "templates.h"

int
_TEMPLATE(T, poly_divides) (
    TEMPLATE(T, struct) * Q,
    const TEMPLATE(T, struct) * A, slong lenA,
    const TEMPLATE(T, struct) * B, slong lenB,
    const TEMPLATE(T, t) invB,
    const TEMPLATE(T, ctx_t) ctx)
{
    TEMPLATE(T, struct) * R;
    slong lenR = 0;

    R = _TEMPLATE(T, vec_init) (lenA, ctx);

    _TEMPLATE(T, poly_divrem) (Q, R, A, lenA, B, lenB, invB, ctx);

    TEMPLATE(CAP_T, VEC_NORM) (R, lenR, ctx);
    _TEMPLATE(T, vec_clear) (R, lenA, ctx);

    return (lenR == 0);
}

int
TEMPLATE(T, poly_divides) (TEMPLATE(T, poly_t) Q,
                           const TEMPLATE(T, poly_t) A,
                           const TEMPLATE(T, poly_t) B,
                           const TEMPLATE(T, ctx_t) ctx)<commit_msg>Fix bug in fq_poly_divides.<commit_after>/*
    Copyright (C) 2012 <NAME>
    Copyright (C) 2013 <NAME>

    This file is part of FLINT.

    FLINT is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License (LGPL) as published
    by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.  See <http://www.gnu.org/licenses/>.
*/

#ifdef T

#include "templates.h"

int
_TEMPLATE(T, poly_divides) (
    TEMPLATE(T, struct) * Q,
    const TEMPLATE(T, struct) * A, slong lenA,
    const TEMPLATE(T, struct) * B, slong lenB,
    const TEMPLATE(T, t) invB,
    const TEMPLATE(T, ctx_t) ctx)
{
    TEMPLATE(T, struct) * R;
    slong lenR = lenA - lenB + 1;

    R = _TEMPLATE(T, vec_init) (lenA, ctx);

    _TEMPLATE(T, poly_divrem) (Q, R, A, lenA, B, lenB, invB, ctx);

    TEMPLATE(CAP_T, VEC_NORM) (R, lenR, ctx);
    _TEMPLATE(T, vec_clear) (R, lenA, ctx);

    return (lenR == 0);
}

int
TEMPLATE(T, poly_divides) (TEMPLATE(T, poly_t) Q,
                           const TEMPLATE(T, poly_t) A,
                           const TEMPLATE(T, poly_t) B,
                           const TEMPLATE(T, ctx_t) ctx)
{'fraction_non_alphanumeric': 0.11835548172757475, 'fraction_numerical': 0.009966777408637873, 'mean_word_length': 2.5636094674556213, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3486977', 'n_tokens_mistral': 952, 'n_tokens_neox': 892, 'n_words': 286}