added traits for bitvector class

This commit is contained in:
2026-01-29 18:12:04 +01:00
parent febb19d15f
commit febc20965a

View File

@@ -19,9 +19,11 @@
#ifndef _BITVECTOR_H_
#define _BITVECTOR_H_
#include "la_traits.h"
#include "vec.h"
#include "numbers.h"
#include "laerror.h"
#include <stdint.h>
//TODO: if efficiency is requires, make also a monic_bitvector, which will not store the leading 1 explicitly
@@ -251,5 +253,17 @@ public:
unsigned int population(const unsigned int before=0) const {return bitvector::population(before?before-1:0);};
};
//some necessary traits of the non-scalar class to be able to use LA methods
template<>
class LA_traits<bitvector> {
public:
static bool is_plaindata() {return false;};
static void copyonwrite(bitvector& x) {x.copyonwrite();};
typedef bool elementtype;
typedef bool normtype;
};
}//namespace
#endif