OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Classes | Macros | Functions
newmatrm.h File Reference

Go to the source code of this file.

Classes

class  RectMatrixRowCol
 
class  RectMatrixRow
 
class  RectMatrixCol
 
class  RectMatrixDiag
 

Macros

#define NEWMATRM_LIB   0
 

Functions

Real square (Real x)
 
Real sign (Real x, Real y)
 
Real pythag (Real f, Real g, Real &c, Real &s)
 
void GivensRotation (Real cGivens, Real sGivens, Real &x, Real &y)
 
void GivensRotationR (Real cGivens, Real sGivens, Real &x, Real &y)
 

Macro Definition Documentation

◆ NEWMATRM_LIB

#define NEWMATRM_LIB   0

Definition at line 6 of file newmatrm.h.

Function Documentation

◆ GivensRotation()

void GivensRotation ( Real  cGivens,
Real  sGivens,
Real &  x,
Real &  y 
)
inline

Definition at line 116 of file newmatrm.h.

References x, and y.

Referenced by DowndateCholesky(), and UpdateCholesky().

117 {
118  // allow for possibility &x = &y
119  Real tmp0 = cGivens * x + sGivens * y;
120  Real tmp1 = -sGivens * x + cGivens * y;
121  x = tmp0; y = tmp1;
122 }
ossim_uint32 x
double Real
Definition: include.h:57
ossim_uint32 y

◆ GivensRotationR()

void GivensRotationR ( Real  cGivens,
Real  sGivens,
Real &  x,
Real &  y 
)
inline

Definition at line 124 of file newmatrm.h.

References x, and y.

Referenced by LeftCircularUpdateCholesky(), and RightCircularUpdateCholesky().

125 {
126  // also change sign of y
127  // allow for possibility &x = &y
128  Real tmp0 = cGivens * x + sGivens * y;
129  Real tmp1 = sGivens * x - cGivens * y;
130  x = tmp0; y = tmp1;
131 }
ossim_uint32 x
double Real
Definition: include.h:57
ossim_uint32 y

◆ pythag()

Real pythag ( Real  f,
Real  g,
Real &  c,
Real &  s 
)

Definition at line 186 of file newmatrm.cpp.

References REPORT, and sq.

Referenced by DowndateCholesky(), LeftCircularUpdateCholesky(), RightCircularUpdateCholesky(), SVD(), and UpdateCholesky().

190 {
191  if (f==0 && g==0) { c=1.0; s=0.0; return 0.0; }
192  Real af = f>=0 ? f : -f;
193  Real ag = g>=0 ? g : -g;
194  if (ag<af)
195  {
196  REPORT
197  Real h = g/f; Real sq = std::sqrt(1.0+h*h);
198  if (f<0) sq = -sq; // make return value non-negative
199  c = 1.0/sq; s = h/sq; return sq*f;
200  }
201  else
202  {
203  REPORT
204  Real h = f/g; Real sq = std::sqrt(1.0+h*h);
205  if (g<0) sq = -sq;
206  s = 1.0/sq; c = h/sq; return sq*g;
207  }
208 }
double Real
Definition: include.h:57
#define sq(a)
Definition: auxiliary.h:77
#define REPORT
Definition: newmatrm.cpp:18

◆ sign()

Real sign ( Real  x,
Real  y 
)
inline

◆ square()

Real square ( Real  x)
inline

Definition at line 107 of file newmatrm.h.

References x.

107 { return x*x; }
ossim_uint32 x