AlVin  1.0
A C++ implementation of the Vinberg's algorithm for Q, Q( sqrt(d) ) and Q( cos(2 pi / 7) )
rationalinteger_alvin.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2014, 2015, 2016
3 Rafael Guglielmetti, rafael.guglielmetti@unifr.ch
4 */
5 
6 /*
7 This file is part of AlVin.
8 
9 CoxIter is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as
11 published by the Free Software Foundation, either version 3 of the
12 License, or (at your option) any later version.
13 
14 CoxIter is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with AlVin. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
31 #ifndef RATIONAL_INTEGER_ALVIN_H
32 #define RATIONAL_INTEGER_ALVIN_H
33 
34 #include <iterator>
35 
36 #include "rationalinteger.h"
37 #include "alvin.h"
39 
41 {
42  private:
43  vector< unsigned int > riQF;
44  vector< unsigned int > iGCDs;
45  bool bLastTwoCoefficientsQFAre1Mod4;
46 
47  vector< int > iBilinearProducts;
48  vector< int > iVectorCurrent;
49  vector< vector< int > > iVectors;
50 
51  public:
52  RationalInteger_AlVin( const vector< int >& iQuadraticFormCoeffs, const string &strOuputMathematicalFormat, const bool& bWriteInfo, const bool& bDebug );
53 
54  virtual string get_strField() const;
55 
56  private:
57  void findPossibleNorms2();
58 
59  bool PreRun();
60 
61  void findVector( AlgebraicInteger* aiX0, AlgebraicInteger* aiNorm2 );
62 
74  void findVector( const unsigned int& i0, const unsigned int& iNorm2, unsigned int iIndex = 1, unsigned int iSumComp = 0, unsigned int iGCDComponents = 1 );
75 
76  void addCandidate();
77  bool bCandidatePreserveEvenLattice( const unsigned int& iNorm2 ) const;
78 
79  virtual void addVectorChild( const vector< AlgebraicInteger* >& aiVector );
80  virtual int addVector_iFindWeight( AlgebraicInteger* aiNumerator, AlgebraicInteger* aiDenominator );
81 };
82 
83 #endif // RATIONAL_INTEGER_ALVIN_H
Main class for AlVin.
Definition: alvin.h:52
Parent class for rational, quadratic and rc7 integers.
Definition: algebraicinteger.h:43
bool bWriteInfo
If we want to write informations (false if AlVin is used "as a plugin")
Definition: alvin.h:60
virtual string get_strField() const
Return the field of definition of the current quadratic form.
Definition: rationalinteger_alvin.cpp:329
bool bDebug
If true, more information are displayed.
Definition: alvin.h:59
Find the vectors for rational integers.
Definition: rationalinteger_alvin.h:40