octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63173] lsqnonlin from optim 1.6.2 package thr


From: Thomas Madden
Subject: [Octave-bug-tracker] [bug #63173] lsqnonlin from optim 1.6.2 package throws errors in Octave 7.2
Date: Fri, 7 Oct 2022 08:56:09 -0400 (EDT)

Follow-up Comment #3, bug #63173 (project octave):

Here's the call from unnDyes (this is photographic film modeling...)

# Starting guess...
    x0 = [ 1, 1, 1 ];
    if mode == 'r',
      x0 = x0 * 0.5;
    endif

    lb = [];
    ub = [];
    [ xopt, resnorm, residual, exitflag, output, lambda, jacobian ] =...
      lsqnonlin( @(answer) unnDyeErr( answer, dyeSet, illum, cmf, ...
                                      mode, unitNeuLab ), x0, lb, ub );

then...

function dLab = unnDyeErr( guess, dyeSet, illum, cmf, mode, aimLab );
      
# Use guess vector to compute spectral transmission density...
# Upon entry, guess vector is somehow converted to a column vector. Turn it
back to a row vector...
    cmy = guess';

    dyes = dyeSet( :, 1:3 );
    Dmin = dyeSet( :, 4 );

# Compute spectral transmission density for just the dyes...
    sxd = dyes * cmy';

# Apply Clapper-Williams for reflection mode...
    if mode == 'r',
        sxd = Dt_to_Dr( sxd );
    endif
        
# Add spectral density of Dmin...
    sxd = sxd + Dmin;
        
# Convert to spectral transmission or reflection factor...
    sxf = xd_to_xf( sxd );

    Lab = spec_to_Lab( sxf, illum, cmf );
    dLab = aimLab - Lab;


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63173>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]