solve_weighted_lstsq Interface

public interface solve_weighted_lstsq

Computes the weighted least-squares solution to (Specification)

Summary

Subroutine interface for computing weighted least-squares via row scaling.

Description

This interface provides methods for computing weighted least-squares by transforming to ordinary least-squares through row scaling, using a subroutine. Supported data types include real and complex.

     cause loss of precision in the SVD-based solver.

Subroutines

private module subroutine stdlib_linalg_c_solve_weighted_lstsq(w, a, b, x, cond, overwrite_a, rank, err)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: w(:)

Weight vector (must be positive, always real)

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

Input matrix a(m,n)

complex(kind=sp), intent(in) :: b(:)

Right hand side vector b(m)

complex(kind=sp), intent(inout), contiguous, target :: x(:)

Result array x(n)

real(kind=sp), intent(in), optional :: cond

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

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

[optional] Can A data be overwritten and destroyed?

integer(kind=ilp), intent(out), optional :: rank

[optional] Return rank of A

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

[optional] state return flag. On error if not requested, the code will stop

private module subroutine stdlib_linalg_d_solve_weighted_lstsq(w, a, b, x, cond, overwrite_a, rank, err)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: w(:)

Weight vector (must be positive, always real)

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

Input matrix a(m,n)

real(kind=dp), intent(in) :: b(:)

Right hand side vector b(m)

real(kind=dp), intent(inout), contiguous, target :: x(:)

Result array x(n)

real(kind=dp), intent(in), optional :: cond

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

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

[optional] Can A data be overwritten and destroyed?

integer(kind=ilp), intent(out), optional :: rank

[optional] Return rank of A

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

[optional] state return flag. On error if not requested, the code will stop

private module subroutine stdlib_linalg_s_solve_weighted_lstsq(w, a, b, x, cond, overwrite_a, rank, err)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: w(:)

Weight vector (must be positive, always real)

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

Input matrix a(m,n)

real(kind=sp), intent(in) :: b(:)

Right hand side vector b(m)

real(kind=sp), intent(inout), contiguous, target :: x(:)

Result array x(n)

real(kind=sp), intent(in), optional :: cond

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

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

[optional] Can A data be overwritten and destroyed?

integer(kind=ilp), intent(out), optional :: rank

[optional] Return rank of A

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

[optional] state return flag. On error if not requested, the code will stop

private module subroutine stdlib_linalg_z_solve_weighted_lstsq(w, a, b, x, cond, overwrite_a, rank, err)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: w(:)

Weight vector (must be positive, always real)

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

Input matrix a(m,n)

complex(kind=dp), intent(in) :: b(:)

Right hand side vector b(m)

complex(kind=dp), intent(inout), contiguous, target :: x(:)

Result array x(n)

real(kind=dp), intent(in), optional :: cond

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

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

[optional] Can A data be overwritten and destroyed?

integer(kind=ilp), intent(out), optional :: rank

[optional] Return rank of A

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

[optional] state return flag. On error if not requested, the code will stop