Mackey  V3.1
A C++ library for computing RO(G) graded homology
AbelianGroup< T > Class Template Reference

#include <Abelian.hpp>

Inheritance diagram for AbelianGroup< T >:
[legend]

Public Member Functions

 AbelianGroup ()=default
 Default constructor (trivial group) More...
 
 AbelianGroup (const T &a)
 
bool istrivial () const
 Returns 1 if group is trivial. More...
 
bool iscyclic () const
 Returns 1 if group is cyclic. More...
 
auto operator[] (int i) const
 Returns the i-th summand of the group (unmutable). If the i-th summand is Z then this returns 1 and if it's Z/n it returns n. More...
 
auto & operator[] (int i)
 Returns the i-th summand of the group (mutable reference version). If the i-th summand is Z then this returns 1 and if it's Z/n it returns n. More...
 
int number_of_summands () const
 Returns the number of direct summands of the group. More...
 
bool operator== (const AbelianGroup< T > &G) const
 Compares for isomorphism. More...
 
bool operator!= (const AbelianGroup< T > &G) const
 Compares for non-isomorphism. More...
 
AbelianGroup< T > operator+ (const AbelianGroup< T > &G) const
 The direct sum of groups. No sorting! More...
 
int order () const
 The order of the group. Returns 0 if it's infinite. More...
 
int order (const T &element) const
 The order of an element in the group, provided as an array that expresses it as a linear combination of the generators. Returns 0 if it's infinite. More...
 
template<typename Scalar >
void normalize (Eigen::Matrix< Scalar, -1, -1 > &linmap) const
 Normalize linear map whose range is this group (reduce n in Z/n to 0 etc.). More...
 
void normalize (T &element) const
 Normalizes an element in the group to have minimal amount of signs amongst its multiples. More...
 
auto span (const T &a, const std::vector< T > &b) const
 Expresses a as a linear combination of elements b[i] in the group. If a is not in their span, returns empty matrix. More...
 
bool inSpan (const T &a, const std::vector< T > &b) const
 Finds if an element is in the span of other given elements in the group. More...
 
int isMultiple (const T &a, const T &b) const
 Returns k if a=k*b in group. Returns 0 if a is not a multiple of b (so make sure a!=0) More...
 
std::pair< std::vector< dense_t< T > >, std::vector< dense_t< T > > > all_automorphisms () const
 Returns all automorphisms of the group together with their inverses. Currently only for p-groups and Z+p-groups (otherwise returns empty) More...
 

Friends

template<typename S >
std::ostream & operator<< (std::ostream &os, const AbelianGroup< S > &A)
 

Detailed Description

template<typename T>
class Mackey::AbelianGroup< T >

Class for finitely generated abelian groups

Constructor & Destructor Documentation

◆ AbelianGroup() [1/2]

AbelianGroup ( )
default

Default constructor (trivial group)

◆ AbelianGroup() [2/2]

AbelianGroup ( const T &  a)

Given an array of numbers a[0],a[1],...,a[n] constructs the group G(a[0])+G(a[1])+...+G(a[n]) where G(1)=Z and G(n)=Z/n if n>=1 We assume that in the provided array, a[i] divides a[j] if i<=j

Member Function Documentation

◆ istrivial()

bool istrivial ( ) const

Returns 1 if group is trivial.

◆ iscyclic()

bool iscyclic ( ) const

Returns 1 if group is cyclic.

◆ operator[]() [1/2]

auto operator[] ( int  i) const

Returns the i-th summand of the group (unmutable). If the i-th summand is Z then this returns 1 and if it's Z/n it returns n.

◆ operator[]() [2/2]

auto& operator[] ( int  i)

Returns the i-th summand of the group (mutable reference version). If the i-th summand is Z then this returns 1 and if it's Z/n it returns n.

◆ number_of_summands()

int number_of_summands ( ) const

Returns the number of direct summands of the group.

◆ operator==()

bool operator== ( const AbelianGroup< T > &  G) const

Compares for isomorphism.

◆ operator!=()

bool operator!= ( const AbelianGroup< T > &  G) const

Compares for non-isomorphism.

◆ operator+()

AbelianGroup<T> operator+ ( const AbelianGroup< T > &  G) const

The direct sum of groups. No sorting!

◆ order() [1/2]

int order ( ) const

The order of the group. Returns 0 if it's infinite.

◆ order() [2/2]

int order ( const T &  element) const

The order of an element in the group, provided as an array that expresses it as a linear combination of the generators. Returns 0 if it's infinite.

◆ normalize() [1/2]

void normalize ( Eigen::Matrix< Scalar, -1, -1 > &  linmap) const

Normalize linear map whose range is this group (reduce n in Z/n to 0 etc.).

◆ normalize() [2/2]

void normalize ( T &  element) const

Normalizes an element in the group to have minimal amount of signs amongst its multiples.

◆ span()

auto span ( const T &  a,
const std::vector< T > &  b 
) const

Expresses a as a linear combination of elements b[i] in the group. If a is not in their span, returns empty matrix.

◆ inSpan()

bool inSpan ( const T &  a,
const std::vector< T > &  b 
) const

Finds if an element is in the span of other given elements in the group.

◆ isMultiple()

int isMultiple ( const T &  a,
const T &  b 
) const

Returns k if a=k*b in group. Returns 0 if a is not a multiple of b (so make sure a!=0)

◆ all_automorphisms()

std::pair<std::vector<dense_t<T> >, std::vector<dense_t<T> > > all_automorphisms ( ) const

Returns all automorphisms of the group together with their inverses. Currently only for p-groups and Z+p-groups (otherwise returns empty)

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const AbelianGroup< S > &  A 
)
friend

The documentation for this class was generated from the following file: