21 return m_upper.size() - 1;
25 return m_lower.size() - 1;
29 resize(dim, n_u, n_l);
33 lib_assert(dim > 0U,
"dim > 0");
34 m_upper.setSize(n_u + 1);
35 m_lower.setSize(n_l + 1);
36 for (
uint04 i = 0; i < m_upper.size(); i++)
37 m_upper[i].setSize(dim);
38 for (
uint04 i = 0; i < m_lower.size(); i++)
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];
65 t_type savedDiag(
uint04 i)
const
67 lib_assert(i < dim(),
"Bad band location");
70 t_type& savedDiag(
uint04 i)
72 lib_assert(i < dim(),
"Bad band location");
79 for (
uint04 i = 0; i < dim(); i++)
81 lib_assert((*
this)(i, i) != 0.0,
"Bad decompision");
82 savedDiag(i) = 1.0 / (*this)(i, i);
85 for (
uint04 j = j_min; j <= j_max; j++)
86 (*
this)(i, j) *= savedDiag(i);
91 for (
uint04 k = 0; k < dim(); k++)
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>
112 lib_assert(dim() == b.size(),
"Bad size");
115 for (
uint04 i = 0; i < dim(); i++)
119 for (
uint04 j = j_start; j < i; j++)
120 sum += (*
this)(i, j) * x[j];
121 x[i] = (b[i] * savedDiag(i)) - sum;
126 template<
class t_r_type>
129 lib_assert(dim() == b.size(),
"dimensions not equal");
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>
145 lib_assert(dim() == b.size(),
"Bad size");
146 if (!is_lu_decomposed)
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...
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 > ...