NAME

get_dot_product - Computes the dot product of two vectors

SYNOPSIS

#include "m/m_vec_metric.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_dot_product
(
	const Vector *vp1,
	const Vector *vp2,
	double *result_ptr
);

DESCRIPTION

This routine computes the dot product two vectors and puts the result in *result_ptr. If both vectors are NULL, then the result is zero.

RETURNS

NO_ERROR on success, and ERROR on failure. Currenty, this outine will only fail if the vectors are of unequal length or if one of them is NULL but the other is not. If the routine fails, an appropriate error message being set.

NOTE

Vectors of unequal lenths has been treated as a bug (see kjb_bug(3)) in some previous versions, and it is possible that we will go back to this behaviour in the future. Currently, we do not have a good convention for this, and putting one in place may change things. However, such a change should not affect code that checks for an error return.

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

max_abs_vector_difference , get_vector_angle_in_degrees , get_vector_angle_in_radians , vector_distance , vector_distance_sqrd