core/vnl/algo/vnl_orthogonal_complement.txx
Go to the documentation of this file.
00001 // This is core/vnl/algo/vnl_orthogonal_complement.txx
00002 #ifndef vnl_orthogonal_complement_txx_
00003 #define vnl_orthogonal_complement_txx_
00004 /*
00005   fsm
00006 */
00007 #include "vnl_orthogonal_complement.h"
00008 #include <vnl/algo/vnl_svd.h>
00009 
00010 template <class T>
00011 vnl_matrix<T> vnl_orthogonal_complement(vnl_vector<T> const &v)
00012 {
00013   unsigned n = v.size();
00014   vnl_matrix<T> tmp(1, n);
00015   tmp.set_row(0, v);
00016   return vnl_svd<T>(tmp).V().extract(n, n-1, 0, 1);
00017 }
00018 
00019 #if 0
00020 template <class T>
00021 vnl_matrix<T> vnl_orthogonal_complement(vnl_matrix<T> const &M)
00022 {
00023   // TODO
00024 }
00025 #endif
00026 
00027 //--------------------------------------------------------------------------------
00028 
00029 #undef VNL_ORTHOGONAL_COMPLEMENT_INSTANTIATE
00030 #define VNL_ORTHOGONAL_COMPLEMENT_INSTANTIATE(T) \
00031 /* template vnl_matrix<T > vnl_orthogonal_complement(vnl_matrix<T > const &); */ \
00032 template vnl_matrix<T > vnl_orthogonal_complement(vnl_vector<T > const &)
00033 
00034 #endif // vnl_orthogonal_complement_txx_