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

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

[Octave-patch-tracker] [patch #10288] Implementation of Matlab function


From: Kasper H. Filtenborg
Subject: [Octave-patch-tracker] [patch #10288] Implementation of Matlab function tensorprod
Date: Thu, 27 Oct 2022 19:59:03 -0400 (EDT)

Follow-up Comment #12, patch #10288 (project octave):

Thank you all for your valuable comments. I have changed the following:

- Accept only single and double for A and B
- Improved description of error messages (removed all use of print_usage()
except tensorprod())
- Reports errors for combinations of invalid inputs that were not considered
before and added checks for these in the self test
- Where possible, cleared up sections with error checking so that values are
assigned after the checks are done instead of in the middle of a section with
checks
- Long lines are split to keep max. 79 characters (I don't know how I missed
that). Looking at other files, the function descriptions and the self tests
seem to violate the max. 79 characters.
  --> Is this ok?
- After a line has been split, I have put an additional indentation (two
spaces) to indicate that the line is a continuation of the previous line.
Additionally, before the "..." I have put a single space.
  --> What is the correct way to do this?
- Added support for row vectors for the dimensions. A combination of row and
column vector for dimA and dimB is also valid.
- Changed to size_equal(A,B) as suggested
- a==fix(a) changed to mod(a,1)==0, which is slightly better since it can
handle Inf. I am not trying to invent something new with the various checks.
Often they are inspired by other checks I have found by viewing other
functions. E.g. the a==fix(a) comes directly from mean.m, and here
mean([1,2,3],Inf) fails without a good descriptive error as e.g.
mean([1,2,3],NaN) does.

(file #53916)

    _______________________________________________________

Additional Item Attachment:

File name: tensorprod.m                   Size:14 KB
    <https://file.savannah.gnu.org/file/tensorprod.m?file_id=53916>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?10288>

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




reply via email to

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