NAME

get_target_matrix - Gets target matrix

SYNOPSIS

#include "m/m_matrix.h"

Example compile flags (system dependent):
  -DLINUX_386 -DLINUX_386_P4  
   -I/home/kobus/include
   -L/home/kobus/load/linux_386_p4 -L/usr/local/lib -L/usr/lib
  -lKJB         -llapack -lblas -lg2c          -lXext -lX11 


int get_target_matrix
(
	Matrix **target_mpp,
	int num_rows,
	int num_cols
);

DESCRIPTION

This routine implements the creation/over-writing semantics used in the KJB library in the case of matrices. If *target_mpp is NULL, then this routine creates the matrix. If it is not null, and it is the right size, then this routine does nothing. If it is the wrong size, then it is resized. In order to be memory efficient, we free before resizing. If the resizing fails, then the original contents of the *target_mpp will be lost. However, target_mpp->elements will be set to NULL, so *target_mpp can be safely sent to free_matrix(). Note that this is in fact the convention throughout the KJB library--if destruction on failure is a problem (usually when *target_mpp is global)--then work on a copy!

SEEALSO

Matrix

DISCLAIMER

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

AUTHOR

Kobus Barnard

DOCUMENTOR

Kobus Barnard

SEE ALSO

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