MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / BandedMatrix

Method BandedMatrix

GTE/Mathematics/BandedMatrix.h:23–65  ·  view source on GitHub ↗

Construction and destruction.

Source from the content-addressed store, hash-verified

21 public:
22 // Construction and destruction.
23 BandedMatrix(int32_t size, int32_t numLBands, int32_t numUBands)
24 :
25 mSize(size),
26 mDBand{},
27 mLBands{},
28 mUBands{},
29 mZero((Real)0)
30 {
31 if (size > 0
32 && 0 <= numLBands && numLBands < size
33 && 0 <= numUBands && numUBands < size)
34 {
35 mDBand.resize(size);
36 std::fill(mDBand.begin(), mDBand.end(), (Real)0);
37
38 if (numLBands > 0)
39 {
40 mLBands.resize(numLBands);
41 int32_t numElements = size - 1;
42 for (auto& band : mLBands)
43 {
44 band.resize(numElements--);
45 std::fill(band.begin(), band.end(), (Real)0);
46 }
47 }
48
49 if (numUBands > 0)
50 {
51 mUBands.resize(numUBands);
52 int32_t numElements = size - 1;
53 for (auto& band : mUBands)
54 {
55 band.resize(numElements--);
56 std::fill(band.begin(), band.end(), (Real)0);
57 }
58 }
59 }
60 else
61 {
62 // Invalid argument to BandedMatrix constructor.
63 mSize = 0;
64 }
65 }
66
67 ~BandedMatrix()
68 {

Callers

nothing calls this directly

Calls 2

beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected