GitXplorerGitXplorer
Z

Fortran-RedBlack

public
4 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
08482c9d3ed050394d4d3e2542aaa6e542cbd008

Add equality comparison operator

ZZedThree committed 6 years ago
Unverified
a15437c21d35dc9a5f8bf11d4f829096a186ba15

Add assignment operator

ZZedThree committed 6 years ago
Unverified
7bb8474134211366fb93b93bae037a9e052d9605

Install gfortran-7 on travis

ZZedThree committed 6 years ago
Unverified
5545ff5afecfdb9de693857b279b02efb11bb38d

Travis already checks out submodules (and spells it correctly too)

ZZedThree committed 6 years ago
Unverified
a9af78f4a9dc3dbcf71c4a596219cebc22c6c430

Change pfunit submodule from ssh to https

ZZedThree committed 6 years ago
Unverified
d4d01710843904510ac9bf7fe90bbc0a83ca1605

Add travis config

ZZedThree committed 6 years ago

README

The README file for this repository.

Red-Black and Binary Search Trees in Fortran

This repo contains two modules with implementations of red-black and binary search trees. I wrote them purely as a learning exercise and not for actual use, so they only store integers. For an actually useful associative container, they would need to store key-value pairs.

Examples

Use of either type of tree goes as follows:

use binary_tree
implicit none

type(binary_tree_t) :: tree

call tree%add(4)
call tree%add(5)
call tree%add(3)

print*, tree%values()

Tests

pFUnit is bundled as a submodule. You may need to run the following command to get it:

git submodule update --init --recursive

Then build it like:

mkdir externals/build_pfunit
cd externals/build_pfunit
cmake ../pFUnit/ -DMPI=NO -DOPENMP=NO \
  -DCMAKE_INSTALL_PREFIX=../install_pfunit
make && make install

Then you can build and run the tests like:

mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=$(pwd)/../externals/install_pfunit/
make && ctest --verbose