Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
- solve linear NxM system mkl ifort

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

hi everyone,

diedro

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-14-2012
12:54 PM

13 Views

solve linear NxM system mkl ifort

I would like to solve a general nxm system in fortran ifort intel using mkl libraries or lapack.

Is this possible?

what subroutine should I use?

The system is not quadratic (nxn) but a general system.

thank you very much

4 Replies

Highlighted
##

First of all, you need to specify what you mean by "solve" when you have an overdetermined (more equations than unknowns) or underdetermined (too few equations to determine the unknowns) problem.

In the former case, usually the norm of the residual is to be minimized; see the section*Linear Least Squares (LLS) Problems *in the MKL Reference Manual.

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-14-2012
04:25 PM

13 Views

In the former case, usually the norm of the residual is to be minimized; see the section

In the latter case, if the variables have been suitably scaled, you may look for the solution of minimal norm, or you may look for the analytic center.

Highlighted
##

hi,

diedro

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2012
01:49 AM

13 Views

I am trying to apply a "moving last square" to get the gradient and second derivaive af a known distribution of value.

This means that my sytem isoverdetermined. I would like simple inverte the matrix to solve the problem. I red on MKL manual that this is more stable and precise.

What do you suggest? Are there any subs that do this?

tahnk you

Highlighted
##

*> This means that my sytem isoverdetermined. *

May be so, depending on how you define "moving least square".

*> I would like simple inverte
the matrix to solve the problem.*

If the system is overdetermined, the matrix is not square and therefore has no inverse in the usual sense.

*> I red on MKL manual that this is more
stable and precise*

Overdetermined equations are usually solved in the least-square-residual sense using the A = Q R decomposition, where Q is orthogonal and R is upper-triangular. MKL provides routines (?gels?) to do this.

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2012
04:44 AM

13 Views

May be so, depending on how you define "moving least square".

If the system is overdetermined, the matrix is not square and therefore has no inverse in the usual sense.

Highlighted
##

hi,

diedro

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2012
06:15 AM

13 Views

now it works

this is the porblem

[bash]PROGRAM solve_mn[/bash][bash]USE LAPACK95
IMPLICIT NONE
!
! | .000000000 2.000000000 |
! | 2.000000000 -1.000000000 |
! A = | 2.000000000 -1.000000000 |
! | .000000000 1.500000000 |
! | 2.000000000 -1.000000000 |
! | 2.000000000 -1.000000000 |
!
!
! B = | 1.000000000 |
! | 1.000000000 |
! | . |
! | . |
! | . |
! | . |
!
INTEGER M
INTEGER N
INTEGER NB
INTEGER info
CHARACTER*1 trans !type solver
REAL, ALLOCATABLE ,DIMENSION(:,:) ::AA !SYSTEM
REAL, ALLOCATABLE ,DIMENSION(:) ::XX !UNKNOWN
REAL, ALLOCATABLE ,DIMENSION(:) ::BB !KNOWN
M = 6 !ROWS
N = 2 !COLUMNS
ALLOCATE (AA (M,N ))
ALLOCATE (BB (M))
AA(:,:) = 0.d0
BB(:) = 0.d0
XX(:) = 0.d0
!----------------------------------------------------------------------------------
AA(1,1) = 0.d0
AA(1,2) = 2.d0
AA(2,1) = 2.d0
AA(2,2) = -1.d0
AA(3,1) = 2.d0
AA(3,2) = -1.d0
AA(4,1) = 0.d0
AA(4,2) = -1.5d0
AA(5,1) = 2.d0
AA(5,2) = -1.d0
AA(6,1) = 2.d0
AA(6,2) = -1.d0
BB(1) = 1.d0
BB(2) = 1.d0
BB(3) = 0.d0
BB(4) = 0.d0
BB(5) = 0.d0
BB(6) = 0.d0
!----------------------------------------------------------------------------------
CALL GELS(AA,BB,'N',info)
ENDPROGRAM[/bash]

THANKS

For more complete information about compiler optimizations, see our Optimization Notice.