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

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

[Octave-bug-tracker] [bug #34852] incorrect column number on error messa


From: Hartmut
Subject: [Octave-bug-tracker] [bug #34852] incorrect column number on error messages
Date: Sat, 19 Nov 2016 19:32:43 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #4, bug #34852 (project octave):

This issue is still present in Octave 4.2.0.

Here is the code of the original submission in runable form:


1;
function [theta, J_history] = gradientDescent(X, y, theta, alpha, num_iters)

  m = length(y); % number of training examples
  J_history = zeros(num_iters, 1);

  for iter = 1:num_iters

    theta = theta - alpha/m * sum ( (((X*theta) - y) )*X )
    J_history(iter) = computeCost(X, y, theta);

  endfor

endfunction

X = 1:100;
y = 3.3 ;
theta = pi/2;
alpha = 0.5;
num_iters = 10;

gradientDescent(X, y, theta, alpha, num_iters)


The resulting error message is

error: gradientDescent: operator *: nonconformant arguments (op1 is 1x100, op2
is 1x100)
error: called from
    gradientDescent at line 9 column 11
    testscript at line 22 column 1


If I understand jwe's comment #2 correct, then it would be better if Octave
did not mention any column number at all in this error message, since this
column number is not adding any useful information anyways.

My personal opinion: There might as well be cases where the given column
number makes debugging easier than without this column number. Just imagine
code that has several commands on a single text line, like this


a = [1 2] .* [3 4]; b = [5 6] * [7 8]




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?34852>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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