NAME

get_diagonal_matrix - Gets a diagonal matrix from a vector

SYNOPSIS

#include "m/m_matrix.h"

Example compile flags (system dependent):
  -DLINUX_X86_64 -DLINUX_X86_64_OPTERON  -DGNU_COMPILER 
   -I/home/kobus/include
   -L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
  -lKJB                               -lfftw3  -lgsl -lgslcblas -ljpeg  -lSVM -lstdc++                    -lpthread -lSLATEC -lg2c    -lacml -lacml_mv -lblas -lg2c      -lncursesw 


int get_diagonal_matrix
(
	Matrix **mpp,
	const Vector *vp
);

DESCRIPTION

This routine creates a diagonal matrix from a vector provided as the argument. The first argument is the adress of the target matrix. If the target matrix itself is null, then a matrix of the appropriate size is created. If the target matrix is the wrong size, it is resized. Finally, if it is the right size, then the storage is recycled, as is.

RETURNS

NO_ERROR on success and ERROR on failure This routine will only fail if storage allocation fails.

DISCLAIMER

This software is not adequatedly tested. It is recomended that results are checked independantly where appropriate.

AUTHOR

Kobus Barnard

DOCUMENTER

Kobus Barnard

SEE ALSO

get_zero_matrix , get_unity_matrix , get_initialized_matrix , get_target_matrix , free_matrix , get_identity_matrix , ow_zero_matrix , ow_set_matrix , get_random_matrix , get_random_matrix_2