<commit_before>/*
	linear_algebra_containers/vector3 header file
	Copyright (C) 2015  <NAME>

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License along
	with this program; if not, write to the Free Software Foundation, Inc.,
	51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef VECTOR3
#define VECTOR3

#include <utility>

#include "column_vector.h"

/**
 * Vector template for 3d space
 *
 * This template provides some convenience methods on top of the
 * column_vector class which are appropriate for calculations in three
 * dimensions.
 * @tparam T Type used for the entries of the vector. Must support basic
 * aritmethic operations.
 */
template<typename T>
class vector3 : public column_vector<T,3>
{

public:
	/**
	 * @brief Construct an empty vector
	 *
	 * All entries are uninitialized if T is of fundamental type or constructed
	 * using their default constructor if T is a complex type.
	 */
	vector3() = default;

	/**
	 * @brief Construct a vector with values
	 *
	 * Constructs a vector initialized to the specified values.
	 */
	vector3(T x, T y, T z)
		: column_vector {{x,y,z}}
	{
	}

	/**
	* @brief Construct a vector3 from column vector
	*
	* Constructs a vector3 from the specified 3 dimensional column vector.
	*/
	vector3(const column_vector<T,3>& vec)
		: column_vector<T,3>(vec)
	{
	}

	/**
	* @brief Construct a vector3 from column vector
	*
	* Constructs a vector3 from the specified 3 dimensional r-value column
	* vector.
	*/
	vector3(column_vector<T,3>&& vec)
		: column_vector<T,3>(std::forward<column_vector<T,3>>(vec))
	{
	}

	/**
	 * @brief Return x value
	 * @return The x value of the vector
	 */
	T x() const
	{
		return this->entries[0];
	}

	/**
	 * @brief Return y value
	 * @return The y value of the vector
	 */
	T y() const<commit_msg>Added matrix to vector3 conversion constructor<commit_after>/*
	linear_algebra_containers/vector3 header file
	Copyright (C) 2015  <NAME>

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License along
	with this program; if not, write to the Free Software Foundation, Inc.,
	51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef VECTOR3
#define VECTOR3

#include <utility>

#include "column_vector.h"

/**
 * Vector template for 3d space
 *
 * This template provides some convenience methods on top of the
 * column_vector class which are appropriate for calculations in three
 * dimensions.
 * @tparam T Type used for the entries of the vector. Must support basic
 * aritmethic operations.
 */
template<typename T>
class vector3 : public column_vector<T,3>
{

public:
	/**
	 * @brief Construct an empty vector
	 *
	 * All entries are uninitialized if T is of fundamental type or constructed
	 * using their default constructor if T is a complex type.
	 */
	vector3() = default;

	/**
	 * @brief Construct a vector with values
	 *
	 * Constructs a vector initialized to the specified values.
	 */
	vector3(T x, T y, T z)
		: column_vector {{x,y,z}}
	{
	}

	/**
	* @brief Construct a vector3 from column vector
	*
	* Constructs a vector3 from the specified 3 dimensional column vector.
	*/
	vector3(const column_vector<T,3>& vec)
		: column_vector<T,3>(vec)
	{
	}

	/**
	* @brief Construct a vector3 from matrix
	*
	* Constructs a vector3 from the specified 3x1 dimensional matrix.
	*/
	vector3(const matrix<T,3,1>& mat)
		: column_vector<T,3>(mat)
	{
	}

	/**
	* @brief Construct a vector3 from column vector
	*
	* Constructs a vector3 from the specified 3 dimensional r-value column
	* vector.
	*/
	vector3(column_vector<T,3>&& vec)
		: column_vector<T,3>(std::forward<column_vector<T,3>>(vec))
	{
	}

	/**
	 * @brief Return x value
	 * @return The x value of the vector
	 */
	T x() const
	{
		return this->entries[0];
	}

	/**
	 * @brief Return y value
	 * @return The y value of the vector
	 */
	T y() const
{'fraction_non_alphanumeric': 0.08523434259643302, 'fraction_numerical': 0.017627540439651597, 'mean_word_length': 3.7053658536585368, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '3344742', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1422, 'n_words': 621}