Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SortIncludes: Never
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
62 changes: 24 additions & 38 deletions affine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
/* local variables */

namespace affine {
using namespace error;
using namespace graph;
using namespace minroots;
using namespace error;
using namespace graph;
using namespace minroots;

/****************************************************************************

Expand All @@ -50,37 +50,30 @@ namespace affine {

****************************************************************************/

AffineCoxGroup::AffineCoxGroup(const Type& x, const Rank& l):CoxGroup(x,l)
{}
AffineCoxGroup::AffineCoxGroup(const Type &x, const Rank &l) : CoxGroup(x, l) {}

/**
Virtual destructor for the AffineCoxGroup class. Currently, nothing has
to be done.
*/
AffineCoxGroup::~AffineCoxGroup()
{}
AffineCoxGroup::~AffineCoxGroup() {}

AffineBigRankCoxGroup::AffineBigRankCoxGroup(const Type& x, const Rank& l)
: AffineCoxGroup(x,l)
{}
AffineBigRankCoxGroup::AffineBigRankCoxGroup(const Type &x, const Rank &l)
: AffineCoxGroup(x, l) {}

/**
Virtual destructor for the AffineBigRankCoxGroup class. Currently, nothing
has to be done.
*/
AffineBigRankCoxGroup::~AffineBigRankCoxGroup()
{}
AffineBigRankCoxGroup::~AffineBigRankCoxGroup() {}

GeneralABRCoxGroup::GeneralABRCoxGroup(const Type& x, const Rank& l)
:AffineBigRankCoxGroup(x,l)
{}
GeneralABRCoxGroup::GeneralABRCoxGroup(const Type &x, const Rank &l)
: AffineBigRankCoxGroup(x, l) {}

GeneralABRCoxGroup::~GeneralABRCoxGroup()
{}
GeneralABRCoxGroup::~GeneralABRCoxGroup() {}

AffineMedRankCoxGroup::AffineMedRankCoxGroup(const Type& x, const Rank& l)
:AffineCoxGroup(x,l)
{
AffineMedRankCoxGroup::AffineMedRankCoxGroup(const Type &x, const Rank &l)
: AffineCoxGroup(x, l) {
mintable().fill(graph());
/* an error is set here in case of failure */
}
Expand All @@ -89,40 +82,33 @@ AffineMedRankCoxGroup::AffineMedRankCoxGroup(const Type& x, const Rank& l)
Virtual destructor for the AffineMedRankCoxGroup class. The destruction
of the mintable should be the job of the CoxGroup destructor.
*/
AffineMedRankCoxGroup::~AffineMedRankCoxGroup()
{}
AffineMedRankCoxGroup::~AffineMedRankCoxGroup() {}

GeneralAMRCoxGroup::GeneralAMRCoxGroup(const Type& x, const Rank& l)
:AffineMedRankCoxGroup(x,l)
{}
GeneralAMRCoxGroup::GeneralAMRCoxGroup(const Type &x, const Rank &l)
: AffineMedRankCoxGroup(x, l) {}

/**
Virtual destructor for the GeneralAMRCoxGroup class. Currently, nothing has
to be done.
*/
GeneralAMRCoxGroup::~GeneralAMRCoxGroup()
{}
GeneralAMRCoxGroup::~GeneralAMRCoxGroup() {}

AffineSmallRankCoxGroup::AffineSmallRankCoxGroup(const Type& x, const Rank& l)
:AffineMedRankCoxGroup(x,l)
{}
AffineSmallRankCoxGroup::AffineSmallRankCoxGroup(const Type &x, const Rank &l)
: AffineMedRankCoxGroup(x, l) {}

/**
Virtual destructor for the AffineSmallRankCoxGroup class. Currently,
nothing has to be done.
*/
AffineSmallRankCoxGroup::~AffineSmallRankCoxGroup()
{}
AffineSmallRankCoxGroup::~AffineSmallRankCoxGroup() {}

GeneralASRCoxGroup::GeneralASRCoxGroup(const Type& x, const Rank& l)
:AffineSmallRankCoxGroup(x,l)
{}
GeneralASRCoxGroup::GeneralASRCoxGroup(const Type &x, const Rank &l)
: AffineSmallRankCoxGroup(x, l) {}

/**
Virtual destructor for the GeneralASRCoxGroup class. Currently, nothing has
to be done.
*/
GeneralASRCoxGroup::~GeneralASRCoxGroup()
{}
GeneralASRCoxGroup::~GeneralASRCoxGroup() {}

}
} // namespace affine
128 changes: 66 additions & 62 deletions affine.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,96 +5,102 @@
See file main.cpp for full copyright notice
*/

