八度跳过参数 [英] Octave skip parameter

查看:57
本文介绍了八度跳过参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:

我想使用八度"pcg"中定义为的以下功能:

I want to use following function from Octave "pcg" defined as:

x = pcg(A,b,tol,maxit,m1,m2,x0,…)

x = pcg (A, b, tol, maxit, m1, m2, x0, …)

文档说:

"m = m1 * m2是(左)预处理矩阵,因此迭代(理论上)等效于通过pcg P * x = m \ b求解,其中P = m \A.请注意,适当的选择预处理器的使用可能会大大改善该方法的整体性能.用户可以传递两个函数,而不是矩阵m1和m2,这两个函数返回将m1和m2的逆值应用于向量的结果(通常这是使用的首选方法如果省略m1或为空[],则不应用任何预处理.如果省略m2,则m = m1将用作预处理器."

"m = m1 * m2 is the (left) preconditioning matrix, so that the iteration is (theoretically) equivalent to solving by pcg P * x = m \ b, with P = m \ A. Note that a proper choice of the preconditioner may dramatically improve the overall performance of the method. Instead of matrices m1 and m2, the user may pass two functions which return the results of applying the inverse of m1 and m2 to a vector (usually this is the preferred way of using the preconditioner). If m1 is omitted or empty [] then no preconditioning is applied. If m2 is omitted, m = m1 will be used as a preconditioner."

现在我有了所有参数,但是我没有m2,所以我想把它排除在外.就像文档中说忽略"一样,因此m = m1.

Now i got all parameters but i don't have m2 and I want to leave this one out. Like the documentation says "omit" it so m = m1.

我找不到在八度中忽略此参数的方法.

I could not find a way to omit this parameter in octave.

有人可以帮我吗?

推荐答案

pcg 的文档为:

Example 6 in the documentation for pcg is:

[x, flag, relres, iter, resvec, eigest] = ...
     pcg (A, b, [], [], "apply_m", [], [], 3)

在这里,"apply_m" 是输入参数 m1 ,对于 m2 ,他们填写了 [] 以便能够提供更高的参数.

Here, "apply_m" is the input argument m1, and for m2 they have filled out [] to be able to provide a later parameter.

因此,要给参数 x0 但忽略 m1 ,您应该可以说:

Thus, to give parameter x0 but omit m1 you should be able to say:

x = pcg (A, b, tol, maxit, m1, [], x0, …)

这篇关于八度跳过参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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