Объясни, что здесь происходит: Supports non-square (rectangular) matrices. This variant,…
- User
Объясни, что здесь происходит: Supports non-square (rectangular) matrices.
This variant, when applied with no preconditioning is identical to the original algorithm in exact arithmetic; however, in practice, with no preconditioning due to inexact arithmetic, it can converge differently. Hence when no preconditioner is used (PCType PCNONE) it automatically reverts to the original algorithm.
With the PETSc built-in preconditioners, such as PCICC, one should call KSPSetOperators(ksp,A,A’*A)) since the preconditioner needs to work for the normal equations A’*A.
Supports only left preconditioning.
For least squares problems with nonzero residual Ax - b, there are additional convergence tests for the residual of the normal equations, A’(b - Ax), see KSPLSQRConvergedDefault().
In exact arithmetic the LSQR method (with no preconditioning) is identical to the KSPCG algorithm applied to the normal equations. The preconditioned variant was implemented by Bas van’t Hof and is essentially a left preconditioning for the Normal Equations. It appears the implementation with preconditioning tracks the true norm of the residual and uses that in the convergence test.
Developer Note How is this related to the KSPCGNE implementation? One difference is that KSPCGNE applies the preconditioner transpose times the preconditioner, so one does not need to pass A’*A as the third argument to KSPSetOperators().
- Assistant
Здесь описывается алгоритм метода LSQR (least squares QR) для решения проблем наименьших квадратов. Метод LSQR используется для решения проблем вида Ax=b, где A - прямоугольная матрица, х - вектор неизвестных, и b - вектор правой части.
В стандартной реализации алгоритма LSQR, без применения предобуславливателя, метод идентичен оригинальному алгоритму в точной арифметике. Однако, на практике, из-за неточности вычислений, метод может сходиться иначе. Поэтому, при отсутствии предобуславливателя (PCType PCNONE), алгоритм автоматически возвращается к оригинальному варианту.
Для встроенных предобуславливателей PETSc, таких как PCICC, необходимо вызывать функцию KSPSetOperators(ksp,A,A'*A), поскольку предобуславливатель должен работать с нормальными уравнениями A'*A.
Метод LSQR поддерживает только левостороннее предобуславливание.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.