Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* Mathematics Subpackage (VrMath)
|
||||
*
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "LinearR2.h"
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
// ******************************************************
|
||||
@@ -30,10 +29,10 @@
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * **
|
||||
|
||||
const VectorR2 VectorR2::Zero(0.0, 0.0);
|
||||
const VectorR2 VectorR2::UnitX( 1.0, 0.0);
|
||||
const VectorR2 VectorR2::UnitY( 0.0, 1.0);
|
||||
const VectorR2 VectorR2::UnitX(1.0, 0.0);
|
||||
const VectorR2 VectorR2::UnitY(0.0, 1.0);
|
||||
const VectorR2 VectorR2::NegUnitX(-1.0, 0.0);
|
||||
const VectorR2 VectorR2::NegUnitY( 0.0,-1.0);
|
||||
const VectorR2 VectorR2::NegUnitY(0.0, -1.0);
|
||||
|
||||
const Matrix2x2 Matrix2x2::Identity(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
@@ -41,61 +40,50 @@ const Matrix2x2 Matrix2x2::Identity(1.0, 0.0, 0.0, 1.0);
|
||||
// * Matrix2x2 class - math library functions *
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * **
|
||||
|
||||
|
||||
// ******************************************************
|
||||
// * LinearMapR2 class - math library functions *
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * **
|
||||
|
||||
|
||||
LinearMapR2 LinearMapR2::Inverse() const // Returns inverse
|
||||
LinearMapR2 LinearMapR2::Inverse() const // Returns inverse
|
||||
{
|
||||
double detInv = 1.0 / (m11 * m22 - m12 * m21);
|
||||
|
||||
|
||||
double detInv = 1.0/(m11*m22 - m12*m21) ;
|
||||
|
||||
return( LinearMapR2( m22*detInv, -m21*detInv, -m12*detInv, m11*detInv ) );
|
||||
return (LinearMapR2(m22 * detInv, -m21 * detInv, -m12 * detInv, m11 * detInv));
|
||||
}
|
||||
|
||||
LinearMapR2& LinearMapR2::Invert() // Converts into inverse.
|
||||
LinearMapR2& LinearMapR2::Invert() // Converts into inverse.
|
||||
{
|
||||
double detInv = 1.0/(m11*m22 - m12*m21) ;
|
||||
double detInv = 1.0 / (m11 * m22 - m12 * m21);
|
||||
|
||||
double temp;
|
||||
temp = m11*detInv;
|
||||
m11= m22*detInv;
|
||||
m22=temp;
|
||||
m12 = -m12*detInv;
|
||||
m21 = -m22*detInv;
|
||||
temp = m11 * detInv;
|
||||
m11 = m22 * detInv;
|
||||
m22 = temp;
|
||||
m12 = -m12 * detInv;
|
||||
m21 = -m22 * detInv;
|
||||
|
||||
return ( *this );
|
||||
return (*this);
|
||||
}
|
||||
|
||||
VectorR2 LinearMapR2::Solve(const VectorR2& u) const // Returns solution
|
||||
{
|
||||
VectorR2 LinearMapR2::Solve(const VectorR2& u) const // Returns solution
|
||||
{
|
||||
// Just uses Inverse() for now.
|
||||
return ( Inverse()*u );
|
||||
return (Inverse() * u);
|
||||
}
|
||||
|
||||
// ******************************************************
|
||||
// * RotationMapR2 class - math library functions *
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * **
|
||||
|
||||
|
||||
|
||||
// ***************************************************************
|
||||
// * 2-space vector and matrix utilities *
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
|
||||
|
||||
|
||||
// ***************************************************************
|
||||
// Stream Output Routines *
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
ostream& operator<< ( ostream& os, const VectorR2& u )
|
||||
ostream& operator<<(ostream& os, const VectorR2& u)
|
||||
{
|
||||
return (os << "<" << u.x << "," << u.y << ">");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user