<commit_before>/// @file
///	@ingroup 	minlib
///	@copyright	Copyright 2018 The Min-Lib Authors. All rights reserved.
///	@license	Use of this source code is governed by the MIT License found in the License.md file.

#pragma once


namespace c74 { namespace min { namespace lib {


	///	A single-channel interpolating delay line.

	class delay {
	public:
		/// Capacity of the delay is fixed at instantiation
		/// @param capacity	The number of samples to allocate for the maximum delay allowed, which will also be used as the initial delay.
		/// Default is 256.

		delay(number capacity = 256)
		: m_history(static_cast<size_t>(capacity + 5))    // 5 extra samples to accomodate the 'now' sample + up to 4 interpolation samples
		{
			size(capacity);
		}


		/// Capacity of the delay is fixed at instantiation
		/// @param capacity_and_size	The number of samples to allocate for the maximum delay allowed, along with a second initial delay
		/// setting that is less than this maximum.

		delay(std::pair<size_t, number> capacity_and_size)
		: m_history(capacity_and_size.first + 5) {
			assert(capacity_and_size.first > capacity_and_size.second);
			size(capacity_and_size.second);
		}


		/// Set a new delay time in samples.
		/// @param	new_size	The new delay time in samples.

		void size(number new_size) {
			m_size            = new_size;
			m_size_fractional = m_size - static_cast<std::size_t>(m_size);
		}

		/// Set a new delay time in samples.
		/// @param	new_size	The new delay time in samples.

		void size(size_t new_size) {
			m_size = static_cast<number>(m_size);
			m_size_fractional = 0;
		}


		/// Return the current delay time in samples.
		/// @return The delay time in samples.

		number size() const {
			return m_size;
		}


		/// Return the integer part of the current delay time in samples.
		/// @return The integer part of the delay time in samples.

		std::size_t integral_size() {<commit_msg>delay: fix for setting size with an int<commit_after>/// @file
///	@ingroup 	minlib
///	@copyright	Copyright 2018 The Min-Lib Authors. All rights reserved.
///	@license	Use of this source code is governed by the MIT License found in the License.md file.

#pragma once


namespace c74 { namespace min { namespace lib {


	///	A single-channel interpolating delay line.

	class delay {
	public:
		/// Capacity of the delay is fixed at instantiation
		/// @param capacity	The number of samples to allocate for the maximum delay allowed, which will also be used as the initial delay.
		/// Default is 256.

		delay(number capacity = 256)
		: m_history(static_cast<size_t>(capacity + 5))    // 5 extra samples to accomodate the 'now' sample + up to 4 interpolation samples
		{
			size(capacity);
		}


		/// Capacity of the delay is fixed at instantiation
		/// @param capacity_and_size	The number of samples to allocate for the maximum delay allowed, along with a second initial delay
		/// setting that is less than this maximum.

		delay(std::pair<size_t, number> capacity_and_size)
		: m_history(capacity_and_size.first + 5) {
			assert(capacity_and_size.first > capacity_and_size.second);
			size(capacity_and_size.second);
		}


		/// Set a new delay time in samples.
		/// @param	new_size	The new delay time in samples.

		void size(number new_size) {
			m_size            = new_size;
			m_size_fractional = m_size - static_cast<std::size_t>(m_size);
		}

		/// Set a new delay time in samples.
		/// @param	new_size	The new delay time in samples.

		void size(size_t new_size) {
			m_size = static_cast<number>(new_size);
			m_size_fractional = 0;
		}


		/// Return the current delay time in samples.
		/// @return The delay time in samples.

		number size() const {
			return m_size;
		}


		/// Return the integer part of the current delay time in samples.
		/// @return The integer part of the delay time in samples.

		std::size_t integral_size() {
{'fraction_non_alphanumeric': 0.09191555097837281, 'fraction_numerical': 0.008753861997940269, 'mean_word_length': 3.0808823529411766, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '4517793', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1156, 'n_words': 459}