本文介绍了如何管理大型数据库并根据数据创建显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的能力:我在一所坚实的大学里做数学本科。我参加了几个涉及编码的课程和一些简介CS课程。使用C ++,Fortran,Perl的经验有限。



我想做什么:我想创建一个大约10,000 x 10,000块的数据库环境,其中有大约三个数值关联每个块,加上建立边界条件。



接下来,我想迭代我的块,运行计算和更新值。



从逻辑的角度来看,我编码没问题。我可以构建逻辑循环,以所需的顺序和这种性质的东西循环遍历数组。在理论基础上(从数学方面来说),我熟悉不同的例程,可以优化执行各种数学任务所需的计算时间。我做了一个计算物理课程,教师为我们提供了一个算法数据库,它实现了不同的准确性/效率平衡的不同例程,我知道如何选择最适合我的目的。我不再那样了,它只是一种语言,我现在不知道在哪里看。



我意识到这是计算上昂贵的我可能需要减少我的数组大小。那很好 - 我可以修补一下,看看我的限制是什么。



我想根据我的值将颜色与块相关联,然后才能够以动画方式显示每个时间步长。额外的功能可以放大到某些区域(因为我没有10,000 ^ 2像素的监视器)。然而,这不是关键任务 - 我可以做一些粗略的事情,比如改变代码,如果它太麻烦,只显示一个选定的切片。我(或许是天真的)认为这些数据的显示需要在我的事物结束时对一组块进行某种平均到一种颜色然后输出1000x1000像素或类似的东西,但我真的没有任何线索。 />


能够在这个彩色编码背景之上分层图像也是非常好的(就像一个简单的 - >看向箭头,也许是我可变长度的尾巴计算)。



最后,也许最不重要的是,能够实现下拉菜单或者让我更改代码中的某些变量的东西会很不错 - 能够在命令行停止例程,提供输入,重新启动它的等效功能。



我将在一个相对较新的mac上编码,最好是在xcode中,除非你有理由让我做别的事情。



所以,广泛的问题:



我用什么语言?任何有良好的在线文档我会学习。无论如何我都要查阅上述语言的文档 - 已经有一段时间了。



我应该阅读哪些关于优化大型计算任务的文献?我对此有一些模糊的了解;例如,我已经实现了过去多线程的代码。更新我的网格的逻辑将需要每个周期多次传递,因此我可以从一个滞后线程获得大幅加速,覆盖第二次或第三次传递,基于已经更新的主要线程。除此之外,我认为我的主要效率提升是相当有限的,因为我需要逐块遍历网格 - 只需选择正确的例程来在每一步中进行数学计算,即在多线程的基础上可以获得任何显着的加速。如果可以的话,请给我启发!



有人可以解释一下显示器的工作原理吗?是否有一些预先打包的代码可以执行类似的功能?如果它相对接近,我可以修补它。我甚至不知道如何制作一个盒子并在其中打印你好的世界;我过去只在终端工作并将数据吐出到文件中。

My capabilities: I did math as an undergraduate at a solid university. I have taken a couple of classes that involved coding for narrow purposes and a couple of intro CS classes. Limited experience with C++, Fortran, Perl.

What I want to do: I want to create a database environment of about 10,000 x 10,000 blocks with about three numerical values associated with each block, plus establish boundary conditions.

Next, I want to iterate through my blocks, running calculations, and updating values.

From a logic standpoint, I have no problem coding this. I can build logical loops that cycle through arrays in the desired order and things of this nature. On a theoretical basis (from math side), I am familiar with different routines that optimize your computational time required to do various mathematical tasks. I did a computational physics course where the instructor gave us a database of algorithms that implement different routines with varying accuracy/efficiency balances and I know how to select what is best for my purpose. I don't have that anymore, it was just for one language, and I wouldn't know where to look now.

I realize this is computationally expensive and I might need to reduce my array size. That's fine - I can tinker and see what my limits are here.

I want to associate a color with a block based on my values in it, then be able to display each "time step" in an animated way. Additional functionality that would be nice is the ability to zoom into certain areas (since I don't have a 10,000^2 pixel monitor). That's not mission critical however - I can do something crude like change the code to display only a selected slice if it's too much trouble. I would (perhaps naively) think that the display of this data would require some sort of averaging of a cluster of blocks to one color on my end of things then feeding out 1000x1000 pixels or something like that but I have no clue really.

It would also be really nice to be able to layer images on top of this color coded background (like a simple -> looking arrow, perhaps with variable length tails that I compute).

Finally, and perhaps least important, it would be nice to be able to implement a drop down menu or something that lets me change certain variables in the code - the equivalent functionality of being able to halt a routine at the command line, give input, start it back up.

I will be coding on a relatively new mac, preferably in xcode unless you have reasons for me to do something else.

So, the broad questions:

What language do I use for this? Anything with good documentation online I will learn. I'll have to consult documentation anyway for above languages - it has been a while.

What literature should I read about optimizing really large computational tasks? I do have some vague familiarity with this; for instance, I have implemented code that was multi-threaded in the past. The logic that updates my grid will require multiple passes per cycle so I might be able to get a big speed up from a lagging thread covering 2nd or 3rd passes based on what the leading thread already updated. Beyond that, I think my primary efficiency gains are fairly restricted because I need to iterate through the grid block by block - just picking the right routines to do my math at each step is where any significant speed up might derive on top of multi-threading. Enlighten me otherwise if you can though!

Can someone explain how the display side works? Is there some prepackaged code that does a similar function? If it's relatively close I can tinker with it. I wouldn't even know how to make a box and print hello world in it; I've only worked in terminals and spit out data to files in the past.

推荐答案


这篇关于如何管理大型数据库并根据数据创建显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 14:31