在数组中找到从一个点到另一个点的所有根 [英] Find all the roots form one point to another in an array

查看:59
本文介绍了在数组中找到从一个点到另一个点的所有根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我不能指责它。我的程序必须读取一个数组,然后将其动态存储到内存中。好的,直到现在。


问题是程序必须从一个数组[a] [b]到另一个数组[c] [d]计算这个数组中所有可能的根。该数组是NxN,您可以将其视为该原因的2D地图。


主要观点是找出程序需要遵循的所有这些根源,我的意思是从数组[a] [b]到数组[i] [j]到数组[p] [y]等等到数组[c] [d]。任何帮助?

Hi, I have a problem that I cant finger it out. My program have to read an array and then dynamically store it to the memory. Ok ''till now.

The thing is that the program has to calculate all the possible root in this array from one array[a][b] to another array[c][d]. The array is a NxN and you can see it as a 2D map for that cause.

The main point of is to find out all this roots that the program need to follow to get there and by that I mean from array[a][b] to array[i][j] to array[p][y] and so on to the very array[c][d]. Any Help ?

推荐答案


问题是程序必须从一个计算此数组中所有可能的根array [a] [b]到另一个数组[c] [d]。
The thing is that the program has to calculate all the possible root in this array from one array[a][b] to another array[c][d].



root是什么意思?多项式方程的根?平方根?

你的2D数组如何相互关联?

What do you mean by a root? A root of a polynomial equation? A square root?

How are your 2D arrays related to eachother?



我有一个问题,我不能指责它。我的程序必须读取一个数组,然后将其动态存储到内存中。好的,直到现在。


问题是程序必须从一个数组[a] [b]到另一个数组[c] [d]计算这个数组中所有可能的根。该数组是NxN,您可以将其视为该原因的2D地图。


主要观点是找出程序需要遵循的所有这些根源,我的意思是从数组[a] [b]到数组[i] [j]到数组[p] [y]等等到数组[c] [d]。任何帮助?
Hi, I have a problem that I cant finger it out. My program have to read an array and then dynamically store it to the memory. Ok ''till now.

The thing is that the program has to calculate all the possible root in this array from one array[a][b] to another array[c][d]. The array is a NxN and you can see it as a 2D map for that cause.

The main point of is to find out all this roots that the program need to follow to get there and by that I mean from array[a][b] to array[i][j] to array[p][y] and so on to the very array[c][d]. Any Help ?



我假设这些数组是Pn中的向量。如果是这样,你需要做的只是使用牛顿方法,这应该是非常容易的,因为区分多项式是明确的。你很可能能够在网上找到一些你可以复制和粘贴的代码。


编辑:

实际上,因为那里有没有可靠的方法来猜测一个初始值,给我一点思考一个更好的解决方案

I''m assuming that these arrays are vectors in Pn. If so, all you need to do is use Newton''s method, which should be very easy, since differentiating a polynomial is staight-forword. You''ll most likely be able to find some code online that you can just copy and paste.


Actually, since there''s no reliable way to guess an initial value, give me a second to think of a better solution


我找到了一个方法。但是实际的代码让我感到困惑。因此,我真正需要做的唯一事情就是制作一个包含所有可能组合的数组,并测试每个数字是否为邻居。下一个。


这个COMB数组桅杆有(N * N)^(N * N)个复合(因为Map数组是NxN.COMB应该是那样的

COMB = {(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0), (0,0),(0,0),(0,0)...........}现在我想要的是找到所有可能的组合,以便我可以在之后检查它们。线索?
I find out a way. But the actual code is somehow confusing me. So the only thing that I really need to do is make an array of all possible combinations and the test if every single number is a "neighbor" of the next.

This COMB array mast have (N*N)^(N*N) compinations ( because the Map array is NxN. COMB should be something like that

COMB={(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0 ,0),(0,0),(0,0)...........} now what I want is to find ALL the possible combinations of this so I may check them after. Any clue ?


这篇关于在数组中找到从一个点到另一个点的所有根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