BRL-CAD
nurb_solve.c File Reference
#include "common.h"
#include <math.h>
#include "bio.h"
#include "vmath.h"
#include "raytrace.h"
#include "nurb.h"
Include dependency graph for nurb_solve.c:

Go to the source code of this file.

Functions

void rt_nurb_solve (fastf_t *mat_1, fastf_t *mat_2, fastf_t *solution, int dim, int coords)
 
void rt_nurb_doolittle (fastf_t *mat_1, fastf_t *mat_2, int row, int coords)
 
void rt_nurb_forw_solve (const fastf_t *lu, const fastf_t *b, fastf_t *y, int n)
 
void rt_nurb_back_solve (const fastf_t *lu, const fastf_t *y, fastf_t *x, int n)
 
void rt_nurb_p_mat (const fastf_t *mat, int dim)
 

Detailed Description

Decompose a matrix into its LU decomposition using pivoting.

These Procedures take a set of matrices of the form Ax = b and allows one to solve the system by various means. The rt_nurb_doolittle routine takes the system and creates a lu decomposition using pivoting to get the system in a desired form. Forward and backward substitution are then used to solve the system. All work is done in place.

Definition in file nurb_solve.c.

Function Documentation

void rt_nurb_solve ( fastf_t mat_1,
fastf_t mat_2,
fastf_t solution,
int  dim,
int  coords 
)

Solve must be passed two matrices that are of the form of pointer to double arrays. mat_1 is the n by n matrix that is to be decomposed and mat_2 is the matrix that contains the left side of the equation. The variable solution which is double is also to be created by the user and consisting of n elements of which the solution set is passed back.

Arguments mat_1 and mat_2 are modified by this call. The solution is written into the solution[] array.

Definition at line 58 of file nurb_solve.c.

References bu_free(), bu_malloc(), rt_nurb_back_solve(), rt_nurb_doolittle(), rt_nurb_forw_solve(), and s.

Referenced by rt_nurb_cinterp().

Here is the call graph for this function:

void rt_nurb_doolittle ( fastf_t mat_1,
fastf_t mat_2,
int  row,
int  coords 
)

Create LU decomposition. Modifies both mat_1 and mat_2 values.

Definition at line 116 of file nurb_solve.c.

References bu_free(), bu_malloc(), and s.

Referenced by rt_nurb_solve().

Here is the call graph for this function:

void rt_nurb_forw_solve ( const fastf_t lu,
const fastf_t b,
fastf_t y,
int  n 
)

Definition at line 206 of file nurb_solve.c.

Referenced by rt_nurb_solve().

void rt_nurb_back_solve ( const fastf_t lu,
const fastf_t y,
fastf_t x,
int  n 
)

Definition at line 223 of file nurb_solve.c.

Referenced by rt_nurb_solve().

void rt_nurb_p_mat ( const fastf_t mat,
int  dim 
)

Definition at line 241 of file nurb_solve.c.