<commit_before>/*
 * Matcha Robotics Application Framework
 *
 * Copyright (C) 2011 <NAME> 
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
#ifndef MATCHA_MATH_MATRIX_OPERATIONS_HPP__
#define MATCHA_MATH_MATRIX_OPERATIONS_HPP__

#include <matcha/math/scalar.hpp>
#include <matcha/math/matrix.hpp>

#include <utility>

namespace matcha { namespace math {

void fill(const scalar_base& src, matrix_base& dst);

void split(const matrix_base& src, matrix_base& dst, uint32_t channel);

template<typename T>
matrix<T> split(const matrix<T>& src, uint32_t channel)
{
	matrix<T> result(src.rows(), src.cols(), channel);
	split(src, result, channel);

	return std::move( result );
}

void make_identity(matrix_base& dst);

template<typename T>
matrix<T> identity(uint32_t rows, uint32_t cols, uint32_t channels = 1)
{
	matrix<T> result(rows, cols, channels);
	make_identity( result );

	return std::move( result );
}

} // end of namespace math
} // end of namespace matcha

#endif
<commit_msg>modify comment<commit_after>/*
 * Matcha Robotics Application Framework
 *
 * Copyright (C) 2011 <NAME> 
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
#ifndef MATCHA_MATH_MATRIX_OPERATIONS_HPP__
#define MATCHA_MATH_MATRIX_OPERATIONS_HPP__

#include <matcha/math/scalar.hpp>
#include <matcha/math/matrix.hpp>

#include <utility>

namespace matcha { namespace math {

/**
 * fill matrix with scalar value 
 */
void fill(const scalar_base& src, matrix_base& dst);

/**
 * split matrix
 */
void split(const matrix_base& src, matrix_base& dst, uint32_t channel);

/**
 * return splitted matrix
 */
template<typename T>
matrix<T> split(const matrix<T>& src, uint32_t channel)
{
	matrix<T> result(src.rows(), src.cols(), channel);
	split(src, result, channel);

	return std::move( result );
}

/**
 * make matrix identity matrix
 */
void make_identity(matrix_base& dst);

/**
 * return identity matrix
 */
template<typename T>
matrix<T> identity(uint32_t rows, uint32_t cols, uint32_t channels = 1)
{
	matrix<T> result(rows, cols, channels);
	make_identity( result );

	return std::move( result );
}

} // end of namespace math
} // end of namespace matcha

#endif

{'fraction_non_alphanumeric': 0.1047087980173482, 'fraction_numerical': 0.011771995043370507, 'mean_word_length': 4.149920255183413, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6956512', 'n_tokens_mistral': 1026, 'n_tokens_neox': 990, 'n_words': 346}