diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-12-04 02:22:31 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-12-04 02:22:31 +0300 |
commit | c2cff1cbcf71634de3aca184c70cc4bd23fe35a8 (patch) | |
tree | f5b507efeffa60eb028dc0887226a28cf8182e86 /intern/opennl | |
parent | 8cb14867b0ad104ebe1f6fd086656dd12ada5758 (diff) |
More work on the new unwrapper code (orange branch):
- There is now a (temporary) dropdown box in the image window header for
switching between the old an new unwrapper code. So to test the changes
described below you need to enable the new unwrapper code.
- Pinning is now more predictable, if one uv is pinned, the others belonging
to the same vertex are pinned also.
- Live LSCM is much faster, since the LU factorization, the most expensive
part of the computation, is now stored and reused (was Jens' idea).
- Packing multiple uv charts is slightly improved, by doing a binary search
over the texture width. This fixes the case where all the charts are
packed at the bottom of the image.
- LSCM now uses an angle based formulation, and the results seem somewhat
different (maybe slightly better?), didn't find out why yet.
Diffstat (limited to 'intern/opennl')
-rw-r--r-- | intern/opennl/intern/opennl.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/intern/opennl/intern/opennl.c b/intern/opennl/intern/opennl.c index ad40f45c73a..c5518731c6b 100644 --- a/intern/opennl/intern/opennl.c +++ b/intern/opennl/intern/opennl.c @@ -808,7 +808,7 @@ static void __nlBeginMatrix() { } else { /* need to recompute b only, A is not constructed anymore */ - __NL_CLEAR_ARRAY(NLfloat, __nlCurrentContext->b, n); + __NL_CLEAR_ARRAY(NLfloat, __nlCurrentContext->b, __nlCurrentContext->n); } __nlVariablesToVector(); @@ -871,12 +871,11 @@ static void __nlEndRow() { } S = -__nlCurrentContext->right_hand_side; - for(j=0; j<nl; j++) { + for(j=0; j<nl; j++) S += al->coeff[j].value; - } - for(i=0; i<nf; i++) { + + for(i=0; i<nf; i++) b[ af->coeff[i].index ] -= af->coeff[i].value * S; - } } else { if (!__nlCurrentContext->solve_again) { for(i=0; i<nf; i++) { @@ -1110,12 +1109,13 @@ static void __nlFree_SUPERLU(__NLContext *context) { void nlPrintMatrix(void) { __NLSparseMatrix* M = &(__nlCurrentContext->M); + float *b = __nlCurrentContext->b; NLuint i, jj, k; NLuint n = __nlCurrentContext->n; __NLRowColumn* Ri = NULL; float *value = malloc(sizeof(*value)*n); - printf("M:\n"); + printf("A:\n"); for(i=0; i<n; i++) { Ri = &(M->row[i]); @@ -1127,6 +1127,13 @@ void nlPrintMatrix(void) { printf("%.3f ", value[k]); printf("\n"); } + + printf("b:\n"); + for(i=0; i<n; i++) + printf("%f ", b[i]); + printf("\n"); + + free(value); } /************************************************************************/ |