NAME

get_target_vector - Gets target vector

SYNOPSIS

#include "m/m_vector.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_target_vector
(
	Vector **target_vpp,
	int length
);

DESCRIPTION

This routine implements the creation/over-writing semantics used in the KJB library in the case of vectors. If *target_vpp is NULL, then this routine creates the vector. 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_vpp will be lost. However, (*target_vpp)->elements will be set to NULL, so (*target_vpp) can be safely sent to free_vector(). Note that this is in fact the convention throughout the KJB library--if destruction on failure is a problem (usually when *target_vpp is global)--then work on a copy!

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_unity_vector , get_zero_vector , get_initialized_vector , free_vector , get_random_vector , get_random_vector_2 , get_random_unit_vector , vp_get_indexed_vector , get_zero_indexed_vector , get_random_indexed_vector , get_target_indexed_vector , free_indexed_vector , ascend_sort_indexed_vector , descend_sort_indexed_vector , get_target_vector_vector , free_vector_vector , allocate_2D_vp_array , free_2D_vp_array_and_vectors , get_target_v3 , free_v3 , get_target_v4 , free_v4