GithubHelp home page GithubHelp logo

fortcpp's Introduction

FortC++

FortC++ is a templated header library designed to add Fortran-style arrays into C++. This is not the first or the best such offering. Here is a list of others:

This library is not intended to be a linear algebra package. It is intended to create user-friendly arrays which provide whole-array operations, slicing, views, multi-d indexing, and bounds checking. Whole-array operations do not generate temporaries (with appropriate inlining), keeping the overhead of using the arrays down.

FortC++ supports any rank of array using variadic templates. Column-Major ordering of the data is the default, but Row-Major ordering is fully supported. There are two main components to FortCpp:

FortCpp::Alloc< Type, Rank, Options >
FortCpp::Fixed< Type, Dims... >

The Alloc class specifies an allocatable array, whose dimensions are only known at runtime. This is the main workhorse of FortC++. The Fixed class specifies a static array whose size must be determined at compile time. These two classes are fully compatible with each other.


How to use FortC++

Because FortC++ is a header-file only library, using the library is as straightforward as placing the library in your project's directory and including FortCpp.h.

For a more detailed introduction to FortC++, see the tutorial.

fortcpp's People

Contributors

dalon-work avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fortcpp's Issues

where

This will have to act similar to NumPy's where routine.

MultiD Iterator

Implement a multiD Iterator, compare it's speed with normal usage, etc.

Lbound shift

Create a wrapper class to specify the index of the lower bounds of an array

Vector Indexing

Create new class that allows for Vector Indexing, similar to Fortran:

real,dimension(10) :: a
a = 1.0
a( [1,3,4,7] ) = 0.0

I'm thinking of using Array1d as a linear indexer, which can then be used in functions like where

Align data

Need to default align dynamically allocated arrays

struct member/function access

By overloading the ->* operator, it might be possible to create arrays that reference a particular member in a struct, or to apply a member function to all elements in an array.

Create LHS resize

Make a function that allows the LHS of an operation to be resized to the size of the RHS.
Something like this:

Array1d<float> a,b(10),c(10);
a.resize() = b+c;

Unit Tests

Create a small testing framework to make sure everything is working correctly, at all times.

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.