Skip to content

Commit 2c53f08

Browse files
committed
add sage.features.ecm
1 parent 7a9ce37 commit 2c53f08

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

src/sage/features/ecm.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# -*- coding: utf-8 -*-
2+
r"""
3+
Feature for testing the presence of ``ecm`` or ``gmp-ecm``
4+
"""
5+
# ****************************************************************************
6+
# Copyright (C) 2032 Dima Pasechnik <[email protected]>
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation, either version 2 of the License, or
11+
# (at your option) any later version.
12+
# https://www.gnu.org/licenses/
13+
# ****************************************************************************
14+
15+
from . import Executable
16+
from sage.env import SAGE_ECMBIN
17+
18+
19+
class Ecm(Executable):
20+
r"""
21+
A :class:`~sage.features.Feature` describing the presence of :ref:`GMP-ECM <spkg_ecm>`.
22+
23+
EXAMPLES::
24+
25+
sage: from sage.features.ecm import Ecm
26+
sage: Ecm().is_present()
27+
FeatureTestResult('ecm', True)
28+
"""
29+
def __init__(self):
30+
r"""
31+
TESTS::
32+
33+
sage: from sage.features.ecm import Ecm
34+
sage: isinstance(Ecm(), Ecm)
35+
True
36+
"""
37+
Executable.__init__(self, name="ecm", executable=SAGE_ECMBIN,
38+
spkg="ecm", type="standard")
39+
40+
41+
def all_features():
42+
return [Ecm()]

0 commit comments

Comments
 (0)