copyonwrite() on nested LA types will recursively call element copyonwrites even if the top type had count=1

This commit is contained in:
2024-04-03 22:12:08 +02:00
parent 80f915946b
commit 8bbbaa5bae
5 changed files with 43 additions and 8 deletions

View File

@@ -139,7 +139,7 @@ public:
void setunsymmetric();//unwind the matrix assuming it was indeed symmetric
inline bool issymmetric() const {return symmetric;}
unsigned int length() const;
void copyonwrite(bool detachonly=false);
void copyonwrite(bool detachonly=false, bool deep=true);
void clear() {copyonwrite(LA_traits<T>::is_plaindata()); if(count) {delete count; count=NULL;}}
void simplify(const double sparseepsilon=SPARSEEPSILON);
const T trace() const;