2#include <NDEVR/Buffer.h>
3#include <NDEVR/Vertex.h>
10 template<
class t_type>
21 return m_upper.
size() - 1;
25 return m_lower.
size() - 1;
37 m_upper[i].setSize(
dim);
39 m_lower[i].setSize(
dim);
43 if (m_upper.
size() > 0)
44 return m_upper[0].
size();
53 return m_upper[j - i][i];
55 return m_lower[i - j][i];
60 return m_upper[j - i][i];
62 return m_lower[i - j][i];
81 lib_assert((*
this)(i, i) != 0.0,
"Bad decompision");
85 for (
uint04 j = j_min; j <= j_max; j++)
94 for (
uint04 i = k + 1; i <= i_max; i++)
96 lib_assert((*
this)(k, k) != 0.0,
"get minimum");
97 t_type x = -(*this)(i, k) / (*
this)(k, k);
100 for (
uint04 j = k + 1; j <= j_max; j++)
103 (*this)(i, j) = (*
this)(i, j) + x * (*
this)(k, j);
109 template<
class t_l_type>
119 for (
uint04 j = j_start; j < i; j++)
120 sum += (*
this)(i, j) * x[j];
126 template<
class t_r_type>
136 for (
uint04 j = i + 1; j <= j_stop; j++)
137 sum += (*
this)(i, j) * x[j];
138 x[i] = (b[i] - sum) / (*
this)(i, i);
142 template<
class t_l_type>
146 if (!is_lu_decomposed)
#define lib_assert(expression, message)
Definition LibAssert.h:61
Band Matrix solver.
Definition BandMatrix.hpp:12
~BandMatrix()
Definition BandMatrix.hpp:18
t_type savedDiag(uint04 i) const
Definition BandMatrix.hpp:65
uint04 dim() const
Definition BandMatrix.hpp:41
uint04 upperCount() const
Definition BandMatrix.hpp:19
Buffer< t_l_type > luSolve(const Buffer< t_l_type > &b, bool is_lu_decomposed=false)
Definition BandMatrix.hpp:143
void luDecompose()
Definition BandMatrix.hpp:77
Buffer< t_r_type > rSolve(const Buffer< t_r_type > &b) const
Definition BandMatrix.hpp:127
t_type & operator()(uint04 i, uint04 j)
Definition BandMatrix.hpp:50
BandMatrix(uint04 dim, uint04 n_u, uint04 n_l)
Definition BandMatrix.hpp:27
BandMatrix()
Definition BandMatrix.hpp:17
uint04 lowerCount() const
Definition BandMatrix.hpp:23
Buffer< t_l_type > lSolve(const Buffer< t_l_type > &b) const
Definition BandMatrix.hpp:110
void resize(uint04 dim, uint04 n_u, uint04 n_l)
Definition BandMatrix.hpp:31
t_type & savedDiag(uint04 i)
Definition BandMatrix.hpp:70
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
constexpr t_index_type size() const
Definition Buffer.hpp:823
void setSize(t_index_type new_size)
Definition Buffer.hpp:803
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
constexpr t_type getMax(const t_type &left, const t_type &right)
Finds the max of the given arguments using the > operator The only requirement is that t_type have > ...
Definition BaseFunctions.hpp:94
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05...
Definition BaseFunctions.hpp:56