<commit_before>//---------------------------------------------------------------------------
//    $Id$
//
//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//---------------------------------------------------------------------------
#ifndef __deal2__point_h
#define __deal2__point_h


#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/tensor_base.h>
#include <cmath>

DEAL_II_NAMESPACE_OPEN

/**
 * The <tt>Point</tt> class provides for a point or vector in a space with
 * arbitrary dimension <tt>dim</tt>.
 *
 * It is the preferred object to be passed to functions which operate on
 * points in spaces of a priori unknown dimension: rather than using functions
 * like <tt>double f(double x)</tt> and <tt>double f(double x, double y)</tt>,
 * you use <tt>double f(Point<dim> &p)</tt>.
 *
 * <tt>Point</tt> also serves as a starting point for the implementation of
 * the geometrical primitives like cells, edges, or faces.
 *
 * Within deal.II, we use the <tt>Point</tt> class mainly to denote the points
 * that make up geometric objects. As such, they have a small number of
 * additional operations over general tensors of rank 1 for which we use the
 * <tt>Tensor<1,dim></tt> class. In particular, there is a distance() function
 * to compute the Euclidian distance between two points in space.
 *
 * The <tt>Point</tt> class is really only used where the coordinates of an
 * object can be thought to possess the dimension of a length. For all other
 * uses, such as the gradient of a scalar function (which is a tensor of rank
 * 1, or vector, with as many elements as a point object, but with different
 * physical units), we use the <tt>Tensor<1,dim></tt> class.
 *
 * @ingroup geomprimitives
 * @author <NAME>, 1997
 */
template <int dim, typename Number>
class Point : public Tensor<1,dim,Number>
{
public:
  /**
   * Standard constructor. Creates
   * an origin.
   */
  Point ();

  /**
   * Constructor. Initialize all
   * entries to zero if
   * <tt>initialize==true</tt>.
   */
  explicit Point (const bool initialize);

  /**
   * Convert a tensor to a point. Since no
   * additional data is inside a point,
   * this is ok.
   */
  Point (const Tensor<1,dim,Number> &);

  /**
   *  Constructor for one dimensional
   *  points. This function is only
   *  implemented for <tt>dim==1</tt> since
   *  the usage is considered unsafe for
   *  points with <tt>dim!=1</tt>.
   */
  explicit Point (const Number x);

  /**
   *  Constructor for two dimensional
   *  points. This function is only
   *  implemented for <tt>dim==2</tt> since
   *  the usage is considered unsafe for
   *  points with <tt>dim!=2</tt>.
   */
  Point (const Number x, const Number y);

  /**
   *  Constructor for three dimensional
   *  points. This function is only
   *  implemented for <tt>dim==3</tt> since
   *  the usage is considered unsafe for
   *  points with <tt>dim!=3</tt>.
   */
  Point (const Number x, const Number y, const Number z);

  /**
   * Return a unit vector in
   * coordinate direction <tt>i</tt>.
   */
  static Point<dim,Number> unit_vector(const unsigned int i);

  /**
   *  Read access to the <tt>index</tt>th
   *  coordinate.
   */
  Number   operator () (const unsigned int index) const;

  /**
   *  Read and write access to the<commit_msg>Improve documentation somewhat.<commit_after>//---------------------------------------------------------------------------
//    $Id$
//
//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//---------------------------------------------------------------------------
#ifndef __deal2__point_h
#define __deal2__point_h


#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/tensor_base.h>
#include <cmath>

DEAL_II_NAMESPACE_OPEN

/**
 * The <tt>Point</tt> class provides for a point or vector in a space with
 * arbitrary dimension <tt>dim</tt>.
 *
 * It is the preferred object to be passed to functions which operate on
 * points in spaces of a priori unknown dimension: rather than using functions
 * like <tt>double f(double x)</tt> and <tt>double f(double x, double y)</tt>,
 * you use <tt>double f(Point<dim> &p)</tt>.
 *
 * <tt>Point</tt> also serves as a starting point for the implementation of
 * the geometrical primitives like cells, edges, or faces.
 *
 * Within deal.II, we use the <tt>Point</tt> class mainly to denote the points
 * that make up geometric objects. As such, they have a small number of
 * additional operations over general tensors of rank 1 for which we use the
 * <tt>Tensor<1,dim></tt> class. In particular, there is a distance() function
 * to compute the Euclidian distance between two points in space.
 *
 * The <tt>Point</tt> class is really only used where the coordinates of an
 * object can be thought to possess the dimension of a length. For all other
 * uses, such as the gradient of a scalar function (which is a tensor of rank
 * 1, or vector, with as many elements as a point object, but with different
 * physical units), we use the <tt>Tensor<1,dim></tt> class.
 *
 * @ingroup geomprimitives
 * @author <NAME>, 1997
 */
template <int dim, typename Number>
class Point : public Tensor<1,dim,Number>
{
public:
  /**
   * Standard constructor. Creates
   * an object that corresponds to the origin, i.e., all coordinates
   * are set to zero.
   */
  Point ();

  /**
   * Constructor. Initialize all
   * entries to zero if
   * <tt>initialize==true</tt> (in which case it is equivalent to the default
   * constructor) or leaves the elements uninitialized if
   * <tt>initialize==false</tt>.
   */
  explicit Point (const bool initialize);

  /**
   * Convert a tensor to a point.
   */
  Point (const Tensor<1,dim,Number> &);

  /**
   *  Constructor for one dimensional
   *  points. This function is only
   *  implemented for <tt>dim==1</tt> since
   *  the usage is considered unsafe for
   *  points with <tt>dim!=1</tt> as it would leave some components
   *  of the point coordinates uninitialized.
   */
  explicit Point (const Number x);

  /**
   *  Constructor for two dimensional
   *  points. This function is only
   *  implemented for <tt>dim==2</tt> since
   *  the usage is considered unsafe for
   *  points with <tt>dim!=2</tt> as it would leave some components
   *  of the point coordinates uninitialized (if dim>2) or would
   *  not use some arguments (if dim<2).
   */
  Point (const Number x,
         const Number y);

  /**
   *  Constructor for three dimensional
   *  points. This function is only
   *  implemented for <tt>dim==3</tt> since
   *  the usage is considered unsafe for
   *  points with <tt>dim!=3</tt> as it would leave some components
   *  of the point coordinates uninitialized (if dim>3) or would
   *  not use some arguments (if dim<3).
   */
  Point (const Number x,
         const Number y,
         const Number z);

  /**
   * Return a unit vector in
   * coordinate direction <tt>i</tt>.
   */
  static Point<dim,Number> unit_vector(const unsigned int i);

  /**
   *  Read access to the <tt>index</tt>th
   *  coordinate.
   */
  Number   operator () (const unsigned int index) const;

  /**
   *  Read and write access to the
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.017471736896197326, 'mean_word_length': 2.6773736419461502, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 107, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '804155', 'n_tokens_mistral': 2376, 'n_tokens_neox': 2230, 'n_words': 938}