constrained_lstsq Interface

public interface constrained_lstsq

Computes the solution of the equality constrained least-squares problem

minimize || Ax - b ||² subject to Cx = d

where A is of size m x n and C of size p x n. (Specification)

Description

This interface provides methods for computing the solution of an equality-constrained least-squares problem using a function. Supported data types include real and complex.


Functions

private module function stdlib_linalg_c_constrained_lstsq(A, b, C, d, overwrite_matrices, err) result(x)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(inout), target :: A(:,:)

Least-squares cost

complex(kind=sp), intent(inout), target :: b(:)

Least-squares cost

complex(kind=sp), intent(inout), target :: C(:,:)

Equality constraints.

complex(kind=sp), intent(inout), target :: d(:)

Equality constraints.

logical(kind=lk), intent(in), optional :: overwrite_matrices

[optional] Can A and C be overwritten?

type(linalg_state_type), intent(out), optional :: err

[optional] State return flag.

Return Value complex(kind=sp), allocatable, target, (:)

Solution of the constrained least-squares problem.

private module function stdlib_linalg_d_constrained_lstsq(A, b, C, d, overwrite_matrices, err) result(x)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), target :: A(:,:)

Least-squares cost

real(kind=dp), intent(inout), target :: b(:)

Least-squares cost

real(kind=dp), intent(inout), target :: C(:,:)

Equality constraints.

real(kind=dp), intent(inout), target :: d(:)

Equality constraints.

logical(kind=lk), intent(in), optional :: overwrite_matrices

[optional] Can A and C be overwritten?

type(linalg_state_type), intent(out), optional :: err

[optional] State return flag.

Return Value real(kind=dp), allocatable, target, (:)

Solution of the constrained least-squares problem.

private module function stdlib_linalg_s_constrained_lstsq(A, b, C, d, overwrite_matrices, err) result(x)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout), target :: A(:,:)

Least-squares cost

real(kind=sp), intent(inout), target :: b(:)

Least-squares cost

real(kind=sp), intent(inout), target :: C(:,:)

Equality constraints.

real(kind=sp), intent(inout), target :: d(:)

Equality constraints.

logical(kind=lk), intent(in), optional :: overwrite_matrices

[optional] Can A and C be overwritten?

type(linalg_state_type), intent(out), optional :: err

[optional] State return flag.

Return Value real(kind=sp), allocatable, target, (:)

Solution of the constrained least-squares problem.

private module function stdlib_linalg_z_constrained_lstsq(A, b, C, d, overwrite_matrices, err) result(x)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), target :: A(:,:)

Least-squares cost

complex(kind=dp), intent(inout), target :: b(:)

Least-squares cost

complex(kind=dp), intent(inout), target :: C(:,:)

Equality constraints.

complex(kind=dp), intent(inout), target :: d(:)

Equality constraints.

logical(kind=lk), intent(in), optional :: overwrite_matrices

[optional] Can A and C be overwritten?

type(linalg_state_type), intent(out), optional :: err

[optional] State return flag.

Return Value complex(kind=dp), allocatable, target, (:)

Solution of the constrained least-squares problem.