#ifndef AFFINE_H /* guarantee single inclusion */
#define AFFINE_H
#pragma once

#include "globals.h"
#include "coxgroup.h"

namespace affine {
using namespace coxeter;
using namespace coxeter;

//******** type declarations *************************************************
class AffineCoxGroup;
class AffineBigRankCoxGroup;
class GeneralABRCoxGroup;
class AffineMedRankCoxGroup;
class GeneralAMRCoxGroup;
class AffineSmallRankCoxGroup;
class GeneralASRCoxGroup;
class AffineCoxGroup;
class AffineBigRankCoxGroup;
class GeneralABRCoxGroup;
class AffineMedRankCoxGroup;
class GeneralAMRCoxGroup;
class AffineSmallRankCoxGroup;
class GeneralASRCoxGroup;

//******** type definitions **************************************************

class AffineCoxGroup : public CoxGroup {
public:
/* constructors and destructors */
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(AffineCoxGroup));}

AffineCoxGroup(const Type& x, const Rank& l);
public:
/* constructors and destructors */
void *operator new(size_t size) { return arena().alloc(size); }
void operator delete(void *ptr) {
return arena().free(ptr, sizeof(AffineCoxGroup));
}

AffineCoxGroup(const Type &x, const Rank &l);
virtual ~AffineCoxGroup();
/* accessors */
CoxSize order() const; /* inlined */
/* accessors */
CoxSize order() const; /* inlined */
};

class AffineBigRankCoxGroup : public AffineCoxGroup {
public:
/* constructors and destructors */
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(AffineBigRankCoxGroup));}
AffineBigRankCoxGroup(const Type& x, const Rank& l);
public:
/* constructors and destructors */
void *operator new(size_t size) { return arena().alloc(size); }
void operator delete(void *ptr) {
return arena().free(ptr, sizeof(AffineBigRankCoxGroup));
}
AffineBigRankCoxGroup(const Type &x, const Rank &l);
virtual ~AffineBigRankCoxGroup();
};

class GeneralABRCoxGroup:public AffineBigRankCoxGroup {
public:
/* constructors and destructors */
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(GeneralABRCoxGroup));}
GeneralABRCoxGroup(const Type& x, const Rank& l);
class GeneralABRCoxGroup : public AffineBigRankCoxGroup {
public:
/* constructors and destructors */
void *operator new(size_t size) { return arena().alloc(size); }
void operator delete(void *ptr) {
return arena().free(ptr, sizeof(GeneralABRCoxGroup));
}
GeneralABRCoxGroup(const Type &x, const Rank &l);
~GeneralABRCoxGroup();
};

class AffineMedRankCoxGroup : public AffineCoxGroup {
public:
/* constructors and destructors */
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(AffineMedRankCoxGroup));}
AffineMedRankCoxGroup(const Type& x, const Rank& l);
public:
/* constructors and destructors */
void *operator new(size_t size) { return arena().alloc(size); }
void operator delete(void *ptr) {
return arena().free(ptr, sizeof(AffineMedRankCoxGroup));
}
AffineMedRankCoxGroup(const Type &x, const Rank &l);
virtual ~AffineMedRankCoxGroup();
};

