49 buffer = Eigen::VectorX<Scalar>::Zero(num_nodes + 1);
51 Scalar sequence_interval =
52 static_cast<Scalar
>(1) /
static_cast<Scalar
>(base_sequence_size);
53 while (current_size <= num_nodes) {
54 const index_type current_sequence_size = std::max<index_type>(2,
56 base_sequence_size, (num_nodes + current_size) / current_size));
58 for (
index_type i = 1; i < current_sequence_size; ++i) {
59 const index_type dest_begin = current_size * i;
60 dest_end = dest_begin + current_size;
61 if (dest_end > num_nodes + 1 || dest_end < 0) {
62 dest_end = num_nodes + 1;
64 if (dest_end <= dest_begin) {
67 const index_type dest_size = dest_end - dest_begin;
68 const Scalar value_offset =
69 static_cast<Scalar
>(i) * sequence_interval;
70 buffer.segment(dest_begin, dest_size) =
71 buffer.head(dest_size).array() + value_offset;
73 current_size = dest_end;
74 sequence_interval /=
static_cast<Scalar
>(base_sequence_size);