<commit_before>{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MagicHash, UnboxedTuples #-}
{-# LANGUAGE KindSignatures, DataKinds #-}
{-# LANGUAGE TypeOperators, FlexibleInstances, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Numeric.EasyTensor
-- Copyright   :  (c) <NAME>
-- License     :  MIT
--
-- Maintainer  :  <EMAIL>
--
-- This module generalizes matrices and vectors.
-- Yet it is limited to rank 2, allowing for a simple and nicely type-checked interface.
--
--
--
-----------------------------------------------------------------------------

module Numeric.EasyTensor
  ( Tensor ()
  -- * Common operations
  , fill
  , prod, (%*)
  , inverse, transpose
  , (<:>), (//), (\\)
  , index, indexCol, indexRow, dimN, dimM
  , (V..*.), dot, (·), normL1,  normL2, normLPInf, normLNInf, normLP
  , eye, diag, det, trace
  , toDiag, toDiag', fromDiag, fromDiag'
  -- * Type abbreviations
  , Mat, Vec, Vec', Scf
  , Vec2f, Vec3f, Vec4f
  , Vec2f', Vec3f', Vec4f'
  , Mat22f, Mat23f, Mat24f
  , Mat32f, Mat33f, Mat34f
  , Mat42f, Mat43f, Mat44f
  -- * Simplified type constructors
  , scalar, vec2, vec3, vec4, vec2', vec3', vec4'
  , mat22, mat33, mat44
  -- * Some low-dimensional operations
  , det2, det2', cross, (×)
  ) where

import GHC.Base (runRW#)
import GHC.Prim
import GHC.Types
import GHC.TypeLits
import Unsafe.Coerce (unsafeCoerce)

import qualified Numeric.Vector as V
import qualified Numeric.Matrix as M<commit_msg>Exposed MatrixCalculus and VectorCalculus to make possible their use in constraints<commit_after>{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MagicHash, UnboxedTuples #-}
{-# LANGUAGE KindSignatures, DataKinds #-}
{-# LANGUAGE TypeOperators, FlexibleInstances, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Numeric.EasyTensor
-- Copyright   :  (c) <NAME>
-- License     :  MIT
--
-- Maintainer  :  <EMAIL>
--
-- This module generalizes matrices and vectors.
-- Yet it is limited to rank 2, allowing for a simple and nicely type-checked interface.
--
--
--
-----------------------------------------------------------------------------

module Numeric.EasyTensor
  ( Tensor ()
  , V.VectorCalculus (), M.MatrixCalculus ()
  -- * Common operations
  , fill
  , prod, (%*)
  , inverse, transpose
  , (<:>), (//), (\\)
  , index, indexCol, indexRow, dimN, dimM
  , (V..*.), dot, (·), normL1,  normL2, normLPInf, normLNInf, normLP
  , eye, diag, det, trace
  , toDiag, toDiag', fromDiag, fromDiag'
  -- * Type abbreviations
  , Mat, Vec, Vec', Scf
  , Vec2f, Vec3f, Vec4f
  , Vec2f', Vec3f', Vec4f'
  , Mat22f, Mat23f, Mat24f
  , Mat32f, Mat33f, Mat34f
  , Mat42f, Mat43f, Mat44f
  -- * Simplified type constructors
  , scalar, vec2, vec3, vec4, vec2', vec3', vec4'
  , mat22, mat33, mat44
  -- * Some low-dimensional operations
  , det2, det2', cross, (×)
  ) where

import GHC.Base (runRW#)
import GHC.Prim
import GHC.Types
import GHC.TypeLits
import Unsafe.Coerce (unsafeCoerce)

import qualified Numeric.Vector as V
import qualified Numeric.Matrix as M
{'fraction_non_alphanumeric': 0.21993890585948347, 'fraction_numerical': 0.022771452374340462, 'mean_word_length': 2.4634615384615386, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '208578', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1238, 'n_words': 309}