<commit_before>#pragma once

#include <vector>
#include <memory>

#include "pugixml.hpp"

#include "core_mesh.hpp"
#include "angular_quadrature.hpp"
#include "angle.hpp"
#include "geom.hpp"

/** \file
* Here are provided a couple of classes that facilitate ray tracing for MoC.
* There is a Ray class, which contains vectors of ray segment lengths and the
* FSR index corresponding to each segment, as well as the boundary condition
* index corresponding the start and end points of the ray.
*
* Also defined is the RayData class, which is a collection of Ray objects
* organized by angle and plane.
*/


namespace mocc {
    enum VolumeCorrection {
        FLAT,
        ANGLE
    };

    /**
     * A Ray stores vectors of segment length and the flat source region index
     * that each segment is crossing. The FSR indices are represented as an
     * offset from the first FSR in a given plane, allowing for ray data to be
     * reused for each instance of a geometrically-unique plane. 
    */
    class Ray {
    public:
        /** \brief Construct a ray from two starting points. */
        Ray( Point2 p1, Point2 p2, unsigned int bc1, unsigned int bc2, int iz, 
                const CoreMesh &mesh );

        unsigned int nseg() const {
            return nseg_;
        }

        // Return a reference to the whole vector of segment lengths
        const VecF& seg_len() const {
            return seg_len_;
        }

        /**
         * \brief Return a reference to a single segment length.
         *
         * This method is not const, since the segment lengths must be mutable,
         * so that the RayData object can correct the segment lengths once all
         * rays have been traced. Its a bit messy... when interacting with the
         * rays in any other context, the const version should be used. This is
         * relatively automatic, since the RayData object only exposes each Ray
         * as a const reference.
         */ 
        float_t& seg_len( int iseg ) {
            return seg_len_[iseg];
        }

        // Return a const segment length
        float_t seg_len( int iseg ) const {
            return seg_len_[iseg];
        }

        // Return a reference to the whole vector of segment indices
        const VecI& seg_index() const {
            return seg_index_;
        }

        // Only return a reference to a single segment length
        unsigned int seg_index( int iseg ) const {
            return seg_index_[iseg];
        }

        // Return the bc index for the start/stop of the ray
        unsigned int bc( int dir ) const {
            return bc_[dir];
        }

        

    private:
        // Length of ray segments
        VecF seg_len_;<commit_msg>Fix a typo in the ncseg routine on Ray<commit_after>#pragma once

#include <vector>
#include <memory>

#include "pugixml.hpp"

#include "core_mesh.hpp"
#include "angular_quadrature.hpp"
#include "angle.hpp"
#include "geom.hpp"

/** \file
* Here are provided a couple of classes that facilitate ray tracing for MoC.
* There is a Ray class, which contains vectors of ray segment lengths and the
* FSR index corresponding to each segment, as well as the boundary condition
* index corresponding the start and end points of the ray.
*
* Also defined is the RayData class, which is a collection of Ray objects
* organized by angle and plane.
*/


namespace mocc {
    enum VolumeCorrection {
        FLAT,
        ANGLE
    };

    /**
     * A Ray stores vectors of segment length and the flat source region index
     * that each segment is crossing. The FSR indices are represented as an
     * offset from the first FSR in a given plane, allowing for ray data to be
     * reused for each instance of a geometrically-unique plane. 
    */
    class Ray {
    public:
        /** \brief Construct a ray from two starting points. */
        Ray( Point2 p1, Point2 p2, unsigned int bc1, unsigned int bc2, int iz, 
                const CoreMesh &mesh );

        unsigned int nseg() const {
            return nseg_;
        }

        // Return a reference to the whole vector of segment lengths
        const VecF& seg_len() const {
            return seg_len_;
        }

        /**
         * \brief Return a reference to a single segment length.
         *
         * This method is not const, since the segment lengths must be mutable,
         * so that the RayData object can correct the segment lengths once all
         * rays have been traced. Its a bit messy... when interacting with the
         * rays in any other context, the const version should be used. This is
         * relatively automatic, since the RayData object only exposes each Ray
         * as a const reference.
         */ 
        float_t& seg_len( int iseg ) {
            return seg_len_[iseg];
        }

        // Return a const segment length
        float_t seg_len( int iseg ) const {
            return seg_len_[iseg];
        }

        // Return a reference to the whole vector of segment indices
        const VecI& seg_index() const {
            return seg_index_;
        }

        // Only return a reference to a single segment length
        unsigned int seg_index( int iseg ) const {
            return seg_index_[iseg];
        }

        // Return the bc index for the start/stop of the ray
        unsigned int bc( int dir ) const {
            return bc_[dir];
        }

        unsigned int ncseg() const {
            return cm_cell_.size();
        }


    private:
        // Length of ray segments
        VecF seg_len_;
{'fraction_non_alphanumeric': 0.06297229219143577, 'fraction_numerical': 0.0021590500179920835, 'mean_word_length': 2.031079607415485, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4410108', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1419, 'n_words': 683}