template <typename T>
class BatchedTridiagonalSolver
{
public:
BatchedTridiagonalSolver(int matrix_dimension, int batch_count, bool is_cyclic = true)
: matrix_dimension_(matrix_dimension)
, batch_count_(batch_count)
, main_diagonal_("BatchedTridiagonalSolver::main_diagonal", matrix_dimension * batch_count)
, sub_diagonal_("BatchedTridiagonalSolver::sub_diagonal", matrix_dimension * batch_count)
, buffer_("BatchedTridiagonalSolver::buffer", is_cyclic ? matrix_dimension * batch_count : 0)
, gamma_("BatchedTridiagonalSolver::gamma", is_cyclic ? batch_count : 0)
, is_cyclic_(is_cyclic)
, is_factorized_(false)
{
assign(main_diagonal_, T(0));
assign(sub_diagonal_, T(0));
}
We dont need to allocate buffer here. It can be supplied externally in the solve() method.
Note that often the radial section does contain more nodes then the circular section, so this is probably less dramatic and not really noticeable.
We dont need to allocate buffer here. It can be supplied externally in the solve() method.
Note that often the radial section does contain more nodes then the circular section, so this is probably less dramatic and not really noticeable.