From 50646fc0f8dc822fe9b2f1ffef873d034ea10eec Mon Sep 17 00:00:00 2001 From: Seb James Date: Sat, 18 Nov 2023 23:06:04 +0000 Subject: [PATCH] Playing with pages --- docs/404.html | 24 ++++++++++++++++++++++++ docs/Gemfile | 33 +++++++++++++++++++++++++++++++++ docs/README.md | 3 +++ docs/_config.yml | 31 ++++++++++++++++++++++++++++--- docs/about.md | 18 ++++++++++++++++++ tests/testRandom.cpp | 22 +++++++++++----------- 6 files changed, 117 insertions(+), 14 deletions(-) create mode 100644 docs/404.html create mode 100644 docs/Gemfile create mode 100644 docs/about.md diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 00000000..c472b4ea --- /dev/null +++ b/docs/404.html @@ -0,0 +1,24 @@ +--- +layout: default +--- + + + +
+

404

+ +

Page not found :(

+

The requested page could not be found.

+
diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 00000000..73defd93 --- /dev/null +++ b/docs/Gemfile @@ -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? diff --git a/docs/README.md b/docs/README.md index 3a941037..dd5047e1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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) diff --git a/docs/_config.yml b/docs/_config.yml index 0d170146..0893d996 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,3 +1,28 @@ -theme: jekyll-theme-minimal -title: morphologica -description: Reference material on using morphologica classes. +title: morphologica OpenGL data visualization +email: your-email@example.com +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/ diff --git a/docs/about.md b/docs/about.md new file mode 100644 index 00000000..8b4e0b28 --- /dev/null +++ b/docs/about.md @@ -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 diff --git a/tests/testRandom.cpp b/tests/testRandom.cpp index 359112a3..13850b59 100644 --- a/tests/testRandom.cpp +++ b/tests/testRandom.cpp @@ -19,7 +19,7 @@ int main() morph::RandUniform rui; cout << "Random number is " << static_cast(rui.get()) << endl; // You can find the min and max: - cout << "That integer RNG has min and max: " << static_cast(rui.min()) + cout << "That integer unsigned char (or short on Windows) RNG has min and max: " << static_cast(rui.min()) << "/" << static_cast(rui.max()) << endl; // A random uniform generator returning real/floating point types @@ -40,15 +40,15 @@ int main() // numbers before a repeat. morph::RandUniform 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 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 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; } @@ -56,40 +56,40 @@ int main() morph::RandUniform 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 tenrns3 = rubndf.get(10); for (auto d : tenrns3) { cout << d << endl; } // Another with seed 1 for float morph::RandUniform 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 tenrns32 = rubndf2.get(10); for (auto d : tenrns32) { cout << d << endl; } // Test two rng generators where no seed is specified morph::RandUniform 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 tenrns33 = rubndf3.get(10); for (auto d : tenrns33) { cout << d << endl; } morph::RandUniform 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 tenrns34 = rubndf4.get(10); for (auto d : tenrns34) { cout << d << endl; } // Normally distributed numbers: morph::RandNormal rnorm (5, 0.1); vector tennorms = rnorm.get(10); - cout << "10 normals:" << endl; + cout << "10 random normals (double type):" << endl; for (auto d : tennorms) { cout << d << endl; } morph::RandLogNormal rln (5, 0.1); vector 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 rpois (5); vector 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;