typename ReadWriteVector<Number>::iterator
ReadWriteVector<Number>::begin ()
{
- return &val[0];
+ return val;
}
typename ReadWriteVector<Number>::const_iterator
ReadWriteVector<Number>::begin () const
{
- return &val[0];
+ return val;
}
typename ReadWriteVector<Number>::iterator
ReadWriteVector<Number>::end ()
{
- return &val[this->n_elements()];
+ return val + this->n_elements();
}
typename ReadWriteVector<Number>::const_iterator
ReadWriteVector<Number>::end () const
{
- return &val[this->n_elements()];
+ return val + this->n_elements();
}
const unsigned int n_elements = stored_elements.n_elements();
if (operation == VectorOperation::insert)
{
- cudaError_t error_code = cudaMemcpy(&val[0], cuda_vec.get_values(),
+ cudaError_t error_code = cudaMemcpy(val, cuda_vec.get_values(),
n_elements*sizeof(Number),
cudaMemcpyDeviceToHost);
AssertCuda(error_code);
typename Vector<Number>::iterator
Vector<Number>::begin ()
{
- return &val[0];
+ return val;
}
typename Vector<Number>::const_iterator
Vector<Number>::begin () const
{
- return &val[0];
+ return val;
}
typename Vector<Number>::iterator
Vector<Number>::end ()
{
- return &val[vec_size];
+ return val + vec_size;
}
typename Vector<Number>::const_iterator
Vector<Number>::end () const
{
- return &val[vec_size];
+ return val + vec_size;
}
AssertIndexRange (row, row_starts.size()-1);
const unsigned int index = row_starts[row][0];
AssertIndexRange(index, dof_indices.size()+1);
- return dof_indices.empty() ? nullptr : &dof_indices[0] + index;
+ return dof_indices.empty() ? nullptr : &dof_indices[index];
}
AssertIndexRange (row, row_starts.size()-1);
const unsigned int index = row_starts[row+1][0];
AssertIndexRange(index, dof_indices.size()+1);
- return dof_indices.empty() ? nullptr : &dof_indices[0] + index;
+ return dof_indices.empty() ? nullptr : &dof_indices[index];
}
AssertIndexRange (row, row_starts.size()-1);
const unsigned int index = row_starts[row][1];
AssertIndexRange (index, constraint_indicator.size()+1);
- return constraint_indicator.empty() ? nullptr : &constraint_indicator[0] + index;
+ return constraint_indicator.empty() ? nullptr : &constraint_indicator[index];
}
AssertIndexRange (row, row_starts.size()-1);
const unsigned int index = row_starts[row+1][1];
AssertIndexRange (index, constraint_indicator.size()+1);
- return constraint_indicator.empty() ? nullptr : &constraint_indicator[0] + index;
+ return constraint_indicator.empty() ? nullptr : &constraint_indicator[index];
}
AssertDimension (row_starts.size(), row_starts_plain_indices.size());
const unsigned int index = row_starts_plain_indices[row];
AssertIndexRange(index, plain_dof_indices.size()+1);
- return plain_dof_indices.empty() ? nullptr : &plain_dof_indices[0] + index;
+ return plain_dof_indices.empty() ? nullptr : &plain_dof_indices[index];
}
}
do
{
- int ierr = MPI_Bcast (&interesting_range[0], 2, MPI_DOUBLE,
+ int ierr = MPI_Bcast (interesting_range, 2, MPI_DOUBLE,
master_mpi_rank, mpi_communicator);
AssertThrowMPI(ierr);
do
{
- int ierr = MPI_Bcast (&interesting_range[0], 2, MPI_DOUBLE,
+ int ierr = MPI_Bcast (interesting_range, 2, MPI_DOUBLE,
master_mpi_rank, mpi_communicator);
AssertThrowMPI(ierr);
cells[i].material_id = 0;
};
tria.create_triangulation (
- std::vector<Point<2> >(&vertices[0], &vertices[10]),
+ std::vector<Point<2> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
vertices_tmp[2] = Point<2> (-half_length, radius_0);
vertices_tmp[3] = Point<2> (half_length, radius_1);
- const std::vector<Point<2> > vertices (&vertices_tmp[0], &vertices_tmp[4]);
+ const std::vector<Point<2> > vertices (std::begin(vertices_tmp), std::end(vertices_tmp));
unsigned int cell_vertices[1][GeometryInfo<2>::vertices_per_cell];
for (unsigned int i = 0; i < GeometryInfo<2>::vertices_per_cell; ++i)
};
tria.create_triangulation (
- std::vector<Point<2> >(&vertices[0], &vertices[8]),
+ std::vector<Point<2> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData());
};
tria.create_triangulation (
- std::vector<Point<2> >(&vertices[0], &vertices[8]),
+ std::vector<Point<2> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
}
};
tria.create_triangulation (
- std::vector<Point<dim> >(&vertices[0], &vertices[7]),
+ std::vector<Point<dim> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
};
tria.create_triangulation (
- std::vector<Point<2> >(&vertices[0], &vertices[8]),
+ std::vector<Point<2> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
cells[i].material_id = 0;
};
tria.create_triangulation (
- std::vector<Point<3> >(&vertices[0], &vertices[20]),
+ std::vector<Point<3> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
};
tria.create_triangulation (
- std::vector<Point<3> >(&vertices[0], &vertices[26]),
+ std::vector<Point<3> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
};
tria.create_triangulation (
- std::vector<Point<3> >(&vertices[0], &vertices[n_vertices]),
+ std::vector<Point<3> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
}
};
tria.create_triangulation (
- std::vector<Point<3> >(&vertices[0], &vertices[24]),
+ std::vector<Point<3> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
};
tria.create_triangulation (
- std::vector<Point<dim> >(&vertices[0], &vertices[15]),
+ std::vector<Point<dim> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
};
tria.create_triangulation (
- std::vector<Point<3> >(&vertices[0], &vertices[16]),
+ std::vector<Point<3> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
};
tria.create_triangulation (
- std::vector<Point<3> >(&vertices[0], &vertices[16]),
+ std::vector<Point<3> >(std::begin(vertices), std::end(vertices)),
cells,
SubCellData()); // no boundary information
}
*/
const_iterator begin () const
{
- return &adjacent_cells[0];
+ return adjacent_cells;
}
// adjacent cells, and use this to point to the element past the
// last valid one
if (adjacent_cells[0].cell_index == numbers::invalid_unsigned_int)
- return &adjacent_cells[0];
+ return adjacent_cells;
else if (adjacent_cells[1].cell_index == numbers::invalid_unsigned_int)
- return &adjacent_cells[0]+1;
+ return adjacent_cells + 1;
else
- return &adjacent_cells[0]+2;
+ return adjacent_cells + 2;
}
private:
*/
const_iterator begin () const
{
- return &edge_indices[0];
+ return edge_indices;
}
// indices, and use this to point to the element past the
// last valid one
if (edge_indices[0] == numbers::invalid_unsigned_int)
- return &edge_indices[0];
+ return edge_indices;
else if (edge_indices[1] == numbers::invalid_unsigned_int)
- return &edge_indices[0]+1;
+ return edge_indices + 1;
else
- return &edge_indices[0]+2;
+ return edge_indices + 2;
}
private:
for (origin_vertex_of_cell=0;
origin_vertex_of_cell<GeometryInfo<dim>::vertices_per_cell;
++origin_vertex_of_cell)
- if (std::count (&starting_vertex_of_edge[0],
- &starting_vertex_of_edge[0]+GeometryInfo<dim>::lines_per_cell,
+ if (std::count (starting_vertex_of_edge,
+ starting_vertex_of_edge + GeometryInfo<dim>::lines_per_cell,
cell_list[cell_index].vertex_indices[origin_vertex_of_cell])
== dim)
break;
const Tensor<spacedim-structdim,spacedim>
average_parent_alternating_form
- = std::accumulate (&parent_alternating_forms[0],
- &parent_alternating_forms[GeometryInfo<structdim>::vertices_per_cell],
+ = std::accumulate (parent_alternating_forms,
+ parent_alternating_forms + GeometryInfo<structdim>::vertices_per_cell,
Tensor<spacedim-structdim,spacedim>());
// now do the same
->line((hex->face(5)->refinement_case() == RefinementCase<2>::cut_x) ? 1 : 3) //3
};
- lines = &lines_x[0];
+ lines = lines_x;
unsigned int line_indices_x[4];
AssertCuda(error_code);
// Copy the vector from the host to the temporary vector on the device
- error_code = cudaMemcpy(&tmp[0], V.begin(), n_elements*sizeof(Number),
+ error_code = cudaMemcpy(tmp, V.begin(), n_elements*sizeof(Number),
cudaMemcpyHostToDevice);
AssertCuda(error_code);