<commit_before>#pragma once
#include <iostream>
#include <CommonStates.h>
#include <SimpleMath.h>
#include <chrono>
#include "Logger.h"

using DirectX::SimpleMath::Ray;
using DirectX::CommonStates;
using std::unique_ptr;

inline void SetD3DDebugName(ID3D11DeviceChild* child, const std::string& name)
{
	if (child != nullptr)
	{
		child->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(name.size()), name.c_str());
	}
}

inline float lerp(float value1, float value2, float amount)
{
	return value1 + ((value2 - value1) * amount);
}

inline float frand()
{
	float r = static_cast <float> (rand()) / static_cast <float> (RAND_MAX);
	return r;
}

inline float RandomFloat(float a, float b) 
{
	float random = ((float)rand()) / (float)RAND_MAX;
	float diff = b - a;
	float r = random * diff;
	return a + r;
}

class StatesHelper
{
public:
	static StatesHelper& GetInstance()
	{
		static StatesHelper instance;
		return instance;
	}

	inline CommonStates* GetStates()
	{
		return states.get();
	}

	inline void Load(ComPtr<ID3D11Device> device)
	{
		states.reset(new CommonStates(device.Get()));
	}

private:
	unique_ptr<CommonStates> states;
};

static std::chrono::time_point<std::chrono::system_clock> g_start;
static std::chrono::time_point<std::chrono::system_clock> g_end;
<commit_msg>Add RandomVector3 Helper Function<commit_after>#pragma once
#include <iostream>
#include <CommonStates.h>
#include <SimpleMath.h>
#include <chrono>
#include "Logger.h"

using DirectX::SimpleMath::Ray;
using DirectX::CommonStates;
using std::unique_ptr;
using DirectX::SimpleMath::Vector3;


inline void SetD3DDebugName(ID3D11DeviceChild* child, const std::string& name)
{
	if (child != nullptr)
	{
		child->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(name.size()), name.c_str());
	}
}

inline float lerp(float value1, float value2, float amount)
{
	return value1 + ((value2 - value1) * amount);
}

inline float frand()
{
	float r = static_cast <float> (rand()) / static_cast <float> (RAND_MAX);
	return r;
}

inline float RandomFloat(float a, float b) 
{
	float random = static_cast <float> (rand()) / static_cast <float> (RAND_MAX);

	float diff = b - a;
	float r = random * diff;
	return a + r;
}

// Return a Vector3 whose components are randomly chosen
// based on the components of a and b
// NewVector(Random(a.x, b.x), Random(a.y, b.y), Random(a.z, b.z))
inline Vector3 RandomVector3(const Vector3& a, const Vector3& b)
{
	return Vector3(RandomFloat(a.x, b.x), RandomFloat(a.y, b.y), RandomFloat(a.z, b.z));
}

class StatesHelper
{
public:
	static StatesHelper& GetInstance()
	{
		static StatesHelper instance;
		return instance;
	}

	inline CommonStates* GetStates()
	{
		return states.get();
	}

	inline void Load(ComPtr<ID3D11Device> device)
	{
		states.reset(new CommonStates(device.Get()));
	}

private:
	unique_ptr<CommonStates> states;
};

static std::chrono::time_point<std::chrono::system_clock> g_start;
static std::chrono::time_point<std::chrono::system_clock> g_end;

{'fraction_non_alphanumeric': 0.141, 'fraction_numerical': 0.011333333333333334, 'mean_word_length': 5.495670995670996, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, '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': '2003556', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1073, 'n_words': 264}