Ignore:
Timestamp:
06/03/2009 10:01:22 AM (11 years ago)
Author:
dave
Message:

renamed faceident as it's not so simple these days

File:
1 edited

Legend:

Unmodified
Added
Removed
  • foam/trunk/vision/src/SVD.cpp

    r86 r89  
    5757#include <stdlib.h> 
    5858#include <math.h> 
     59#include <algorithm> 
     60#include <list> 
    5961#include "SVD.h" 
     62 
     63using namespace std; 
    6064 
    6165#define SIGN(a, b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) 
    6266#define MAX(x,y) ((x)>(y)?(x):(y)) 
    6367 
    64 static double PYTHAG(double a, double b) 
    65 { 
    66     double at = fabs(a), bt = fabs(b), ct, result; 
    67  
    68     if (at > bt)       { ct = bt / at; result = at * sqrt(1.0 + ct * ct); } 
    69     else if (bt > 0.0) { ct = at / bt; result = bt * sqrt(1.0 + ct * ct); } 
    70     else result = 0.0; 
    71     return(result); 
    72 } 
     68/////////////////////////////////////////////////////// 
    7369 
    7470Vector<float> SVD(Matrix<float> &m) 
     
    7773        Matrix<float> v(m.GetRows(),m.GetCols()); 
    7874        dsvd(m, m.GetRows(), m.GetCols(), w.GetRawData(), v); 
     75        m.SortCols(w); 
    7976        return w; 
     77} 
     78 
     79/////////////////////////////////////////////////////// 
     80 
     81static double PYTHAG(double a, double b) 
     82{ 
     83    double at = fabs(a), bt = fabs(b), ct, result; 
     84 
     85    if (at > bt)       { ct = bt / at; result = at * sqrt(1.0 + ct * ct); } 
     86    else if (bt > 0.0) { ct = at / bt; result = bt * sqrt(1.0 + ct * ct); } 
     87    else result = 0.0; 
     88    return(result); 
    8089} 
    8190 
Note: See TracChangeset for help on using the changeset viewer.