Back to the main page.

Bug 2009 - pinvNx2 function is missing, lmoutrn and lmoutr confusion

Status CLOSED FIXED
Reported 2013-02-25 18:42:00 +0100
Modified 2013-10-26 17:59:37 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2013-02-25 18:42:53 +0100

I noticed that On 25 Feb 2013, at 17:00, <fieldtrip-bugs-bounces@science.ru.nl> wrote: The following tests have started failing since the last e-mail: test_bug1042 test_bug1082 test_bug1309 test_bug1368 test_bug686 test_bug70 test_ft_connectivity_powcorr_ortho test_headmodel_asa test_headmodel_bemcp test_headmodel_dipoli test_headmodel_dipoli_new_old test_headmodel_openmeeg test_headmodel_openmeeg_new_old Some of them were due to teh change of Jan-Mathijs in project_elec http://code.google.com/p/fieldtrip/source/detail?r=7543 and specifically to a function pinvNx2 that is called in lmoutrn.m but that does not exist (yet). I temporarily replaced the pinvNx2() by a normal pinv() roboos@mentat001> svn commit lmoutrn.m Sending lmoutrn.m Transmitting file data . Committed revision 7547.


Robert Oostenveld - 2013-02-25 18:45:31 +0100

todo: - resolve the missing function, which probably is faster than the normal pinv. - clarify why there is now a lmoutr and a lmoutrn (with n). Do they do the same? Is one faster? How about the mex files? Only the preferred implementation should stay.


Jan-Mathijs Schoffelen - 2013-02-25 20:10:15 +0100

My bad: bash-3.2$ svn commit -m "bugfix - added missing function for vectorized lmoutrn" pinvNx2.m Adding pinvNx2.m Transmitting file data . Committed revision 7548.


Robert Oostenveld - 2013-02-25 20:16:27 +0100

(In reply to comment #2) note that the function won't be called at the moment, as I replaced it with a normal pinv.


Jan-Mathijs Schoffelen - 2013-02-25 20:17:05 +0100

which causes a crash because a pinv on a 3-d array is not allowed...


Robert Oostenveld - 2013-02-25 20:17:48 +0100

oh, dat wist ik nie...


Jan-Mathijs Schoffelen - 2013-02-25 20:33:42 +0100

lmoutrn is generally faster than the mex'ed implementation, once it needs to loop more than ~20 times. At the moment I don't know whether the function is called to test a single point against a single triangle, but in case a point (e.g. electrode) is tested against a set of triangles, it's way faster. Note that at present project_elec is calling both lmoutrn (indirectly for the whole array because it is called from ptriprojn), and lmoutr when the closest point has been identified. Since lmoutr and ptriproj seem to be needed throughout fieldtrip for project_elec only, it may be safe to consider the removal of the mex-files, and to replace the call to lmoutr in project_elec by a call to lmoutrn


Jan-Mathijs Schoffelen - 2013-02-25 20:34:16 +0100

@comment 5: ...dat een pinv op een 3D array niet mag, of dat het een 3D array was ;-)


Jan-Mathijs Schoffelen - 2013-05-09 23:21:43 +0200

.