vHouse.c
Go to the documentation of this file.
00001 /*******************************************************
00002  *
00003  * Author: Shinsaku Hiura, Hirokazu Kato
00004  *
00005  *         shinsaku@sys.es.osaka-u.ac.jp
00006  *         kato@sys.im.hiroshima-cu.ac.jp
00007  *
00008  * Revision: 2.1
00009  * Date: 99/07/16
00010  *
00011 *******************************************************/
00012 
00013 #include <stdio.h>
00014 #include <math.h>
00015 #include <AR/matrix.h>
00016 
00017 double arVecHousehold( ARVec *x )
00018 {
00019     double s, t;
00020     int    i;
00021 
00022     s = sqrt( arVecInnerproduct(x,x) );
00023 
00024     if( s != 0.0 ) {
00025         if(x->v[0] < 0) s = -s;
00026         x->v[0] += s;
00027         t = 1 / sqrt(x->v[0] * s);
00028         for( i = 0; i < x->clm; i++ ) {
00029             x->v[i] *= t;
00030         }
00031     }
00032 
00033     return(-s);
00034 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


ar_recog
Author(s): Graylin Trevor Jay and Christopher Crick
autogenerated on Fri Jan 25 2013 12:15:00