aboutsummaryrefslogtreecommitdiffstats
path: root/util/draft/matrix.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/draft/matrix.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/draft/matrix.h')
-rw-r--r--util/draft/matrix.h52
1 files changed, 26 insertions, 26 deletions
diff --git a/util/draft/matrix.h b/util/draft/matrix.h
index 154d00b35e..71d1537ded 100644
--- a/util/draft/matrix.h
+++ b/util/draft/matrix.h
@@ -5,42 +5,42 @@
#include <util/system/defaults.h>
#include <string.h>
-template <typename T>
-class TMatrix: TNonCopyable {
- // Constructor/Destructor
+template <typename T>
+class TMatrix: TNonCopyable {
+ // Constructor/Destructor
public:
TMatrix()
: Buf(nullptr)
, Arr(nullptr)
- , M(0)
- , N(0)
- , BufSize(0)
- {
- }
+ , M(0)
+ , N(0)
+ , BufSize(0)
+ {
+ }
TMatrix(size_t m, size_t n)
- : Buf(new T[m * n])
- , Arr(Buf)
- , M(m)
- , N(n)
- , BufSize(m * n)
- {
- }
+ : Buf(new T[m * n])
+ , Arr(Buf)
+ , M(m)
+ , N(n)
+ , BufSize(m * n)
+ {
+ }
TMatrix(size_t m, size_t n, T* buf)
: Buf(nullptr)
- , Arr(buf)
- , M(m)
- , N(n)
- , BufSize(m * n)
- {
- }
+ , Arr(buf)
+ , M(m)
+ , N(n)
+ , BufSize(m * n)
+ {
+ }
~TMatrix() {
delete[] Buf;
}
- // Properties/Methods
+ // Properties/Methods
public:
void Clear() {
M = N = 0;
@@ -51,12 +51,12 @@ public:
size_t newSize = m * n;
if (newSize > BufSize) {
T* newBuf = new T[newSize];
- delete[] Buf;
+ delete[] Buf;
Arr = Buf = newBuf;
BufSize = newSize;
}
- M = m;
- N = n;
+ M = m;
+ N = n;
}
size_t Width() const {
@@ -96,7 +96,7 @@ public:
}
void Fill(T value) {
- for (T *p = Arr, *end = Arr + M * N; p < end; ++p)
+ for (T *p = Arr, *end = Arr + M * N; p < end; ++p)
*p = value;
}