// Exchanging the size of each buffer
MPI_Allgather(
- &n_local_data, 1, MPI_INT, &(size_all_data[0]), 1, MPI_INT, comm);
+ &n_local_data, 1, MPI_INT, size_all_data.data(), 1, MPI_INT, comm);
// Now computing the displacement, relative to recvbuf,
// at which to store the incoming buffer
#ifdef DEAL_II_WITH_MPI
// makes use of the fact that the matrix stores its data in a
// contiguous array.
- sum(ArrayView<const Number>(&local.val[0], local.n_nonzero_elements()),
+ sum(ArrayView<const Number>(local.val.get(), local.n_nonzero_elements()),
mpi_communicator,
- ArrayView<Number>(&global.val[0], global.n_nonzero_elements()));
+ ArrayView<Number>(global.val.get(), global.n_nonzero_elements()));
#else
(void)mpi_communicator;
if (!PointerComparison::equal(&local, &global))
::gradient(active_tape_index,
independent_variables.size(),
const_cast<scalar_type *>(independent_variables.data()),
- &gradient[0]);
+ gradient.data());
}
static void
independent_variables.size();
std::vector<scalar_type *> H(n_independent_variables);
for (unsigned int i = 0; i < n_independent_variables; ++i)
- H[i] = &(hessian[i][0]);
+ H[i] = &hessian[i][0];
::hessian(active_tape_index,
n_independent_variables,
n_dependent_variables,
independent_variables.size(),
const_cast<scalar_type *>(independent_variables.data()),
- &values[0]);
+ values.data());
}
static void
std::vector<scalar_type *> J(n_dependent_variables);
for (unsigned int i = 0; i < n_dependent_variables; ++i)
- J[i] = &(jacobian[i][0]);
+ J[i] = &jacobian[i][0];
::jacobian(active_tape_index,
n_dependent_variables,
destinations.push_back(it->receiver);
it->pack_data(*buffer);
- const int ierr = MPI_Isend(&(*buffer)[0],
+ const int ierr = MPI_Isend(buffer->data(),
buffer->size(),
MPI_BYTE,
it->receiver,
-> Point<spacedim> {
return object->get_manifold().get_new_point(
make_array_view(vertices.begin(), vertices.end()),
- make_array_view(&weights[0],
- &weights[n_vertices_per_cell - 1] + 1));
+ make_array_view(weights.begin_raw(), weights.end_raw()));
};
// pick the initial weights as (normalized) inverse distances from
// calculate all the data that will be written into the matrix row.
if (use_dealii_matrix == false)
{
- size_type *col_ptr = &cols[0];
+ size_type *col_ptr = cols.data();
// cast is uncritical here and only used to avoid compiler
// warnings. We never access a non-double array
- number *val_ptr = &vals[0];
+ number *val_ptr = vals.data();
internals::resolve_matrix_row(global_rows,
global_rows,
i,
local_matrix,
col_ptr,
val_ptr);
- const size_type n_values = col_ptr - &cols[0];
+ const size_type n_values = col_ptr - cols.data();
if (n_values > 0)
- global_matrix.add(row, n_values, &cols[0], &vals[0], false, true);
+ global_matrix.add(
+ row, n_values, cols.data(), vals.data(), false, true);
}
else
internals::resolve_matrix_row(
end_block = block_starts[block_col + 1];
if (use_dealii_matrix == false)
{
- size_type *col_ptr = &cols[0];
- number * val_ptr = &vals[0];
+ size_type *col_ptr = cols.data();
+ number * val_ptr = vals.data();
internals::resolve_matrix_row(global_rows,
global_rows,
i,
local_matrix,
col_ptr,
val_ptr);
- const size_type n_values = col_ptr - &cols[0];
+ const size_type n_values = col_ptr - cols.data();
if (n_values > 0)
global_matrix.block(block, block_col)
- .add(row, n_values, &cols[0], &vals[0], false, true);
+ .add(
+ row, n_values, cols.data(), vals.data(), false, true);
}
else
{
const size_type row = global_rows.global_row(i);
// calculate all the data that will be written into the matrix row.
- size_type *col_ptr = &cols[0];
- number * val_ptr = &vals[0];
+ size_type *col_ptr = cols.data();
+ number * val_ptr = vals.data();
internals::resolve_matrix_row(global_rows,
global_cols,
i,
local_matrix,
col_ptr,
val_ptr);
- const size_type n_values = col_ptr - &cols[0];
+ const size_type n_values = col_ptr - cols.data();
if (n_values > 0)
- global_matrix.add(row, n_values, &cols[0], &vals[0], false, true);
+ global_matrix.add(row, n_values, cols.data(), vals.data(), false, true);
}
}
block(row_index.first, block_col)
.set(row_index.second,
temporary_data.counter_within_block[block_col],
- &temporary_data.column_indices[block_col][0],
- &temporary_data.column_values[block_col][0],
+ temporary_data.column_indices[block_col].data(),
+ temporary_data.column_values[block_col].data(),
false);
}
}
block(row_index.first, block_col)
.add(row_index.second,
temporary_data.counter_within_block[block_col],
- &temporary_data.column_indices[block_col][0],
- &temporary_data.column_values[block_col][0],
+ temporary_data.column_indices[block_col].data(),
+ temporary_data.column_values[block_col].data(),
false,
col_indices_are_sorted);
}
// add everything, including padding elements
const size_type chunk_size = cols->get_chunk_size();
number * val_ptr = val.get();
- const somenumber * matrix_ptr = &matrix.val[0];
+ const somenumber * matrix_ptr = matrix.val.get();
const number *const end_ptr =
val.get() +
cols->sparsity_pattern.n_nonzero_elements() * chunk_size * chunk_size;
{
Assert(!this->empty(), ExcEmptyMatrix());
- const number * p = &this->values[0];
- const number *const e = &this->values[0] + this->n_elements();
+ const number * p = this->values.data();
+ const number *const e = this->values.data() + this->n_elements();
while (p != e)
if (*p++ != number(0.0))
return false;
Assert(&src != &dst, ExcSourceEqualsDestination());
- const number *e = &this->values[0];
+ const number *e = this->values.data();
// get access to the data in order to
// avoid copying it when using the ()
// operator
Assert(&src != &dst, ExcSourceEqualsDestination());
- const number * e = &this->values[0];
+ const number * e = this->values.data();
number2 * dst_ptr = &dst(0);
const size_type size_m = m(), size_n = n();
&alpha,
&src(0, 0),
&m,
- &this->values[0],
+ this->values.data(),
&k,
&beta,
&dst(0, 0),
&alpha,
&src(0, 0),
&m,
- &this->values[0],
+ this->values.data(),
&n,
&beta,
&dst(0, 0),
&alpha,
&src(0, 0),
&k,
- &this->values[0],
+ this->values.data(),
&k,
&beta,
&dst(0, 0),
&alpha,
&src(0, 0),
&k,
- &this->values[0],
+ this->values.data(),
&n,
&beta,
&dst(0, 0),
number2 sum = 0.;
const size_type n_rows = m();
- const number * val_ptr = &this->values[0];
+ const number * val_ptr = this->values.data();
for (size_type row = 0; row < n_rows; ++row)
{
number2 sum = 0.;
const size_type n_rows = m();
const size_type n_cols = n();
- const number * val_ptr = &this->values[0];
+ const number * val_ptr = this->values.data();
for (size_type row = 0; row < n_rows; ++row)
{
// Use the LAPACK function getrf for
// calculating the LU factorization.
- getrf(&nn, &nn, &this->values[0], &nn, ipiv.data(), &info);
+ getrf(&nn, &nn, this->values.data(), &nn, ipiv.data(), &info);
Assert(info >= 0, ExcInternalError());
Assert(info == 0, LACExceptions::ExcSingular());
// Use the LAPACK function getri for
// calculating the actual inverse using
// the LU factorization.
- getri(
- &nn, &this->values[0], &nn, ipiv.data(), inv_work.data(), &nn, &info);
+ getri(&nn,
+ this->values.data(),
+ &nn,
+ ipiv.data(),
+ inv_work.data(),
+ &nn,
+ &info);
Assert(info >= 0, ExcInternalError());
Assert(info == 0, LACExceptions::ExcSingular());
VectorBase::extract_subvector_to(const std::vector<size_type> &indices,
std::vector<PetscScalar> & values) const
{
- extract_subvector_to(&(indices[0]),
- &(indices[0]) + indices.size(),
- &(values[0]));
+ Assert(indices.size() <= values.size(),
+ ExcDimensionMismatch(indices.size(), values.size()));
+ extract_subvector_to(indices.begin(), indices.end(), values.begin());
}
template <typename ForwardIterator, typename OutputIterator>
row,
matrix.row_length(row),
ncols,
- &(value_cache[0]),
+ value_cache.data(),
reinterpret_cast<TrilinosWrappers::types::int_type *>(
- &(colnum_cache[0])));
+ colnum_cache.data()));
(void)ierr;
Assert(ierr == 0, ExcTrilinosError(ierr));
const size_type n = src.size();
somenumber * dst_ptr = dst.begin();
const somenumber * src_ptr = src.begin();
- const std::size_t *rowstart_ptr = &cols->rowstart[0];
+ const std::size_t *rowstart_ptr = cols->rowstart.get();
// optimize the following loop for
// the case that the relaxation
internal::SparseMatrixImplementation::AssertNoZerosOnDiagonal(*this);
const size_type n = src.size();
- const std::size_t *rowstart_ptr = &cols->rowstart[0];
+ const std::size_t *rowstart_ptr = cols->rowstart.get();
somenumber * dst_ptr = &dst(0);
// case when we have stored the position
*dst_ptr /= val[*rowstart_ptr];
}
- rowstart_ptr = &cols->rowstart[0];
+ rowstart_ptr = cols->rowstart.get();
dst_ptr = &dst(0);
for (; rowstart_ptr != &cols->rowstart[n]; ++rowstart_ptr, ++dst_ptr)
*dst_ptr *=
// line denotes the diagonal element,
// which we need not check.
const size_type first_right_of_diagonal_index =
- (Utilities::lower_bound(&cols->colnums[*rowstart_ptr + 1],
- &cols->colnums[*(rowstart_ptr + 1)],
+ (Utilities::lower_bound(cols->colnums.get() + *rowstart_ptr + 1,
+ cols->colnums.get() + *(rowstart_ptr + 1),
row) -
- &cols->colnums[0]);
+ cols->colnums.get());
number s = 0;
for (size_type j = (*rowstart_ptr) + 1; j < first_right_of_diagonal_index;
*dst_ptr /= val[*rowstart_ptr];
};
- rowstart_ptr = &cols->rowstart[0];
+ rowstart_ptr = cols->rowstart.get();
dst_ptr = &dst(0);
for (size_type row = 0; row < n; ++row, ++rowstart_ptr, ++dst_ptr)
*dst_ptr *= somenumber((number(2.) - om)) * somenumber(val[*rowstart_ptr]);
(Utilities::lower_bound(&cols->colnums[*rowstart_ptr + 1],
&cols->colnums[end_row],
static_cast<size_type>(row)) -
- &cols->colnums[0]);
+ cols->colnums.get());
number s = 0;
for (size_type j = first_right_of_diagonal_index; j < end_row; ++j)
s += val[j] * number(dst(cols->colnums[j]));
mass_matrix[0].n_rows());
Number * t = tmp_array.begin();
const Number *src = src_view.begin();
- Number * dst = &(dst_view[0]);
+ Number * dst = dst_view.data();
if (dim == 1)
{
mass_matrix[0].n_rows());
Number * t = tmp_array.begin();
const Number *src = src_view.data();
- Number * dst = &(dst_view[0]);
+ Number * dst = dst_view.data();
// NOTE: dof_to_quad has to be interpreted as 'dof to eigenvalue index'
// --> apply<.,true,.> (S,src,dst) calculates dst = S^T * src,
unsigned int size_shape_values = n_dofs_1d * n_q_points_1d * sizeof(Number);
cudaError_t cuda_error = cudaMemcpyToSymbol(internal::global_shape_values,
- &shape_info.shape_values[0],
+ shape_info.shape_values.data(),
size_shape_values,
0,
cudaMemcpyHostToDevice);
if (update_flags & update_gradients)
{
cuda_error = cudaMemcpyToSymbol(internal::global_shape_gradients,
- &shape_info.shape_gradients[0],
+ shape_info.shape_gradients.data(),
size_shape_values,
0,
cudaMemcpyHostToDevice);
AssertIndexRange(range.second, fe_indices.size() + 1);
#endif
std::pair<unsigned int, unsigned int> return_range;
- return_range.first = std::lower_bound(&fe_indices[0] + range.first,
- &fe_indices[0] + range.second,
+ return_range.first = std::lower_bound(fe_indices.begin() + range.first,
+ fe_indices.begin() + range.second,
fe_index) -
- &fe_indices[0];
+ fe_indices.begin();
return_range.second =
- std::lower_bound(&fe_indices[0] + return_range.first,
- &fe_indices[0] + range.second,
+ std::lower_bound(fe_indices.begin() + return_range.first,
+ fe_indices.begin() + range.second,
fe_index + 1) -
- &fe_indices[0];
+ fe_indices.begin();
Assert(return_range.first >= range.first &&
return_range.second <= range.second,
ExcInternalError());
const unsigned int shift_coefficient =
inverse_coefficients.size() > dofs_per_component ? dofs_per_component : 0;
- const VectorizedArray<Number> *inv_coefficient = &inverse_coefficients[0];
- VectorizedArray<Number> temp_data_field[dofs_per_component];
+ const VectorizedArray<Number> *inv_coefficient =
+ inverse_coefficients.data();
+ VectorizedArray<Number> temp_data_field[dofs_per_component];
for (unsigned int d = 0; d < n_actual_components; ++d)
{
const VectorizedArray<Number> *in = in_array + d * dofs_per_component;
const double *
DataOutFilter::get_data_set(const unsigned int set_num) const
{
- return &data_sets[set_num][0];
+ return data_sets[set_num].data();
}
int total = (vars_per_node * num_nodes);
- ierr = TECDAT(&total, &tm.nodalData[0], &is_double);
+ ierr = TECDAT(&total, tm.nodalData.data(), &is_double);
Assert(ierr == 0, ExcTecplotAPIError());
- ierr = TECNOD(&tm.connData[0]);
+ ierr = TECNOD(tm.connData.data());
Assert(ierr == 0, ExcTecplotAPIError());
// results over all processes
unsigned int n_recv_from;
const int ierr = MPI_Reduce_scatter_block(
- &dest_vector[0], &n_recv_from, 1, MPI_UNSIGNED, MPI_SUM, mpi_comm);
+ dest_vector.data(), &n_recv_from, 1, MPI_UNSIGNED, MPI_SUM, mpi_comm);
AssertThrowMPI(ierr);
el,
32766,
mpi_comm,
- &send_requests[&el - &destinations[0]]);
+ send_requests.data() + (&el - destinations.data()));
// if no one to receive from, return an empty vector
if (n_recv_from == 0)
unsigned int n_recv_from = 0;
const int ierr = MPI_Reduce_scatter_block(
- &dest_vector[0], &n_recv_from, 1, MPI_UNSIGNED, MPI_SUM, mpi_comm);
+ dest_vector.data(), &n_recv_from, 1, MPI_UNSIGNED, MPI_SUM, mpi_comm);
AssertThrowMPI(ierr);
std::vector<unsigned int> buffer(dest_vector.size());
unsigned int n_recv_from = 0;
- MPI_Reduce(&dest_vector[0],
- &buffer[0],
+ MPI_Reduce(dest_vector.data(),
+ buffer.data(),
dest_vector.size(),
MPI_UNSIGNED,
MPI_SUM,
0,
mpi_comm);
- MPI_Scatter(&buffer[0],
+ MPI_Scatter(buffer.data(),
1,
MPI_UNSIGNED,
&n_recv_from,
for (unsigned d = 0; d < dim; ++d)
polynomials[i].value(p(d),
n_values_and_derivatives,
- &values_1d[i][d][0]);
+ values_1d[i][d].data());
unsigned int indices[3];
unsigned int ind = 0;
// that the packet has been
// received
it->second.pack_data(*buffer);
- const int ierr = MPI_Isend(&(*buffer)[0],
+ const int ierr = MPI_Isend(buffer->data(),
buffer->size(),
MPI_BYTE,
it->first,
// send reply
reply_buffers[idx] = cell_data_transfer_buffer.pack_data();
- ierr = MPI_Isend(&(reply_buffers[idx])[0],
+ ierr = MPI_Isend(reply_buffers[idx].data(),
reply_buffers[idx].size(),
MPI_BYTE,
status.MPI_SOURCE,
&level_number_cache.n_locally_owned_dofs,
1,
DEAL_II_DOF_INDEX_MPI_TYPE,
- &level_number_cache.n_locally_owned_dofs_per_processor[0],
+ level_number_cache.n_locally_owned_dofs_per_processor.data(),
1,
DEAL_II_DOF_INDEX_MPI_TYPE,
triangulation->get_communicator());
Assert(data.n_shape_functions > 0, ExcInternalError());
const Tensor<1, spacedim> *supp_pts =
- &data.mapping_support_points[0];
+ data.mapping_support_points.data();
for (unsigned int point = 0; point < n_q_points; ++point)
{
, n_child_indices(n_child_indices)
{
Assert(n_child_indices < child_indices.size(), ExcInternalError());
- memcpy(&(child_indices[0]), id, n_child_indices);
+ memcpy(child_indices.data(), id, n_child_indices);
}
ExcIO());
std::vector<std::vector<double>> point_values(
3, std::vector<double>(n_vertices));
- points_xc->get(&*point_values[0].begin(), n_vertices);
- points_yc->get(&*point_values[1].begin(), n_vertices);
- points_zc->get(&*point_values[2].begin(), n_vertices);
+ points_xc->get(point_values[0].data(), n_vertices);
+ points_yc->get(point_values[1].data(), n_vertices);
+ points_zc->get(point_values[2].data(), n_vertices);
// and fill the vertices
std::vector<Point<spacedim>> vertices(n_vertices);
ExcIO());
std::vector<std::vector<double>> point_values(
3, std::vector<double>(n_vertices));
- points_xc->get(&*point_values[0].begin(), n_vertices);
- points_yc->get(&*point_values[1].begin(), n_vertices);
- points_zc->get(&*point_values[2].begin(), n_vertices);
+ points_xc->get(point_values[0].data(), n_vertices);
+ points_yc->get(point_values[1].data(), n_vertices);
+ points_zc->get(point_values[2].data(), n_vertices);
// and fill the vertices
std::vector<Point<spacedim>> vertices(n_vertices);
}
// Send the message
- ierr = MPI_Isend(&vertices_send_buffers[i][0],
+ ierr = MPI_Isend(vertices_send_buffers[i].data(),
buffer_size,
DEAL_II_VERTEX_INDEX_MPI_TYPE,
destination,
vertices_recv_buffers[i].resize(buffer_size);
// Receive the message
- ierr = MPI_Recv(&vertices_recv_buffers[i][0],
+ ierr = MPI_Recv(vertices_recv_buffers[i].data(),
buffer_size,
DEAL_II_VERTEX_INDEX_MPI_TYPE,
source,
}
// Send the message
- ierr = MPI_Isend(&cellids_send_buffers[i][0],
+ ierr = MPI_Isend(cellids_send_buffers[i].data(),
buffer_size,
MPI_CHAR,
destination,
cellids_recv_buffers[i].resize(buffer_size);
// Receive the message
- ierr = MPI_Recv(&cellids_recv_buffers[i][0],
+ ierr = MPI_Recv(cellids_recv_buffers[i].data(),
buffer_size,
MPI_CHAR,
source,
int ierr = MPI_Allgather(&n_local_data,
1,
MPI_INT,
- &(size_all_data[0]),
+ size_all_data.data(),
1,
MPI_INT,
mpi_communicator);
// Allocating a vector to contain all the received data
std::vector<double> data_array(rdispls.back() + size_all_data.back());
- ierr = MPI_Allgatherv(&(loc_data_array[0]),
+ ierr = MPI_Allgatherv(loc_data_array.data(),
n_local_data,
MPI_DOUBLE,
- &(data_array[0]),
- &(size_all_data[0]),
- &(rdispls[0]),
+ data_array.data(),
+ size_all_data.data(),
+ rdispls.data(),
MPI_DOUBLE,
mpi_communicator);
AssertThrowMPI(ierr);
Assert(ptr.level() == 0, ExcInternalError());
const unsigned int coarse_index = ptr.index();
- return CellId(coarse_index, n_child_indices, &(id[0]));
+ return CellId(coarse_index, n_child_indices, id.data());
}
// Copy the elements to the gpu
val_dev.reset(Utilities::CUDA::allocate_device_data<Number>(nnz));
cudaError_t error_code = cudaMemcpy(val_dev.get(),
- &val[0],
+ val.data(),
nnz * sizeof(Number),
cudaMemcpyHostToDevice);
AssertCuda(error_code);
column_index_dev.reset(Utilities::CUDA::allocate_device_data<int>(nnz));
AssertCuda(error_code);
error_code = cudaMemcpy(column_index_dev.get(),
- &column_index[0],
+ column_index.data(),
nnz * sizeof(int),
cudaMemcpyHostToDevice);
AssertCuda(error_code);
row_ptr_dev.reset(Utilities::CUDA::allocate_device_data<int>(row_ptr_size));
AssertCuda(error_code);
error_code = cudaMemcpy(row_ptr_dev.get(),
- &row_ptr[0],
+ row_ptr.data(),
row_ptr_size * sizeof(int),
cudaMemcpyHostToDevice);
AssertCuda(error_code);
geev(&vl,
&vr,
&n_rows,
- &matrix[0],
+ matrix.data(),
&n_rows,
real_part_eigenvalues.data(),
imag_part_eigenvalues.data(),
geev(&vl,
&vr,
&n_rows,
- &matrix[0],
+ matrix.data(),
&n_rows,
eigenvalues.data(),
left_eigenvectors.data(),
gesdd(&job,
&n_rows,
&n_cols,
- &matrix[0],
+ matrix.data(),
&n_rows,
singular_values.data(),
- &left_vectors[0],
+ left_vectors.data(),
&n_rows,
- &right_vectors[0],
+ right_vectors.data(),
&n_cols,
real_work.data(),
&work_flag,
gesdd(&job,
&n_rows,
&n_cols,
- &matrix[0],
+ matrix.data(),
&n_rows,
singular_values.data(),
- &left_vectors[0],
+ left_vectors.data(),
&n_rows,
- &right_vectors[0],
+ right_vectors.data(),
&n_cols,
work.data(),
&work_flag,
types::blas_int info = 0;
// kl and ku will not be referenced for type = G (dense matrices).
const types::blas_int kl = 0;
- number * values = &this->values[0];
+ number * values = this->values.data();
lascl(&type, &kl, &kl, &cfrom, &factor, &m, &n, values, &lda, &info);
types::blas_int info = 0;
// kl and ku will not be referenced for type = G (dense matrices).
const types::blas_int kl = 0;
- number * values = &this->values[0];
+ number * values = this->values.data();
lascl(&type, &kl, &kl, &factor, &cto, &m, &n, values, &lda, &info);
// ==> use BLAS 1 for adding vectors
const types::blas_int n = this->m() * this->n();
const types::blas_int inc = 1;
- number * values = &this->values[0];
- const number * values_A = &A.values[0];
+ number * values = this->values.data();
+ const number * values_A = A.values.data();
axpy(&n, &a, values_A, &inc, values, &inc);
}
const types::blas_int lda = N;
const types::blas_int incx = 1;
- trmv(&uplo, &trans, &diag, &N, &this->values[0], &lda, &w[0], &incx);
+ trmv(
+ &uplo, &trans, &diag, &N, this->values.data(), &lda, w.data(), &incx);
return;
}
&mm,
&nn,
&alpha,
- &this->values[0],
+ this->values.data(),
&mm,
- v.values.get(),
+ v.data(),
&one,
&beta,
- w.values.get(),
+ w.data(),
&one);
break;
}
&nn,
&nn,
&alpha,
- &svd_vt->values[0],
+ svd_vt->values.data(),
&nn,
- v.values.get(),
+ v.data(),
&one,
&null,
work.data(),
&mm,
&mm,
&alpha,
- &svd_u->values[0],
+ svd_u->values.data(),
&mm,
work.data(),
&one,
&beta,
- w.values.get(),
+ w.data(),
&one);
break;
}
&mm,
&mm,
&alpha,
- &svd_u->values[0],
+ svd_u->values.data(),
&mm,
- v.values.get(),
+ v.data(),
&one,
&null,
work.data(),
&nn,
&nn,
&alpha,
- &svd_vt->values[0],
+ svd_vt->values.data(),
&nn,
work.data(),
&one,
&beta,
- w.values.get(),
+ w.data(),
&one);
break;
}
const types::blas_int lda = N;
const types::blas_int incx = 1;
- trmv(&uplo, &trans, &diag, &N, &this->values[0], &lda, &w[0], &incx);
+ trmv(
+ &uplo, &trans, &diag, &N, this->values.data(), &lda, w.data(), &incx);
return;
}
&mm,
&nn,
&alpha,
- &this->values[0],
+ this->values.data(),
&mm,
- v.values.get(),
+ v.data(),
&one,
&beta,
- w.values.get(),
+ w.data(),
&one);
break;
}
&mm,
&mm,
&alpha,
- &svd_u->values[0],
+ svd_u->values.data(),
&mm,
- v.values.get(),
+ v.data(),
&one,
&null,
work.data(),
&nn,
&nn,
&alpha,
- &svd_vt->values[0],
+ svd_vt->values.data(),
&nn,
work.data(),
&one,
&beta,
- w.values.get(),
+ w.data(),
&one);
break;
}
&nn,
&nn,
&alpha,
- &svd_vt->values[0],
+ svd_vt->values.data(),
&nn,
- v.values.get(),
+ v.data(),
&one,
&null,
work.data(),
&mm,
&mm,
&alpha,
- &svd_u->values[0],
+ svd_u->values.data(),
&mm,
work.data(),
&one,
&beta,
- w.values.get(),
+ w.data(),
&one);
break;
}
&nn,
&kk,
&alpha,
- &this->values[0],
+ this->values.data(),
&mm,
- &B.values[0],
+ B.values.data(),
&kk,
&beta,
- &C.values[0],
+ C.values.data(),
&mm);
}
&mm,
&kk,
&alpha,
- &B.values[0],
+ B.values.data(),
&kk,
- &this->values[0],
+ this->values.data(),
&mm,
&beta,
&C(0, 0),
&nn,
&kk,
&alpha,
- &this->values[0],
+ this->values.data(),
&kk,
- &work[0],
+ work.data(),
&kk,
&beta,
- &C.values[0],
+ C.values.data(),
&mm);
}
const types::blas_int n = B.n();
#ifdef DEAL_II_LAPACK_WITH_MKL
const number one = 1.;
- omatcopy('C', 'C', n, m, one, &A.values[0], n, &B.values[0], m);
+ omatcopy('C', 'C', n, m, one, A.values.data(), n, B.values.data(), m);
#else
for (types::blas_int i = 0; i < m; ++i)
for (types::blas_int j = 0; j < n; ++j)
&nn,
&kk,
&alpha,
- &this->values[0],
+ this->values.data(),
&kk,
&beta,
- &C.values[0],
+ C.values.data(),
&nn);
// fill-in lower triangular part
&nn,
&kk,
&alpha,
- &this->values[0],
+ this->values.data(),
&kk,
- &B.values[0],
+ B.values.data(),
&kk,
&beta,
- &C.values[0],
+ C.values.data(),
&mm);
}
}
&mm,
&kk,
&alpha,
- &B.values[0],
+ B.values.data(),
&kk,
- &this->values[0],
+ this->values.data(),
&kk,
&beta,
&C(0, 0),
&nn,
&kk,
&alpha,
- &this->values[0],
+ this->values.data(),
&nn,
&beta,
- &C.values[0],
+ C.values.data(),
&nn);
// fill-in lower triangular part
&nn,
&kk,
&alpha,
- &this->values[0],
+ this->values.data(),
&mm,
- &B.values[0],
+ B.values.data(),
&nn,
&beta,
- &C.values[0],
+ C.values.data(),
&mm);
}
}
&mm,
&kk,
&alpha,
- &B.values[0],
+ B.values.data(),
&nn,
- &this->values[0],
+ this->values.data(),
&mm,
&beta,
&C(0, 0),
&nn,
&kk,
&alpha,
- &this->values[0],
+ this->values.data(),
&kk,
- &B.values[0],
+ B.values.data(),
&nn,
&beta,
- &C.values[0],
+ C.values.data(),
&mm);
}
&mm,
&kk,
&alpha,
- &B.values[0],
+ B.values.data(),
&nn,
- &this->values[0],
+ this->values.data(),
&kk,
&beta,
&C(0, 0),
const types::blas_int mm = this->m();
const types::blas_int nn = this->n();
- number *const values = &this->values[0];
+ number *const values = this->values.data();
ipiv.resize(mm);
types::blas_int info = 0;
getrf(&mm, &nn, values, &mm, ipiv.data(), &info);
const types::blas_int N = this->n();
const types::blas_int M = this->m();
- const number *const values = &this->values[0];
+ const number *const values = this->values.data();
if (property == symmetric)
{
const types::blas_int lda = std::max<types::blas_int>(1, N);
(void)mm;
Assert(mm == nn, ExcDimensionMismatch(mm, nn));
- number *const values = &this->values[0];
+ number *const values = this->values.data();
types::blas_int info = 0;
const types::blas_int lda = std::max<types::blas_int>(1, nn);
potrf(&LAPACKSupport::L, &nn, values, &lda, &info);
number rcond = 0.;
const types::blas_int N = this->m();
- const number * values = &this->values[0];
+ const number * values = this->values.data();
types::blas_int info = 0;
const types::blas_int lda = std::max<types::blas_int>(1, N);
work.resize(3 * N);
number rcond = 0.;
const types::blas_int N = this->m();
- const number *const values = &this->values[0];
+ const number *const values = this->values.data();
types::blas_int info = 0;
const types::blas_int lda = std::max<types::blas_int>(1, N);
work.resize(3 * N);
const types::blas_int nn = this->n();
Assert(nn == mm, ExcNotQuadratic());
- number *const values = &this->values[0];
+ number *const values = this->values.data();
types::blas_int info = 0;
if (property != symmetric)
AssertDimension(this->m(), v.size());
const char * trans = transposed ? &T : &N;
const types::blas_int nn = this->n();
- const number *const values = &this->values[0];
+ const number *const values = this->values.data();
const types::blas_int n_rhs = 1;
types::blas_int info = 0;
AssertDimension(this->m(), B.m());
const char * trans = transposed ? &T : &N;
const types::blas_int nn = this->n();
- const number *const values = &this->values[0];
+ const number *const values = this->values.data();
const types::blas_int n_rhs = B.n();
types::blas_int info = 0;
if (state == lu)
{
- getrs(
- trans, &nn, &n_rhs, values, &nn, ipiv.data(), &B.values[0], &nn, &info);
+ getrs(trans,
+ &nn,
+ &n_rhs,
+ values,
+ &nn,
+ ipiv.data(),
+ B.values.data(),
+ &nn,
+ &info);
}
else if (state == cholesky)
{
- potrs(
- &LAPACKSupport::L, &nn, &n_rhs, values, &nn, &B.values[0], &nn, &info);
+ potrs(&LAPACKSupport::L,
+ &nn,
+ &n_rhs,
+ values,
+ &nn,
+ B.values.data(),
+ &nn,
+ &info);
}
else if (property == upper_triangular || property == lower_triangular)
{
&n_rhs,
values,
&lda,
- &B.values[0],
+ B.values.data(),
&ldb,
&info);
}
wr.resize(nn);
LAPACKFullMatrix<number> matrix_eigenvectors(nn, nn);
- number *const values_A = &this->values[0];
- number *const values_eigenvectors = &matrix_eigenvectors.values[0];
+ number *const values_A = this->values.data();
+ number *const values_eigenvectors = matrix_eigenvectors.values.data();
types::blas_int info(0), lwork(-1), n_eigenpairs(0);
const char *const jobz(&V);
wr.resize(nn);
LAPACKFullMatrix<number> matrix_eigenvectors(nn, nn);
- number *const values_A = &this->values[0];
- number *const values_B = &B.values[0];
- number *const values_eigenvectors = &matrix_eigenvectors.values[0];
+ number *const values_A = this->values.data();
+ number *const values_B = B.values.data();
+ number *const values_eigenvectors = matrix_eigenvectors.values.data();
types::blas_int info(0), lwork(-1), n_eigenpairs(0);
const char *const jobz(&V);
wi.resize(nn); // This is set purely for consistency reasons with the
// eigenvalues() function.
- number *const values_A = &this->values[0];
- number *const values_B = &B.values[0];
+ number *const values_A = this->values.data();
+ number *const values_B = B.values.data();
types::blas_int info = 0;
types::blas_int lwork = -1;
// now copy over the information
// from the sparsity pattern.
{
- PetscInt *ptr = &colnums_in_window[0];
+ PetscInt *ptr = colnums_in_window.data();
for (PetscInt i = local_row_start; i < local_row_end; ++i)
for (typename SparsityPatternType::iterator p =
sparsity_pattern.begin(i);
// now copy over the information
// from the sparsity pattern.
{
- PetscInt *ptr = &colnums_in_window[0];
+ PetscInt *ptr = colnums_in_window.data();
for (size_type i = local_row_start; i < local_row_end; ++i)
for (typename SparsityPatternType::iterator p =
sparsity_pattern.begin(i);
const PetscInt *ptr =
(ghostindices.size() > 0 ?
- reinterpret_cast<const PetscInt *>(&(ghostindices[0])) :
+ reinterpret_cast<const PetscInt *>(ghostindices.data()) :
nullptr);
PetscErrorCode ierr = VecCreateGhost(communicator,
{
const int ii = 1;
NumberType *loc_vals_A =
- this->values.size() > 0 ? &(this->values[0]) : nullptr;
+ this->values.size() > 0 ? this->values.data() : nullptr;
const NumberType *loc_vals_B =
mpi_process_is_active_B ? &(B(0, 0)) : nullptr;
{
const int ii = 1;
const NumberType *loc_vals_A =
- this->values.size() > 0 ? &(this->values[0]) : nullptr;
+ this->values.size() > 0 ? this->values.data() : nullptr;
NumberType *loc_vals_B = mpi_process_is_active_B ? &(B(0, 0)) : nullptr;
pgemr2d(&n_rows,
if (in_context_A)
{
if (this->values.size() != 0)
- loc_vals_A = &this->values[0];
+ loc_vals_A = this->values.data();
for (unsigned int i = 0; i < desc_A.size(); ++i)
desc_A[i] = this->descriptor[i];
if (in_context_B)
{
if (B.values.size() != 0)
- loc_vals_B = &B.values[0];
+ loc_vals_B = B.values.data();
for (unsigned int i = 0; i < desc_B.size(); ++i)
desc_B[i] = B.descriptor[i];
AssertThrow(this->values.size() > 0,
dealii::ExcMessage(
"source: process is active but local matrix empty"));
- loc_vals_source = &this->values[0];
+ loc_vals_source = this->values.data();
}
if (dest.grid->mpi_process_is_active && (dest.values.size() > 0))
{
dest.values.size() > 0,
dealii::ExcMessage(
"destination: process is active but local matrix empty"));
- loc_vals_dest = &dest.values[0];
+ loc_vals_dest = dest.values.data();
}
pgemr2d(&n_rows,
&n_columns,
{
char trans_b = transpose_B ? 'T' : 'N';
NumberType *A_loc =
- (this->values.size() > 0) ? &this->values[0] : nullptr;
- const NumberType *B_loc = (B.values.size() > 0) ? &B.values[0] : nullptr;
+ (this->values.size() > 0) ? this->values.data() : nullptr;
+ const NumberType *B_loc =
+ (B.values.size() > 0) ? B.values.data() : nullptr;
pgeadd(&trans_b,
&n_rows,
char trans_b = transpose_B ? 'T' : 'N';
const NumberType *A_loc =
- (this->values.size() > 0) ? (&(this->values[0])) : nullptr;
+ (this->values.size() > 0) ? this->values.data() : nullptr;
const NumberType *B_loc =
- (B.values.size() > 0) ? (&(B.values[0])) : nullptr;
- NumberType *C_loc = (C.values.size() > 0) ? (&(C.values[0])) : nullptr;
+ (B.values.size() > 0) ? B.values.data() : nullptr;
+ NumberType *C_loc = (C.values.size() > 0) ? C.values.data() : nullptr;
int m = C.n_rows;
int n = C.n_columns;
int k = transpose_A ? this->n_rows : this->n_columns;
if (grid->mpi_process_is_active)
{
int info = 0;
- NumberType *A_loc = &this->values[0];
+ NumberType *A_loc = this->values.data();
// pdpotrf_(&uplo,&n_columns,A_loc,&submatrix_row,&submatrix_column,descriptor,&info);
ppotrf(&uplo,
&n_columns,
if (grid->mpi_process_is_active)
{
int info = 0;
- NumberType *A_loc = &this->values[0];
+ NumberType *A_loc = this->values.data();
const int iarow = indxg2p_(&submatrix_row,
&row_block_size,
property == LAPACKSupport::upper_triangular ? 'U' : 'L';
const char diag = 'N';
int info = 0;
- NumberType *A_loc = &this->values[0];
+ NumberType *A_loc = this->values.data();
ptrtri(&uploTriangular,
&diag,
&n_columns,
if (grid->mpi_process_is_active)
{
int info = 0;
- NumberType *A_loc = &this->values[0];
+ NumberType *A_loc = this->values.data();
if (is_symmetric)
{
il = std::min(eigenvalue_idx.first, eigenvalue_idx.second) + 1;
iu = std::max(eigenvalue_idx.first, eigenvalue_idx.second) + 1;
}
- NumberType *A_loc = &this->values[0];
+ NumberType *A_loc = this->values.data();
/*
* by setting lwork to -1 a workspace query for optimal length of work is
* performed
int lwork = -1;
int liwork = -1;
NumberType *eigenvectors_loc =
- (compute_eigenvectors ? &eigenvectors->values[0] : nullptr);
+ (compute_eigenvectors ? eigenvectors->values.data() : nullptr);
work.resize(1);
iwork.resize(1);
&submatrix_row,
&submatrix_column,
descriptor,
- &ev[0],
+ ev.data(),
eigenvectors_loc,
&eigenvectors->submatrix_row,
&eigenvectors->submatrix_column,
eigenvectors->descriptor,
- &work[0],
+ work.data(),
&lwork,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("psyev", info));
&abstol,
&m,
&nz,
- &ev[0],
+ ev.data(),
&orfac,
eigenvectors_loc,
&eigenvectors->submatrix_row,
&eigenvectors->submatrix_column,
eigenvectors->descriptor,
- &work[0],
+ work.data(),
&lwork,
- &iwork[0],
+ iwork.data(),
&liwork,
- &ifail[0],
- &iclustr[0],
- &gap[0],
+ ifail.data(),
+ iclustr.data(),
+ gap.data(),
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("psyevx", info));
}
&submatrix_row,
&submatrix_column,
descriptor,
- &ev[0],
+ ev.data(),
eigenvectors_loc,
&eigenvectors->submatrix_row,
&eigenvectors->submatrix_column,
eigenvectors->descriptor,
- &work[0],
+ work.data(),
&lwork,
&info);
&abstol,
&m,
&nz,
- &ev[0],
+ ev.data(),
&orfac,
eigenvectors_loc,
&eigenvectors->submatrix_row,
&eigenvectors->submatrix_column,
eigenvectors->descriptor,
- &work[0],
+ work.data(),
&lwork,
- &iwork[0],
+ iwork.data(),
&liwork,
- &ifail[0],
- &iclustr[0],
- &gap[0],
+ ifail.data(),
+ iclustr.data(),
+ gap.data(),
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("psyevx", info));
il = std::min(eigenvalue_idx.first, eigenvalue_idx.second) + 1;
iu = std::max(eigenvalue_idx.first, eigenvalue_idx.second) + 1;
}
- NumberType *A_loc = &this->values[0];
+ NumberType *A_loc = this->values.data();
/*
* By setting lwork to -1 a workspace query for optimal length of work is
int lwork = -1;
int liwork = -1;
NumberType *eigenvectors_loc =
- (compute_eigenvectors ? &eigenvectors->values[0] : nullptr);
+ (compute_eigenvectors ? eigenvectors->values.data() : nullptr);
work.resize(1);
iwork.resize(1);
{
char jobu = left_singluar_vectors ? 'V' : 'N';
char jobvt = right_singluar_vectors ? 'V' : 'N';
- NumberType *A_loc = &this->values[0];
- NumberType *U_loc = left_singluar_vectors ? &(U->values[0]) : nullptr;
- NumberType *VT_loc = right_singluar_vectors ? &(VT->values[0]) : nullptr;
+ NumberType *A_loc = this->values.data();
+ NumberType *U_loc = left_singluar_vectors ? U->values.data() : nullptr;
+ NumberType *VT_loc = right_singluar_vectors ? VT->values.data() : nullptr;
int info = 0;
/*
* by setting lwork to -1 a workspace query for optimal length of work is
&VT->submatrix_row,
&VT->submatrix_column,
VT->descriptor,
- &work[0],
+ work.data(),
&lwork,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pgesvd", info));
&VT->submatrix_row,
&VT->submatrix_column,
VT->descriptor,
- &work[0],
+ work.data(),
&lwork,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pgesvd", info));
if (grid->mpi_process_is_active)
{
char trans = transpose ? 'T' : 'N';
- NumberType *A_loc = &this->values[0];
- NumberType *B_loc = &B.values[0];
+ NumberType *A_loc = this->values.data();
+ NumberType *B_loc = B.values.data();
int info = 0;
/*
* by setting lwork to -1 a workspace query for optimal length of work is
&B.submatrix_row,
&B.submatrix_column,
B.descriptor,
- &work[0],
+ work.data(),
&lwork,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pgels", info));
&B.submatrix_row,
&B.submatrix_column,
B.descriptor,
- &work[0],
+ work.data(),
&lwork,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pgels", info));
iwork.resize(liwork);
int info = 0;
- const NumberType *A_loc = &this->values[0];
+ const NumberType *A_loc = this->values.data();
// by setting lwork to -1 a workspace query for optimal length of work is
// performed
descriptor,
&a_norm,
&rcond,
- &work[0],
+ work.data(),
&lwork,
- &iwork[0],
+ iwork.data(),
&liwork,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pdpocon", info));
descriptor,
&a_norm,
&rcond,
- &work[0],
+ work.data(),
&lwork,
- &iwork[0],
+ iwork.data(),
&liwork,
&info);
AssertThrow(info == 0, LAPACKSupport::ExcErrorCode("pdpocon", info));
hid_t dataspace_id = H5Screate_simple(2, dims, nullptr);
// create the dataset within the file using chunk creation properties
- hid_t type_id = hdf5_type_id(&tmp.values[0]);
+ hid_t type_id = hdf5_type_id(tmp.values.data());
hid_t dataset_id = H5Dcreate2(file_id,
"/matrix",
type_id,
// write the dataset
status = H5Dwrite(
- dataset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &tmp.values[0]);
+ dataset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp.values.data());
AssertThrow(status >= 0, ExcIO());
// create HDF5 enum type for LAPACKSupport::State and
copy_to(tmp);
// get pointer to data held by the process
- NumberType *data = (tmp.values.size() > 0) ? &tmp.values[0] : nullptr;
+ NumberType *data = (tmp.values.size() > 0) ? tmp.values.data() : nullptr;
herr_t status;
// dataset dimensions
// Selection
hid_t datatype = H5Dget_type(dataset_id);
H5T_class_t t_class_in = H5Tget_class(datatype);
- H5T_class_t t_class = H5Tget_class(hdf5_type_id(&tmp.values[0]));
+ H5T_class_t t_class = H5Tget_class(hdf5_type_id(tmp.values.data()));
AssertThrow(
t_class_in == t_class,
ExcMessage(
// read data
status = H5Dread(dataset_id,
- hdf5_type_id(&tmp.values[0]),
+ hdf5_type_id(tmp.values.data()),
H5S_ALL,
H5S_ALL,
H5P_DEFAULT,
- &tmp.values[0]);
+ tmp.values.data());
AssertThrow(status >= 0, ExcIO());
// create HDF5 enum type for LAPACKSupport::State and
ScaLAPACKMatrix<NumberType> tmp(n_rows, n_columns, column_grid, MB, NB);
// get pointer to data held by the process
- NumberType *data = (tmp.values.size() > 0) ? &tmp.values[0] : nullptr;
+ NumberType *data = (tmp.values.size() > 0) ? tmp.values.data() : nullptr;
herr_t status;
unsigned int idx = 0;
for (const auto &sparsity_line : send_data)
{
- const int ierr = MPI_Isend(&(sparsity_line.second[0]),
+ const int ierr = MPI_Isend(sparsity_line.second.data(),
sparsity_line.second.size(),
DEAL_II_DOF_INDEX_MPI_TYPE,
sparsity_line.first,
unsigned int idx = 0;
for (const auto &sparsity_line : send_data)
{
- const int ierr = MPI_Isend(&(sparsity_line.second[0]),
+ const int ierr = MPI_Isend(sparsity_line.second.data(),
sparsity_line.second.size(),
DEAL_II_DOF_INDEX_MPI_TYPE,
sparsity_line.first,
this->a_row,
colnums,
ncols,
- &((*value_cache)[0]),
+ value_cache->data(),
reinterpret_cast<TrilinosWrappers::types::int_type *>(
- &((*colnum_cache)[0])));
+ colnum_cache->data()));
value_cache->resize(ncols);
colnum_cache->resize(ncols);
AssertThrow(ierr == 0, ExcTrilinosError(ierr));
*column_space_map,
reinterpret_cast<int *>(
const_cast<unsigned int *>(
- &(n_entries_per_row[0]))),
+ n_entries_per_row.data())),
false))
, last_action(Zero)
, compressed(false)
input_row_map,
reinterpret_cast<int *>(
const_cast<unsigned int *>(
- &(n_entries_per_row[0]))),
+ n_entries_per_row.data())),
false))
, last_action(Zero)
, compressed(false)
Utilities::Trilinos::comm_self()),
*column_space_map,
reinterpret_cast<int *>(
- const_cast<unsigned int *>(&(n_entries_per_row[0]))),
+ const_cast<unsigned int *>(n_entries_per_row.data())),
false))
, last_action(Zero)
, compressed(false)
*column_space_map,
reinterpret_cast<int *>(
const_cast<unsigned int *>(
- &(n_entries_per_row[0]))),
+ n_entries_per_row.data())),
false))
, last_action(Zero)
, compressed(false)
Copy,
row_parallel_partitioning.make_trilinos_map(communicator, false),
reinterpret_cast<int *>(
- const_cast<unsigned int *>(&(n_entries_per_row[0]))),
+ const_cast<unsigned int *>(n_entries_per_row.data())),
false))
, last_action(Zero)
, compressed(false)
colnum_cache->size(),
ncols,
reinterpret_cast<TrilinosWrappers::types::int_type *>(
- const_cast<size_type *>(&(*colnum_cache)[0])));
+ const_cast<size_type *>(colnum_cache->data())));
AssertThrow(ierr == 0, ExcTrilinosError(ierr));
AssertThrow(static_cast<std::vector<size_type>::size_type>(ncols) ==
colnum_cache->size(),
[(cell / vec_size) * three_to_dim],
n_components,
fe_degree,
- &evaluation_data[0]);
+ evaluation_data.data());
for (unsigned int c = 0; c < n_components; ++c)
internal::FEEvaluationImplBasisChange<internal::evaluate_general,
dim,
// now build the patches in parallel
if (all_cells.size() > 0)
WorkStream::run(
- &all_cells[0],
- &all_cells[0] + all_cells.size(),
+ all_cells.data(),
+ all_cells.data() + all_cells.size(),
std::bind(&DataOut<dim, DoFHandlerType>::build_one_patch,
this,
std::placeholders::_1,
n_datasets, Utilities::fixed_power<dimension - 1>(n_subdivisions + 1));
// now build the patches in parallel
- WorkStream::run(&all_faces[0],
- &all_faces[0] + all_faces.size(),
+ WorkStream::run(all_faces.data(),
+ all_faces.data() + all_faces.size(),
std::bind(&DataOutFaces<dim, DoFHandlerType>::build_one_patch,
this,
std::placeholders::_1,
// now build the patches in parallel
WorkStream::run(
- &all_cells[0],
- &all_cells[0] + all_cells.size(),
+ all_cells.data(),
+ all_cells.data() + all_cells.size(),
std::bind(&DataOutRotation<dim, DoFHandlerType>::build_one_patch,
this,
std::placeholders::_1,
params.sorted = sorted;
std::vector<std::pair<unsigned int, double>> matches;
- kdtree->radiusSearch(¢er[0], radius, matches, params);
+ kdtree->radiusSearch(center.begin_raw(), radius, matches, params);
return matches;
}
std::vector<unsigned int> indices(n_points);
std::vector<double> distances(n_points);
- kdtree->knnSearch(&target[0], n_points, &indices[0], &distances[0]);
+ kdtree->knnSearch(target.begin_raw(),
+ n_points,
+ indices.data(),
+ distances.data());
// convert it to the format we want to return
std::vector<std::pair<unsigned int, double>> matches(n_points);
AssertThrowMPI(ierr);
}
const int ierr =
- MPI_Waitall(2 * n_neighbors, &n_requests[0], MPI_STATUSES_IGNORE);
+ MPI_Waitall(2 * n_neighbors, n_requests.data(), MPI_STATUSES_IGNORE);
AssertThrowMPI(ierr);
}
recv_ops++;
}
const int ierr =
- MPI_Waitall(send_ops + recv_ops, &requests[0], MPI_STATUSES_IGNORE);
+ MPI_Waitall(send_ops + recv_ops, requests.data(), MPI_STATUSES_IGNORE);
AssertThrowMPI(ierr);
}