32#if defined(IntegerMatrixFunctions_RECURSES)
33#error Recursive header files inclusion detected in IntegerMatrixFunctions.h
36#define IntegerMatrixFunctions_RECURSES
38#if !defined IntegerMatrixFunctions_h
40#define IntegerMatrixFunctions_h
44#include "DGtal/base/Common.h"
45#include "DGtal/kernel/ArithmeticConversionTraits.h"
46#include "DGtal/arithmetic/IntegerComputer.h"
47#include "DGtal/math/linalg/SimpleMatrix.h"
59 template <
typename TComponent>
61 negate( std::vector<TComponent> &V );
71 template <
typename TComponent>
73 equals(
const std::vector<TComponent> &a,
const std::vector<TComponent> &b );
85 template <
typename T,
typename U >
87 dotProduct(
const std::vector<T>& a,
const std::vector<U>& b );
97 dotProduct(
const std::vector<BigInteger>& a,
const std::vector<double>& b );
107 dotProduct(
const std::vector<double>& a,
const std::vector<BigInteger>& b );
118 template <
typename T,
typename U >
119 std::vector< typename DGtal::ArithmeticConversionTraits<T,U>::type >
135 template <
typename T,
typename U,
typename Op2 >
136 std::vector< typename DGtal::ArithmeticConversionTraits<T,U>::type >
137 apply(
const std::vector<T>& a,
const std::vector<U>& b,
149 template <
typename T>
160 template <
typename T>
171 template <
typename T>
183 template <
typename TOutput,
typename T>
213 template <
typename TOutput,
215 typename TEuclideanRing,
238 typename TInternalNumber>
258 template <
typename TComponent,
typename TInternalNumber>
261 const std::vector< std::vector< TComponent > >& matrix );
273 template <
typename TComponent>
274 std::vector< std::vector< TComponent > >
276 const std::vector< TComponent >& c );
288 template <
typename TComponent, DGtal::Dimension TM, DGtal::Dimension TN>
289 std::vector< std::vector< TComponent > >
322 template <
typename TComponent,
typename TDouble =
long double >
323 std::vector< std::vector< TComponent > >
325 TDouble delta = 0.75 );
357 template <
typename TComponent,
typename TDouble =
long double >
360 TDouble delta = 0.75 );
370 template <
typename TComponent>
383 template <
typename TComponent>
385 extendedGcd( TComponent& x, TComponent& y, TComponent a,TComponent b );
398 template <
typename TComponent>
400 extendedGcd( std::vector<TComponent> &C,
const std::vector<TComponent> &
A );
422 template <
typename TComponent>
423 std::vector< std::vector< TComponent > >
435 template <
typename TComponent>
438 std::vector< TComponent >& v );
451 template <
typename TComponent>
462#include "DGtal/math/linalg/IntegerMatrixFunctions.ih"
469#undef IntegerMatrixFunctions_RECURSES
Aim: Implements basic operations that will be used in Point and Vector classes.
Aim: implements basic MxN Matrix services (M,N>=1).
std::vector< std::vector< TComponent > > matrixAsVectorVector(std::size_t m, std::size_t n, const std::vector< TComponent > &c)
bool shortenVectors(std::vector< TComponent > &u, std::vector< TComponent > &v)
std::vector< typename DGtal::ArithmeticConversionTraits< T, U >::type > apply(const std::vector< T > &a, const std::vector< U > &b, Op2 op2)
void getSquaredNormL2(TOutput &n, const std::vector< T > &a)
void reduceBasisWithLLL(std::vector< std::vector< TComponent > > &B, TDouble delta=0.75)
T normLoo(const std::vector< T > &a)
std::size_t shortenBasis(std::vector< std::vector< TComponent > > &B)
T squaredNormL2(const std::vector< T > &a)
bool equals(const std::vector< TComponent > &a, const std::vector< TComponent > &b)
std::vector< typename DGtal::ArithmeticConversionTraits< T, U >::type > crossProduct(const std::vector< T > &a, const std::vector< U > &b)
DGtal::ArithmeticConversionTraits< T, U >::type dotProduct(const std::vector< T > &a, const std::vector< U > &b)
std::vector< std::vector< TComponent > > computeLLLBasis(const std::vector< std::vector< TComponent > > &B, TDouble delta=0.75)
TComponent makePrimitive(std::vector< TComponent > &N)
std::vector< std::vector< TComponent > > computeOrthogonalLattice(std::vector< TComponent > N)
void negate(std::vector< TComponent > &V)
void getDeterminantBareiss(TInternalNumber &result, const SimpleMatrix< TComponent, TN, TN > &matrix)
TComponent extendedGcd(TComponent &x, TComponent &y, TComponent a, TComponent b)
T normL1(const std::vector< T > &a)
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Aim: Trait class to get result type of arithmetic binary operators between two given types.