Robotran C Documentation
Macros | Functions | Variables
svdcmp.c File Reference
#include <math.h>
#include "useful_functions.h"
#include "nrfct.h"
#include "mbs_message.h"

Macros

#define NRANSI
 

Functions

void svdcmp (double **a, int m, int n, double w[], double **v)
 computes the Singular Value Decomposition a = u.w.v' More...
 
void svdcmp_0 (double **a, int m, int n, double w[], double **v)
 computes the Singular Value Decomposition a = u.w.v' More...
 
double pythag (double a, double b)
 

Variables

static double dmaxarg1
 
static double dmaxarg2
 
static int iminarg1
 
static int iminarg2
 
static double dsqrarg
 

Detailed Description

This c file implements the functions to do the singular value decomposition of matrices.

Creation date: 2008

Author
Robotran team

Original file by JF Collard, 2008

(c) Universite catholique de Louvain

Macro Definition Documentation

◆ NRANSI

#define NRANSI

Function Documentation

◆ pythag()

double pythag ( double  a,
double  b 
)

◆ svdcmp()

void svdcmp ( double **  a,
int  m,
int  n,
double  w[],
double **  v 
)

computes the Singular Value Decomposition a = u.w.v'

The output matrix u is stored in the input matrix a.

The given arrays size is the minimum size, bigger arrays are acceptable. Indeed, the function will only use the first N elements of a 1D array or the first N rows and M columns of 2D arrays. Giving an oversized array as input (for example one of mbs_aux->... that is initialized at the system maximum possible size) is not an issue.

Parameters
[in,out]athe input matrix, with index starting at 1, to be decomposed. The content is modified to be the output matrix u. Its size must at least be m x n (0 element not taken into account).
[in]mthe number of rows (0 element not taken into account) of the matrix a.
[in]nthe number of columns (0 element not taken into account) of the matrix a.
[out]wthe vector, with index starting at 1, to store the singular values.
[out]vthe matrix v (not the transpose) of size n x n (0 element not taken into account).

◆ svdcmp_0()

void svdcmp_0 ( double **  a,
int  m,
int  n,
double  w[],
double **  v 
)

computes the Singular Value Decomposition a = u.w.v'

The output matrix u is stored in the input matrix a. The given arrays size are minimum size, bigger arrays are acceptable.

Parameters
[in,out]athe input matrix, with index starting at 0, to be decomposed. The content is modified to be the output matrix u. Its size must be m x n.
[in]mthe number of rows of the matrix a.
[in]nthe number of columns of the matrix a.
[out]wthe vector, with index starting at 0, to store the singular values.
[out]vthe matrix v (not the transpose) of size n x n.

Variable Documentation

◆ dmaxarg1

double dmaxarg1
static

◆ dmaxarg2

double dmaxarg2
static

◆ dsqrarg

double dsqrarg
static

◆ iminarg1

int iminarg1
static

◆ iminarg2

int iminarg2
static