Skip to content

FortC++ provides header-only arrays that act like Fortran arrays

License

Notifications You must be signed in to change notification settings

dalon-work/FortCpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

FortC++ provides header-only arrays that act like Fortran arrays

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published