Skip to content

Commit

Permalink
Playing with pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sebjameswml committed Nov 18, 2023
1 parent 37a682e commit 50646fc
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 14 deletions.
24 changes: 24 additions & 0 deletions docs/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
33 changes: 33 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
#gem "jekyll", "~> 3.8.6"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
layout: home
---
# morphologica

![A banner image of a hexgrid surface plot](https://github.com/ABRG-Models/morphologica/blob/main/examples/screenshots/banner.png?raw=true)
Expand Down
31 changes: 28 additions & 3 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
theme: jekyll-theme-minimal
title: morphologica
description: Reference material on using morphologica classes.
title: morphologica OpenGL data visualization
email: [email protected]
description: >- # this means to ignore newlines until "baseurl:"
Learn how to use morphologica C++ classes to write fast numerical simulations
with amazing OpenGL visualization
#baseurl: "" # the subpath of your site, e.g. /blog
#url: "" # the base hostname & protocol for your site, e.g. http://example.com
#twitter_username:
github_username: sebjameswml

# Build settings
#markdown: kramdown
theme: minima
#theme: jekyll-theme-minimal
plugins:
- jekyll-feed

# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
# exclude:
# - Gemfile
# - Gemfile.lock
# - node_modules
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
18 changes: 18 additions & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
layout: page
title: About
permalink: /about/
---

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/)

You can find the source code for Minima at GitHub:
[jekyll][jekyll-organization] /
[minima](https://github.com/jekyll/minima)

You can find the source code for Jekyll at GitHub:
[jekyll][jekyll-organization] /
[jekyll](https://github.com/jekyll/jekyll)


[jekyll-organization]: https://github.com/jekyll
22 changes: 11 additions & 11 deletions tests/testRandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main()
morph::RandUniform<SMALL_T, std::mt19937> rui;
cout << "Random number is " << static_cast<unsigned int>(rui.get()) << endl;
// You can find the min and max:
cout << "That integer RNG has min and max: " << static_cast<unsigned int>(rui.min())
cout << "That integer unsigned char (or short on Windows) RNG has min and max: " << static_cast<unsigned int>(rui.min())
<< "/" << static_cast<unsigned int>(rui.max()) << endl;

// A random uniform generator returning real/floating point types
Expand All @@ -40,56 +40,56 @@ int main()
// numbers before a repeat.
morph::RandUniform<unsigned int, std::mt19937_64> rubnd (0, 3);
// You can find the min and max:
cout << "That bounded, integer RNG has min and max: " << rubnd.min() << "/" << rubnd.max() << endl;
cout << "Ten random numbers in that range:\n";
cout << "That bounded, unsigned integer RNG has min and max: " << rubnd.min() << "/" << rubnd.max() << endl;
cout << "Ten random unsigned int numbers in that range:\n";
vector<unsigned int> tenrns2 = rubnd.get(10);
for (auto d : tenrns2) { cout << d << endl; }

// There is an overload of get which fills a fixed size array that you pass it with random numbers
std::array<unsigned int, 12> twelverns;
rubnd.get(twelverns);
cout << "Twelve random numbers in an array:\n";
cout << "Twelve random unsigned int numbers in an array:\n";
for (auto d : twelverns) { cout << d << endl; }


// Similar for float
morph::RandUniform<float, std::mt19937> rubndf (0.0f, 1000.0f, 1);
// You can find the min and max:
cout << "FIXED SEED: bounded, float RNG has min and max: " << rubndf.min() << "/" << rubndf.max() << endl;
cout << "Ten random numbers in that range:\n";
cout << "Ten random float numbers in that range:\n";
vector<float> tenrns3 = rubndf.get(10);
for (auto d : tenrns3) { cout << d << endl; }

// Another with seed 1 for float
morph::RandUniform<float, std::mt19937> rubndf2 (0.0f, 1000.0f, 1);
cout << "Ten random numbers in that range from second rng with seed 1:\n";
cout << "Ten random float numbers in that range from second rng with seed 1:\n";
vector<float> tenrns32 = rubndf2.get(10);
for (auto d : tenrns32) { cout << d << endl; }

// Test two rng generators where no seed is specified
morph::RandUniform<float, std::mt19937> rubndf3 (0.0f, 1000.0f);
cout << "Ten random numbers from the first 'default seed rng':\n";
cout << "Ten random float numbers from the first 'default seed rng':\n";
vector<float> tenrns33 = rubndf3.get(10);
for (auto d : tenrns33) { cout << d << endl; }
morph::RandUniform<float, std::mt19937> rubndf4 (0.0f, 1000.0f);
cout << "Ten random numbers from the second 'default seed rng':\n";
cout << "Ten random float numbers from the second 'default seed rng':\n";
vector<float> tenrns34 = rubndf4.get(10);
for (auto d : tenrns34) { cout << d << endl; }

// Normally distributed numbers:
morph::RandNormal<double, std::mt19937_64> rnorm (5, 0.1);
vector<double> tennorms = rnorm.get(10);
cout << "10 normals:" << endl;
cout << "10 random normals (double type):" << endl;
for (auto d : tennorms) { cout << d << endl; }

morph::RandLogNormal<double, std::mt19937_64> rln (5, 0.1);
vector<double> tenlnorms = rln.get(10);
cout << "10 log normals:" << endl;
cout << "10 log normals (double type):" << endl;
for (auto d : tenlnorms) { cout << d << endl; }

morph::RandPoisson<int, std::mt19937> rpois (5);
vector<int> tenpois = rpois.get(10);
cout << "10 Poisson RNs:" << endl;
cout << "10 Poisson RNs (int type):" << endl;
for (auto d : tenpois) { cout << d << endl; }

return rtn;
Expand Down

0 comments on commit 50646fc

Please sign in to comment.