From febc20965a2aac02acc18fd1aa6ff39845ac9b9a Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Thu, 29 Jan 2026 18:12:04 +0100 Subject: [PATCH] added traits for bitvector class --- bitvector.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bitvector.h b/bitvector.h index 94fc837..a68a81a 100644 --- a/bitvector.h +++ b/bitvector.h @@ -19,9 +19,11 @@ #ifndef _BITVECTOR_H_ #define _BITVECTOR_H_ +#include "la_traits.h" #include "vec.h" #include "numbers.h" #include "laerror.h" + #include //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 { +public: + static bool is_plaindata() {return false;}; + static void copyonwrite(bitvector& x) {x.copyonwrite();}; + typedef bool elementtype; + typedef bool normtype; +}; + + }//namespace #endif