## -*- mode: octave; coding: utf-8 -*-
-
+0; # Don't make this a function file
function res = tcomp (fn)
%% res = tcomp (fn)
%% imports components and rearranges them.
y = 'hello';
z = y';
+ ## Bug#14399.
+ vec = [...
+ one;...
+ two;...
+ three];
+
cnty = repmat(x(:,1)(:), 10, 1);
+ x = ...
+ 12
pop = x(:,1:10)(:);
## Here and below, we test if the indentation aligns with a previous
while (! feof (fid) || line != -1)
if (! any (! isspace (line)) || line(1) == "#" || any (line == "="))
- ## Comments, blank lines or comments about unimplemented
- ## functions: do nothing
- ## FIXME: probably comments and pointers to external functions
- ## could be treated better when printing to screen?
+ ## Comments, blank lines or comments about unimplemented
+ ## functions: do nothing
+ ## FIXME: probably comments and pointers to external functions
+ ## could be treated better when printing to screen?
elseif (! isempty (strfind (line, ">>")))
- ## Skip package name and description as they are in DESCRIPTION
- ## already.
+ ## Skip package name and description as they are in DESCRIPTION
+ ## already.
elseif (! isspace (line(1)))
## Category.
if (! isempty (pkg_idx_struct{cat_num}.functions))
line = fgetl (fid);
while (line != -1)
if (line(1) == "#")
- ## Comments, do nothing.
+ ## Comments, do nothing.
elseif (isspace(line(1)))
## Continuation lines
if (exist ("keyword", "var") && isfield (desc, keyword))
endif
version = fix_version (parts{2});
- ## If no version is specified for the dependency
- ## we say that the version should be greater than
- ## or equal to "0.0.0".
+ ## If no version is specified for the dependency
+ ## we say that the version should be greater than
+ ## or equal to "0.0.0".
else
package = tolower (strip (dep));
operator = ">=";
if (! compare_versions (OCTAVE_VERSION, dep.version, dep.operator))
bad_deps{end+1} = dep;
endif
- ## Is the current dependency not Octave?
+ ## Is the current dependency not Octave?
else
ok = false;
for i = 1:length (installed_pkgs_lst)
endif
h1 = postpad (h1, max_name_length + 1, " ");
- h2 = postpad (h2, max_version_length, " ");;
+ h2 = postpad (h2, max_version_length, " ");
## Print a header.
header = sprintf("%s | %s | %s\n", h1, h2, h3);
## Load all.
if (length (files) == 1 && strcmp (files{1}, "all"))
idx = [1:length(installed_pkgs_lst)];
- ## Load auto.
+ ## Load auto.
elseif (length (files) == 1 && strcmp (files{1}, "auto"))
idx = [];
for i = 1:length (installed_pkgs_lst)
idx (end + 1) = i;
endif
endfor
- ## Load package_name1 ...
+ ## Load package_name1 ...
else
idx = [];
for i = 1:length (files)
idx = strcmp (p, d);
if (any (idx))
rmpath (d);
- ## FIXME: We should also check if we need to remove items from
- ## EXEC_PATH.
+ ## FIXME: We should also check if we need to remove items from
+ ## EXEC_PATH.
endif
endfor
endfunction
isglob = true;
ext(end) = [];
else
- isglob = false;
+ isglob = false; # I am a test
+ #%% me too
+### I shall align to column 0
endif
pos = findstr (nm, ext);
if (pos)
endif
endfor
endfunction
+
+%!assert(norm(logm([1 -1;0 1]) - [0 -1; 0 0]) < 1e-5);
+%!assert(norm(expm(logm([-1 2 ; 4 -1])) - [-1 2 ; 4 -1]) < 1e-5);
+%!assert(logm([1 -1 -1;0 1 -1; 0 0 1]), [0 -1 -1.5; 0 0 -1; 0 0 0], 1e-5);
+%!assert (logm (expm ([0 1i; -1i 0])), [0 1i; -1i 0], 10 * eps)
+
+%% Test input validation
+%!error logm ();
+%!error logm (1, 2, 3);
+%!error <logm: A must be a square matrix> logm([1 0;0 1; 2 2]);
+
+%!assert (logm (10), log (10))
+%!assert (full (logm (eye (3))), logm (full (eye (3))))
+%!assert (full (logm (10*eye (3))), logm (full (10*eye (3))), 8*eps)