<commit_before>//
//  MatrixComponentWiseFunction.swift
//  SwiftNum
//
//  Created by <NAME> on 1/1/17.
//
//

import Foundation

public func extendToMatrix(_ f: @escaping (Double) -> Double) -> ((Matrix) -> Matrix) {
    return { mat in
        var res = mat
        res.data = res.data.map(f)
        return res
    }
}

public let exp = extendToMatrix(Foundation.exp)
public let tanh = extendToMatrix(Foundation.tanh)
public let log = extendToMatrix(Foundation.log)<commit_msg>Add more common component wise functions<commit_after>//
//  MatrixComponentWiseFunction.swift
//  SwiftNum
//
//  Created by <NAME> on 1/1/17.
//
//

import Foundation

public func extendToMatrix(_ f: @escaping (Double) -> Double) -> ((Matrix) -> Matrix) {
    return { mat in
        var res = mat
        res.data = res.data.map(f)
        return res
    }
}

public let exp = extendToMatrix(Foundation.exp)
public let log = extendToMatrix(Foundation.log)
public let sin = extendToMatrix(Foundation.sin)
public let cos = extendToMatrix(Foundation.cos)
public let tan = extendToMatrix(Foundation.tan)
public let sinh = extendToMatrix(Foundation.sinh)
public let cosh = extendToMatrix(Foundation.cosh)
public let tanh = extendToMatrix(Foundation.tanh)
{'fraction_non_alphanumeric': 0.11678832116788321, 'fraction_numerical': 0.006488240064882401, 'mean_word_length': 3.375886524822695, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1554730', 'n_tokens_mistral': 391, 'n_tokens_neox': 377, 'n_words': 106}