<commit_before>//******************************************************************************
// FILE : function_matrix_trace.cpp
//
// LAST MODIFIED : 1 October 2004
//
// DESCRIPTION :
//==============================================================================

#if defined (ONE_TEMPLATE_DEFINITION_IMPLEMENTED)
#include "computed_variable/function_matrix_trace_implementation.cpp"
#else // defined (ONE_TEMPLATE_DEFINITION_IMPLEMENTED)
#include "computed_variable/function_matrix_trace.hpp"
#endif // defined (ONE_TEMPLATE_DEFINITION_IMPLEMENTED)

#if !defined (AIX)
template<>
Function_handle Function_variable_matrix_trace<Scalar>::evaluate_derivative(
	std::list<Function_variable_handle>& independent_variables)
//******************************************************************************
// LAST MODIFIED : 1 October 2004
//
// DESCRIPTION :
// ???DB.  To be done
//==============================================================================
{
	boost::intrusive_ptr< Function_matrix_trace<Scalar> > function_matrix_trace;
	Function_handle result(0);
	Function_size_type order;

	if ((function_matrix_trace=boost::dynamic_pointer_cast<
		Function_matrix_trace<Scalar>,Function>(function()))&&
		(0<(order=independent_variables.size())))
	{
		Function_size_type number_of_dependent_values,number_of_independent_values,
			number_of_rows;
		boost::intrusive_ptr< Function_matrix<Scalar> > derivative,matrix;

		if ((matrix=boost::dynamic_pointer_cast<Function_matrix<Scalar>,
			Function>(function_matrix_trace->matrix_private->evaluate()))&&
			(matrix->number_of_columns()==(number_of_rows=matrix->number_of_rows()))&&
			(derivative=boost::dynamic_pointer_cast<Function_matrix<Scalar>,
			Function>(function_matrix_trace->matrix_private->evaluate_derivative(
			independent_variables)))&&(number_of_rows*number_of_rows==
			(number_of_dependent_values=derivative->number_of_rows()))&&
			(0<(number_of_independent_values=derivative->number_of_columns())))
		{
			Function_size_type dependent_row,i,j;
			Matrix result_matrix(1,number_of_independent_values);
			Scalar sum;

			for (j=1;j<=number_of_independent_values;j++)
			{
				sum=0;
				dependent_row=1;
				for (i=0;i<number_of_rows;i++)<commit_msg>Removed unused variables<commit_after>//******************************************************************************
// FILE : function_matrix_trace.cpp
//
// LAST MODIFIED : 18 October 2004
//
// DESCRIPTION :
//==============================================================================

#if defined (ONE_TEMPLATE_DEFINITION_IMPLEMENTED)
#include "computed_variable/function_matrix_trace_implementation.cpp"
#else // defined (ONE_TEMPLATE_DEFINITION_IMPLEMENTED)
#include "computed_variable/function_matrix_trace.hpp"
#endif // defined (ONE_TEMPLATE_DEFINITION_IMPLEMENTED)

#if !defined (AIX)
template<>
Function_handle Function_variable_matrix_trace<Scalar>::evaluate_derivative(
	std::list<Function_variable_handle>& independent_variables)
//******************************************************************************
// LAST MODIFIED : 18 October 2004
//
// DESCRIPTION :
// ???DB.  To be done
//==============================================================================
{
	boost::intrusive_ptr< Function_matrix_trace<Scalar> > function_matrix_trace;
	Function_handle result(0);

	if ((function_matrix_trace=boost::dynamic_pointer_cast<
		Function_matrix_trace<Scalar>,Function>(function()))&&
		(0<independent_variables.size()))
	{
		Function_size_type number_of_independent_values,number_of_rows;
		boost::intrusive_ptr< Function_matrix<Scalar> > derivative,matrix;

		if ((matrix=boost::dynamic_pointer_cast<Function_matrix<Scalar>,
			Function>(function_matrix_trace->matrix_private->evaluate()))&&
			(matrix->number_of_columns()==(number_of_rows=matrix->number_of_rows()))&&
			(derivative=boost::dynamic_pointer_cast<Function_matrix<Scalar>,
			Function>(function_matrix_trace->matrix_private->evaluate_derivative(
			independent_variables)))&&(number_of_rows*number_of_rows==
			derivative->number_of_rows())&&
			(0<(number_of_independent_values=derivative->number_of_columns())))
		{
			Function_size_type dependent_row,i,j;
			Matrix result_matrix(1,number_of_independent_values);
			Scalar sum;

			for (j=1;j<=number_of_independent_values;j++)
			{
				sum=0;
				dependent_row=1;
				for (i=0;i<number_of_rows;i++)
{'fraction_non_alphanumeric': 0.252400548696845, 'fraction_numerical': 0.008687700045724738, 'mean_word_length': 8.943181818181818, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 45, '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': '4435107', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1247, 'n_words': 154}