<commit_before>/*
 * Copyright 2016, Simula Research Laboratory
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#ifndef _CCTAG_NUMERICAL_ELLIPSE_HPP_
#define _CCTAG_NUMERICAL_ELLIPSE_HPP_

#include <cctag/geometry/Point.hpp>
#include <Eigen/Core>
#include <iostream>

namespace cctag {
namespace numerical {
namespace geometry {

/**
 * It models an ellipse with standard form  x^2/a^2 + y^2/b^2 = 1, centered in center and rotated clock-wise by angle wrt the x-axis.
 * Note that, arbitrarly, the representation with the major axis aligned with the y-axis is chosen.
 */
class Ellipse
{
public:
    using Matrix = Eigen::Matrix3f;

    /**
     * @brief Default constructor, set all parameters to zero.
     */
    Ellipse() = default;

    /**
     * @brief Build an ellipse from a 3x3 matrix representing the ellipse as a conic.
     * @param[in] matrix The 3x3 matrix representing the ellipse.
     * @note By default, the representation with the major axis aligned with the y-axis is chosen.
     */
    explicit Ellipse(const Matrix& matrix);

    /**
     * @brief Build an ellipse from a set of parameters.
     * @param[in] center The center of the conic.
     * @param[in] a The length of the semi-axis x.
     * @param[in] b The length of the semi-axis y.
     * @param[in] angle The orientation of the ellipse wrt the x-axis as a clock-wise angle in radians.
     */
    Ellipse(const Point2d <Eigen::Vector3f>& center, float a, float b, float angle);


    /**
     * @brief Return the matrix representation of the ellipse.
     * @return 3x3 matrix representation of the ellipse.
     */
    inline Matrix &matrix() { return _matrix; }

    /**
     * @brief Return the center of the ellipse.
     * @return 3 element vector with the homogeneous coordinates of the ellipse.
     */
    inline const Point2d <Eigen::Vector3f> &center() const { return _center; }

    /**
     * @brief Return the center of the ellipse.
     * @return 3 element vector with the homogeneous coordinates of the ellipse.
     */
    inline Point2d <Eigen::Vector3f> &center() { return _center; }

    /**
     * @brief Return the length of the x-semi axis of the ellipse.
     * @return the length of the x-semi axis of the ellipse.
     */
    inline float a() const { return _a; }

    /**
     * @brief Return the length of the y-semi axis of the ellipse.
     * @return the length of the y-semi axis of the ellipse.
     */
    inline float b() const { return _b; }

    /**
     * @brief Return the orientation of the ellipse.
     * @return the clock-wise orientation angle in radians of the ellipse wrt the x-axis
     */
    inline float angle() const { return _angle; }

    /**
     * @brief Set the length of the x-semi axis of the ellipse.
     * @param[in] a the length of the x-semi axis.
     */
    void setA(float a);


    /**
     * @brief Set the orientation angle of the ellipse.
     * @param[in] angle the clock-wise orientation angle in radians.
     */
    void setAngle(float angle);
<commit_msg>[geometry] fix missing methods<commit_after>/*
 * Copyright 2016, Simula Research Laboratory
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#ifndef _CCTAG_NUMERICAL_ELLIPSE_HPP_
#define _CCTAG_NUMERICAL_ELLIPSE_HPP_

#include <cctag/geometry/Point.hpp>
#include <Eigen/Core>
#include <iostream>

namespace cctag {
namespace numerical {
namespace geometry {

/**
 * It models an ellipse with standard form  x^2/a^2 + y^2/b^2 = 1, centered in center and rotated clock-wise by angle wrt the x-axis.
 * Note that, arbitrarly, the representation with the major axis aligned with the y-axis is chosen.
 */
class Ellipse
{
public:
    using Matrix = Eigen::Matrix3f;

    /**
     * @brief Default constructor, set all parameters to zero.
     */
    Ellipse() = default;

    /**
     * @brief Build an ellipse from a 3x3 matrix representing the ellipse as a conic.
     * @param[in] matrix The 3x3 matrix representing the ellipse.
     * @note By default, the representation with the major axis aligned with the y-axis is chosen.
     */
    explicit Ellipse(const Matrix& matrix);

    /**
     * @brief Build an ellipse from a set of parameters.
     * @param[in] center The center of the conic.
     * @param[in] a The length of the semi-axis x.
     * @param[in] b The length of the semi-axis y.
     * @param[in] angle The orientation of the ellipse wrt the x-axis as a clock-wise angle in radians.
     */
    Ellipse(const Point2d <Eigen::Vector3f>& center, float a, float b, float angle);

    /**
     * @brief Return the matrix representation of the ellipse.
     * @return 3x3 matrix representation of the ellipse.
     */
    inline const Matrix &matrix() const { return _matrix; }

    /**
     * @brief Return the matrix representation of the ellipse.
     * @return 3x3 matrix representation of the ellipse.
     */
    inline Matrix& matrix() { return _matrix; }

    /**
     * @brief Return the center of the ellipse.
     * @return 3 element vector with the homogeneous coordinates of the ellipse.
     */
    inline const Point2d <Eigen::Vector3f> &center() const { return _center; }

    /**
     * @brief Return the center of the ellipse.
     * @return 3 element vector with the homogeneous coordinates of the ellipse.
     */
    inline Point2d <Eigen::Vector3f> &center() { return _center; }

    /**
     * @brief Return the length of the x-semi axis of the ellipse.
     * @return the length of the x-semi axis of the ellipse.
     */
    inline float a() const { return _a; }

    /**
     * @brief Return the length of the y-semi axis of the ellipse.
     * @return the length of the y-semi axis of the ellipse.
     */
    inline float b() const { return _b; }

    /**
     * @brief Return the orientation of the ellipse.
     * @return the clock-wise orientation angle in radians of the ellipse wrt the x-axis
     */
    inline float angle() const { return _angle; }

    /**
     * @brief Set the length of the x-semi axis of the ellipse.
     * @param[in] a the length of the x-semi axis.
     */
    void setA(float a);

    /**
     * @brief Set the length of the y-semi axis of the ellipse.
     * @param[in] b the length of the y-semi axis.
     */
    void setB(float b);

    /**
     * @brief Set the orientation angle of the ellipse.
     * @param[in] angle the clock-wise orientation angle in radians.
     */
    void setAngle(float angle);

{'fraction_non_alphanumeric': 0.09452217922000596, 'fraction_numerical': 0.008633521881512354, 'mean_word_length': 2.6675764192139737, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '7635154', 'n_tokens_mistral': 2114, 'n_tokens_neox': 1996, 'n_words': 843}