view liboctave/cruft/blas-xtra/zdotc3.f @ 16499:facf00ce97d3

gui: configurable synchronization between file browser and octave directory * default-qt-settings: all settings of the file browser are now located in its section, new setting sync_octave_directory * files-dock-widget.cc(constructor): make QToolBar and QAction variables local, add two buttons for syncing from octave to file browser and vice versa, change status-tips into tool-tips * files-dock-widget.cc(set_current_directory): do not emit signal displayed_directory_changed (would change octave dir) * files-dock-widget.cc(do_sync_octave_directory): new function for manually setting the octave dir to the one in the file browser * files-dock-widget.cc(do_sync_browser_directory): new function for manually setting the file browser to the octave directory * files-dock-widget.cc(update_octave_directory): new function called from the main-window when the octave directory has changed * files-doc-widget.cc(display_directory): new second parameter (bool, default is true) determining whether the signal with the new displayed directory should be emitted if synchronizing is enabled * files-dock-widget.cc(notice-settings): read new setting, enalbe or disable the sync buttons and set file browser to octave directory depending on setting * files-dock-widget.h: removed QToolBar and QAction variibles, new varaibles for storing the actual octave directory and whether syncing is desired or not, new functions (do_sync_octave_directory, do_sync_browser_directory, update_octave_directory), function display_directory with second parameter (bool, default true) * libgui/src/icons/ok.png,libgui/src/icons/reload.png: new icons for the toolbar * main-window.cc(change_directory): call new function update_octave_directory instead of display_directory * main-window.cc(construct-window-menu): rename "Current Directory" into "File Browser" * libgui/src/module.mk: new files icons/ok.png and icons/reload.png * settings-dialog.cc(constructor,write_changed_settings): all files-dock-widgets settings in a section, new setting sync_octave_directory * settings-dialog.ui: new setting sync_octave_directory
author Torsten <ttl@justmail.de>
date Thu, 11 Apr 2013 19:01:55 +0200
parents 648dabbb4c6b
children
line wrap: on
line source

c Copyright (C) 2009-2012  VZLU Prague, a.s., Czech Republic
c
c Author: Jaroslav Hajek <highegg@gmail.com>
c
c This file is part of Octave.
c
c Octave is free software; you can redistribute it and/or modify
c it under the terms of the GNU General Public License as published by
c the Free Software Foundation; either version 3 of the License, or
c (at your option) any later version.
c
c This program is distributed in the hope that it will be useful,
c but WITHOUT ANY WARRANTY; without even the implied warranty of
c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c GNU General Public License for more details.
c
c You should have received a copy of the GNU General Public License
c along with this software; see the file COPYING.  If not, see
c <http://www.gnu.org/licenses/>.
c
      subroutine zdotc3(m,n,k,a,b,c)
c purpose:      a 3-dimensional dot product.
c               c = sum (conj (a) .* b, 2), where a and b are 3d arrays.
c arguments:
c m,n,k (in)    the dimensions of a and b
c a,b (in)      double complex input arrays of size (m,k,n)
c c (out)       double complex output array, size (m,n)
      integer m,n,k,i,j,l
      double complex a(m,k,n),b(m,k,n)
      double complex c(m,n)

      double complex zdotc
      external zdotc

c quick return if possible.
      if (m <= 0 .or. n <= 0) return

      if (m == 1) then
c the column-major case.
        do j = 1,n
          c(1,j) = zdotc(k,a(1,1,j),1,b(1,1,j),1)
        end do
      else
c We prefer performance here, because that's what we generally
c do by default in reduction functions. Besides, the accuracy
c of xDOT is questionable. Hence, do a cache-aligned nested loop.
        do j = 1,n
          do i = 1,m
            c(i,j) = 0d0
          end do
          do l = 1,k
            do i = 1,m
              c(i,j) = c(i,j) + conjg(a(i,l,j))*b(i,l,j)
            end do
          end do
        end do
      end if

      end subroutine