Skip to content

Commit 12a8dd1

Browse files
committed
Implemented inheritance hierarchy to Python properties, added methods to properties on python side
1 parent 7bbeb75 commit 12a8dd1

File tree

7 files changed

+349
-190
lines changed

7 files changed

+349
-190
lines changed

core/properties/Spinor.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace cadabra {
1515

1616
int dimension;
1717
bool weyl;
18-
enum { positive, negative } chirality; // only in combination with weyl
18+
enum Chirality { positive, negative } chirality; // only in combination with weyl
1919
bool majorana;
2020
};
2121

core/properties/TableauBase.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
using namespace cadabra;
55

6+
std::string TableauBase::name() const
7+
{
8+
return "TableauBase";
9+
}
10+
611
int TableauBase::get_indexgroup(const Properties& pr, Ex& tr, Ex::iterator it, int indexnum) const
712
{
813
const TableauBase *pd;

core/properties/TableauBase.hh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
namespace cadabra {
88

9-
class TableauBase {
9+
class TableauBase : virtual public property {
1010
public:
1111
virtual ~TableauBase() {};
1212
typedef yngtab::filled_tableau<unsigned int> tab_t;
1313

14+
virtual std::string name() const;
15+
1416
virtual unsigned int size(const Properties&, Ex&, Ex::iterator) const=0;
1517
virtual tab_t get_tab(const Properties&, Ex&, Ex::iterator, unsigned int) const=0;
1618

core/properties/WeightInherit.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace cadabra {
2323
};
2424
virtual std::string name() const override;
2525

26-
enum { multiplicative, additive, power } combination_type;
26+
enum CombinationType { multiplicative, additive, power } combination_type;
2727

2828
multiplier_t value_self;
2929
};

0 commit comments

Comments
 (0)