<commit_before>/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2012 <NAME>
 * Copyright (C) 2012 <NAME>
 */

#include <shogun/features/MatrixFeatures.h>

namespace shogun {

template< class ST > CMatrixFeatures< ST >::CMatrixFeatures()
: CFeatures(0)
{
	init();
}

template< class ST > CMatrixFeatures< ST >::CMatrixFeatures(
		int32_t num_vec,
		int32_t num_feat)
: CFeatures(0), m_num_vectors(num_vec), m_num_features(num_feat)
{
	init();

	m_features = SG_MALLOC(SGMatrix< ST >, num_vec);
}

template< class ST > CMatrixFeatures< ST >::CMatrixFeatures(
		SGMatrix< ST >* feats,
		int32_t num)
: CFeatures(0)<commit_msg>* bug fix: add initialization of matrices in MatrixFeatures constructor<commit_after>/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2012 <NAME>
 * Copyright (C) 2012 <NAME>
 */

#include <shogun/features/MatrixFeatures.h>

namespace shogun {

template< class ST > CMatrixFeatures< ST >::CMatrixFeatures()
: CFeatures(0)
{
	init();
}

template< class ST > CMatrixFeatures< ST >::CMatrixFeatures(
		int32_t num_vec,
		int32_t num_feat)
: CFeatures(0), m_num_vectors(num_vec), m_num_features(num_feat)
{
	init();

	m_features = SG_MALLOC(SGMatrix< ST >, num_vec);
	for ( int32_t i = 0 ; i < num_vec ; ++i )
		new (&m_features[i]) SGMatrix< ST >();
}

template< class ST > CMatrixFeatures< ST >::CMatrixFeatures(
		SGMatrix< ST >* feats,
		int32_t num)
: CFeatures(0)
{'fraction_non_alphanumeric': 0.11655773420479303, 'fraction_numerical': 0.021241830065359478, 'mean_word_length': 4.722741433021807, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 26, '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': '4137836', 'n_tokens_mistral': 661, 'n_tokens_neox': 609, 'n_words': 203}