Note that I removed several #define whose purpose was to avoid typing "typename
ctraits<t>::…". Even though this tends to complicates the code, this is
probably safer, especially since the #define was capturing a free variable (t).
As a consequence, the singleton implementation has to be made thread-safe.
Also implement the singleton pattern using a namespace, rather than a static
instance.
There were two implementations of integer exponentiation. Merge them into a new
file under utils/cc/.
By the way, optimize it using exponentiation by squaring.
We now use a initializer list constructor for creating symmetries of the form
$y^n$, $y^n u^m$, $y^nu^m\sigma^k$.
The constructor taking a single integer is used to initialize a symmetry of a
given length.
Similar changes are made to IntSequence.
This behavior is similar to std::vector.
On Windows, this means that a POSIX threads implementation is no longer needed,
since C++11 threads are implemented using native Windows threads.
On GNU/Linux and macOS, POSIX threads are still used under the hood.
A new m4 macro (AX_CXX11_THREAD) is used to add the proper compilation
flags (instead of AX_PTHREAD).
- Remove the GeneralMatrix(const ConstVector &) constructor, since it is hides
a memory allocation (copying the ConstVector into a fresh Vector). This
helped detecting and fixing several unneeded memory allocations. Some other
memory allocations are now more visible (with an explicit Vector{}
constructor).
- Add checks in GeneralMatrix(Vector, …) and ConstGeneralMatrix(ConstVector, …)
constructors for verifying that the {Const,}Vector has unit-stride (this was
an implicit assumption so far) and is large enough for storing rows*cols
elements.
- Add GeneralMatrix::operator=(const ConstGeneralMatrix &).
- Delete ConstGeneralMatrix::operator=().
- these classes now encapsulate a std::shared_ptr<{const, }double>, so that
they do not perform memory management, and several {Const,}Vector instances
can transparently share the same underlying data
- make converting constructor from ConstVector to Vector explicit, since that
entails memory allocation (but the reverse conversion is almost costless, so
keep it implicit); do the same for GeneralMatrix/ConstGeneralMatrix,
TwoDMatrix/ConstTwoDMatrix
- remove the constructors that were extracting a row/column from a matrix, and
replace them by getRow() and getCol() methods on {Const,}GeneralMatrix
- rename and change the API of the complex version Vector::add(), so that it is
explicit that it deals with complex numbers
- add constructors that take a MATLAB mxArray
The criterium was previously incorrectly applied to the square absolute value of
eigenvalues. Rather apply it to the absolute value itself (as done in
mjdgges.m and the AIM solver).
Closes#1632