~ubuntu-branches/ubuntu/vivid/regina-normal/vivid

« back to all changes in this revision

Viewing changes to python/algebra/ngrouppresentation.cpp

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2014-08-29 17:37:46 UTC
  • mfrom: (19.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140829173746-igmqc9b67y366a7u
Tags: 4.96-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  Regina - A Normal Surface Theory Calculator                           *
5
5
 *  Python Interface                                                      *
6
6
 *                                                                        *
7
 
 *  Copyright (c) 1999-2013, Ben Burton                                   *
 
7
 *  Copyright (c) 1999-2014, Ben Burton                                   *
8
8
 *  For further details contact Ben Burton (bab@debian.org).              *
9
9
 *                                                                        *
10
10
 *  This program is free software; you can redistribute it and/or         *
61
61
        NGroupExpression::substitute, 2, 3);
62
62
    BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(OL_addGenerator,
63
63
        NGroupPresentation::addGenerator, 0, 1);
 
64
    BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(OL_nielsenCombine,
 
65
        NGroupPresentation::nielsenCombine, 3, 4);
 
66
 
 
67
    std::auto_ptr<NGroupExpression> newExpression_str(const std::string& str) {
 
68
        return std::auto_ptr<NGroupExpression>(new NGroupExpression(str, 0));
 
69
    }
64
70
 
65
71
    object getTerms_list(const NGroupExpression& e) {
66
72
        boost::python::list ans;
95
101
        p.writeTextCompact(std::cout);
96
102
    }
97
103
 
98
 
    regina::NHomGroupPresentation* intelligentSimplifyDetail_ptr(
99
 
            NGroupPresentation& p) {
100
 
        return p.intelligentSimplifyDetail().release();
101
 
    }
102
 
 
103
 
    regina::NAbelianGroup* abelianisation_ptr(const NGroupPresentation& p) {
104
 
        return p.abelianisation().release();
105
 
    }
106
 
 
107
 
    regina::NMarkedAbelianGroup* markedAbelianisation_ptr(
108
 
            const NGroupPresentation& p) {
109
 
        return p.markedAbelianisation().release();
110
 
    }
111
 
 
112
104
    BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(OL_proliferateRelators,
113
105
        NGroupPresentation::proliferateRelators, 0, 1);
114
106
}
120
112
        .def(init<unsigned long, long>())
121
113
        .def(init<const NGroupExpressionTerm&>())
122
114
        .def(self == self)
 
115
        .def(self < self)
123
116
        .def("inverse", &NGroupExpressionTerm::inverse)
124
117
        .def(self += self)
125
118
        .def(self_ns::str(self))
129
122
            std::auto_ptr<NGroupExpression>, boost::noncopyable>
130
123
            ("NGroupExpression")
131
124
        .def(init<const NGroupExpression&>())
 
125
        .def("__init__", boost::python::make_constructor(newExpression_str))
 
126
        .def(self == self)
132
127
        .def("getTerms", getTerms_list)
133
128
        .def("getNumberOfTerms", &NGroupExpression::getNumberOfTerms)
134
129
        .def("wordLength", &NGroupExpression::wordLength)
 
130
        .def("isTrivial", &NGroupExpression::isTrivial)
135
131
        .def("erase", &NGroupExpression::erase)
136
132
        .def("getTerm", getTerm_non_const, return_internal_reference<>())
137
133
        .def("getGenerator", &NGroupExpression::getGenerator)
142
138
        .def("addTermLast", addTermLast_pair)
143
139
        .def("addTermsFirst", &NGroupExpression::addTermsFirst)
144
140
        .def("addTermsLast", &NGroupExpression::addTermsLast)
 
141
        .def("addStringFirst", &NGroupExpression::addStringFirst)
 
142
        .def("addStringLast", &NGroupExpression::addStringLast)
145
143
        .def("cycleLeft", &NGroupExpression::cycleLeft)
146
144
        .def("cycleRight", &NGroupExpression::cycleRight)
147
145
        .def("inverse", &NGroupExpression::inverse,
168
166
        .def("getNumberOfRelations", &NGroupPresentation::getNumberOfRelations)
169
167
        .def("getRelation", &NGroupPresentation::getRelation,
170
168
            return_internal_reference<>())
 
169
        .def("isValid", &NGroupPresentation::isValid)
171
170
        .def("intelligentSimplify", &NGroupPresentation::intelligentSimplify)
172
171
        .def("intelligentSimplifyDetail",
173
 
            intelligentSimplifyDetail_ptr,
174
 
            return_value_policy<manage_new_object>())
 
172
            &NGroupPresentation::intelligentSimplifyDetail)
 
173
        .def("smallCancellation", &NGroupPresentation::smallCancellation)
 
174
        .def("smallCancellationDetail",
 
175
            &NGroupPresentation::smallCancellationDetail)
 
176
        .def("simplifyWord", &NGroupPresentation::simplifyWord)
175
177
        .def("proliferateRelators", &NGroupPresentation::proliferateRelators,
176
178
            OL_proliferateRelators())
 
179
        .def("identifyAbelian", &NGroupPresentation::identifyAbelian)
 
180
        .def("nielsenTransposition", &NGroupPresentation::nielsenTransposition)
 
181
        .def("nielsenInvert", &NGroupPresentation::nielsenInvert)
 
182
        .def("nielsenCombine", &NGroupPresentation::nielsenCombine,
 
183
            OL_nielsenCombine())
 
184
        .def("intelligentNielsen", &NGroupPresentation::intelligentNielsen)
 
185
        .def("intelligentNielsenDetail",
 
186
            &NGroupPresentation::intelligentNielsenDetail)
 
187
        .def("homologicalAlignment", &NGroupPresentation::homologicalAlignment)
 
188
        .def("homologicalAlignmentDetail",
 
189
            &NGroupPresentation::homologicalAlignmentDetail)
 
190
        .def("prettyRewriting", &NGroupPresentation::prettyRewriting)
 
191
        .def("prettyRewritingDetail",
 
192
            &NGroupPresentation::prettyRewritingDetail)
 
193
        .def("identifySimplyIsomorphicTo",
 
194
            &NGroupPresentation::identifySimplyIsomorphicTo)
177
195
        .def("recogniseGroup", &NGroupPresentation::recogniseGroup)
178
196
        .def("relatorLength", &NGroupPresentation::relatorLength)
179
 
        .def("abelianisation", abelianisation_ptr,
180
 
            return_value_policy<manage_new_object>())
181
 
        .def("markedAbelianisation", markedAbelianisation_ptr,
182
 
            return_value_policy<manage_new_object>())
 
197
        .def("abelianisation", &NGroupPresentation::abelianisation)
 
198
        .def("markedAbelianisation", &NGroupPresentation::markedAbelianisation)
183
199
        .def("toTeX", &NGroupPresentation::toTeX)
184
200
        .def("toStringCompact", &NGroupPresentation::toStringCompact)
185
201
        .def("compact", &NGroupPresentation::compact)