From fecd622b9261c2d003531fae0a0f1e4a1193d84e Mon Sep 17 00:00:00 2001 From: Irlan <-> Date: Tue, 3 Apr 2018 23:01:26 -0300 Subject: [PATCH] rearrange input and output arguments --- include/bounce/dynamics/cloth/spring_solver.h | 4 ++-- src/bounce/dynamics/cloth/spring_solver.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/bounce/dynamics/cloth/spring_solver.h b/include/bounce/dynamics/cloth/spring_solver.h index feb8656..5c7688f 100644 --- a/include/bounce/dynamics/cloth/spring_solver.h +++ b/include/bounce/dynamics/cloth/spring_solver.h @@ -58,13 +58,13 @@ private: // Solve Ax = b using the Modified Conjugate Gradient (MCG). // Output x and the residual error f. - void Solve_MCG(b3DenseVec3& x, const b3SparseMat33& A, b3DenseVec3& f, u32& iterations, const b3DenseVec3& b) const; + void Solve_MCG(b3DenseVec3& x, b3DenseVec3& f, u32& iterations, const b3SparseMat33& A, const b3DenseVec3& b) const; // Solve Ax = b using MCG with Jacobi preconditioning. // Output x and the residual error f. // This method is slower than MCG because we have to compute the preconditioning // matrix P, but it can improve convergence. - void Solve_MPCG(b3DenseVec3& x, const b3SparseMat33& A, b3DenseVec3& f, u32& iterations, const b3DenseVec3& b) const; + void Solve_MPCG(b3DenseVec3& x, b3DenseVec3& f, u32& iterations, const b3SparseMat33& A, const b3DenseVec3& b) const; b3SpringCloth * m_cloth; float32 m_h; diff --git a/src/bounce/dynamics/cloth/spring_solver.cpp b/src/bounce/dynamics/cloth/spring_solver.cpp index 74833ef..fb95a46 100644 --- a/src/bounce/dynamics/cloth/spring_solver.cpp +++ b/src/bounce/dynamics/cloth/spring_solver.cpp @@ -95,11 +95,11 @@ void b3SpringSolver::Solve(b3DenseVec3& f) if (b3_enablePrecontitioning) { - Solve_MPCG(x, A, f, m_iterations, b); + Solve_MPCG(x, f, m_iterations, A, b); } else { - Solve_MCG(x, A, f, m_iterations, b); + Solve_MCG(x, f, m_iterations, A, b); } // Update state @@ -431,7 +431,7 @@ static void b3Filter(b3DenseVec3& out, } } -void b3SpringSolver::Solve_MCG(b3DenseVec3& dv, const b3SparseMat33& A, b3DenseVec3& e, u32& iterations, const b3DenseVec3& b) const +void b3SpringSolver::Solve_MCG(b3DenseVec3& dv, b3DenseVec3& e, u32& iterations, const b3SparseMat33& A, const b3DenseVec3& b) const { // b3Mat33* S = (b3Mat33*)m_allocator->Allocate(m_massCount * sizeof(b3Mat33)); @@ -519,7 +519,7 @@ static bool b3IsPD(const b3Mat33* diagA, u32 n) return true; } -void b3SpringSolver::Solve_MPCG(b3DenseVec3& dv, const b3SparseMat33& A, b3DenseVec3& e, u32& iterations, const b3DenseVec3& b) const +void b3SpringSolver::Solve_MPCG(b3DenseVec3& dv, b3DenseVec3& e, u32& iterations, const b3SparseMat33& A, const b3DenseVec3& b) const { // S b3Mat33* S = (b3Mat33*)m_allocator->Allocate(m_massCount * sizeof(b3Mat33));