diff options
-rwxr-xr-x | src/configure | 3 | ||||
-rw-r--r-- | src/configure.ac | 1 | ||||
-rw-r--r-- | src/matrixOperations/Makefile.am | 3 | ||||
-rw-r--r-- | src/matrixOperations/Makefile.in | 3 | ||||
-rw-r--r-- | src/matrixOperations/includes/logm.h | 23 | ||||
-rw-r--r-- | src/matrixOperations/logm/Makefile.am | 87 | ||||
-rw-r--r-- | src/matrixOperations/logm/Makefile.in | 682 | ||||
-rw-r--r-- | src/matrixOperations/logm/cbal.c | 177 | ||||
-rw-r--r-- | src/matrixOperations/logm/clogma.c | 92 | ||||
-rw-r--r-- | src/matrixOperations/logm/comqr3.c | 246 | ||||
-rw-r--r-- | src/matrixOperations/logm/corth.c | 112 | ||||
-rw-r--r-- | src/matrixOperations/logm/cortr.c | 72 | ||||
-rw-r--r-- | src/matrixOperations/logm/logm_internal.h | 37 | ||||
-rw-r--r-- | src/matrixOperations/logm/slogma.c | 25 | ||||
-rw-r--r-- | src/matrixOperations/logm/testDoubleLogm.c | 48 | ||||
-rw-r--r-- | src/matrixOperations/logm/testFloatLogm.c | 37 | ||||
-rw-r--r-- | src/matrixOperations/logm/wbdiag.c | 306 | ||||
-rw-r--r-- | src/matrixOperations/logm/zlogma.c | 90 |
18 files changed, 2041 insertions, 3 deletions
diff --git a/src/configure b/src/configure index 70bf49c5..317b7a8d 100755 --- a/src/configure +++ b/src/configure @@ -22149,7 +22149,7 @@ fi #operations/multiplication/Makefile #operations/division/Makefile -ac_config_files="$ac_config_files Makefile lib/blas/Makefile lib/lapack/Makefile type/Makefile operations/Makefile operations/addition/Makefile operations/subtraction/Makefile operations/division/Makefile operations/multiplication/Makefile matrixOperations/Makefile matrixOperations/addition/Makefile matrixOperations/subtraction/Makefile matrixOperations/multiplication/Makefile matrixOperations/division/Makefile matrixOperations/cat/Makefile matrixOperations/transpose/Makefile matrixOperations/trace/Makefile matrixOperations/hilbert/Makefile matrixOperations/expm/Makefile matrixOperations/eye/Makefile matrixOperations/ones/Makefile matrixOperations/infiniteNorm/Makefile matrixOperations/inversion/Makefile matrixOperations/jmat/Makefile matrixOperations/chol/Makefile matrixOperations/determ/Makefile matrixOperations/dist/Makefile matrixOperations/fill/Makefile matrixOperations/magnitude/Makefile matrixOperations/squaredMagnitude/Makefile implicitList/Makefile elementaryFunctions/Makefile elementaryFunctions/cos/Makefile elementaryFunctions/cosh/Makefile elementaryFunctions/acos/Makefile elementaryFunctions/acosh/Makefile elementaryFunctions/sin/Makefile elementaryFunctions/sinh/Makefile elementaryFunctions/asin/Makefile elementaryFunctions/asinh/Makefile elementaryFunctions/tan/Makefile elementaryFunctions/tanh/Makefile elementaryFunctions/atan/Makefile elementaryFunctions/atan2/Makefile elementaryFunctions/atanh/Makefile elementaryFunctions/log/Makefile elementaryFunctions/log1p/Makefile elementaryFunctions/log10/Makefile elementaryFunctions/exp/Makefile elementaryFunctions/exp10/Makefile elementaryFunctions/sqrt/Makefile elementaryFunctions/lnp1m1/Makefile elementaryFunctions/pow/Makefile auxiliaryFunctions/Makefile auxiliaryFunctions/abs/Makefile auxiliaryFunctions/find/Makefile auxiliaryFunctions/frexp/Makefile auxiliaryFunctions/isempty/Makefile auxiliaryFunctions/isnan/Makefile auxiliaryFunctions/rand/Makefile auxiliaryFunctions/sign/Makefile auxiliaryFunctions/size/Makefile auxiliaryFunctions/length/Makefile auxiliaryFunctions/type/Makefile auxiliaryFunctions/pythag/Makefile auxiliaryFunctions/conj/Makefile statisticsFunctions/Makefile statisticsFunctions/mean/Makefile statisticsFunctions/sum/Makefile statisticsFunctions/variance/Makefile string/Makefile string/disp/Makefile string/string/Makefile signalProcessing/Makefile signalProcessing/fft/Makefile signalProcessing/ifft/Makefile signalProcessing/levin/Makefile signalProcessing/conv/Makefile signalProcessing/conv2d/Makefile signalProcessing/hilbert/Makefile" +ac_config_files="$ac_config_files Makefile lib/blas/Makefile lib/lapack/Makefile type/Makefile operations/Makefile operations/addition/Makefile operations/subtraction/Makefile operations/division/Makefile operations/multiplication/Makefile matrixOperations/Makefile matrixOperations/addition/Makefile matrixOperations/subtraction/Makefile matrixOperations/multiplication/Makefile matrixOperations/division/Makefile matrixOperations/cat/Makefile matrixOperations/transpose/Makefile matrixOperations/trace/Makefile matrixOperations/hilbert/Makefile matrixOperations/expm/Makefile matrixOperations/eye/Makefile matrixOperations/ones/Makefile matrixOperations/infiniteNorm/Makefile matrixOperations/inversion/Makefile matrixOperations/jmat/Makefile matrixOperations/chol/Makefile matrixOperations/determ/Makefile matrixOperations/dist/Makefile matrixOperations/fill/Makefile matrixOperations/magnitude/Makefile matrixOperations/squaredMagnitude/Makefile matrixOperations/logm/Makefile implicitList/Makefile elementaryFunctions/Makefile elementaryFunctions/cos/Makefile elementaryFunctions/cosh/Makefile elementaryFunctions/acos/Makefile elementaryFunctions/acosh/Makefile elementaryFunctions/sin/Makefile elementaryFunctions/sinh/Makefile elementaryFunctions/asin/Makefile elementaryFunctions/asinh/Makefile elementaryFunctions/tan/Makefile elementaryFunctions/tanh/Makefile elementaryFunctions/atan/Makefile elementaryFunctions/atan2/Makefile elementaryFunctions/atanh/Makefile elementaryFunctions/log/Makefile elementaryFunctions/log1p/Makefile elementaryFunctions/log10/Makefile elementaryFunctions/exp/Makefile elementaryFunctions/exp10/Makefile elementaryFunctions/sqrt/Makefile elementaryFunctions/lnp1m1/Makefile elementaryFunctions/pow/Makefile auxiliaryFunctions/Makefile auxiliaryFunctions/abs/Makefile auxiliaryFunctions/find/Makefile auxiliaryFunctions/frexp/Makefile auxiliaryFunctions/isempty/Makefile auxiliaryFunctions/isnan/Makefile auxiliaryFunctions/rand/Makefile auxiliaryFunctions/sign/Makefile auxiliaryFunctions/size/Makefile auxiliaryFunctions/length/Makefile auxiliaryFunctions/type/Makefile auxiliaryFunctions/pythag/Makefile auxiliaryFunctions/conj/Makefile statisticsFunctions/Makefile statisticsFunctions/mean/Makefile statisticsFunctions/sum/Makefile statisticsFunctions/variance/Makefile string/Makefile string/disp/Makefile string/string/Makefile signalProcessing/Makefile signalProcessing/fft/Makefile signalProcessing/ifft/Makefile signalProcessing/levin/Makefile signalProcessing/conv/Makefile signalProcessing/conv2d/Makefile signalProcessing/hilbert/Makefile" @@ -22790,6 +22790,7 @@ do "matrixOperations/fill/Makefile") CONFIG_FILES="$CONFIG_FILES matrixOperations/fill/Makefile" ;; "matrixOperations/magnitude/Makefile") CONFIG_FILES="$CONFIG_FILES matrixOperations/magnitude/Makefile" ;; "matrixOperations/squaredMagnitude/Makefile") CONFIG_FILES="$CONFIG_FILES matrixOperations/squaredMagnitude/Makefile" ;; + "matrixOperations/logm/Makefile") CONFIG_FILES="$CONFIG_FILES matrixOperations/logm/Makefile" ;; "implicitList/Makefile") CONFIG_FILES="$CONFIG_FILES implicitList/Makefile" ;; "elementaryFunctions/Makefile") CONFIG_FILES="$CONFIG_FILES elementaryFunctions/Makefile" ;; "elementaryFunctions/cos/Makefile") CONFIG_FILES="$CONFIG_FILES elementaryFunctions/cos/Makefile" ;; diff --git a/src/configure.ac b/src/configure.ac index ac4e5e82..b2c09de7 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -186,6 +186,7 @@ matrixOperations/dist/Makefile matrixOperations/fill/Makefile matrixOperations/magnitude/Makefile matrixOperations/squaredMagnitude/Makefile +matrixOperations/logm/Makefile implicitList/Makefile elementaryFunctions/Makefile elementaryFunctions/cos/Makefile diff --git a/src/matrixOperations/Makefile.am b/src/matrixOperations/Makefile.am index 25d3c5b2..4f3ae352 100644 --- a/src/matrixOperations/Makefile.am +++ b/src/matrixOperations/Makefile.am @@ -29,7 +29,8 @@ SUBDIRS= addition \ dist \ fill \ magnitude \ - squaredMagnitude + squaredMagnitude\ + logm diff --git a/src/matrixOperations/Makefile.in b/src/matrixOperations/Makefile.in index 605aae7a..bf30261a 100644 --- a/src/matrixOperations/Makefile.in +++ b/src/matrixOperations/Makefile.in @@ -184,7 +184,8 @@ SUBDIRS = addition \ dist \ fill \ magnitude \ - squaredMagnitude + squaredMagnitude\ + logm all: all-recursive diff --git a/src/matrixOperations/includes/logm.h b/src/matrixOperations/includes/logm.h new file mode 100644 index 00000000..43b5406f --- /dev/null +++ b/src/matrixOperations/includes/logm.h @@ -0,0 +1,23 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#ifndef __LOGM_H__ +#define __LOGM_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + + +void zlogma (doubleComplex* in, int size, doubleComplex* out); + +#endif /* !__LOGM_H__ */ diff --git a/src/matrixOperations/logm/Makefile.am b/src/matrixOperations/logm/Makefile.am new file mode 100644 index 00000000..848783e5 --- /dev/null +++ b/src/matrixOperations/logm/Makefile.am @@ -0,0 +1,87 @@ +## +## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +## Copyright (C) 2008 - INRIA - Arnaud TORSET +## +## This file must be used under the terms of the CeCILL. +## This source file is licensed as described in the file COPYING, which +## you should have received as part of this distribution. The terms +## are also available at +## http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +## +## + + + + +libLogm_la_CFLAGS = -I ./includes \ + -I $(top_builddir)/type \ + -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes \ + -I $(top_builddir)/matrixOperations/includes + + +instdir = $(top_builddir)/lib + + +pkglib_LTLIBRARIES = libLogm.la + +HEAD = ../includes/logm.h \ + logm_internal.h + + +libLogm_la_SOURCES = $(HEAD) \ + zlogma.c\ + wbdiag.c \ + cbal.c \ + corth.c \ + cortr.c \ + comqr3.c + +############# +## CHECK ## +############# + +check_PROGRAMS = testDoubleLogm + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/matrixOperations/inversion/libMatrixInversion.la\ + $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + $(top_builddir)/auxiliaryFunctions/abs/libAbs.la \ + $(top_builddir)/auxiliaryFunctions/sign/libSign.la \ + $(top_builddir)/auxiliaryFunctions/conj/libConj.la \ + $(top_builddir)/auxiliaryFunctions/pythag/libPythag.la \ + $(top_builddir)/operations/addition/libAddition.la \ + $(top_builddir)/operations/multiplication/libMultiplication.la \ + $(top_builddir)/operations/division/libDivision.la \ + $(top_builddir)/operations/subtraction/libSubtraction.la \ + $(top_builddir)/matrixOperations/transpose/libMatrixTranspose.la\ + $(top_builddir)/matrixOperations/multiplication/libMatrixMultiplication.la\ + $(top_builddir)/elementaryFunctions/log/libLog.la \ + $(top_builddir)/elementaryFunctions/log1p/libLog1p.la \ + $(top_builddir)/elementaryFunctions/lnp1m1/libLnp1m1.la \ + $(top_builddir)/elementaryFunctions/pow/libPow.la \ + $(top_builddir)/elementaryFunctions/exp/libExp.la \ + $(top_builddir)/elementaryFunctions/sin/libSin.la \ + $(top_builddir)/elementaryFunctions/cos/libCos.la \ + $(top_builddir)/elementaryFunctions/sinh/libSinh.la \ + $(top_builddir)/elementaryFunctions/cosh/libCosh.la \ + $(top_builddir)/matrixOperations/logm/libLogm.la + + +check_INCLUDES = -I ./includes \ + -I $(top_builddir)/type \ + -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes \ + -I $(top_builddir)/matrixOperations/includes\ + -I $(top_builddir)/matrixOperations/logm + +testDoubleLogm_SOURCES = testDoubleLogm.c +testDoubleLogm_LDADD = $(check_LDADD) +testDoubleLogm_CFLAGS = $(check_INCLUDES) + +TESTS = testDoubleLogm diff --git a/src/matrixOperations/logm/Makefile.in b/src/matrixOperations/logm/Makefile.in new file mode 100644 index 00000000..33a55edc --- /dev/null +++ b/src/matrixOperations/logm/Makefile.in @@ -0,0 +1,682 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +check_PROGRAMS = testDoubleLogm$(EXEEXT) +TESTS = testDoubleLogm$(EXEEXT) +subdir = matrixOperations/logm +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/includes/machine.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +libLogm_la_LIBADD = +am__objects_1 = +am_libLogm_la_OBJECTS = $(am__objects_1) libLogm_la-zlogma.lo \ + libLogm_la-wbdiag.lo libLogm_la-cbal.lo libLogm_la-corth.lo \ + libLogm_la-cortr.lo libLogm_la-comqr3.lo +libLogm_la_OBJECTS = $(am_libLogm_la_OBJECTS) +libLogm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libLogm_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_testDoubleLogm_OBJECTS = testDoubleLogm-testDoubleLogm.$(OBJEXT) +testDoubleLogm_OBJECTS = $(am_testDoubleLogm_OBJECTS) +testDoubleLogm_DEPENDENCIES = $(check_LDADD) +testDoubleLogm_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleLogm_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libLogm_la_SOURCES) $(testDoubleLogm_SOURCES) +DIST_SOURCES = $(libLogm_la_SOURCES) $(testDoubleLogm_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBMATH = @LIBMATH@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +libLogm_la_CFLAGS = -I ./includes \ + -I $(top_builddir)/type \ + -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib +pkglib_LTLIBRARIES = libLogm.la +HEAD = ../includes/logm.h \ + logm_internal.h + +libLogm_la_SOURCES = $(HEAD) \ + zlogma.c\ + wbdiag.c \ + cbal.c \ + corth.c \ + cortr.c \ + comqr3.c + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/matrixOperations/inversion/libMatrixInversion.la\ + $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + $(top_builddir)/auxiliaryFunctions/abs/libAbs.la \ + $(top_builddir)/auxiliaryFunctions/sign/libSign.la \ + $(top_builddir)/auxiliaryFunctions/conj/libConj.la \ + $(top_builddir)/auxiliaryFunctions/pythag/libPythag.la \ + $(top_builddir)/operations/addition/libAddition.la \ + $(top_builddir)/operations/multiplication/libMultiplication.la \ + $(top_builddir)/operations/division/libDivision.la \ + $(top_builddir)/operations/subtraction/libSubtraction.la \ + $(top_builddir)/matrixOperations/transpose/libMatrixTranspose.la\ + $(top_builddir)/matrixOperations/multiplication/libMatrixMultiplication.la\ + $(top_builddir)/elementaryFunctions/log/libLog.la \ + $(top_builddir)/elementaryFunctions/log1p/libLog1p.la \ + $(top_builddir)/elementaryFunctions/lnp1m1/libLnp1m1.la \ + $(top_builddir)/elementaryFunctions/pow/libPow.la \ + $(top_builddir)/elementaryFunctions/exp/libExp.la \ + $(top_builddir)/elementaryFunctions/sin/libSin.la \ + $(top_builddir)/elementaryFunctions/cos/libCos.la \ + $(top_builddir)/elementaryFunctions/sinh/libSinh.la \ + $(top_builddir)/elementaryFunctions/cosh/libCosh.la \ + $(top_builddir)/matrixOperations/logm/libLogm.la + +check_INCLUDES = -I ./includes \ + -I $(top_builddir)/type \ + -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes \ + -I $(top_builddir)/matrixOperations/includes\ + -I $(top_builddir)/matrixOperations/logm + +testDoubleLogm_SOURCES = testDoubleLogm.c +testDoubleLogm_LDADD = $(check_LDADD) +testDoubleLogm_CFLAGS = $(check_INCLUDES) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign matrixOperations/logm/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign matrixOperations/logm/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libLogm.la: $(libLogm_la_OBJECTS) $(libLogm_la_DEPENDENCIES) + $(libLogm_la_LINK) -rpath $(pkglibdir) $(libLogm_la_OBJECTS) $(libLogm_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +testDoubleLogm$(EXEEXT): $(testDoubleLogm_OBJECTS) $(testDoubleLogm_DEPENDENCIES) + @rm -f testDoubleLogm$(EXEEXT) + $(testDoubleLogm_LINK) $(testDoubleLogm_OBJECTS) $(testDoubleLogm_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLogm_la-cbal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLogm_la-comqr3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLogm_la-corth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLogm_la-cortr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLogm_la-wbdiag.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLogm_la-zlogma.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleLogm-testDoubleLogm.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libLogm_la-zlogma.lo: zlogma.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -MT libLogm_la-zlogma.lo -MD -MP -MF $(DEPDIR)/libLogm_la-zlogma.Tpo -c -o libLogm_la-zlogma.lo `test -f 'zlogma.c' || echo '$(srcdir)/'`zlogma.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLogm_la-zlogma.Tpo $(DEPDIR)/libLogm_la-zlogma.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zlogma.c' object='libLogm_la-zlogma.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -c -o libLogm_la-zlogma.lo `test -f 'zlogma.c' || echo '$(srcdir)/'`zlogma.c + +libLogm_la-wbdiag.lo: wbdiag.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -MT libLogm_la-wbdiag.lo -MD -MP -MF $(DEPDIR)/libLogm_la-wbdiag.Tpo -c -o libLogm_la-wbdiag.lo `test -f 'wbdiag.c' || echo '$(srcdir)/'`wbdiag.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLogm_la-wbdiag.Tpo $(DEPDIR)/libLogm_la-wbdiag.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wbdiag.c' object='libLogm_la-wbdiag.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -c -o libLogm_la-wbdiag.lo `test -f 'wbdiag.c' || echo '$(srcdir)/'`wbdiag.c + +libLogm_la-cbal.lo: cbal.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -MT libLogm_la-cbal.lo -MD -MP -MF $(DEPDIR)/libLogm_la-cbal.Tpo -c -o libLogm_la-cbal.lo `test -f 'cbal.c' || echo '$(srcdir)/'`cbal.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLogm_la-cbal.Tpo $(DEPDIR)/libLogm_la-cbal.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cbal.c' object='libLogm_la-cbal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -c -o libLogm_la-cbal.lo `test -f 'cbal.c' || echo '$(srcdir)/'`cbal.c + +libLogm_la-corth.lo: corth.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -MT libLogm_la-corth.lo -MD -MP -MF $(DEPDIR)/libLogm_la-corth.Tpo -c -o libLogm_la-corth.lo `test -f 'corth.c' || echo '$(srcdir)/'`corth.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLogm_la-corth.Tpo $(DEPDIR)/libLogm_la-corth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='corth.c' object='libLogm_la-corth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -c -o libLogm_la-corth.lo `test -f 'corth.c' || echo '$(srcdir)/'`corth.c + +libLogm_la-cortr.lo: cortr.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -MT libLogm_la-cortr.lo -MD -MP -MF $(DEPDIR)/libLogm_la-cortr.Tpo -c -o libLogm_la-cortr.lo `test -f 'cortr.c' || echo '$(srcdir)/'`cortr.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLogm_la-cortr.Tpo $(DEPDIR)/libLogm_la-cortr.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cortr.c' object='libLogm_la-cortr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -c -o libLogm_la-cortr.lo `test -f 'cortr.c' || echo '$(srcdir)/'`cortr.c + +libLogm_la-comqr3.lo: comqr3.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -MT libLogm_la-comqr3.lo -MD -MP -MF $(DEPDIR)/libLogm_la-comqr3.Tpo -c -o libLogm_la-comqr3.lo `test -f 'comqr3.c' || echo '$(srcdir)/'`comqr3.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLogm_la-comqr3.Tpo $(DEPDIR)/libLogm_la-comqr3.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='comqr3.c' object='libLogm_la-comqr3.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLogm_la_CFLAGS) $(CFLAGS) -c -o libLogm_la-comqr3.lo `test -f 'comqr3.c' || echo '$(srcdir)/'`comqr3.c + +testDoubleLogm-testDoubleLogm.o: testDoubleLogm.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLogm_CFLAGS) $(CFLAGS) -MT testDoubleLogm-testDoubleLogm.o -MD -MP -MF $(DEPDIR)/testDoubleLogm-testDoubleLogm.Tpo -c -o testDoubleLogm-testDoubleLogm.o `test -f 'testDoubleLogm.c' || echo '$(srcdir)/'`testDoubleLogm.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleLogm-testDoubleLogm.Tpo $(DEPDIR)/testDoubleLogm-testDoubleLogm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleLogm.c' object='testDoubleLogm-testDoubleLogm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLogm_CFLAGS) $(CFLAGS) -c -o testDoubleLogm-testDoubleLogm.o `test -f 'testDoubleLogm.c' || echo '$(srcdir)/'`testDoubleLogm.c + +testDoubleLogm-testDoubleLogm.obj: testDoubleLogm.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLogm_CFLAGS) $(CFLAGS) -MT testDoubleLogm-testDoubleLogm.obj -MD -MP -MF $(DEPDIR)/testDoubleLogm-testDoubleLogm.Tpo -c -o testDoubleLogm-testDoubleLogm.obj `if test -f 'testDoubleLogm.c'; then $(CYGPATH_W) 'testDoubleLogm.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleLogm.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleLogm-testDoubleLogm.Tpo $(DEPDIR)/testDoubleLogm-testDoubleLogm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleLogm.c' object='testDoubleLogm-testDoubleLogm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLogm_CFLAGS) $(CFLAGS) -c -o testDoubleLogm-testDoubleLogm.obj `if test -f 'testDoubleLogm.c'; then $(CYGPATH_W) 'testDoubleLogm.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleLogm.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-pkglibLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-pkglibLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkglibLTLIBRARIES install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-pkglibLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/matrixOperations/logm/cbal.c b/src/matrixOperations/logm/cbal.c new file mode 100644 index 00000000..ff866cd1 --- /dev/null +++ b/src/matrixOperations/logm/cbal.c @@ -0,0 +1,177 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + + /* + This is a transcription of the fortran subroutine cbal.f + */ + +#include "multiplication.h" +#include "logm_internal.h" +#include "abs.h" + +/******************/ +/* Sous-Fonctions */ +/******************/ +static int boucle_100(doubleComplex* in, int size, int l, int* j, int* m, int *iexc){ + int jj=0, i=0; + for (jj=1;jj<=l;jj++){ + *j=l+1-jj; + for(i=1;i<=l;i++){ + if(i!=(*j)) { + if ( (zreals(in[((*j)-1)*size+i-1])!=0) || (zimags(in[((*j)-1)*size+i-1])!=0) ) break; + } + } + if (i!=(l+1)) break; + else { + *m=l; + *iexc=1; + return 20; + } + } + return 140; +} + + +static int boucle_140(doubleComplex* in, int size, int k, int l, int* j, int* m, int *iexc){ + int i=0; + for ((*j)=k;(*j)<=l;(*j)++){ + for(i=k;i<=l;i++){ + if(i!=(*j)) { + if ( (zreals(in[(i-1)*size+(*j)-1])!=0) || (zimags(in[(i-1)*size+(*j)-1])!=0) ) break; + } + } + if (i!=(l+1)) break; + else{ + *m=k; + *iexc=2; + return 20; + } + } + return 170; +} + + +/***********************/ +/* Fonction principale */ +/***********************/ + +void cbal(doubleComplex* in, int n, int* low, int* high, double* scale){ + const double radix=2; + double b2=0, c=0, r=0, g=0, f=0, s=0; + int k=0, l=0, continuer=1, j=0, i=0, iexc=0, noconv=0; + int result, m; + doubleComplex fCpx; + + b2=radix*radix; + k=1; + l=n; + + result= boucle_100(in,n,l,&j,&m, &iexc); + while(continuer){ + if(result==20){ + scale[m-1] = j; + if (j != m) { + for(i=1; i<=l;i++){ + fCpx = in[(i-1)*n+j-1]; + in[(i-1)*n+j-1] = in[(i-1)*n+m-1]; + in[(i-1)*n+m-1] = fCpx; + } + for(i=k; i<=m; i++){ + fCpx = in[(j-1)*n+i-1]; + in[(j-1)*n+i-1] = in[(m-1)*n+i-1]; + in[(m-1)*n+i-1] = fCpx; + } + } + + if (iexc==1){ + if (l==1) { + continuer=0; + break; + } + else { + l--; + result = boucle_100(in,n,l,&j,&m, &iexc); + } + } + else if (iexc==2){ + k++; + result = boucle_140(in,n,k,l,&j,&m, &iexc); + } + + + } + + if (result == 140){ + result = boucle_140(in,n,k,l,&j,&m, &iexc); + } + + if (result == 170){ + continuer=0; + } + } + + for (i=k;i<=l;i++){ + scale[i-1]=1; + } + + do{ + noconv=0; /* noconv=false */ + for (i=k;i<=l;i++){ + c=0; + r=0; + + + for (j=k;j<=l;j++){ + if(j!=i){ + c += ( dabss(zreals(in[(i-1)*n+j-1])) + dabss(zimags(in[(i-1)*n+j-1])) ); + r += ( dabss(zreals(in[(j-1)*n+i-1])) + dabss(zimags(in[(j-1)*n+i-1])) ); + } + } + + /* :::::::::: guard against zero c or r due to underflow :::::::::: */ + if ( (r!=0) && (c!=0) ){ + g=r/radix; + f=1; + s=c+r; + + while (c < g){ + f = f * radix; + c = c * b2; + } + + g = r * radix; + while(c >= g) { + f = f / radix; + c = c / b2; + + } + /* :::::::::: now balance :::::::::: */ + if (((c + r) / f) < 0.950 * s) { + g = 1 / f; + scale[i-1] = scale[i-1] * f; + noconv = 1; + + for (j = k; j <= n; j++) + in[(j-1)*n+i-1] = zmuls(in[(j-1)*n+i-1],DoubleComplex(g,0)); + + for (j = 1; j <= l; j++) + in[(i-1)*n+j-1] = zmuls(in[(i-1)*n+j-1],DoubleComplex(f,0)); + } + } + } + }while(noconv); /* while (noconv == true) */ + + *low = k; + *high = l; +} + diff --git a/src/matrixOperations/logm/clogma.c b/src/matrixOperations/logm/clogma.c new file mode 100644 index 00000000..f64e574c --- /dev/null +++ b/src/matrixOperations/logm/clogma.c @@ -0,0 +1,92 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include <malloc.h> +#include "logm.h" +#include "schur.h" +#include "log.h" +#include "multiplication.h" +#include "tranpose.h" +#include "inverse.h" + +static void bdiag(floatComplex *in, int size, double n, floatComplex *out1, floatComplex *out2){ + +} + + + +void clogma (floatComplex* in, int size, floatComplex* out){ + doubleComplex *out1, *out2, *dtmp; + int i=0, egaux=0; + float eps = 2.220e-16; + int select, sdim, lwork, bwork, info = 0; + doubleComplex *eigenvalues, *work, *rwork; + + + out1=malloc((uint)(size*size)*sizeof(doubleComplex)); + out2=malloc((uint)(size*size)*sizeof(doubleComplex)); + dtmp=malloc((uint)(size*size)*sizeof(doubleComplex)); + eigenvalues=malloc((uint)size*sizeof(doubleComplex)); + work=malloc((uint)(pow(2,size))*sizeof(doubleComplex)); + rwork=malloc((uint)size*sizeof(doubleComplex)); + + ctransposea(in,size,size,tmp);/*pb entre float et double*/ + + for (i=0;i<size*size;i++){ + if (in[i]!=tmp[i]) break; + } + if (i==size*size) egaux =1; + + + if (egaux){ + /*Hermitian matrix*/ + for (i=0;i<size*size,i++) + out1[i]=DoubleComplex((double)creals(in[i]),(double)cimags(in[i]));; + + C2F(zgees)("V","S", &select, &size, out1, &size, &sdim, eigenvalues, out2, &size, work, &lwork, rwork, &bwork, &info); + + for (i=0;i<size;i++){ + for (j=0;j<size;j++){ + tmp[i*size+j]=0; + if (i==j) dtmp[i*size+j]=zlogs(out2[i*size+j]); + } + } + + zmulma(out1,size,size,dtmp,size,size,out2); + ztransposea(out1,size,size,dtmp); + + cmula(out2,size,size,tmp,size,size,out1); + for (i=0;i<size*size,i++) + out[i]=FloatComplex((float)zreals(in[i]),(float)zimags(in[i]));; + } + else + { + /*General Matrix*/ + bdiag(in, size, eps, out1, out2); + + + for (i=0;i<size;i++){ + for (j=0;j<size;j++){ + tmp[i*size+j]=0; + if (i==j) tmp[i*size+j]=clogs(out2[i*size+j]); + } + } + + out2 = cmulma(out1,tmp); + tmp = cinversea(out1,size,size,out1); + + out= cmula(out2,tmp); + } + + +} diff --git a/src/matrixOperations/logm/comqr3.c b/src/matrixOperations/logm/comqr3.c new file mode 100644 index 00000000..1e8fb063 --- /dev/null +++ b/src/matrixOperations/logm/comqr3.c @@ -0,0 +1,246 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + /* + This is a transcription of the fortran subroutine comqr3.f + */ + + + +#include "logm_internal.h" +#include "sqrt.h" +#include "abs.h" +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "pythag.h" +#include "conj.h" +#include "min.h" + + +void comqr3(doubleComplex* in, int n, doubleComplex* w, int low, int high, int job, doubleComplex* z){ + /* Variables */ + int i=0, j=0, l=0, ll=0, ip1=0; + int ierr=0, iend=0, jx=0, jy=0, en=0, itn=0, its=0, enm1=0, lp1=0; + int boucle_220=0, boucle_240=0; + double norm; + doubleComplex s,t,x,y,zz; + + + ierr=0; + jx=job/10; + jy=job%10; + /*......... create real subdiagonal elements ..........*/ + iend = high-low-1; + + if (iend>=0){ + l=low+1; + + for(i=l;i<=high;i++){ + ll=min(i+1,high); + if (zimags(in[(i-2)*n+i-1])!=0){ + norm = dpythags(zreals(in[(i-2)*n+i-1]),zimags(in[(i-2)*n+i-1])); + y=zrdivs(in[(i-2)*n+i-1],DoubleComplex(norm,0)); + in[(i-2)*n+i-1]=DoubleComplex(norm,0); + + for(j=i;j<=n;j++){ + s=DoubleComplex(0, zimags(zmuls(y,zconjs(in[(j-1)*n+i-1])))); + in[(j-1)*n+i-1] = DoubleComplex(zreals(zmuls(zconjs(y),in[(j-1)*n+i-1])),zimags(s)); + } + + for(j=1;j<=ll;j++){ + s=DoubleComplex(0, zimags(zmuls(zconjs(y),in[(i-1)*n+j-1]))); + in[(i-1)*n+j-1] = DoubleComplex(zreals(zmuls(zconjs(y),in[(i-1)*n+j-1])),zimags(s)); + } + + if (jy!=0){ + for (j=low;j<=high;j++){ + s=DoubleComplex(0, zimags(zmuls(y,z[(i-1)*n+j-1]))); + z[(i-1)*n+j-1] = DoubleComplex(zreals(zmuls(y,z[(i-1)*n+j-1])),zimags(s)); + } + } + } + } + } + + /*.......... store roots isolated by cbal ..........*/ + for(i=1;i<=n;i++){ + if( (i<low) || (i>high) ){ + w[i-1]=in[(i-1)*n+i-1]; + } + } + + en = high; + t=DoubleComplex(0,0); + itn = 30*n; + boucle_220=1; + + /*.......... search for next eigenvalue ..........*/ + while (boucle_220 && (en>=low)){ + its=0; + enm1= en-1; + /* .......... look for single small sub-diagonal element + for l=en step -1 until low do -- ..........*/ + boucle_240=1; + while(boucle_240){ + + for(ll=low; ll<=en;ll++){ + l = en + low - ll; + if (l!=low){ + x = DoubleComplex(dabss(zreals(in[(l-2)*n+l-2])) + dabss(zimags(in[(l-2)*n+l-2])) + dabss(zreals(in[(l-1)*n+l-1])) +dabss(zimags(in[(l-1)*n+l-1])),0); + y = DoubleComplex(zreals(x) + dabss(zreals(in[(l-2)*n+l-1])),0); + if (zreals(x) == zreals(y)) break; + } + } + /*.......... form shift ..........*/ + if (l==en) { + boucle_240=0; + break; + } + if (itn==0) { + boucle_240=0; + break; + } + if ( (its == 10) || (its == 20) ){ + /*.......... form exceptional shift ..........*/ + s = DoubleComplex(dabss( zreals(in[(enm1-1)*n+en-1]) ) + dabss( zreals(in[(en-3)*n+enm1-1]) ),0); + } + else { + s = in[(en-1)*n+en-1]; + + x = zmuls(in[(en-1)*n+enm1-1],DoubleComplex(zreals(in[(enm1-1)*n+en-1]),0)); + + if ( (zreals(x)!=0) || (zimags(x)!=0) ){ + y=zrdivs(zdiffs(in[(enm1-1)*n+enm1-1],s),DoubleComplex(2,0)); + + zz=zsqrts(zadds(zmuls(y,y),x)); + + if ( (zreals(y)*zreals(zz) + zimags(y)*zimags(zz)) < 0){ + zz = DoubleComplex(-zreals(zz),-zimags(zz)); + } + zz=zrdivs(x,zadds(y,zz)); + s = zdiffs(s,zz); + } + } + + for(i=low;i<=en;i++){ + in[(i-1)*n+i-1]=zdiffs(in[(i-1)*n+i-1],s); + } + + t = zadds(t,s); + its++; + itn--; + /*.......... reduce to triangle (rows) ..........*/ + lp1=l+1; + + for(i=lp1;i<=en;i++){ + s=DoubleComplex(zreals(in[(i-2)*n+i-1]),zimags(s)); + norm = dpythags(dpythags(zreals(in[(i-2)*n+i-2]),zimags(in[(i-2)*n+i-2])),zreals(s)); + x=zrdivs(in[(i-2)*n+i-2],DoubleComplex(norm,0)); + w[i-2]=x; + in[(i-2)*n+i-2]=DoubleComplex(norm, 0); + in[(i-2)*n+i-1]=DoubleComplex(0, zreals(s)/norm); + + for (j=i;j<=n;j++){ + y = in[(j-1)*n+i-2]; + zz = in[(j-1)*n+i-1]; + in[(j-1)*n+i-2] = zadds(zmuls(zconjs(x),y),zmuls(DoubleComplex(zimags(in[(i-2)*n+i-1]),0),zz)); + in[(j-1)*n+i-1] = zdiffs(zmuls(x,zz),zmuls(DoubleComplex(zimags(in[(i-2)*n+i-1]),0),y)); + } + } + /* FIXME s make sign problem with the exemple */ + s=DoubleComplex(zreals(s),zimags(in[(en-1)*n+en-1])); + if( zimags(s)!=0){ + + norm = dpythags(zreals(in[(en-1)*n+en-1]),zimags(s)); + s = DoubleComplex( zreals(in[(en-1)*n+en-1])/norm , zimags(s)/norm); + + in[(en-1)*n+en-1]=DoubleComplex( norm, 0); + if (en!=n){ + + ip1=en+1; + for(j=ip1;j<=n;j++){ + y=in[(j-1)*n+en-1]; + in[(j-1)*n+en-1]=zmuls(zconjs(s),y); + } + } + } + + /*.......... inverse operation (columns) ..........*/ + for (j=lp1;j<=en;j++){ + x=w[j-2]; + for(i=1;i<=j;i++){ + y=DoubleComplex(zreals(in[(j-2)*n+i-1]),0); + zz=in[(j-1)*n+i-1]; + if(i!=j){ + + y=DoubleComplex(zreals(y), zimags(in[(j-2)*n+i-1])); + + in[(j-2)*n+i-1] = DoubleComplex(zreals(in[(j-2)*n+i-1]), + zreals(x)*zimags(y) + zimags(x)*zreals(y) + zimags(in[(j-2)*n+j-1])*zimags(zz)); + } + + in[(j-2)*n+i-1] = DoubleComplex( + zreals(x)*zreals(y) - zimags(x)*zimags(y) + zimags(in[(j-2)*n+j-1])*zreals(zz), + zimags(in[(j-2)*n+i-1])); + + in[(j-1)*n+i-1] = zdiffs(zmuls(zconjs(x),zz),zmuls(DoubleComplex(zimags(in[(j-2)*n+j-1]),0),y)); + } + + + + if(jy!=0){ + for(i=low;i<=high;i++){ + y=z[(j-2)*n+i-1]; + zz=z[(j-1)*n+i-1]; + z[(j-2)*n+i-1] = zadds(zmuls(x,y),zmuls(DoubleComplex(zimags(in[(j-2)*n+j-1]),0),zz)); + + z[(j-1)*n+i-1] = zdiffs(zmuls(zconjs(x),zz),zmuls(DoubleComplex(zimags(in[(j-2)*n+j-1]),0),y)); + } + } + } + + if (zimags(s)!=0){ + for (i=1;i<=en;i++){ + y=in[(en-1)*n+i-1]; + in[(en-1)*n+i-1]=zmuls(s,y); + } + + if(jy!=0){ + for(i=low;i<=high;i++){ + y=z[(en-1)*n+i-1]; + z[(en-1)*n+i-1]=zmuls(s,y); + } + } + } + + } + + + if( (l!=en) && (itn==0) ){ + boucle_220=0; + break; + } + in[(en-1)*n+en-1]=zadds(in[(en-1)*n+en-1],t); + w[en-1] = in[(en-1)*n+en-1]; + en = enm1; + + } + + ierr=en; +} + + + + + diff --git a/src/matrixOperations/logm/corth.c b/src/matrixOperations/logm/corth.c new file mode 100644 index 00000000..a98edefc --- /dev/null +++ b/src/matrixOperations/logm/corth.c @@ -0,0 +1,112 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* + This is a transcription of the fortran subroutine corth.f + */ + + +#include "logm_internal.h" +#include "abs.h" +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "conj.h" + +void corth(doubleComplex* in , int n, int low,int high, doubleComplex* ort){ + int la=0, kp1=0, m=0, mp=0, i=0, j=0, ii=0, jj=0; + double h=0, scale=0, g=0, f=0; + doubleComplex fCpx; + + la = high - 1 ; + kp1 = low + 1 ; + if (la >= kp1) { + + for (m = kp1; m <= la; m++){ + h = 0; + ort[m-1]=DoubleComplex(0,0); + scale = 0; + /* :::::::::: scale column (algol tol then not needed) :::::::::: */ + for (i = m; i <= high; i++) + scale = scale + dabss(zreals(in[(m-2)*n+i-1])) + dabss(zimags(in[(m-2)*n+i-1])); + + + + if (scale != 0) { + mp = m + high; + /* :::::::::: for i=igh step -1 until m do -- :::::::::: */ + for (ii = m; ii <= high; ii++){ + i = mp - ii; + ort[i-1] = zrdivs(in[(m-2)*n+i-1],DoubleComplex(scale,0)); + h = h + zreals(ort[i-1]) * zreals(ort[i-1]) + zimags(ort[i-1]) * zimags(ort[i-1]); + } + + + g = dsqrts(h); + + f = dsqrts(zreals(ort[m-1]) * zreals(ort[m-1]) + zimags(ort[m-1]) * zimags(ort[m-1])); + + if (f == 0){ + ort[m-1]=DoubleComplex(g,zimags(ort[m-1])); + in[(m-2)*n+m-1]=DoubleComplex(scale,zreals(in[(m-2)*n+m-1]) ); + } + else { + h = h + f * g; + g = g / f; + ort[m-1]=zmuls(DoubleComplex(1+g,0),ort[m-1]); + } + + /* :::::::::: form (i-(u*ut)/h) * a :::::::::: */ + for (j=m;j<=n;j++){ + + fCpx = DoubleComplex(0,0); + + /* :::::::::: for i=igh step -1 until m do -- :::::::::: */ + for (ii=m;ii<=high;ii++){ + i = mp - ii; + fCpx = zadds(fCpx, zmuls(zconjs(ort[i-1]),in[(j-1)*n+i-1])); + } + + fCpx=zrdivs(fCpx,DoubleComplex(h,0)); + + for (i=m;i<=high;i++){ + in[(j-1)*n+i-1] = zdiffs(in[(j-1)*n+i-1],zmuls(zconjs(fCpx),ort[i-1])); + } + } + + /* :::::::::: form (i-(u*ut)/h)*a*(i-(u*ut)/h) :::::::::: */ + for(i=1;i<=high;i++){ + fCpx = DoubleComplex(0,0); + /* :::::::::: for j=igh step -1 until m do -- :::::::::: */ + for (jj=m;jj<=high;jj++){ + j = mp - jj; + fCpx = zadds(fCpx, zmuls(ort[j-1],in[(j-1)*n+i-1])); + } + + fCpx=zrdivs(fCpx,DoubleComplex(h,0)); + + for (j=m;j<=high;j++){ + in[(j-1)*n+i-1] = zadds(in[(j-1)*n+i-1], zmuls(fCpx,DoubleComplex(-zreals(ort[j-1]),zimags(ort[j-1])))); + } + } + + ort[m-1] = zmuls(DoubleComplex(scale,0),ort[m-1]); + in[(m-2)*n+m-1] = zmuls(DoubleComplex(-g,0),in[(m-2)*n+m-1]); + + + } + } + + + } +} diff --git a/src/matrixOperations/logm/cortr.c b/src/matrixOperations/logm/cortr.c new file mode 100644 index 00000000..609afe86 --- /dev/null +++ b/src/matrixOperations/logm/cortr.c @@ -0,0 +1,72 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + /* + This is a transcription of the fortran subroutine cortr.f + */ + +#include "logm_internal.h" +#include "conj.h" +#include "addition.h" +#include "multiplication.h" +#include "division.h" + + + +void cortr(doubleComplex* in, int n, int low, int high, doubleComplex* ort, doubleComplex* z){ + int i=0, j=0, k=0, ii=0, iend=0, ip1=0; + double norm; + doubleComplex s; + + + /*.......... initialize eigenvector matrix ..........*/ + for (i=1;i<=n;i++){ + for (j=1;j<=n;j++){ + if (i==j) z[(j-1)*n+i-1]=DoubleComplex(1,0); + else z[(j-1)*n+i-1]=DoubleComplex(0,0); + } + } + + /*.......... form the matrix of accumulated transformations + from the information left by corth ..........*/ + iend = high -low -1; + if (iend >= 0){ + for (ii=1;ii<=iend;ii++){ + i=high-ii; + if ( ( !((zreals(ort[i-1])==0) && (zimags(ort[i-1])==0) )) + && ( !((zreals(in[(i-2)*n+i-1])==0) && (zimags(in[(i-2)*n+i-1])==0) ) ) ){ + /* .......... norm below is negative of h formed in corth .........*/ + norm = zreals(zmuls(zconjs(in[(i-2)*n+i-1]),ort[i-1])); + if (norm != 0 ){ + ip1=i+1; + for(k=ip1;k<=high;k++){ + ort[k-1] = DoubleComplex( zreals(in[(i-2)*n+k-1]), zimags(in[(i-2)*n+k-1]) ); + } + + for (j=i;j<=high;j++){ + s=DoubleComplex(0,0); + for(k=i;k<=high;k++){ + s=zadds(s, zmuls(zconjs(ort[k-1]),z[(j-1)*n+k-1])); + } + + s = zrdivs(s,DoubleComplex(norm,0)); + + for(k=i;k<=high;k++){ + z[(j-1)*n+k-1]=zadds(z[(j-1)*n+k-1], zmuls(s,ort[k-1])); + } + } + } + } + } + } +} + diff --git a/src/matrixOperations/logm/logm_internal.h b/src/matrixOperations/logm/logm_internal.h new file mode 100644 index 00000000..e0263cfc --- /dev/null +++ b/src/matrixOperations/logm/logm_internal.h @@ -0,0 +1,37 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + + +#ifndef __LOGM_INTERNAL_H__ +#define __LOGM_INTERNAL_H__ + +#include "doubleComplex.h" + +void wbdiag(doubleComplex* in, int size, doubleComplex* out); + +void cbal(doubleComplex* in, int n, int* low, int* high, double* scale); + +void corth(doubleComplex* in , int n, int low,int high, doubleComplex* ort); + +void cortr(doubleComplex* in, int n, int low, int high, doubleComplex* ort, doubleComplex* z); + +void comqr3(doubleComplex* in, int n, doubleComplex* w, int low, int high, int job, doubleComplex* z); + +void wexchn(); +void dad(doubleComplex* in, int size_1, int l11_1, int l22m1, int l11_2, int size_2, int one, int n); +void balbak(); +void dset(); +void dad(); +void wshrsl(); +doubleComplex ddot(); +#endif /*__LOGM_INTERNAL_H__*/ diff --git a/src/matrixOperations/logm/slogma.c b/src/matrixOperations/logm/slogma.c new file mode 100644 index 00000000..09d0979e --- /dev/null +++ b/src/matrixOperations/logm/slogma.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include <malloc.h> +#include "logm.h" + + +void slogma (float* in, int size, floatComplex* out){ + floatComplex *inCpx; + int i; + + inCpx=malloc((uint)(size*size)*sizeof(floatComplex)); + for (i=0;i<size*size) inCpx[i] = FloatComplex(in[i],0); + + clogma(inCpx, size, out); +} diff --git a/src/matrixOperations/logm/testDoubleLogm.c b/src/matrixOperations/logm/testDoubleLogm.c new file mode 100644 index 00000000..6fe3d563 --- /dev/null +++ b/src/matrixOperations/logm/testDoubleLogm.c @@ -0,0 +1,48 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include <malloc.h> +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include "logm.h" +#include "logm_internal.h" + +static void dlogmaTest(void){ +} + + +static void zlogmaTest(void){ + int i; + double inD[9]={0.2113249,0.3303271 , 0.8497452 , 0.7560439, 0.6653811 , 0.6857310 ,0.0002211 , 0.6283918 , 0.8782165}; + doubleComplex *in, *out; + in=malloc((uint)9*sizeof(doubleComplex)); + out=malloc((uint)9*sizeof(doubleComplex)); + + for(i=0;i<9;i++) in[i]=DoubleComplex(inD[i],0); + + wbdiag(in,3,out); + +} + +static int logmTest(void){ + dlogmaTest(); + zlogmaTest(); + return 0; +} + +int main (void){ + assert(logmTest()==0); + return 0; +} + + diff --git a/src/matrixOperations/logm/testFloatLogm.c b/src/matrixOperations/logm/testFloatLogm.c new file mode 100644 index 00000000..71fb1c16 --- /dev/null +++ b/src/matrixOperations/logm/testFloatLogm.c @@ -0,0 +1,37 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include <assert.h> +#include <math.h> +#include <stdio.h> +#include "logm.h" + + +static void slogmaTest(void){ +} + + +static void clogmaTest(void){ +} + +static int logmTest(void){ + slogmaTest(); + clogmaTest(); + return 0; +} + +int main (void){ + assert(logmTest()==0); + return 0; +} + + diff --git a/src/matrixOperations/logm/wbdiag.c b/src/matrixOperations/logm/wbdiag.c new file mode 100644 index 00000000..da6fb1d6 --- /dev/null +++ b/src/matrixOperations/logm/wbdiag.c @@ -0,0 +1,306 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "logm_internal.h" +#include "pow.h" +#include "abs.h" +#include "addition.h" +#include "subtraction.h" +#include <malloc.h> +#include <stdio.h> + +void wbdiag( doubleComplex* in, int size, doubleComplex* out){ + double norm=0, rav, cav,c,d; + int i=0, j=0, ok=0, l1=0, l11pi=0,k,l, *bs, fail; + int l11=0, l22=0, l22m1=0, da22=0, da11=0, one=1, mone, km1; + int job=0; /* It seems job is always zero for a call with a complex matrix. It must be confirmed. + If it's true, we could remove some parts of the code that use j<>0 */ + int low=0, high=0; + double* scale; + doubleComplex *eigenvalue, *x, *y, temp; + int boucle_50, boucle_60, boucle_110, boucle_420, boucle_460, boucle_520, boucle_560; + + + scale = malloc((uint)size*sizeof(double)); + eigenvalue = malloc((uint)size*sizeof(doubleComplex)); + x = malloc((uint)size*sizeof(doubleComplex)); + y = malloc((uint)size*sizeof(doubleComplex)); + bs = malloc((uint)size*sizeof(int)); + + + /* Compute l1 norm of in */ + for (i=0;i<size*size;i++){ + norm += (zreals(in[i])+zimags(in[i])); + } + + + /* convert a to upper hessenberg form */ + cbal(in, size, &low, &high, scale); + corth(in, size, 1, size, eigenvalue); + cortr(in, size, 1, size, eigenvalue, x); + + + /* convert a to upper triangular form by qr method */ + comqr3(in, size, eigenvalue, 1, size, 11, x); + + /* reduce a to block diagonal form + + segment a into 4 matrices: a11, a 1 x 1 block + whose (1,1)-element is at a(l11,l11)) a22, a 1 x 1 + block whose (1,1)-element is at a(l22,l22)) a12, + a 1 x 1 block whose (1,1)-element is at a(l11,l22)) + and a21, a 1 x 1 block = 0 whose (1,1)- + element is at a(l22,l11). + + + + this loop uses l11 as loop index and splits off a block + starting at a(l11,l11). */ + + l11=1; + + while(l11<=size){/* debut boucle_40 */ + l22=l11; + /* this loop uses da11 as loop variable and attempts to split + c off a block of size da11 starting at a(l11,l11) */ + while (boucle_50){ + if (l22!=l11) boucle_60=1; + else { + da11 = 1; + l22 = l11 + 1; + l22m1 = l22 - 1; + boucle_60=0; + } + if (boucle_60==1){ + /* compute the average of the eigenvalues in a11 */ + rav = 0; + cav = 0; + for (i=l11;i<l22m1;i++){ + rav = rav + zreals(eigenvalue[i]); + cav = cav + dabss(zimags(eigenvalue[i])); + } + + rav = rav/da11; + cav = cav/da11; + /* loop on eigenvalues of a22 to find the one closest to the av */ + d = dpows(rav-zreals(eigenvalue[l22-1]),2) + dpows(cav-zimags(eigenvalue[l22-1]),2); + k = l22; + l = l22 + 1; + + if(l<size){ + c = dpows(rav-zreals(eigenvalue[l-1]),2) + dpows(cav-zimags(eigenvalue[l-1]),2); + if (c < d){ + k = l; + d = c; + } + l = l + 1; + } + + /* loop to move the eigenvalue just located + into first position of block a22. + the block we're moving to add to a11 is a 1 x 1 */ + boucle_110=1; + while (boucle_110){ + if (k==l22) boucle_110=0; + else{ + km1 = k - 1; + wexchn(); + temp = eigenvalue[k-1]; + eigenvalue[k-1] = eigenvalue[km1-1]; + eigenvalue[km1-1] = temp; + k = km1; + + if (k<=l22) boucle_110=0; + } + } + da11 = da11 + 1; + l22 = l11 + da11; + l22m1 = l22 - 1; + } + if (l22>=size) boucle_50=0; + else { + /* attempt to split off a block of size da11. */ + da22 = size - l22 + 1; + + /* save a12 in its transpose form in block a21. */ + for (j=l11;j<l22m1;j++){ + for (i=l22;i<size;i++){ + in[(i-1)*size+j]=in[(j-1)*size+i]; + } + } + /* convert a11 to lower quasi-triangular and multiply it by -1 and + c a12 appropriately (for solving -a11*p+p*a22=a12). + + c write(6,'(''da11='',i2,''da22='',i2)') da11,da22 + c write(6,'(''a'')') + c call wmdsp(ar,ai,n,n,n,10,1,80,6,cw,iw) + */ + + dad(in, size, l11, l22m1, l11, size, one, 0); + dad(in, size, l11, l22m1, l11, l22m1, mone, 1); + + /* solve -a11*p + p*a22 = a12. */ + wshrsl(); + if (ok) boucle_50=0; + else { + /* change a11 back to upper quasi-triangular. */ + dad(in, size, l11, l22m1, l11, l22m1, one, 1); + dad(in, size, l11, l22m1, l11, l22m1, mone, 0); + + /* move saved a12 back into its correct position. */ + for (j=l11;j<l22m1;j++){ + for(i=l22;i<size;i++){ + in[(j-1)*size+i-1] = in[(i-1)*size+j-1]; + in[(i-1)*size+j-1] = DoubleComplex(0,0); + } + + } + } + + } + }/*boucle_50*/ + /* change solution to p to proper form */ + if (l22<=size){ + dad(in,size,l11,l22m1,l11,size,one,0); + dad(in,size,l11,l22m1,l11,l22m1,mone,1); + } + bs[l11-1]=da11; + j=da11-1; + if (j!=0){ + for(i=1;i<=j;i++){ + l11pi=l1+i; + bs[l11pi-1]=-(da11-i); + } + l11=l22; + }/* boucle_40 */ + + + fail=1; + /* + set transformations matrices as required + if (job == 3) return; + + compute inverse tranformation + if (job ==1){ + for (i=0;i<size;i++){ + for(j=0;j<size;j++){ + y[i*size+j-1]=x[j*size+i-1]; + } + } + + l22=1; + boucle_420=1; + while (boucle_420){ + l11=l22; + l22=l11+bs[l11-1]; + if (l22>size) { + boucle_420=0; + break; + } + l22m1=l22-1; + + for (i=l11;i<=l22m1;i++){ + for(j=1;j<=size;j++){ + y[i*size+j-1]=zadds(zdiffs(y[i*size+j-1],ddot()),ddot()); + } + } + } + + if (high<>low){ + for (j=low;j<=high;j++){ + temp=1/scale[j-1]; + for(i=1;i<=size;i++){ + y[i*size+j-1]=y[i*size+j-1]*temp; + } + } + } + + for (ii=1;ii<+size;i++){ + i=ii; + if ( (i<low) || (i>high) ){ + if (i<low) i=low-ii; + k=scale[i-1]; + if (k<>i){ + for (j=1;j<=size;j++){ + temp=y[j*size+i-1]; + y[j*size+i-1] = y[j*size+k-1]; + y[j*size+k-1] = temp; + } + } + } + } + } + */ + if (job!=2){ + /* Compute right transformation */ + l22=1; + boucle_460=1; + while(boucle_460){ + l11=l22; + l22=l11+bs[l11-1]; + if (l22>size) { + boucle_420=0; + break; + } + + for (j=l22;j<=size;j++){ + for(i=1;i<=size;i++){ + x[i*size+j-1]=zadds(zdiffs(x[i*size+j-1],ddot()),ddot()); + } + } + } + balbak(); + } + + /* extract non orthogonal transformation from in */ + for (j=1;j<size;j++){ + dset(); + } + + dset(); + l22=1; + boucle_520=1; + while(boucle_520){ + l11=l22; + if(l11>size) { + boucle_520=0; + break; + } + l22=l11+bs[l11-1]; + for (j=l22;j<=size;j++){ + for (i=1;i<=size;i++){ + y[i*size+j-1]=zdiffs(zadds(y[i*size+j-1],ddot()),ddot()); + } + } + } + } + + /* set zeros in the matrix in */ + l11=1; + boucle_560=1; + while (boucle_560){ + l22=l11+bs[l11-1]; + if (l22>size){ + boucle_560=0; + break; + } + l22m1=l22-1; + + for(j=l11;j<=l22m1;j++){ + dset(); + dset(); + } + l11=l22; + } + out=in; + +} diff --git a/src/matrixOperations/logm/zlogma.c b/src/matrixOperations/logm/zlogma.c new file mode 100644 index 00000000..2bbb4488 --- /dev/null +++ b/src/matrixOperations/logm/zlogma.c @@ -0,0 +1,90 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include <stdio.h> +#include <malloc.h> +#include "lapack.h" +#include "pow.h" +#include "logm.h" +#include "log.h" +#include "matrixMultiplication.h" +#include "matrixTranspose.h" +#include "matrixInversion.h" +#include "logm_internal.h" + +void zlogma (doubleComplex* in, int size, doubleComplex* out){ + doubleComplex *out1, *out2, *tmp, *inCopy; + int i=0, j=0, egaux=0; + int mon_select, sdim, lwork, bwork, info = 0; + doubleComplex *eigenvalues, *work, *rwork; + + + + inCopy=malloc((uint)(size*size)*sizeof(doubleComplex)); + out1=malloc((uint)(size*size)*sizeof(doubleComplex)); + out2=malloc((uint)(size*size)*sizeof(doubleComplex)); + tmp=malloc((uint)(size*size)*sizeof(doubleComplex)); + eigenvalues=malloc((uint)size*sizeof(doubleComplex)); + work=malloc((uint)(dpows(2,size))*sizeof(doubleComplex)); + rwork=malloc((uint)size*sizeof(doubleComplex)); + + for (i=0;i<size*size;i++) inCopy[i]=in[i]; + ztransposea(in,size,size,tmp); + + /* Check if in and transpose(in) are equals */ + for (i=0;i<size*size;i++){ + if ( (zreals(in[i])!=zreals(tmp[i])) || (zimags(in[i])!=zimags(tmp[i])) ) break; + } + if (i==size*size) egaux =1; + + for (i=0;i<size*size;i++) out1[i]=in[i]; + + if (egaux){ + /*Hermitian matrix*/ + + + C2F(zgees)("V","S", &mon_select, &size, out1, &size, &sdim, eigenvalues, out2, &size, work, &lwork, rwork, &bwork, &info); + + for (i=0;i<size;i++){ + for (j=0;j<size;j++){ + tmp[i*size+j]=DoubleComplex(0,0); + if (i==j) tmp[i*size+j]=zlogs(out2[i*size+j]); + } + } + + zmulma(out1,size,size,tmp,size,size,out2); + ztransposea(out1,size,size,tmp); + + } + else + { + /*General Matrix*/ + /* A faire + wbdiag (appel à bdiag dans le script mais le bdiag de scilab + appelle sci_bdiag qui lui appelle wbdiag car input complexe) + */ + wbdiag(out1,size,out2); + + for (i=0;i<size;i++){ + for (j=0;j<size;j++){ + tmp[i*size+j]=DoubleComplex(0,0); + if (i==j) tmp[i*size+j]=zlogs(out2[i*size+j]); + } + } + + zmulma(out1,size,size,tmp,size,size,out2); + zinverma(out1,tmp,size); + + } + + zmulma(out2,size,size,tmp,size,size,out); +} |