Skip to content

B-Manitas/CMatrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

163 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMatrix: A Powerful C++ Matrix Library

License: MIT Status

CMatrix is a robust C++ matrix library designed to simplify matrix operations and provide extensive functionalities. This library is tailored for Data Science and Machine Learning projects, offering a versatile toolset for working with matrices.

Table of Contents

  1. Installation
  2. Example of Usage
  3. Hierarchical Structure
  4. Documentation
  5. Libraries Used
  6. See Also
  7. License

Installation

To install the library, follow these steps:

  1. Clone the repository using the following command:
git clone https://github.com/B-Manitas/CMatrix.git
  1. Include the CMatrix.hpp file in your project.

  2. Compile your project with the following flags:

-std=c++11 -fopenmp

Exemple of Usage

Here's an example of how to use CMatrix:

#include "CMatrix.hpp"

int main()
{
    // Create a 2x3 matrix
    cmatrix<int> mat = {{1, 2, 3}, {4, 5, 6}};

    // Create a random 3x2 matrix
    cmatrix<int> rand = cmatrix<int>::randint(3, 2, 0, 10);
    rand.print();

    // Performs a calculation on the matrix
    mat += ((rand * 2) - 1);

    // Print the transpose of the result
    mat.transpose().print();

    return 0;
}

// TERMINAL
$ g++ -std=c++11 -fopenmp main.cpp -o main
> "[[18, 9], [5, 22], [20, 13]]"

Hierarchical Structure

CMatrix is structured as follows:

Class Description
include
CBool.hpp The class that represents a boolean matrix.
CMatrix.hpp The main template class that can work with any data type.
src
CMatrix.tpp General methods of the class.
CMatrixConstructors.hpp Implementation of class constructors.
CMatrixGetter.hpp Methods to retrieve information about the matrix and access its elements.
CMatrixSetter.hpp Methods to set data in the matrix.
CMatrixCheck.tpp Methods to verify matrix conditions and perform checks before operations to prevent errors.
CMatrixManipulation.hpp Methods to find elements in the matrix and transform it.
CMatrixOperator.hpp Implementation of various operators.
CMatrixStatic.hpp Implementation of static methods of the class.
CMatrixStatistics.hpp Methods to perform statistical operations on the matrix.
test
CMatrixTest.hpp Contains the tests for the class.

Documentation

For detailed information on how to use CMatrix, consult the documentation.

Libraries Used

  • OpenMP: An API for parallel programming. (Required for compile CMatrix)
  • GoogleTest: A C++ testing framework.
  • GoogleBenchmark: A C++ benchmarking framework.
  • Doxygen: A documentation generator.

See Also

  • CDataFrame: A C++ DataFrame library for Data Science and Machine Learning projects.

License

This project is licensed under the MIT License, ensuring its free and open availability to the community.

About

A C++ Matrix library for Data Science

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors