This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a929bc1
commit 80f5791
Showing
10 changed files
with
411 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
libantic* | ||
Makefile | ||
build/ | ||
antic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*============================================================================= | ||
This file is part of Antic. | ||
Antic 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/>. | ||
=============================================================================*/ | ||
/****************************************************************************** | ||
Copyright (C) 2014 William Hart | ||
******************************************************************************/ | ||
|
||
#include "nf_elem.h" | ||
|
||
void nf_elem_get_coeff_fmpq(fmpq_t a, const nf_elem_t b, | ||
slong i, const nf_t nf) | ||
{ | ||
if (nf->flag & NF_LINEAR) | ||
{ | ||
if (i > 0) | ||
fmpq_zero(a); | ||
else | ||
{ | ||
fmpz_set(fmpq_numref(a), LNF_ELEM_NUMREF(b)); | ||
fmpz_set(fmpq_denref(a), LNF_ELEM_DENREF(b)); | ||
} | ||
} else if (nf->flag & NF_QUADRATIC) | ||
{ | ||
const fmpz * const bnum = QNF_ELEM_NUMREF(b); | ||
|
||
if (i > 2) /* element may be unreduced */ | ||
fmpq_zero(a); | ||
else | ||
{ | ||
fmpz_set(fmpq_numref(a), bnum + i); | ||
fmpz_set(fmpq_denref(a), QNF_ELEM_DENREF(b)); | ||
} | ||
|
||
fmpq_canonicalise(a); | ||
} else | ||
fmpq_poly_get_coeff_fmpq(a, NF_ELEM(b), i); | ||
} |
Oops, something went wrong.