libtpcmodel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Functions
ldp.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "include/nnls.h"
#include "include/lss_lib.h"
Include dependency graph for ldp.c:

Go to the source code of this file.

Functions

int ldp (const double *G, int m, int n, const double *h, double *x)

Function Documentation

int ldp ( const double *  G,
int  m,
int  n,
const double *  h,
double *  x 
)

This file contains the routine ldp (least distance programming), and uses lss_lib.c and nnls.c

This routine is based on the text of C.L. Lawson and R.J. Hanson, Solving Least Squares Problems, Prentice-Hall, Englewood Cliffs, New Jersey, 1974.

Version history: 2006-06 Pauli Sundberg - First created 2006-07 Pauli Sundberg - Changed workspace allocation to Memory Handler 2007-05-18 Vesa Oikonen Changed DEBUG to LSS_TEST. Algorithm solving Least Distance Programming problem. Minimizes ||x||, so that Gx >_ h

Returns:
0 - on success 1 - if no solution or dimension error 2 - on system error (out of memory)
Parameters:
GOn entry G[...] is a m x n matrix defining the constrain 'Gx >_ h'.
mMatrix G dimension (is m x n matrix)
nMatrix G dimension (is m x n matrix)
hOn Entry h[..] defines mx1 vector definig the constant on the constrain 'Gx >_ h'.
xThe solution vector ( n x 1 )

Definition at line 55 of file ldp.c.

References _lss_print_matrix(), FREE_WORKSPACE, GET_WORKSPACE, LSS_TEST, and nnls().

Referenced by do_ldp(), and lsi().

Here is the call graph for this function: