Skip to content

Commit

Permalink
feat: add description task-split-cube
Browse files Browse the repository at this point in the history
  • Loading branch information
maks-mishin committed Sep 20, 2022
1 parent 62b3e48 commit 38c1319
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 93 deletions.
4 changes: 2 additions & 2 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
<p><strong>Страница удалена или вы могли ошибиться в адресе.</strong></p>
<p>Попробуйте найти её среди публикаций <a href="/">вот тут</a></p>
</div>
59 changes: 10 additions & 49 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,16 @@
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
#
# If you need help with YAML syntax, here are some quick references for you:
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
# https://learnxinyminutes.com/docs/yaml/
#
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.

title: Your awesome title
email: [email protected]
description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll
title: Zato Development
email: [email protected]
author: Макс Мишин
description: >-
Блог о разработке и преподавании.
baseurl: ""
url: ""
github_username: maks-mishin
linkedin_username: maks-mishin-a1450717a
telegram_username: maks_mishin

# Build settings
theme: minima
plugins:
- jekyll-feed

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
#
# exclude:
# - .sass-cache/
# - .jekyll-cache/
# - gemfiles/
# - Gemfile
# - Gemfile.lock
# - node_modules/
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
29 changes: 0 additions & 29 deletions _posts/2022-08-19-welcome-to-jekyll.markdown

This file was deleted.

73 changes: 73 additions & 0 deletions _posts/2022-09-20-task-split-cube.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
layout: post
title: "Разрезание кубика"
date: 2022-09-20 22:07:00 +0300
categories: numerical_recipes
---
Для распараллеливания задач мат. физики необходимо разбить исходную сетку на набор областей и обрабатывать их все параллельно.

### Описание задания

Представим, что исходная сетка представляет собой сферу. Тогда её поместить в некий ограничивающий куб, который задаётся двумя диагонально противоположными вершинами `A (xmin, ymin, zmin)` и `B (xmax, ymax, zmax)`.

Программист Максим предложил следующую идею: для разбиения исходной сетки можно разбить ограничивающий куб на параллелепипеды и потом просто проверять, какие элементы сетки попали в ту или иную область.

Вот так должен выглядеть результат работы алгоритма, когда для каждого направления задан коэффициент разбиения, равный 2:

![Пример работы алгоритма](/images/task_split_cube.png)

Из исходного куба получается 8 параллелепипедов поменьше, у которых также заданы координаты двух вершин.

### Что нужно сделать

Реализуйте функцию `Cube[] CubePartition(Cube source_cube, int x_coeff, int y_coeff, int z_coeff)`, которая получает на вход исходный куб и коэффициенты разбиения, а возвращает набор параллелепипедов поменьше, либо исходный куб, если все коэффициенты равны 1.

Ограничения на коэффициенты разбиения:
`1 <= x_coeff, y_coeff, z_coeff <= 10`

Структура для хранения куба в Си и Fortran выглядит вот так:
```cpp
struct Cube {
double xmin, ymin, zmin;
double xmax, ymax, zmax;
}
```
```fortran
type(Cube)
real(8) :: xmin, ymin, zmin
real(8) :: xmax, ymax, zmax
end type
```

Как видно из примеров, решение принимается либо на C/C++, либо на Fortran, если вам так проще.

### Как должно работать

Здесь приведен псевдокод использования алгоритма, адаптируйте его под свой язык.

input:
```cpp
xmin = 0.0, ymin = 0.0, zmin = 0.0
xmax = 1.0, ymax = 1.0, zmax = 1.0

Cube source_cube = Cube(xmin, ymin, zmin, xmax, ymax, zmax)

result_cubes[] = CubePartition(source_cube, x_coeff = 2, y_coeff = 1, z_coeff = 1)
```

На выходе получается два параллелепипеда.

output:
```cpp
result_cubes = [
Cube(
xmin = 0.0, ymin = 0.0, zmin = 0.0,
xmax = 0.5, ymax = 1.0, zmax = 1.0
),
Cube(
xmin = 0.5, ymin = 0.0, zmin = 0.0,
xmax = 1.0, ymax = 1.0, zmax = 1.0
),
]
```
19 changes: 9 additions & 10 deletions about.markdown
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
---
layout: page
title: About
title: Обо мне
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)
Работаю в НИИ, занимаюсь численными методами электродинамики и параллельными вычислениями.
Пишу на Python, C/C++. В свободное время занимаюсь backend-разработкой и веду блог.
Если вы меня читали и появились замечания/предложения, скорее напишите мне об этом.

You can find the source code for Jekyll at GitHub:
[jekyll][jekyll-organization] /
[jekyll](https://github.com/jekyll/jekyll)
Мои проекты можете найти на <a href="https://github.com/maks-mishin/" target="_blank">GitHub</a>.


[jekyll-organization]: https://github.com/jekyll
Для связи со мной тележка
<a href="https://t.me/maks_mishin/" target="_blank">maks_mishin</a>
или почта <a type="email" href="mailto:[email protected]" target="_blank">[email protected]</a>
Binary file added images/task_split_cube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions index.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
---
# Feel free to add content and custom Front Matter to this file.
# To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults

layout: home
---

0 comments on commit 38c1319

Please sign in to comment.