Coder Social home page Coder Social logo

verri / jules Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 2.0 1022 KB

Statistical computing library that aims to provide R-like experience in modern C++

Home Page: https://verri.github.io/jules/

License: zlib License

Makefile 0.43% Python 2.85% C++ 92.51% CMake 4.21%
statistical-computing multidimensional-arrays blas modern-cpp

jules's Introduction

Jules

Join the chat at https://gitter.im/verri-jules/Lobby Build Status codecov GitHub license Github Releases AUR

Jules is a statistical computing library that aims to provide R-like experience in modern C++.

Currently, it focus on a versatile, yet easy-to-use multi-dimensional array implementation with some common statistical functionalities.

A implementation of data frames and their common operations inspired by Tidyverse is also intended, but it will probably require many features to come to C++ in the next years.

Dependencies

Installation

If you intend to use BLAS optimized functions, make sure CBLAS is installed.

Recommended: Local Git Submodule

The recommended installation of the library is including it as a submodule of your Git project.

In your project, do

$ git submodule add https://github.com/verri/jules.git external/jules

Local copy

Download the latest release and unzip it.

System-wide installation

For Arch Linux users, install the AUR package jules-git via pacaur, makepkg, or any other method of your preference.

System-wide installation is recommended only if you are sure about what you doing.

Clone the repository.

$ git clone https://github.com/verri/jules.git
$ cd jules

Install via CMake 3.0+.

$ cmake -H. -Bbuild
$ cmake --build build --target install

Usage and Compilation

Jules is a header-only library, so you just need to instruct the compiler its location.

Recommended: CMake 3.0+

If you installed the library as a submodule, include the following line in your CMakeLists.txt

add_subdirectory(external/jules)
target_link_libraries(my-target PRIVATE jules)

If you installed system-wide, use

find_package(Cool REQUIRED)
target_link_libraries(my-target PRIVATE ${Cool_LIBRARY})

If using BLAS, make sure to link to your target.

find_package(BLAS REQUIRED)
target_link_libraries(my-target PRIVATE ${BLAS_LIBRARIES})

Compiler flags

You can directly specify the compiler flags:

CXXFLAGS="-std=c++17 -isystem/path/to/release/include"

If using BLAS, make sure to link it using -lblas or -lcblas, depending on your system.

Documentation

Generated with standardese here (not up-to-date, since standardese is not progressing very well).

Soon, we should provide a cheatsheet with a summary of functionalities. In the meantime, the examples in the test folder should suffice.

Acknowledgements

This project is supported by FAPESP as part of the project "High level data classification based on complex network applied to invariant pattern recognition" (2013/25876-6).

jules's People

Contributors

codacy-badger avatar verri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jules's Issues

Base/Numeric utilities based on R base package.

All these functions should receive an range with 0 or more elements.
The result for an empty range must be well defined.

Arithmetic

  • sum
    • sum(empty<T>) returns jules::numeric_traits<T>::additive_identity()
  • prod
    • prod(empty<T>) returns jules::numeric_traits<T>::multiplicative_identity()
  • mean
    • Effectively mean(rng) -> sum(rng) / length(rng)
  • max
    • max(empty<T>) returns jules::numeric_traits<T>::unbounded_min()
  • min
    • min(empty<T>) returns jules::numeric_traits<T>::unbounded_max()

Logical:

  • all
    • all(empty<bool>) returns true
  • any
    • any(empty<bool>) returns false
  • none
    • none(empty<bool>) returns true
  • which
  • count
  • freq

Set operations:

All of them assume that the input ranges are sorted.

  • unique
  • set_difference
  • set_union
  • set_intersection
  • includes

The ones that return a range will return jules::const_vector by default.
A mechanism to control this output should be provided.

Fast indirect slicing for jules::vector

We can exploit the simple nature of jules::vector to improve indirect slicing, which is very common.

  • Simplified version of indirect_slicing/do_slice
  • Using move semantics so we do not copy indexes

dplyr-like dataframe operations.

Dataframes should be modified using only dplyr-like operations and views.
Raw exposure of columns may result in an invalid dataframe.

Disable bitwise operators for arrays.

  • Ranges TS uses operator| for actions and views;
  • Other libraries my also use them;
  • They are not common in high level codes;
  • There is always apply as an alternative.

Module structure and dependencies.

-> means depends on

Structure

  • Core
    • Debug (standalone)
    • Type (standalone)
    • Range
  • Base -> Core
    • Async
    • Numeric
    • Random
  • Array -> Base
    • Slice (standalone, except for Base and Core)
    • Expression, Ref, Contiguous, Indirect, Base Array
    • IO
    • Functional
    • BLAS
    • Numeric
  • Dataframe -> Array
    • Column
    • Expression -> Column
    • Dataframe -> Expression
    • IO -> everything else

Dependencies

Dataframe -> Array -> Base -> Core

Implement jules::const_vector

Thread-safe, memory-shared vector with constant values.

It should decrease memory usage in cases where std::vector<jules::index_t> are required.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.