Commit 7db26a5d authored by Kenneth Vanhoey's avatar Kenneth Vanhoey
Browse files

Corrections to matrix creation for lightfield metric computation.

Optimization of matrix calculation (exploit fact that 2 of them are
symmetric)
parent 2b452e36
...@@ -40,8 +40,6 @@ ...@@ -40,8 +40,6 @@
// Eigen includes // Eigen includes
#include <Eigen/Dense> #include <Eigen/Dense>
#define CONST_VAL -5212368.54127 // random value
/*! \namespace CGoGN /*! \namespace CGoGN
* \brief namespace for all elements composing the CGoGN library * \brief namespace for all elements composing the CGoGN library
*/ */
...@@ -563,12 +561,22 @@ public: ...@@ -563,12 +561,22 @@ public:
static std::vector<VEC3> coefsFromTensors(Geom::Tensor3d* T) ; static std::vector<VEC3> coefsFromTensors(Geom::Tensor3d* T) ;
/*! /*!
* \brief method to complete a symmetric tensor that was * \brief method to complete a symmetric matrix that was
* only filled in its first half * only filled in its first half (line >= column)
* *
* \param T the tensor to fill * \param M the matrix to fill
*/ */
static void fillTensor(Geom::Tensor3d& T) ; static void fillSymmetricMatrix(Eigen::MatrixXd& M) ;
/*!
* \brief method to rotate a tensor representing a polynomial light field
*
* \param T the tensor representing a polynomial light field
* \param R the 3x3 matrix representing a rotation in (u,v,1)-space
*
* \return a new rotated tensor representing a polynomial light field.
*/
static Geom::Tensor3d rotate(const Geom::Tensor3d& T, const Geom::Matrix33d& R) ;
private: private:
// Double computation is crucial for stability // Double computation is crucial for stability
...@@ -595,7 +603,7 @@ private: ...@@ -595,7 +603,7 @@ private:
*/ */
bool optimize(std::vector<VEC3>& coefs) const ; bool optimize(std::vector<VEC3>& coefs) const ;
Geom::Tensor3d rotate(const Geom::Tensor3d& T, const Geom::Matrix33d& R) ; // Geom::Tensor3d rotate(const Geom::Tensor3d& T, const Geom::Matrix33d& R) ;
/*! /*!
* \brief method to build a rotate matrix (rotation in tangent plane) * \brief method to build a rotate matrix (rotation in tangent plane)
...@@ -639,6 +647,9 @@ private: ...@@ -639,6 +647,9 @@ private:
* \return the integral of product of monomes * \return the integral of product of monomes
*/ */
Eigen::MatrixXd buildIntegralMatrix_C(const REAL& alpha, unsigned int size) ; Eigen::MatrixXd buildIntegralMatrix_C(const REAL& alpha, unsigned int size) ;
Eigen::MatrixXd buildLowerLeftIntegralMatrix_A(const REAL& alpha, unsigned int size) ;
Eigen::MatrixXd buildLowerLeftIntegralMatrix_C(const REAL& alpha, unsigned int size) ;
} ; } ;
} // Utils } // Utils
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment