aboutsummaryrefslogtreecommitdiffstats
path: root/util/draft/matrix.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/draft/matrix.h
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 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 71d1537ded..154d00b35e 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;
}