class GeneralAMRCoxGroup:public AffineMedRankCoxGroup {
public:
/* constructors and destructors */
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(GeneralAMRCoxGroup));}
GeneralAMRCoxGroup(const Type& x, const Rank& l);
class GeneralAMRCoxGroup : public AffineMedRankCoxGroup {
public:
/* constructors and destructors */
void *operator new(size_t size) { return arena().alloc(size); }
void operator delete(void *ptr) {
return arena().free(ptr, sizeof(GeneralAMRCoxGroup));
}
GeneralAMRCoxGroup(const Type &x, const Rank &l);
~GeneralAMRCoxGroup();
};

class AffineSmallRankCoxGroup : public AffineMedRankCoxGroup {
public:
/* constructors and destructors */
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(AffineSmallRankCoxGroup));}
AffineSmallRankCoxGroup(const Type& x, const Rank& l);
public:
/* constructors and destructors */
void *operator new(size_t size) { return arena().alloc(size); }
void operator delete(void *ptr) {
return arena().free(ptr, sizeof(AffineSmallRankCoxGroup));
}
AffineSmallRankCoxGroup(const Type &x, const Rank &l);
virtual ~AffineSmallRankCoxGroup();
};

class GeneralASRCoxGroup:public AffineSmallRankCoxGroup {
public:
/* constructors and destructors */
void* operator new(size_t size) {return arena().alloc(size);}
void operator delete(void* ptr)
{return arena().free(ptr,sizeof(GeneralASRCoxGroup));}
GeneralASRCoxGroup(const Type& x, const Rank& l);
class GeneralASRCoxGroup : public AffineSmallRankCoxGroup {
public:
/* constructors and destructors */
void *operator new(size_t size) { return arena().alloc(size); }
void operator delete(void *ptr) {
return arena().free(ptr, sizeof(GeneralASRCoxGroup));
}
GeneralASRCoxGroup(const Type &x, const Rank &l);
~GeneralASRCoxGroup();
};

Expand All @@ -103,7 +109,5 @@ class GeneralASRCoxGroup:public AffineSmallRankCoxGroup {
/**
Return the order of this Coxeter group, which is infinite.
*/
inline CoxSize AffineCoxGroup::order() const {return infinite_coxsize;}
}

#endif
inline CoxSize AffineCoxGroup::order() const { return infinite_coxsize; }
} // namespace affine
22 changes: 11 additions & 11 deletions automata.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This is automata.cpp

Coxeter version 3.0 Copyright (C) 2002 Fokko du Cloux
See file main.cpp for full copyright notice
*/
Expand All @@ -10,7 +10,7 @@
#include "memory.h"

namespace automata {
using namespace memory;
using namespace memory;
};

/****************************************************************************
Expand Down Expand Up @@ -44,28 +44,28 @@ namespace automata {
namespace automata {

ExplicitAutomaton::ExplicitAutomaton(Ulong n, Ulong m)
:d_accept(n),d_rank(m),d_size(n)
: d_accept(n), d_rank(m), d_size(n)

{
d_table = (State **)arena().alloc(d_size*sizeof(Ulong *));
d_table[0] = (State *)arena().alloc(d_size*d_rank*sizeof(Ulong));
d_table = (State **)arena().alloc(d_size * sizeof(Ulong *));
d_table[0] = (State *)arena().alloc(d_size * d_rank * sizeof(Ulong));

for (Ulong j = 1; j < d_size; ++j)
d_table[j] = d_table[j-1] + d_rank;
d_table[j] = d_table[j - 1] + d_rank;
}

ExplicitAutomaton::~ExplicitAutomaton()

/*
The memory allocated directly by ExplicitAutomaton is the one for
the table, and for the pointers to the rows. Recall that the number of
states is recorded in d_size, the number of letters in the alphabet in
the table, and for the pointers to the rows. Recall that the number of
states is recorded in d_size, the number of letters in the alphabet in
d_rank. Hence we have the size of our allocation.
*/

{
arena().free(d_table[0],d_size*d_rank*sizeof(Ulong));
arena().free(d_table,d_size*sizeof(Ulong *));
arena().free(d_table[0], d_size * d_rank * sizeof(Ulong));
arena().free(d_table, d_size * sizeof(Ulong *));
}

};
}; // namespace automata
Loading