From 6142e72914eb2d0b94a0cf9fef554cd3a6760c3f Mon Sep 17 00:00:00 2001 From: jofret Date: Thu, 19 Jun 2008 14:45:46 +0000 Subject: Reorganize and separate operations --- src/matrixOperations/Makefile.am | 62 +- src/matrixOperations/Makefile.in | 562 ++++++------------- src/matrixOperations/addition/Makefile.am | 35 ++ src/matrixOperations/addition/Makefile.in | 603 ++++++++++++++++++++ src/matrixOperations/addition/matrixAddition.c | 93 +++ src/matrixOperations/addition/testMatrixAddition.c | 128 +++++ src/matrixOperations/division/Makefile.am | 36 ++ src/matrixOperations/division/Makefile.in | 604 ++++++++++++++++++++ src/matrixOperations/division/matrixDivision.c | 0 src/matrixOperations/includes/matrixAddition.h | 74 +++ src/matrixOperations/includes/matrixDivision.h | 0 .../includes/matrixMultiplication.h | 82 +++ src/matrixOperations/includes/matrixSubtraction.h | 74 +++ src/matrixOperations/matrixAddition.c | 93 --- src/matrixOperations/matrixAddition.h | 74 --- src/matrixOperations/matrixDivision.c | 0 src/matrixOperations/matrixDivision.h | 0 src/matrixOperations/matrixMultiplication.c | 221 -------- src/matrixOperations/matrixMultiplication.h | 82 --- src/matrixOperations/matrixSubtraction.c | 93 --- src/matrixOperations/matrixSubtraction.h | 74 --- src/matrixOperations/multiplication/Makefile.am | 37 ++ src/matrixOperations/multiplication/Makefile.in | 623 +++++++++++++++++++++ .../multiplication/matrixMultiplication.c | 221 ++++++++ .../testDoubleMatrixMultiplication.c | 211 +++++++ .../multiplication/testFloatMatrixMultiplication.c | 206 +++++++ src/matrixOperations/subtraction/Makefile.am | 35 ++ src/matrixOperations/subtraction/Makefile.in | 604 ++++++++++++++++++++ .../subtraction/matrixSubtraction.c | 93 +++ .../subtraction/testMatrixSubtraction.c | 128 +++++ .../testDoubleMatrixMultiplication.c | 211 ------- .../testFloatMatrixMultiplication.c | 206 ------- src/matrixOperations/testMatrixAddition.c | 128 ----- src/matrixOperations/testMatrixSubtraction.c | 128 ----- 34 files changed, 4056 insertions(+), 1765 deletions(-) create mode 100644 src/matrixOperations/addition/Makefile.am create mode 100644 src/matrixOperations/addition/Makefile.in create mode 100644 src/matrixOperations/addition/matrixAddition.c create mode 100644 src/matrixOperations/addition/testMatrixAddition.c create mode 100644 src/matrixOperations/division/Makefile.am create mode 100644 src/matrixOperations/division/Makefile.in create mode 100644 src/matrixOperations/division/matrixDivision.c create mode 100644 src/matrixOperations/includes/matrixAddition.h create mode 100644 src/matrixOperations/includes/matrixDivision.h create mode 100644 src/matrixOperations/includes/matrixMultiplication.h create mode 100644 src/matrixOperations/includes/matrixSubtraction.h delete mode 100644 src/matrixOperations/matrixAddition.c delete mode 100644 src/matrixOperations/matrixAddition.h delete mode 100644 src/matrixOperations/matrixDivision.c delete mode 100644 src/matrixOperations/matrixDivision.h delete mode 100644 src/matrixOperations/matrixMultiplication.c delete mode 100644 src/matrixOperations/matrixMultiplication.h delete mode 100644 src/matrixOperations/matrixSubtraction.c delete mode 100644 src/matrixOperations/matrixSubtraction.h create mode 100644 src/matrixOperations/multiplication/Makefile.am create mode 100644 src/matrixOperations/multiplication/Makefile.in create mode 100644 src/matrixOperations/multiplication/matrixMultiplication.c create mode 100644 src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c create mode 100644 src/matrixOperations/multiplication/testFloatMatrixMultiplication.c create mode 100644 src/matrixOperations/subtraction/Makefile.am create mode 100644 src/matrixOperations/subtraction/Makefile.in create mode 100644 src/matrixOperations/subtraction/matrixSubtraction.c create mode 100644 src/matrixOperations/subtraction/testMatrixSubtraction.c delete mode 100644 src/matrixOperations/testDoubleMatrixMultiplication.c delete mode 100644 src/matrixOperations/testFloatMatrixMultiplication.c delete mode 100644 src/matrixOperations/testMatrixAddition.c delete mode 100644 src/matrixOperations/testMatrixSubtraction.c (limited to 'src/matrixOperations') diff --git a/src/matrixOperations/Makefile.am b/src/matrixOperations/Makefile.am index 7a0efe1f..97760618 100644 --- a/src/matrixOperations/Makefile.am +++ b/src/matrixOperations/Makefile.am @@ -10,61 +10,7 @@ ## ## -libMatrixOperations_la_CFLAGS = -I $(top_builddir)/type \ - -I . - -instdir = $(top_builddir)/lib - -pkglib_LTLIBRARIES = libMatrixOperations.la - -libMatrixOperations_la_SOURCES = $(ADDITIONHEAD) $(ADDITIONSRC) \ - $(SUBTRACTIONHEAD) $(SUBTRACTIONSRC) \ - $(MULTIPLICATIONHEAD) $(MULTIPLICATIONSRC) #\ - #$(DIVISIONHEAD) $(DIVISIONSRC) - -check_PROGRAMS = testMatrixAddition \ - testMatrixSubtraction \ - testMatrixMultiplication #\ - #testMatrixDivision - -check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ - $(top_builddir)/type/libFloatComplex.la \ - $(top_builddir)/lib/blas/libsciblas.la \ - libMatrixOperations.la - -check_INCLUDES = -I $(top_builddir)/type \ - -I . - -testMatrixAddition_SOURCES = testMatrixAddition.c -testMatrixAddition_LDADD = $(check_LDADD) -testMatrixAddition_CFLAGS = $(check_INCLUDES) - -testMatrixSubtraction_SOURCES = testMatrixSubtraction.c -testMatrixSubtraction_LDADD = $(check_LDADD) -testMatrixSubtraction_CFLAGS = $(check_INCLUDES) - -testMatrixMultiplication_SOURCES = testFloatMatrixMultiplication.c testDoubleMatrixMultiplication.c -testMatrixMultiplication_LDADD = $(check_LDADD) -testMatrixMultiplication_CFLAGS = $(check_INCLUDES) - -#testMatrixDivision_SOURCES = testMatrixAddition.c -#testMatrixDivision_LDADD = libMatrixOperations.la - - -TESTS = testMatrixAddition \ - testMatrixSubtraction \ - testMatrixMultiplication #\ - #testMatrixDivision - - -ADDITIONHEAD = matrixAddition.h -ADDITIONSRC = matrixAddition.c - -SUBTRACTIONHEAD = matrixSubtraction.h -SUBTRACTIONSRC = matrixSubtraction.c - -MULTIPLICATIONHEAD = matrixMultiplication.h -MULTIPLICATIONSRC = matrixMultiplication.c - -#DIVISIONHEAD = matrixDivision.h -#DIVISIONSRC = matrixDivision.c +SUBDIRS= addition \ + subtraction \ + multiplication #\ + #division \ No newline at end of file diff --git a/src/matrixOperations/Makefile.in b/src/matrixOperations/Makefile.in index 911cdd4a..e4cc19ec 100644 --- a/src/matrixOperations/Makefile.in +++ b/src/matrixOperations/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -32,11 +31,6 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = testMatrixAddition$(EXEEXT) \ - testMatrixSubtraction$(EXEEXT) \ - testMatrixMultiplication$(EXEEXT) -TESTS = testMatrixAddition$(EXEEXT) testMatrixSubtraction$(EXEEXT) \ - testMatrixMultiplication$(EXEEXT) subdir = matrixOperations DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -46,75 +40,20 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 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) -libMatrixOperations_la_LIBADD = -am__objects_1 = -am__objects_2 = libMatrixOperations_la-matrixAddition.lo -am__objects_3 = libMatrixOperations_la-matrixSubtraction.lo -am__objects_4 = libMatrixOperations_la-matrixMultiplication.lo -am_libMatrixOperations_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ - $(am__objects_1) $(am__objects_3) $(am__objects_1) \ - $(am__objects_4) -libMatrixOperations_la_OBJECTS = $(am_libMatrixOperations_la_OBJECTS) -libMatrixOperations_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(libMatrixOperations_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -am_testMatrixAddition_OBJECTS = \ - testMatrixAddition-testMatrixAddition.$(OBJEXT) -testMatrixAddition_OBJECTS = $(am_testMatrixAddition_OBJECTS) -testMatrixAddition_DEPENDENCIES = $(check_LDADD) -testMatrixAddition_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(testMatrixAddition_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -am_testMatrixMultiplication_OBJECTS = testMatrixMultiplication-testFloatMatrixMultiplication.$(OBJEXT) \ - testMatrixMultiplication-testDoubleMatrixMultiplication.$(OBJEXT) -testMatrixMultiplication_OBJECTS = \ - $(am_testMatrixMultiplication_OBJECTS) -testMatrixMultiplication_DEPENDENCIES = $(check_LDADD) -testMatrixMultiplication_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(testMatrixMultiplication_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -am_testMatrixSubtraction_OBJECTS = \ - testMatrixSubtraction-testMatrixSubtraction.$(OBJEXT) -testMatrixSubtraction_OBJECTS = $(am_testMatrixSubtraction_OBJECTS) -testMatrixSubtraction_DEPENDENCIES = $(check_LDADD) -testMatrixSubtraction_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(testMatrixSubtraction_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 = $(libMatrixOperations_la_SOURCES) \ - $(testMatrixAddition_SOURCES) \ - $(testMatrixMultiplication_SOURCES) \ - $(testMatrixSubtraction_SOURCES) -DIST_SOURCES = $(libMatrixOperations_la_SOURCES) \ - $(testMatrixAddition_SOURCES) \ - $(testMatrixMultiplication_SOURCES) \ - $(testMatrixSubtraction_SOURCES) +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -226,43 +165,14 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -libMatrixOperations_la_CFLAGS = -I $(top_builddir)/type \ - -I . - -instdir = $(top_builddir)/lib -pkglib_LTLIBRARIES = libMatrixOperations.la -libMatrixOperations_la_SOURCES = $(ADDITIONHEAD) $(ADDITIONSRC) \ - $(SUBTRACTIONHEAD) $(SUBTRACTIONSRC) \ - $(MULTIPLICATIONHEAD) $(MULTIPLICATIONSRC) #\ - #$(DIVISIONHEAD) $(DIVISIONSRC) - -check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ - $(top_builddir)/type/libFloatComplex.la \ - $(top_builddir)/lib/blas/libsciblas.la \ - libMatrixOperations.la - -check_INCLUDES = -I $(top_builddir)/type \ - -I . - -testMatrixAddition_SOURCES = testMatrixAddition.c -testMatrixAddition_LDADD = $(check_LDADD) -testMatrixAddition_CFLAGS = $(check_INCLUDES) -testMatrixSubtraction_SOURCES = testMatrixSubtraction.c -testMatrixSubtraction_LDADD = $(check_LDADD) -testMatrixSubtraction_CFLAGS = $(check_INCLUDES) -testMatrixMultiplication_SOURCES = testFloatMatrixMultiplication.c testDoubleMatrixMultiplication.c -testMatrixMultiplication_LDADD = $(check_LDADD) -testMatrixMultiplication_CFLAGS = $(check_INCLUDES) -ADDITIONHEAD = matrixAddition.h -ADDITIONSRC = matrixAddition.c -SUBTRACTIONHEAD = matrixSubtraction.h -SUBTRACTIONSRC = matrixSubtraction.c -MULTIPLICATIONHEAD = matrixMultiplication.h -MULTIPLICATIONSRC = matrixMultiplication.c -all: all-am +SUBDIRS = addition \ + subtraction \ + multiplication #\ + #division + +all: all-recursive .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 \ @@ -292,163 +202,6 @@ $(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 -libMatrixOperations.la: $(libMatrixOperations_la_OBJECTS) $(libMatrixOperations_la_DEPENDENCIES) - $(libMatrixOperations_la_LINK) -rpath $(pkglibdir) $(libMatrixOperations_la_OBJECTS) $(libMatrixOperations_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 -testMatrixAddition$(EXEEXT): $(testMatrixAddition_OBJECTS) $(testMatrixAddition_DEPENDENCIES) - @rm -f testMatrixAddition$(EXEEXT) - $(testMatrixAddition_LINK) $(testMatrixAddition_OBJECTS) $(testMatrixAddition_LDADD) $(LIBS) -testMatrixMultiplication$(EXEEXT): $(testMatrixMultiplication_OBJECTS) $(testMatrixMultiplication_DEPENDENCIES) - @rm -f testMatrixMultiplication$(EXEEXT) - $(testMatrixMultiplication_LINK) $(testMatrixMultiplication_OBJECTS) $(testMatrixMultiplication_LDADD) $(LIBS) -testMatrixSubtraction$(EXEEXT): $(testMatrixSubtraction_OBJECTS) $(testMatrixSubtraction_DEPENDENCIES) - @rm -f testMatrixSubtraction$(EXEEXT) - $(testMatrixSubtraction_LINK) $(testMatrixSubtraction_OBJECTS) $(testMatrixSubtraction_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libMatrixOperations_la-matrixAddition.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libMatrixOperations_la-matrixMultiplication.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libMatrixOperations_la-matrixSubtraction.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixAddition-testMatrixAddition.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.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 $@ $< - -libMatrixOperations_la-matrixAddition.lo: matrixAddition.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libMatrixOperations_la_CFLAGS) $(CFLAGS) -MT libMatrixOperations_la-matrixAddition.lo -MD -MP -MF $(DEPDIR)/libMatrixOperations_la-matrixAddition.Tpo -c -o libMatrixOperations_la-matrixAddition.lo `test -f 'matrixAddition.c' || echo '$(srcdir)/'`matrixAddition.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libMatrixOperations_la-matrixAddition.Tpo $(DEPDIR)/libMatrixOperations_la-matrixAddition.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matrixAddition.c' object='libMatrixOperations_la-matrixAddition.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) $(libMatrixOperations_la_CFLAGS) $(CFLAGS) -c -o libMatrixOperations_la-matrixAddition.lo `test -f 'matrixAddition.c' || echo '$(srcdir)/'`matrixAddition.c - -libMatrixOperations_la-matrixSubtraction.lo: matrixSubtraction.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libMatrixOperations_la_CFLAGS) $(CFLAGS) -MT libMatrixOperations_la-matrixSubtraction.lo -MD -MP -MF $(DEPDIR)/libMatrixOperations_la-matrixSubtraction.Tpo -c -o libMatrixOperations_la-matrixSubtraction.lo `test -f 'matrixSubtraction.c' || echo '$(srcdir)/'`matrixSubtraction.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libMatrixOperations_la-matrixSubtraction.Tpo $(DEPDIR)/libMatrixOperations_la-matrixSubtraction.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matrixSubtraction.c' object='libMatrixOperations_la-matrixSubtraction.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) $(libMatrixOperations_la_CFLAGS) $(CFLAGS) -c -o libMatrixOperations_la-matrixSubtraction.lo `test -f 'matrixSubtraction.c' || echo '$(srcdir)/'`matrixSubtraction.c - -libMatrixOperations_la-matrixMultiplication.lo: matrixMultiplication.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libMatrixOperations_la_CFLAGS) $(CFLAGS) -MT libMatrixOperations_la-matrixMultiplication.lo -MD -MP -MF $(DEPDIR)/libMatrixOperations_la-matrixMultiplication.Tpo -c -o libMatrixOperations_la-matrixMultiplication.lo `test -f 'matrixMultiplication.c' || echo '$(srcdir)/'`matrixMultiplication.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libMatrixOperations_la-matrixMultiplication.Tpo $(DEPDIR)/libMatrixOperations_la-matrixMultiplication.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matrixMultiplication.c' object='libMatrixOperations_la-matrixMultiplication.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) $(libMatrixOperations_la_CFLAGS) $(CFLAGS) -c -o libMatrixOperations_la-matrixMultiplication.lo `test -f 'matrixMultiplication.c' || echo '$(srcdir)/'`matrixMultiplication.c - -testMatrixAddition-testMatrixAddition.o: testMatrixAddition.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixAddition_CFLAGS) $(CFLAGS) -MT testMatrixAddition-testMatrixAddition.o -MD -MP -MF $(DEPDIR)/testMatrixAddition-testMatrixAddition.Tpo -c -o testMatrixAddition-testMatrixAddition.o `test -f 'testMatrixAddition.c' || echo '$(srcdir)/'`testMatrixAddition.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixAddition-testMatrixAddition.Tpo $(DEPDIR)/testMatrixAddition-testMatrixAddition.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixAddition.c' object='testMatrixAddition-testMatrixAddition.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) $(testMatrixAddition_CFLAGS) $(CFLAGS) -c -o testMatrixAddition-testMatrixAddition.o `test -f 'testMatrixAddition.c' || echo '$(srcdir)/'`testMatrixAddition.c - -testMatrixAddition-testMatrixAddition.obj: testMatrixAddition.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixAddition_CFLAGS) $(CFLAGS) -MT testMatrixAddition-testMatrixAddition.obj -MD -MP -MF $(DEPDIR)/testMatrixAddition-testMatrixAddition.Tpo -c -o testMatrixAddition-testMatrixAddition.obj `if test -f 'testMatrixAddition.c'; then $(CYGPATH_W) 'testMatrixAddition.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixAddition.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixAddition-testMatrixAddition.Tpo $(DEPDIR)/testMatrixAddition-testMatrixAddition.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixAddition.c' object='testMatrixAddition-testMatrixAddition.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) $(testMatrixAddition_CFLAGS) $(CFLAGS) -c -o testMatrixAddition-testMatrixAddition.obj `if test -f 'testMatrixAddition.c'; then $(CYGPATH_W) 'testMatrixAddition.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixAddition.c'; fi` - -testMatrixMultiplication-testFloatMatrixMultiplication.o: testFloatMatrixMultiplication.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -MT testMatrixMultiplication-testFloatMatrixMultiplication.o -MD -MP -MF $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Tpo -c -o testMatrixMultiplication-testFloatMatrixMultiplication.o `test -f 'testFloatMatrixMultiplication.c' || echo '$(srcdir)/'`testFloatMatrixMultiplication.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Tpo $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatMatrixMultiplication.c' object='testMatrixMultiplication-testFloatMatrixMultiplication.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) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -c -o testMatrixMultiplication-testFloatMatrixMultiplication.o `test -f 'testFloatMatrixMultiplication.c' || echo '$(srcdir)/'`testFloatMatrixMultiplication.c - -testMatrixMultiplication-testFloatMatrixMultiplication.obj: testFloatMatrixMultiplication.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -MT testMatrixMultiplication-testFloatMatrixMultiplication.obj -MD -MP -MF $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Tpo -c -o testMatrixMultiplication-testFloatMatrixMultiplication.obj `if test -f 'testFloatMatrixMultiplication.c'; then $(CYGPATH_W) 'testFloatMatrixMultiplication.c'; else $(CYGPATH_W) '$(srcdir)/testFloatMatrixMultiplication.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Tpo $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatMatrixMultiplication.c' object='testMatrixMultiplication-testFloatMatrixMultiplication.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) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -c -o testMatrixMultiplication-testFloatMatrixMultiplication.obj `if test -f 'testFloatMatrixMultiplication.c'; then $(CYGPATH_W) 'testFloatMatrixMultiplication.c'; else $(CYGPATH_W) '$(srcdir)/testFloatMatrixMultiplication.c'; fi` - -testMatrixMultiplication-testDoubleMatrixMultiplication.o: testDoubleMatrixMultiplication.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -MT testMatrixMultiplication-testDoubleMatrixMultiplication.o -MD -MP -MF $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Tpo -c -o testMatrixMultiplication-testDoubleMatrixMultiplication.o `test -f 'testDoubleMatrixMultiplication.c' || echo '$(srcdir)/'`testDoubleMatrixMultiplication.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Tpo $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleMatrixMultiplication.c' object='testMatrixMultiplication-testDoubleMatrixMultiplication.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) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -c -o testMatrixMultiplication-testDoubleMatrixMultiplication.o `test -f 'testDoubleMatrixMultiplication.c' || echo '$(srcdir)/'`testDoubleMatrixMultiplication.c - -testMatrixMultiplication-testDoubleMatrixMultiplication.obj: testDoubleMatrixMultiplication.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -MT testMatrixMultiplication-testDoubleMatrixMultiplication.obj -MD -MP -MF $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Tpo -c -o testMatrixMultiplication-testDoubleMatrixMultiplication.obj `if test -f 'testDoubleMatrixMultiplication.c'; then $(CYGPATH_W) 'testDoubleMatrixMultiplication.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleMatrixMultiplication.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Tpo $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleMatrixMultiplication.c' object='testMatrixMultiplication-testDoubleMatrixMultiplication.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) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -c -o testMatrixMultiplication-testDoubleMatrixMultiplication.obj `if test -f 'testDoubleMatrixMultiplication.c'; then $(CYGPATH_W) 'testDoubleMatrixMultiplication.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleMatrixMultiplication.c'; fi` - -testMatrixSubtraction-testMatrixSubtraction.o: testMatrixSubtraction.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixSubtraction_CFLAGS) $(CFLAGS) -MT testMatrixSubtraction-testMatrixSubtraction.o -MD -MP -MF $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Tpo -c -o testMatrixSubtraction-testMatrixSubtraction.o `test -f 'testMatrixSubtraction.c' || echo '$(srcdir)/'`testMatrixSubtraction.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Tpo $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixSubtraction.c' object='testMatrixSubtraction-testMatrixSubtraction.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) $(testMatrixSubtraction_CFLAGS) $(CFLAGS) -c -o testMatrixSubtraction-testMatrixSubtraction.o `test -f 'testMatrixSubtraction.c' || echo '$(srcdir)/'`testMatrixSubtraction.c - -testMatrixSubtraction-testMatrixSubtraction.obj: testMatrixSubtraction.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixSubtraction_CFLAGS) $(CFLAGS) -MT testMatrixSubtraction-testMatrixSubtraction.obj -MD -MP -MF $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Tpo -c -o testMatrixSubtraction-testMatrixSubtraction.obj `if test -f 'testMatrixSubtraction.c'; then $(CYGPATH_W) 'testMatrixSubtraction.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixSubtraction.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Tpo $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixSubtraction.c' object='testMatrixSubtraction-testMatrixSubtraction.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) $(testMatrixSubtraction_CFLAGS) $(CFLAGS) -c -o testMatrixSubtraction-testMatrixSubtraction.obj `if test -f 'testMatrixSubtraction.c'; then $(CYGPATH_W) 'testMatrixSubtraction.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixSubtraction.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -456,6 +209,76 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -466,10 +289,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -482,7 +318,7 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$tags $$unique; \ fi ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -503,79 +339,6 @@ GTAGS: 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'`; \ @@ -602,24 +365,37 @@ distdir: $(DISTFILES) || 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"; \ + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-am +installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ @@ -635,85 +411,77 @@ distclean-generic: 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: clean-recursive -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am -distclean: distclean-am - -rm -rf ./$(DEPDIR) +distclean: distclean-recursive -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags +distclean-am: clean-am distclean-generic distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive -info: info-am +info: info-recursive info-am: install-data-am: -install-dvi: install-dvi-am +install-dvi: install-dvi-recursive -install-exec-am: install-pkglibLTLIBRARIES +install-exec-am: -install-html: install-html-am +install-html: install-html-recursive -install-info: install-info-am +install-info: install-info-recursive install-man: -install-pdf: install-pdf-am +install-pdf: install-pdf-recursive -install-ps: install-ps-am +install-ps: install-ps-recursive installcheck-am: -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) +maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool +mostlyclean-am: mostlyclean-generic mostlyclean-libtool -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive 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 - +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean 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-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am -#DIVISIONHEAD = matrixDivision.h -#DIVISIONSRC = matrixDivision.c # 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/addition/Makefile.am b/src/matrixOperations/addition/Makefile.am new file mode 100644 index 00000000..bc2b0db8 --- /dev/null +++ b/src/matrixOperations/addition/Makefile.am @@ -0,0 +1,35 @@ +## +## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET +## +## 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 +## +## + +libMatrixAddition_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib + +pkglib_LTLIBRARIES = libMatrixAddition.la + +libMatrixAddition_la_SOURCES = matrixAddition.c + +check_PROGRAMS = testMatrixAddition + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + libMatrixAddition.la + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +testMatrixAddition_SOURCES = testMatrixAddition.c +testMatrixAddition_LDADD = $(check_LDADD) +testMatrixAddition_CFLAGS = $(check_INCLUDES) + +TESTS = testMatrixAddition \ No newline at end of file diff --git a/src/matrixOperations/addition/Makefile.in b/src/matrixOperations/addition/Makefile.in new file mode 100644 index 00000000..a972524b --- /dev/null +++ b/src/matrixOperations/addition/Makefile.in @@ -0,0 +1,603 @@ +# 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 = testMatrixAddition$(EXEEXT) +TESTS = testMatrixAddition$(EXEEXT) +subdir = matrixOperations/addition +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) +libMatrixAddition_la_LIBADD = +am_libMatrixAddition_la_OBJECTS = \ + libMatrixAddition_la-matrixAddition.lo +libMatrixAddition_la_OBJECTS = $(am_libMatrixAddition_la_OBJECTS) +libMatrixAddition_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libMatrixAddition_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_testMatrixAddition_OBJECTS = \ + testMatrixAddition-testMatrixAddition.$(OBJEXT) +testMatrixAddition_OBJECTS = $(am_testMatrixAddition_OBJECTS) +testMatrixAddition_DEPENDENCIES = $(check_LDADD) +testMatrixAddition_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(testMatrixAddition_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 = $(libMatrixAddition_la_SOURCES) \ + $(testMatrixAddition_SOURCES) +DIST_SOURCES = $(libMatrixAddition_la_SOURCES) \ + $(testMatrixAddition_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@ +libMatrixAddition_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib +pkglib_LTLIBRARIES = libMatrixAddition.la +libMatrixAddition_la_SOURCES = matrixAddition.c +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + libMatrixAddition.la + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +testMatrixAddition_SOURCES = testMatrixAddition.c +testMatrixAddition_LDADD = $(check_LDADD) +testMatrixAddition_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/addition/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign matrixOperations/addition/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 +libMatrixAddition.la: $(libMatrixAddition_la_OBJECTS) $(libMatrixAddition_la_DEPENDENCIES) + $(libMatrixAddition_la_LINK) -rpath $(pkglibdir) $(libMatrixAddition_la_OBJECTS) $(libMatrixAddition_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 +testMatrixAddition$(EXEEXT): $(testMatrixAddition_OBJECTS) $(testMatrixAddition_DEPENDENCIES) + @rm -f testMatrixAddition$(EXEEXT) + $(testMatrixAddition_LINK) $(testMatrixAddition_OBJECTS) $(testMatrixAddition_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libMatrixAddition_la-matrixAddition.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixAddition-testMatrixAddition.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 $@ $< + +libMatrixAddition_la-matrixAddition.lo: matrixAddition.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libMatrixAddition_la_CFLAGS) $(CFLAGS) -MT libMatrixAddition_la-matrixAddition.lo -MD -MP -MF $(DEPDIR)/libMatrixAddition_la-matrixAddition.Tpo -c -o libMatrixAddition_la-matrixAddition.lo `test -f 'matrixAddition.c' || echo '$(srcdir)/'`matrixAddition.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libMatrixAddition_la-matrixAddition.Tpo $(DEPDIR)/libMatrixAddition_la-matrixAddition.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matrixAddition.c' object='libMatrixAddition_la-matrixAddition.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) $(libMatrixAddition_la_CFLAGS) $(CFLAGS) -c -o libMatrixAddition_la-matrixAddition.lo `test -f 'matrixAddition.c' || echo '$(srcdir)/'`matrixAddition.c + +testMatrixAddition-testMatrixAddition.o: testMatrixAddition.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixAddition_CFLAGS) $(CFLAGS) -MT testMatrixAddition-testMatrixAddition.o -MD -MP -MF $(DEPDIR)/testMatrixAddition-testMatrixAddition.Tpo -c -o testMatrixAddition-testMatrixAddition.o `test -f 'testMatrixAddition.c' || echo '$(srcdir)/'`testMatrixAddition.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixAddition-testMatrixAddition.Tpo $(DEPDIR)/testMatrixAddition-testMatrixAddition.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixAddition.c' object='testMatrixAddition-testMatrixAddition.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) $(testMatrixAddition_CFLAGS) $(CFLAGS) -c -o testMatrixAddition-testMatrixAddition.o `test -f 'testMatrixAddition.c' || echo '$(srcdir)/'`testMatrixAddition.c + +testMatrixAddition-testMatrixAddition.obj: testMatrixAddition.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixAddition_CFLAGS) $(CFLAGS) -MT testMatrixAddition-testMatrixAddition.obj -MD -MP -MF $(DEPDIR)/testMatrixAddition-testMatrixAddition.Tpo -c -o testMatrixAddition-testMatrixAddition.obj `if test -f 'testMatrixAddition.c'; then $(CYGPATH_W) 'testMatrixAddition.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixAddition.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixAddition-testMatrixAddition.Tpo $(DEPDIR)/testMatrixAddition-testMatrixAddition.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixAddition.c' object='testMatrixAddition-testMatrixAddition.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) $(testMatrixAddition_CFLAGS) $(CFLAGS) -c -o testMatrixAddition-testMatrixAddition.obj `if test -f 'testMatrixAddition.c'; then $(CYGPATH_W) 'testMatrixAddition.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixAddition.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/addition/matrixAddition.c b/src/matrixOperations/addition/matrixAddition.c new file mode 100644 index 00000000..f725424a --- /dev/null +++ b/src/matrixOperations/addition/matrixAddition.c @@ -0,0 +1,93 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "matrixAddition.h" + +/* +** \brief Compute an addition element ways for floats. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +void saddma(float *in1, int size1, + float *in2, int size2, + float *out) +{ + int i = 0; + + for(i = 0 ; i < size1 && i < size2 ; ++i) + { + out[i] = in1[i] + in2[i]; + } +} + +/* +** \brief Compute an addition element ways for double. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +void daddma(double *in1, int size1, + double *in2, int size2, + double * out) +{ + int i = 0; + + for(i = 0 ; i < size1 && i < size2 ; ++i) + { + out[i] = in1[i] + in2[i]; + } +} + +/* +** \brief Compute an addition element ways for complex single precision. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +void caddma(floatComplex *in1, int size1, + floatComplex *in2, int size2, + floatComplex *out) +{ + int i = 0; + + for(i = 0 ; i < size1 && i < size2 ; ++i) + { + out[i] = cadds(in1[i], in2[i]); + } +} + +/* +** \brief Compute an addition element ways for complex double precision. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +void zaddma(doubleComplex *in1, int size1, + doubleComplex *in2, int size2, + doubleComplex *out) +{ + int i = 0; + + for(i = 0 ; i < size1 && i < size2 ; ++i) + { + out[i] = zadds(in1[i], in2[i]); + } +} diff --git a/src/matrixOperations/addition/testMatrixAddition.c b/src/matrixOperations/addition/testMatrixAddition.c new file mode 100644 index 00000000..ceb922b9 --- /dev/null +++ b/src/matrixOperations/addition/testMatrixAddition.c @@ -0,0 +1,128 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 +#include +#include +#include +#include "matrixAddition.h" + +#define SIZE 10000 + +/* #define LOCAL_DEBUG */ + +static void zaddmaTest(void) { + doubleComplex M1[SIZE]; + doubleComplex M2[SIZE]; + doubleComplex M1_and_M2[SIZE]; + + int i = 0; + + srand(1); + for (i = 0; i < SIZE; ++i) { + M1[i] = DoubleComplex((double) rand(), (double) rand()); + M2[i] = DoubleComplex((double) rand(), (double) rand()); + } + zaddma(M1, SIZE, M2, SIZE, M1_and_M2); + for (i = 0; i < SIZE; ++i) { +#ifdef LOCAL_DEBUG + printf("M1_and_M2 = %e + %e i\n", zreals(M1_and_M2[i]), zimags(M1_and_M2[i])); +#endif + assert(zreals(M1_and_M2[i]) - (zreals(M1[i]) + zreals(M2[i])) == 0); + assert(zimags(M1_and_M2[i]) - (zimags(M1[i]) + zimags(M2[i])) == 0); + } +} + +static void caddmaTest(void) { + floatComplex M1[SIZE]; + floatComplex M2[SIZE]; + floatComplex M1_and_M2[SIZE]; + + int i = 0; + + srand(1); + for (i = 0; i < SIZE; ++i) { + M1[i] = FloatComplex((float) rand(), (float) rand()); + M2[i] = FloatComplex((float) rand(), (float) rand()); + } + caddma(M1, SIZE, M2, SIZE, M1_and_M2); + for (i = 0; i < SIZE; ++i) { +#ifdef LOCAL_DEBUG + printf("M1_and_M2 = %e + %e i\n", creals(M1_and_M2[i]), cimags(M1_and_M2[i])); +#endif + assert(fabsf(creals(M1_and_M2[i]) - (creals(M1[i]) + creals(M2[i]))) / creals(M1_and_M2[i]) < 1e-07); + assert(fabsf(cimags(M1_and_M2[i]) - (cimags(M1[i]) + cimags(M2[i]))) / cimags(M1_and_M2[i]) < 1e-07); + } +} + +static void saddmaTest(void) { + float M1[SIZE]; + float M2[SIZE]; + float M1_and_M2[SIZE]; + + int i = 0; + + srand(1); + for (i = 0; i < SIZE; ++i) { + M1[i] = (float) rand(); + M2[i] = (float) rand(); + } + saddma(M1, SIZE, M2, SIZE, M1_and_M2); + for (i = 0; i < SIZE; ++i) { +#ifdef LOCAL_DEBUG + printf("M1_and_M2 = %e\n", M1_and_M2[i]); + printf("M1[i] + M2[i] = %e\n", (M1[i] + M2[i])); + printf("Error = %e\n",(float) fabsf(M1_and_M2[i] - (M1[i] + M2[i])) / M1_and_M2[i]); +#endif + assert(fabsf(M1_and_M2[i] - (M1[i] + M2[i])) / M1_and_M2[i] < 1e-07); + } +} + +static void daddmaTest(void) { + double M1[SIZE]; + double M2[SIZE]; + double M1_and_M2[SIZE]; + + int i = 0; + + srand(1); + for (i = 0; i < SIZE; ++i) { + M1[i] = (double) rand(); + M2[i] = (double) rand(); + } + daddma(M1, SIZE, M2, SIZE, M1_and_M2); + for (i = 0; i < SIZE; ++i) { +#ifdef LOCAL_DEBUG + printf("M1_and_M2 = %e\n", M1_and_M2[i]); +#endif + assert(fabs(M1_and_M2[i] - (M1[i] + M2[i])) == 0); + } + +} + +static int testAddition(void) { + + printf("\n>>>> Matrix Addition Tests\n"); + saddmaTest(); + daddmaTest(); + caddmaTest(); + zaddmaTest(); + + return 0; +} + + + +int main(void) { + assert(testAddition() == 0); + return 0; +} diff --git a/src/matrixOperations/division/Makefile.am b/src/matrixOperations/division/Makefile.am new file mode 100644 index 00000000..fc5c728b --- /dev/null +++ b/src/matrixOperations/division/Makefile.am @@ -0,0 +1,36 @@ +## +## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET +## +## 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 +## +## + +libMatrixDivision_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib + +pkglib_LTLIBRARIES = libMatrixDivision.la + +libMatrixDivision_la_SOURCES = matrixDivision.c + +check_PROGRAMS = testMatrixDivision + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + libMatrixDivision.la + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +testMatrixDivision_SOURCES = testMatrixDivision.c +testMatrixDivision_LDADD = $(check_LDADD) +testMatrixDivision_CFLAGS = $(check_INCLUDES) + +TESTS = testMatrixDivision \ No newline at end of file diff --git a/src/matrixOperations/division/Makefile.in b/src/matrixOperations/division/Makefile.in new file mode 100644 index 00000000..758d8ec0 --- /dev/null +++ b/src/matrixOperations/division/Makefile.in @@ -0,0 +1,604 @@ +# 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 = testMatrixDivision$(EXEEXT) +TESTS = testMatrixDivision$(EXEEXT) +subdir = matrixOperations/division +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) +libMatrixDivision_la_LIBADD = +am_libMatrixDivision_la_OBJECTS = \ + libMatrixDivision_la-matrixDivision.lo +libMatrixDivision_la_OBJECTS = $(am_libMatrixDivision_la_OBJECTS) +libMatrixDivision_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libMatrixDivision_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_testMatrixDivision_OBJECTS = \ + testMatrixDivision-testMatrixDivision.$(OBJEXT) +testMatrixDivision_OBJECTS = $(am_testMatrixDivision_OBJECTS) +testMatrixDivision_DEPENDENCIES = $(check_LDADD) +testMatrixDivision_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(testMatrixDivision_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 = $(libMatrixDivision_la_SOURCES) \ + $(testMatrixDivision_SOURCES) +DIST_SOURCES = $(libMatrixDivision_la_SOURCES) \ + $(testMatrixDivision_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@ +libMatrixDivision_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib +pkglib_LTLIBRARIES = libMatrixDivision.la +libMatrixDivision_la_SOURCES = matrixDivision.c +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + libMatrixDivision.la + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +testMatrixDivision_SOURCES = testMatrixDivision.c +testMatrixDivision_LDADD = $(check_LDADD) +testMatrixDivision_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/division/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign matrixOperations/division/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 +libMatrixDivision.la: $(libMatrixDivision_la_OBJECTS) $(libMatrixDivision_la_DEPENDENCIES) + $(libMatrixDivision_la_LINK) -rpath $(pkglibdir) $(libMatrixDivision_la_OBJECTS) $(libMatrixDivision_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 +testMatrixDivision$(EXEEXT): $(testMatrixDivision_OBJECTS) $(testMatrixDivision_DEPENDENCIES) + @rm -f testMatrixDivision$(EXEEXT) + $(testMatrixDivision_LINK) $(testMatrixDivision_OBJECTS) $(testMatrixDivision_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libMatrixDivision_la-matrixDivision.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixDivision-testMatrixDivision.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 $@ $< + +libMatrixDivision_la-matrixDivision.lo: matrixDivision.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libMatrixDivision_la_CFLAGS) $(CFLAGS) -MT libMatrixDivision_la-matrixDivision.lo -MD -MP -MF $(DEPDIR)/libMatrixDivision_la-matrixDivision.Tpo -c -o libMatrixDivision_la-matrixDivision.lo `test -f 'matrixDivision.c' || echo '$(srcdir)/'`matrixDivision.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libMatrixDivision_la-matrixDivision.Tpo $(DEPDIR)/libMatrixDivision_la-matrixDivision.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matrixDivision.c' object='libMatrixDivision_la-matrixDivision.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) $(libMatrixDivision_la_CFLAGS) $(CFLAGS) -c -o libMatrixDivision_la-matrixDivision.lo `test -f 'matrixDivision.c' || echo '$(srcdir)/'`matrixDivision.c + +testMatrixDivision-testMatrixDivision.o: testMatrixDivision.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixDivision_CFLAGS) $(CFLAGS) -MT testMatrixDivision-testMatrixDivision.o -MD -MP -MF $(DEPDIR)/testMatrixDivision-testMatrixDivision.Tpo -c -o testMatrixDivision-testMatrixDivision.o `test -f 'testMatrixDivision.c' || echo '$(srcdir)/'`testMatrixDivision.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixDivision-testMatrixDivision.Tpo $(DEPDIR)/testMatrixDivision-testMatrixDivision.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixDivision.c' object='testMatrixDivision-testMatrixDivision.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) $(testMatrixDivision_CFLAGS) $(CFLAGS) -c -o testMatrixDivision-testMatrixDivision.o `test -f 'testMatrixDivision.c' || echo '$(srcdir)/'`testMatrixDivision.c + +testMatrixDivision-testMatrixDivision.obj: testMatrixDivision.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixDivision_CFLAGS) $(CFLAGS) -MT testMatrixDivision-testMatrixDivision.obj -MD -MP -MF $(DEPDIR)/testMatrixDivision-testMatrixDivision.Tpo -c -o testMatrixDivision-testMatrixDivision.obj `if test -f 'testMatrixDivision.c'; then $(CYGPATH_W) 'testMatrixDivision.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixDivision.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixDivision-testMatrixDivision.Tpo $(DEPDIR)/testMatrixDivision-testMatrixDivision.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixDivision.c' object='testMatrixDivision-testMatrixDivision.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) $(testMatrixDivision_CFLAGS) $(CFLAGS) -c -o testMatrixDivision-testMatrixDivision.obj `if test -f 'testMatrixDivision.c'; then $(CYGPATH_W) 'testMatrixDivision.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixDivision.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/division/matrixDivision.c b/src/matrixOperations/division/matrixDivision.c new file mode 100644 index 00000000..e69de29b diff --git a/src/matrixOperations/includes/matrixAddition.h b/src/matrixOperations/includes/matrixAddition.h new file mode 100644 index 00000000..2299c53e --- /dev/null +++ b/src/matrixOperations/includes/matrixAddition.h @@ -0,0 +1,74 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * 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 __MATRICXADDITION_H__ +#define __MATRICXADDITION_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +/* +** +** WARNING WE ASSUME MATRIXES TO BE CONSCISTENT +** size1 = size2; +** +*/ + + +/* +** \brief Compute an addition element ways for floats. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +void saddma(float *in1, int size1, + float *in2, int size2, + float *out); +/* +** \brief Compute an addition element ways for double. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +void daddma(double *in1, int size1, + double *in2, int size2, + double * out); + +/* +** \brief Compute an addition element ways for complex single precision. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +void caddma(floatComplex *in1, int size1, + floatComplex *in2, int size2, + floatComplex *out); + +/* +** \brief Compute an addition element ways for complex double precision. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +void zaddma(doubleComplex *in1, int size1, + doubleComplex *in2, int size2, + doubleComplex *out); + +#endif /* !__MATRICXADDITION_H__ */ diff --git a/src/matrixOperations/includes/matrixDivision.h b/src/matrixOperations/includes/matrixDivision.h new file mode 100644 index 00000000..e69de29b diff --git a/src/matrixOperations/includes/matrixMultiplication.h b/src/matrixOperations/includes/matrixMultiplication.h new file mode 100644 index 00000000..413f8d96 --- /dev/null +++ b/src/matrixOperations/includes/matrixMultiplication.h @@ -0,0 +1,82 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 __MATRIXMULTIPLICATION_H__ +#define __MATRIXMULTIPLICATION_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +/* +** +** WARNING WE ASSUME MATRIXES TO BE CONSCISTENT +** columns1 = lines2; +** +*/ + +/* +** \brief Compute a multiplication for floats matrixes. +** \param in1 : input matrix. +** \param lines1 : lines of in1 matrix. +** \param columns1 : columns of in1 matrix. +** \param in2 : input arry. +** \param lines2 : lines of in2 matrix. +** \param columns2 : columns of in2 matrix. +** \param out : Matrix that contains the multiplication in1 * in2. +*/ +void smulma(float *in1, int lines1, int columns1, + float *in2, int lines2, int columns2, + float *out); + +/* +** \brief Compute a multiplication for doubles matrixes. +** \param in1 : input matrix. +** \param lines1 : lines of in1 matrix. +** \param columns1 : columns of in1 matrix. +** \param in2 : input arry. +** \param lines2 : lines of in2 matrix. +** \param columns2 : columns of in2 matrix. +** \param out : Matrix that contains the multiplication in1 * in2. +*/ +void dmulma(double *in1, int lines1, int columns1, + double *in2, int lines2, int columns2, + double *out); + +/* +** \brief Compute a multiplication for floats complex matrixes. +** \param in1 : input matrix. +** \param lines1 : lines of in1 matrix. +** \param columns1 : columns of in1 matrix. +** \param in2 : input arry. +** \param lines2 : lines of in2 matrix. +** \param columns2 : columns of in2 matrix. +** \param out : Matrix that contains the multiplication in1 * in2. +*/ +void cmulma(floatComplex *in1, int lines1, int columns1, + floatComplex *in2, int lines2, int columns2, + floatComplex *out); + +/* +** \brief Compute a multiplication for doubles matrixes. +** \param in1 : input matrix. +** \param lines1 : lines of in1 matrix. +** \param columns1 : columns of in1 matrix. +** \param in2 : input arry. +** \param lines2 : lines of in2 matrix. +** \param columns2 : columns of in2 matrix. +** \param out : Matrix that contains the multiplication in1 * in2. +*/ +void zmulma(doubleComplex *in1, int lines1, int columns1, + doubleComplex *in2, int lines2, int columns2, + doubleComplex *out); + +#endif /* !__MATRIXMULTIPLICATION_H__ */ diff --git a/src/matrixOperations/includes/matrixSubtraction.h b/src/matrixOperations/includes/matrixSubtraction.h new file mode 100644 index 00000000..4823d532 --- /dev/null +++ b/src/matrixOperations/includes/matrixSubtraction.h @@ -0,0 +1,74 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * 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 __MATRIXSUBSTRACTION_H__ +#define __MATRIXSUBSTRACTION_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +/* +** +** WARNING WE ASSUME MATRIXES TO BE CONSCISTENT +** size1 = size2; +** +*/ + + +/* +** \brief Compute an substraction element ways for floats. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains in1 - in2. +*/ +void sdiffma(float *in1, int size1, + float *in2, int size2, + float *out); +/* +** \brief Compute an substraction element ways for double. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains in1 - in2. +*/ +void ddiffma(double *in1, int size1, + double *in2, int size2, + double * out); + +/* +** \brief Compute an substraction element ways for complex single precision. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains in1 - in2. +*/ +void cdiffma(floatComplex *in1, int size1, + floatComplex *in2, int size2, + floatComplex *out); + +/* +** \brief Compute an substraction element ways for complex double precision. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains in1 - in2. +*/ +void zdiffma(doubleComplex *in1, int size1, + doubleComplex *in2, int size2, + doubleComplex *out); + +#endif /* !__MATRIXSUBSTRACTION_H__ */ diff --git a/src/matrixOperations/matrixAddition.c b/src/matrixOperations/matrixAddition.c deleted file mode 100644 index f725424a..00000000 --- a/src/matrixOperations/matrixAddition.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 "matrixAddition.h" - -/* -** \brief Compute an addition element ways for floats. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains the addition in1 + in2. -*/ -void saddma(float *in1, int size1, - float *in2, int size2, - float *out) -{ - int i = 0; - - for(i = 0 ; i < size1 && i < size2 ; ++i) - { - out[i] = in1[i] + in2[i]; - } -} - -/* -** \brief Compute an addition element ways for double. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains the addition in1 + in2. -*/ -void daddma(double *in1, int size1, - double *in2, int size2, - double * out) -{ - int i = 0; - - for(i = 0 ; i < size1 && i < size2 ; ++i) - { - out[i] = in1[i] + in2[i]; - } -} - -/* -** \brief Compute an addition element ways for complex single precision. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains the addition in1 + in2. -*/ -void caddma(floatComplex *in1, int size1, - floatComplex *in2, int size2, - floatComplex *out) -{ - int i = 0; - - for(i = 0 ; i < size1 && i < size2 ; ++i) - { - out[i] = cadds(in1[i], in2[i]); - } -} - -/* -** \brief Compute an addition element ways for complex double precision. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains the addition in1 + in2. -*/ -void zaddma(doubleComplex *in1, int size1, - doubleComplex *in2, int size2, - doubleComplex *out) -{ - int i = 0; - - for(i = 0 ; i < size1 && i < size2 ; ++i) - { - out[i] = zadds(in1[i], in2[i]); - } -} diff --git a/src/matrixOperations/matrixAddition.h b/src/matrixOperations/matrixAddition.h deleted file mode 100644 index 2299c53e..00000000 --- a/src/matrixOperations/matrixAddition.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET - * - * 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 __MATRICXADDITION_H__ -#define __MATRICXADDITION_H__ - -#include "floatComplex.h" -#include "doubleComplex.h" - -/* -** -** WARNING WE ASSUME MATRIXES TO BE CONSCISTENT -** size1 = size2; -** -*/ - - -/* -** \brief Compute an addition element ways for floats. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains the addition in1 + in2. -*/ -void saddma(float *in1, int size1, - float *in2, int size2, - float *out); -/* -** \brief Compute an addition element ways for double. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains the addition in1 + in2. -*/ -void daddma(double *in1, int size1, - double *in2, int size2, - double * out); - -/* -** \brief Compute an addition element ways for complex single precision. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains the addition in1 + in2. -*/ -void caddma(floatComplex *in1, int size1, - floatComplex *in2, int size2, - floatComplex *out); - -/* -** \brief Compute an addition element ways for complex double precision. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains the addition in1 + in2. -*/ -void zaddma(doubleComplex *in1, int size1, - doubleComplex *in2, int size2, - doubleComplex *out); - -#endif /* !__MATRICXADDITION_H__ */ diff --git a/src/matrixOperations/matrixDivision.c b/src/matrixOperations/matrixDivision.c deleted file mode 100644 index e69de29b..00000000 diff --git a/src/matrixOperations/matrixDivision.h b/src/matrixOperations/matrixDivision.h deleted file mode 100644 index e69de29b..00000000 diff --git a/src/matrixOperations/matrixMultiplication.c b/src/matrixOperations/matrixMultiplication.c deleted file mode 100644 index dbed4330..00000000 --- a/src/matrixOperations/matrixMultiplication.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 WITHOUT_BLAS -#include "blas.h" -#endif -#include "matrixMultiplication.h" - -/* -** \brief Compute a multiplication for floats matrixes. -** \param in1 : input matrix. -** \param lines1 : lines of in1 matrix. -** \param columns1 : columns of in1 matrix. -** \param in2 : input arry. -** \param lines2 : lines of in2 matrix. -** \param columns2 : columns of in2 matrix. -** \param out : Matrix that contains the multiplication in1 * in2. -*/ -void smulma(float *in1, int lines1, int columns1, - float *in2, int lines2, int columns2, - float *out) -{ - int i = 0; - int k = 0; - float accu = 0; - - /* - ** How to convert 2 index matrixes to one. - ** #define in1(a, b) in1[a+b*lines1] - ** #define in2(c, d) in2[c+d*lines2] - */ - - for (i = 0 ; i < lines1 * columns2 ; ++i) - { - accu = 0; - for (k = 0; k < columns1 ; ++k) - { - accu += in1[i % lines1 + k * lines1] - * in2[k + (i / lines1) * lines2]; - } - out[i] = accu; - } - -} - -/* -** \brief Compute a multiplication for doubles matrixes. -** \param in1 : input matrix. -** \param lines1 : lines of in1 matrix. -** \param columns1 : columns of in1 matrix. -** \param in2 : input arry. -** \param lines2 : lines of in2 matrix. -** \param columns2 : columns of in2 matrix. -** \param out : Matrix that contains the multiplication in1 * in2. -*/ -void dmulma(double *in1, int lines1, int columns1, - double *in2, int lines2, int columns2, - double *out) -{ -#ifndef WITHOUT_BLAS - /* - ** USES BLAS DGEMM FUNCTION. - */ - double One = 1; - double Zero = 0; - - /* Cr <- 1*Ar*Br + 0*Cr */ - dgemm_("N","N", &columns2, &columns2, &columns1, &One, - in1 , &lines1, in2, &lines2, &Zero, out, &columns2); -#else - /* - ** DO NOT USE ANY BLAS FUNCTION. - */ - int i = 0; - int k = 0; - double accu = 0; - - /* - ** How to convert 2 index matrixes to one. - ** #define in1(a, b) in1[a+b*lines1] - ** #define in2(c, d) in2[c+d*lines2] - */ - - for (i = 0 ; i < lines1 * columns2 ; ++i) - { - accu = 0; - for (k = 0; k < columns1 ; ++k) - { - accu += in1[i % lines1 + k * lines1] - * in2[k + (i / lines1) * lines2]; - } - out[i] = accu; - } -#endif -} - -/* -** \brief Compute a multiplication for floats complex matrixes. -** \param in1 : input matrix. -** \param lines1 : lines of in1 matrix. -** \param columns1 : columns of in1 matrix. -** \param in2 : input arry. -** \param lines2 : lines of in2 matrix. -** \param columns2 : columns of in2 matrix. -** \param out : Matrix that contains the multiplication in1 * in2. -*/ -void cmulma(floatComplex *in1, int lines1, int columns1, - floatComplex *in2, int lines2, int columns2, - floatComplex *out) -{ - int i = 0; - int k = 0; - floatComplex accu = FloatComplex(0, 0); - - for (i = 0 ; i < lines1 * columns2 ; ++i) - { - accu = FloatComplex(0,0); - for (k = 0; k < columns1 ; ++k) - { - accu = cadds(accu, - ctimess(in1[i % lines1 + k *lines1] , - in2[k + (i / lines1) *lines2] )); - } - out[i] = accu; - } -} - -/* -** \brief Compute a multiplication for doubles matrixes. -** \param in1 : input matrix. -** \param lines1 : lines of in1 matrix. -** \param columns1 : columns of in1 matrix. -** \param in2 : input arry. -** \param lines2 : lines of in2 matrix. -** \param columns2 : columns of in2 matrix. -** \param out : Matrix that contains the multiplication in1 * in2. -*/ -void zmulma(doubleComplex *in1, int lines1, int columns1, - doubleComplex *in2, int lines2, int columns2, - doubleComplex *out) -{ -#ifndef WITHOUT_BLAS - /* - ** USES BLAS DGEMM FUNCTION. - */ - int i = 0; - double One = 1; - double MinusOne = -1; - double Zero = 0; - - double *in1Real = malloc((uint) lines1 * (uint) columns1 * sizeof(double)); - double *in1Imag = malloc((uint) lines1 * (uint) columns1 * sizeof(double)); - double *in2Real = malloc((uint) lines2 * (uint) columns2 * sizeof(double)); - double *in2Imag = malloc((uint) lines2 * (uint) columns2 * sizeof(double)); - - double *RealOut = malloc((uint) lines1 * (uint) columns2 * sizeof(double)); - double *ImagOut = malloc((uint) lines1 * (uint) columns2 * sizeof(double)); - - zreala(in1, lines1 * columns1, in1Real); - zreala(in2, lines2 * columns2, in2Real); - zimaga(in1, lines1 * columns1, in1Imag); - zimaga(in2, lines2 * columns2, in2Imag); - - /* Cr <- 1*Ar*Br + 0*Cr */ - dgemm_("N","N", &lines1, &columns2, &columns1, &One, - in1Real, &lines1, in2Real, &lines2, &Zero, RealOut, &lines1); - - /* Cr <- -1*Ai*Bi + 1*Cr */ - dgemm_("N","N", &lines1, &columns2, &columns1, &MinusOne, - in1Imag, &lines1, in2Imag, &lines2, &One, RealOut, &lines1); - - /* Ci <- 1*Ar*Bi + 0*Ci */ - dgemm_("N","N", &lines1, &columns2, &columns1, &One, - in1Real, &lines1, in2Imag, &lines2, &Zero, ImagOut, &lines1); - - /* Ci <- 1*Ai*Br + 1*Ci */ - dgemm_("N","N", &lines1, &columns2, &columns1, &One, - in1Imag, &lines1, in2Real, &lines2, &One, ImagOut, &lines1); - - /* Now fill output matrix */ - for(i = 0 ; i < lines1 * columns2 ; ++i) - { - out[i] = DoubleComplex(RealOut[i], ImagOut[i]); - } - /* FREE allocated variables */ - free(in1Real); - free(in2Real); - free(in1Imag); - free(in2Imag); - free(RealOut); - free(ImagOut); -#else - /* - ** DO NOT USE ANY BLAS FUNCTION. - */ - int i = 0; - int k = 0; - doubleComplex accu = DoubleComplex(0, 0); - - for (i = 0 ; i < lines1 * columns2 ; ++i) - { - accu = DoubleComplex(0,0); - for (k = 0; k < columns1 ; ++k) - { - accu = zadds(accu, - ztimess(in1[i % lines1 + k *lines1] , - in2[k + (i / lines1) *lines2] )); - } - out[i] = accu; - } -#endif -} diff --git a/src/matrixOperations/matrixMultiplication.h b/src/matrixOperations/matrixMultiplication.h deleted file mode 100644 index 413f8d96..00000000 --- a/src/matrixOperations/matrixMultiplication.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 __MATRIXMULTIPLICATION_H__ -#define __MATRIXMULTIPLICATION_H__ - -#include "floatComplex.h" -#include "doubleComplex.h" - -/* -** -** WARNING WE ASSUME MATRIXES TO BE CONSCISTENT -** columns1 = lines2; -** -*/ - -/* -** \brief Compute a multiplication for floats matrixes. -** \param in1 : input matrix. -** \param lines1 : lines of in1 matrix. -** \param columns1 : columns of in1 matrix. -** \param in2 : input arry. -** \param lines2 : lines of in2 matrix. -** \param columns2 : columns of in2 matrix. -** \param out : Matrix that contains the multiplication in1 * in2. -*/ -void smulma(float *in1, int lines1, int columns1, - float *in2, int lines2, int columns2, - float *out); - -/* -** \brief Compute a multiplication for doubles matrixes. -** \param in1 : input matrix. -** \param lines1 : lines of in1 matrix. -** \param columns1 : columns of in1 matrix. -** \param in2 : input arry. -** \param lines2 : lines of in2 matrix. -** \param columns2 : columns of in2 matrix. -** \param out : Matrix that contains the multiplication in1 * in2. -*/ -void dmulma(double *in1, int lines1, int columns1, - double *in2, int lines2, int columns2, - double *out); - -/* -** \brief Compute a multiplication for floats complex matrixes. -** \param in1 : input matrix. -** \param lines1 : lines of in1 matrix. -** \param columns1 : columns of in1 matrix. -** \param in2 : input arry. -** \param lines2 : lines of in2 matrix. -** \param columns2 : columns of in2 matrix. -** \param out : Matrix that contains the multiplication in1 * in2. -*/ -void cmulma(floatComplex *in1, int lines1, int columns1, - floatComplex *in2, int lines2, int columns2, - floatComplex *out); - -/* -** \brief Compute a multiplication for doubles matrixes. -** \param in1 : input matrix. -** \param lines1 : lines of in1 matrix. -** \param columns1 : columns of in1 matrix. -** \param in2 : input arry. -** \param lines2 : lines of in2 matrix. -** \param columns2 : columns of in2 matrix. -** \param out : Matrix that contains the multiplication in1 * in2. -*/ -void zmulma(doubleComplex *in1, int lines1, int columns1, - doubleComplex *in2, int lines2, int columns2, - doubleComplex *out); - -#endif /* !__MATRIXMULTIPLICATION_H__ */ diff --git a/src/matrixOperations/matrixSubtraction.c b/src/matrixOperations/matrixSubtraction.c deleted file mode 100644 index ffd30d7a..00000000 --- a/src/matrixOperations/matrixSubtraction.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 "matrixSubtraction.h" - -/* -** \brief Compute an substraction element ways for floats. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains in1 - in2. -*/ -void sdiffma(float *in1, int size1, - float *in2, int size2, - float *out) -{ - int i = 0; - - for(i = 0 ; i < size1 && i < size2 ; ++i) - { - out[i] = in1[i] - in2[i]; - } -} - -/* -** \brief Compute an substraction element ways for double. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains in1 - in2. -*/ -void ddiffma(double *in1, int size1, - double *in2, int size2, - double * out) -{ - int i = 0; - - for(i = 0 ; i < size1 && i < size2 ; ++i) - { - out[i] = in1[i] - in2[i]; - } -} - -/* -** \brief Compute an substraction element ways for complex single precision. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains in1 - in2. -*/ -void cdiffma(floatComplex *in1, int size1, - floatComplex *in2, int size2, - floatComplex *out) -{ - int i = 0; - - for(i = 0 ; i < size1 && i < size2 ; ++i) - { - out[i] = cdiffs(in1[i], in2[i]); - } -} - -/* -** \brief Compute an substraction element ways for complex double precision. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains in1 - in2. -*/ -void zdiffma(doubleComplex *in1, int size1, - doubleComplex *in2, int size2, - doubleComplex *out) -{ - int i = 0; - - for(i = 0 ; i < size1 && i < size2 ; ++i) - { - out[i] = zdiffs(in1[i], in2[i]); - } -} diff --git a/src/matrixOperations/matrixSubtraction.h b/src/matrixOperations/matrixSubtraction.h deleted file mode 100644 index 4823d532..00000000 --- a/src/matrixOperations/matrixSubtraction.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET - * - * 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 __MATRIXSUBSTRACTION_H__ -#define __MATRIXSUBSTRACTION_H__ - -#include "floatComplex.h" -#include "doubleComplex.h" - -/* -** -** WARNING WE ASSUME MATRIXES TO BE CONSCISTENT -** size1 = size2; -** -*/ - - -/* -** \brief Compute an substraction element ways for floats. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains in1 - in2. -*/ -void sdiffma(float *in1, int size1, - float *in2, int size2, - float *out); -/* -** \brief Compute an substraction element ways for double. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains in1 - in2. -*/ -void ddiffma(double *in1, int size1, - double *in2, int size2, - double * out); - -/* -** \brief Compute an substraction element ways for complex single precision. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains in1 - in2. -*/ -void cdiffma(floatComplex *in1, int size1, - floatComplex *in2, int size2, - floatComplex *out); - -/* -** \brief Compute an substraction element ways for complex double precision. -** \param in1 : input array. -** \param size1 : size of in1 array. -** \param in2 : input arry. -** \param size2 : size of in2 array. -** \param out : array that contains in1 - in2. -*/ -void zdiffma(doubleComplex *in1, int size1, - doubleComplex *in2, int size2, - doubleComplex *out); - -#endif /* !__MATRIXSUBSTRACTION_H__ */ diff --git a/src/matrixOperations/multiplication/Makefile.am b/src/matrixOperations/multiplication/Makefile.am new file mode 100644 index 00000000..2d7dbee3 --- /dev/null +++ b/src/matrixOperations/multiplication/Makefile.am @@ -0,0 +1,37 @@ +## +## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET +## +## 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 +## +## + +libMatrixMultiplication_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib + +pkglib_LTLIBRARIES = libMatrixMultiplication.la + +libMatrixMultiplication_la_SOURCES = matrixMultiplication.c + +check_PROGRAMS = testMatrixMultiplication + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + libMatrixMultiplication.la + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +testMatrixMultiplication_SOURCES = testFloatMatrixMultiplication.c \ + testDoubleMatrixMultiplication.c +testMatrixMultiplication_LDADD = $(check_LDADD) +testMatrixMultiplication_CFLAGS = $(check_INCLUDES) + +TESTS = testMatrixMultiplication \ No newline at end of file diff --git a/src/matrixOperations/multiplication/Makefile.in b/src/matrixOperations/multiplication/Makefile.in new file mode 100644 index 00000000..7983fe53 --- /dev/null +++ b/src/matrixOperations/multiplication/Makefile.in @@ -0,0 +1,623 @@ +# 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 = testMatrixMultiplication$(EXEEXT) +TESTS = testMatrixMultiplication$(EXEEXT) +subdir = matrixOperations/multiplication +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) +libMatrixMultiplication_la_LIBADD = +am_libMatrixMultiplication_la_OBJECTS = \ + libMatrixMultiplication_la-matrixMultiplication.lo +libMatrixMultiplication_la_OBJECTS = \ + $(am_libMatrixMultiplication_la_OBJECTS) +libMatrixMultiplication_la_LINK = $(LIBTOOL) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libMatrixMultiplication_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_testMatrixMultiplication_OBJECTS = testMatrixMultiplication-testFloatMatrixMultiplication.$(OBJEXT) \ + testMatrixMultiplication-testDoubleMatrixMultiplication.$(OBJEXT) +testMatrixMultiplication_OBJECTS = \ + $(am_testMatrixMultiplication_OBJECTS) +testMatrixMultiplication_DEPENDENCIES = $(check_LDADD) +testMatrixMultiplication_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(testMatrixMultiplication_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 = $(libMatrixMultiplication_la_SOURCES) \ + $(testMatrixMultiplication_SOURCES) +DIST_SOURCES = $(libMatrixMultiplication_la_SOURCES) \ + $(testMatrixMultiplication_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@ +libMatrixMultiplication_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib +pkglib_LTLIBRARIES = libMatrixMultiplication.la +libMatrixMultiplication_la_SOURCES = matrixMultiplication.c +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + libMatrixMultiplication.la + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +testMatrixMultiplication_SOURCES = testFloatMatrixMultiplication.c \ + testDoubleMatrixMultiplication.c + +testMatrixMultiplication_LDADD = $(check_LDADD) +testMatrixMultiplication_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/multiplication/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign matrixOperations/multiplication/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 +libMatrixMultiplication.la: $(libMatrixMultiplication_la_OBJECTS) $(libMatrixMultiplication_la_DEPENDENCIES) + $(libMatrixMultiplication_la_LINK) -rpath $(pkglibdir) $(libMatrixMultiplication_la_OBJECTS) $(libMatrixMultiplication_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 +testMatrixMultiplication$(EXEEXT): $(testMatrixMultiplication_OBJECTS) $(testMatrixMultiplication_DEPENDENCIES) + @rm -f testMatrixMultiplication$(EXEEXT) + $(testMatrixMultiplication_LINK) $(testMatrixMultiplication_OBJECTS) $(testMatrixMultiplication_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libMatrixMultiplication_la-matrixMultiplication.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.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 $@ $< + +libMatrixMultiplication_la-matrixMultiplication.lo: matrixMultiplication.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libMatrixMultiplication_la_CFLAGS) $(CFLAGS) -MT libMatrixMultiplication_la-matrixMultiplication.lo -MD -MP -MF $(DEPDIR)/libMatrixMultiplication_la-matrixMultiplication.Tpo -c -o libMatrixMultiplication_la-matrixMultiplication.lo `test -f 'matrixMultiplication.c' || echo '$(srcdir)/'`matrixMultiplication.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libMatrixMultiplication_la-matrixMultiplication.Tpo $(DEPDIR)/libMatrixMultiplication_la-matrixMultiplication.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matrixMultiplication.c' object='libMatrixMultiplication_la-matrixMultiplication.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) $(libMatrixMultiplication_la_CFLAGS) $(CFLAGS) -c -o libMatrixMultiplication_la-matrixMultiplication.lo `test -f 'matrixMultiplication.c' || echo '$(srcdir)/'`matrixMultiplication.c + +testMatrixMultiplication-testFloatMatrixMultiplication.o: testFloatMatrixMultiplication.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -MT testMatrixMultiplication-testFloatMatrixMultiplication.o -MD -MP -MF $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Tpo -c -o testMatrixMultiplication-testFloatMatrixMultiplication.o `test -f 'testFloatMatrixMultiplication.c' || echo '$(srcdir)/'`testFloatMatrixMultiplication.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Tpo $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatMatrixMultiplication.c' object='testMatrixMultiplication-testFloatMatrixMultiplication.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) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -c -o testMatrixMultiplication-testFloatMatrixMultiplication.o `test -f 'testFloatMatrixMultiplication.c' || echo '$(srcdir)/'`testFloatMatrixMultiplication.c + +testMatrixMultiplication-testFloatMatrixMultiplication.obj: testFloatMatrixMultiplication.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -MT testMatrixMultiplication-testFloatMatrixMultiplication.obj -MD -MP -MF $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Tpo -c -o testMatrixMultiplication-testFloatMatrixMultiplication.obj `if test -f 'testFloatMatrixMultiplication.c'; then $(CYGPATH_W) 'testFloatMatrixMultiplication.c'; else $(CYGPATH_W) '$(srcdir)/testFloatMatrixMultiplication.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Tpo $(DEPDIR)/testMatrixMultiplication-testFloatMatrixMultiplication.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatMatrixMultiplication.c' object='testMatrixMultiplication-testFloatMatrixMultiplication.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) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -c -o testMatrixMultiplication-testFloatMatrixMultiplication.obj `if test -f 'testFloatMatrixMultiplication.c'; then $(CYGPATH_W) 'testFloatMatrixMultiplication.c'; else $(CYGPATH_W) '$(srcdir)/testFloatMatrixMultiplication.c'; fi` + +testMatrixMultiplication-testDoubleMatrixMultiplication.o: testDoubleMatrixMultiplication.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -MT testMatrixMultiplication-testDoubleMatrixMultiplication.o -MD -MP -MF $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Tpo -c -o testMatrixMultiplication-testDoubleMatrixMultiplication.o `test -f 'testDoubleMatrixMultiplication.c' || echo '$(srcdir)/'`testDoubleMatrixMultiplication.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Tpo $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleMatrixMultiplication.c' object='testMatrixMultiplication-testDoubleMatrixMultiplication.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) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -c -o testMatrixMultiplication-testDoubleMatrixMultiplication.o `test -f 'testDoubleMatrixMultiplication.c' || echo '$(srcdir)/'`testDoubleMatrixMultiplication.c + +testMatrixMultiplication-testDoubleMatrixMultiplication.obj: testDoubleMatrixMultiplication.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -MT testMatrixMultiplication-testDoubleMatrixMultiplication.obj -MD -MP -MF $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Tpo -c -o testMatrixMultiplication-testDoubleMatrixMultiplication.obj `if test -f 'testDoubleMatrixMultiplication.c'; then $(CYGPATH_W) 'testDoubleMatrixMultiplication.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleMatrixMultiplication.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Tpo $(DEPDIR)/testMatrixMultiplication-testDoubleMatrixMultiplication.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleMatrixMultiplication.c' object='testMatrixMultiplication-testDoubleMatrixMultiplication.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) $(testMatrixMultiplication_CFLAGS) $(CFLAGS) -c -o testMatrixMultiplication-testDoubleMatrixMultiplication.obj `if test -f 'testDoubleMatrixMultiplication.c'; then $(CYGPATH_W) 'testDoubleMatrixMultiplication.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleMatrixMultiplication.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/multiplication/matrixMultiplication.c b/src/matrixOperations/multiplication/matrixMultiplication.c new file mode 100644 index 00000000..dbed4330 --- /dev/null +++ b/src/matrixOperations/multiplication/matrixMultiplication.c @@ -0,0 +1,221 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 WITHOUT_BLAS +#include "blas.h" +#endif +#include "matrixMultiplication.h" + +/* +** \brief Compute a multiplication for floats matrixes. +** \param in1 : input matrix. +** \param lines1 : lines of in1 matrix. +** \param columns1 : columns of in1 matrix. +** \param in2 : input arry. +** \param lines2 : lines of in2 matrix. +** \param columns2 : columns of in2 matrix. +** \param out : Matrix that contains the multiplication in1 * in2. +*/ +void smulma(float *in1, int lines1, int columns1, + float *in2, int lines2, int columns2, + float *out) +{ + int i = 0; + int k = 0; + float accu = 0; + + /* + ** How to convert 2 index matrixes to one. + ** #define in1(a, b) in1[a+b*lines1] + ** #define in2(c, d) in2[c+d*lines2] + */ + + for (i = 0 ; i < lines1 * columns2 ; ++i) + { + accu = 0; + for (k = 0; k < columns1 ; ++k) + { + accu += in1[i % lines1 + k * lines1] + * in2[k + (i / lines1) * lines2]; + } + out[i] = accu; + } + +} + +/* +** \brief Compute a multiplication for doubles matrixes. +** \param in1 : input matrix. +** \param lines1 : lines of in1 matrix. +** \param columns1 : columns of in1 matrix. +** \param in2 : input arry. +** \param lines2 : lines of in2 matrix. +** \param columns2 : columns of in2 matrix. +** \param out : Matrix that contains the multiplication in1 * in2. +*/ +void dmulma(double *in1, int lines1, int columns1, + double *in2, int lines2, int columns2, + double *out) +{ +#ifndef WITHOUT_BLAS + /* + ** USES BLAS DGEMM FUNCTION. + */ + double One = 1; + double Zero = 0; + + /* Cr <- 1*Ar*Br + 0*Cr */ + dgemm_("N","N", &columns2, &columns2, &columns1, &One, + in1 , &lines1, in2, &lines2, &Zero, out, &columns2); +#else + /* + ** DO NOT USE ANY BLAS FUNCTION. + */ + int i = 0; + int k = 0; + double accu = 0; + + /* + ** How to convert 2 index matrixes to one. + ** #define in1(a, b) in1[a+b*lines1] + ** #define in2(c, d) in2[c+d*lines2] + */ + + for (i = 0 ; i < lines1 * columns2 ; ++i) + { + accu = 0; + for (k = 0; k < columns1 ; ++k) + { + accu += in1[i % lines1 + k * lines1] + * in2[k + (i / lines1) * lines2]; + } + out[i] = accu; + } +#endif +} + +/* +** \brief Compute a multiplication for floats complex matrixes. +** \param in1 : input matrix. +** \param lines1 : lines of in1 matrix. +** \param columns1 : columns of in1 matrix. +** \param in2 : input arry. +** \param lines2 : lines of in2 matrix. +** \param columns2 : columns of in2 matrix. +** \param out : Matrix that contains the multiplication in1 * in2. +*/ +void cmulma(floatComplex *in1, int lines1, int columns1, + floatComplex *in2, int lines2, int columns2, + floatComplex *out) +{ + int i = 0; + int k = 0; + floatComplex accu = FloatComplex(0, 0); + + for (i = 0 ; i < lines1 * columns2 ; ++i) + { + accu = FloatComplex(0,0); + for (k = 0; k < columns1 ; ++k) + { + accu = cadds(accu, + ctimess(in1[i % lines1 + k *lines1] , + in2[k + (i / lines1) *lines2] )); + } + out[i] = accu; + } +} + +/* +** \brief Compute a multiplication for doubles matrixes. +** \param in1 : input matrix. +** \param lines1 : lines of in1 matrix. +** \param columns1 : columns of in1 matrix. +** \param in2 : input arry. +** \param lines2 : lines of in2 matrix. +** \param columns2 : columns of in2 matrix. +** \param out : Matrix that contains the multiplication in1 * in2. +*/ +void zmulma(doubleComplex *in1, int lines1, int columns1, + doubleComplex *in2, int lines2, int columns2, + doubleComplex *out) +{ +#ifndef WITHOUT_BLAS + /* + ** USES BLAS DGEMM FUNCTION. + */ + int i = 0; + double One = 1; + double MinusOne = -1; + double Zero = 0; + + double *in1Real = malloc((uint) lines1 * (uint) columns1 * sizeof(double)); + double *in1Imag = malloc((uint) lines1 * (uint) columns1 * sizeof(double)); + double *in2Real = malloc((uint) lines2 * (uint) columns2 * sizeof(double)); + double *in2Imag = malloc((uint) lines2 * (uint) columns2 * sizeof(double)); + + double *RealOut = malloc((uint) lines1 * (uint) columns2 * sizeof(double)); + double *ImagOut = malloc((uint) lines1 * (uint) columns2 * sizeof(double)); + + zreala(in1, lines1 * columns1, in1Real); + zreala(in2, lines2 * columns2, in2Real); + zimaga(in1, lines1 * columns1, in1Imag); + zimaga(in2, lines2 * columns2, in2Imag); + + /* Cr <- 1*Ar*Br + 0*Cr */ + dgemm_("N","N", &lines1, &columns2, &columns1, &One, + in1Real, &lines1, in2Real, &lines2, &Zero, RealOut, &lines1); + + /* Cr <- -1*Ai*Bi + 1*Cr */ + dgemm_("N","N", &lines1, &columns2, &columns1, &MinusOne, + in1Imag, &lines1, in2Imag, &lines2, &One, RealOut, &lines1); + + /* Ci <- 1*Ar*Bi + 0*Ci */ + dgemm_("N","N", &lines1, &columns2, &columns1, &One, + in1Real, &lines1, in2Imag, &lines2, &Zero, ImagOut, &lines1); + + /* Ci <- 1*Ai*Br + 1*Ci */ + dgemm_("N","N", &lines1, &columns2, &columns1, &One, + in1Imag, &lines1, in2Real, &lines2, &One, ImagOut, &lines1); + + /* Now fill output matrix */ + for(i = 0 ; i < lines1 * columns2 ; ++i) + { + out[i] = DoubleComplex(RealOut[i], ImagOut[i]); + } + /* FREE allocated variables */ + free(in1Real); + free(in2Real); + free(in1Imag); + free(in2Imag); + free(RealOut); + free(ImagOut); +#else + /* + ** DO NOT USE ANY BLAS FUNCTION. + */ + int i = 0; + int k = 0; + doubleComplex accu = DoubleComplex(0, 0); + + for (i = 0 ; i < lines1 * columns2 ; ++i) + { + accu = DoubleComplex(0,0); + for (k = 0; k < columns1 ; ++k) + { + accu = zadds(accu, + ztimess(in1[i % lines1 + k *lines1] , + in2[k + (i / lines1) *lines2] )); + } + out[i] = accu; + } +#endif +} diff --git a/src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c b/src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c new file mode 100644 index 00000000..e9b71a87 --- /dev/null +++ b/src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c @@ -0,0 +1,211 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 +#include +#include +#include +#include "matrixMultiplication.h" + +int testFloatMultiplication(void); + +static void zmulmaTest(void) { + double realM1[4] = {1.0, 2.0, 3.0, 4.0}; + double imagM1[4] = {1.0, 2.0, 3.0, 4.0}; + double realM3[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; + double imagM3[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; + + doubleComplex *M1; + doubleComplex *M2; + doubleComplex M1_mul_M2[4]; + doubleComplex *M3; + doubleComplex *M4; + doubleComplex M3_mul_M4[4]; + doubleComplex miscM3_mul_M4[9]; + + int i = 0; + + printf("\n>>>> Matrix Complex Double Multiplication Tests\n"); + + M1 = DoubleComplexMatrix(realM1, imagM1, 4); + M2 = DoubleComplexMatrix(realM1, imagM1, 4); + + /* + [ 1+1.%i 3+3.%i] * [ 1+1.%i 3+3.%i] = [ 14.%i 30.%i ] + [ 2+2.%i 4+4.%i] [ 2+2.%i 4+4.%i] [ 20.%i 44.%i ] + */ + zmulma(M1, 2, 2, M2, 2, 2, M1_mul_M2); + for (i = 0; i < 4; ++i) + { + printf("M1_mul_M2[%d] = %e + %e i\n", i, zreals(M1_mul_M2[i]), zimags(M1_mul_M2[i])); + } + for (i = 0; i < 4; ++i) + { + assert(zreals(M1_mul_M2[i]) == 0.0); + } + assert(zimags(M1_mul_M2[0]) == 14.0); + assert(zimags(M1_mul_M2[1]) == 20.0); + assert(zimags(M1_mul_M2[2]) == 30.0); + assert(zimags(M1_mul_M2[3]) == 44.0); + + M3 = DoubleComplexMatrix(realM3, imagM3, 6); + M4 = DoubleComplexMatrix(realM3, imagM3, 6); + + /* + [ 1+1.%i 3+3.%i 5+5.%i ] * [ 1+1.%i 4+4.%i ] = [ 44.%i 98.%i ] + [ 2+2.%i 4+4.%i 6+6.%i ] [ 2+2.%i 5+5.%i ] [ 56.%i 128.%i ] + [ 3+3.%i 6+6.%i ] + */ + zmulma(M3, 2, 3, M4, 3, 2, M3_mul_M4); + for (i = 0; i < 4; ++i) + { + printf("M3_mul_M4[%d] = %e + %e i\n", i, zreals(M3_mul_M4[i]), zimags(M3_mul_M4[i])); + } + for (i = 0; i < 4; ++i) + { + assert(zreals(M3_mul_M4[i]) == 0.0); + } + assert(zimags(M3_mul_M4[0]) == 44.0); + assert(zimags(M3_mul_M4[1]) == 56.0); + assert(zimags(M3_mul_M4[2]) == 98.0); + assert(zimags(M3_mul_M4[3]) == 128.0); + + /* + [ 1+1.%i 4+4.%i ] * [ 1+1.%i 3+3.%i 5+5.%i ] = [ 18.%i 38.%i 58.%i ] + [ 2+2.%i 5+5.%i ] [ 2+2.%i 4+4.%i 6+6.%i ] [ 24.%i 52.%i 80.%i ] + [ 3+3.%i 6+6.%i ] [ 30.%i 66.%i 102.%i ] + */ + zmulma(M3, 3, 2, M4, 2, 3, miscM3_mul_M4); + for (i = 0; i < 9; ++i) + { + printf("miscM3_mul_M4[%d] = %e + %e i\n", i, zreals(miscM3_mul_M4[i]), zimags(miscM3_mul_M4[i])); + } + for (i = 0; i < 9; ++i) + { + assert(zreals(miscM3_mul_M4[i]) == 0.0); + } + assert(zimags(miscM3_mul_M4[0]) == 18.0); + assert(zimags(miscM3_mul_M4[1]) == 24.0); + assert(zimags(miscM3_mul_M4[2]) == 30.0); + assert(zimags(miscM3_mul_M4[3]) == 38.0); + assert(zimags(miscM3_mul_M4[4]) == 52.0); + assert(zimags(miscM3_mul_M4[5]) == 66.0); + assert(zimags(miscM3_mul_M4[6]) == 58.0); + assert(zimags(miscM3_mul_M4[7]) == 80.0); + assert(zimags(miscM3_mul_M4[8]) == 102.0); +} + +static void dmulmaTest(void) { + double M1[4] = {1.0, 2.0, 3.0, 4.0}; + double M2[4] = {1.0, 2.0, 3.0, 4.0}; + double M1_by_M2[4]; + double M3[4] = {1.0, 0.0, 1.0, 0.0}; + double M4[4] = {0.0, 1.0, 0.0, 1.0}; + double M3_by_M4[4]; + double M5[4] = {1.0, 0.0, 0.0, 1.0}; + double M6[4] = {42.0, 51.0, 69.0, 1664.0}; + double M5_by_M6[4]; + double M7[6] = {1.0, 4.0, 2.0, 5.0, 3.0, 6.0}; + double M8[6] = {1.0, 3.0, 5.0, 2.0, 4.0, 6.0}; + double M7_by_M8[4]; + double miscM7_by_M8[9]; + + int i = 0; + + printf("\n>>>> Matrix Real Double Multiplication Tests\n"); + /* + [ 1 3 ] * [ 1 3 ] = [ 7 15 ] + [ 2 4 ] [ 2 4 ] [10 22 ] + */ + dmulma(M1, 2, 2, M2, 2, 2, M1_by_M2); + for (i = 0; i < 4; ++i) { + printf("M1_by_M2[%d] = %e\n", i, M1_by_M2[i]); + } + assert(M1_by_M2[0] == 7.0); + assert(M1_by_M2[1] == 10.0); + assert(M1_by_M2[2] == 15.0); + assert(M1_by_M2[3] == 22.0); + /* + [ 1 1 ] * [ 0 0 ] = [ 1 1 ] + [ 0 0 ] [ 1 1 ] [ 0 0 ] + */ + dmulma(M3, 2, 2, M4, 2, 2, M3_by_M4); + for (i = 0; i < 4; ++i) { + printf("M3_by_M4[%d] = %e\n", i, M3_by_M4[i]); + } + assert(M3_by_M4[0] == 1.0); + assert(M3_by_M4[1] == 0.0); + assert(M3_by_M4[2] == 1.0); + assert(M3_by_M4[3] == 0.0); + + /* + [ 1 0 ] * [ 42 69 ] = [ 42 69 ] + [ 0 1 ] [ 51 1664 ] [ 51 1664 ] + */ + dmulma(M5, 2, 2, M6, 2, 2, M5_by_M6); + for (i = 0; i < 4; ++i) { + printf("M5_by_M6[%d] = %e\n", i, M5_by_M6[i]); + } + assert(M5_by_M6[0] == 42.0); + assert(M5_by_M6[1] == 51.0); + assert(M5_by_M6[2] == 69.0); + assert(M5_by_M6[3] == 1664.0); + + /* + [ 1 2 3 ] * [ 1 2 ] = [ 22 28 ] + [ 4 5 6 ] [ 3 4 ] [ 49 64 ] + [ 5 6 ] + */ + dmulma(M7, 2, 3, M8, 3, 2, M7_by_M8); + for (i = 0; i < 4; ++i) { + printf("M7_by_M8[%d] = %e\n", i, M7_by_M8[i]); + } + assert(M7_by_M8[0] == 22.0); + assert(M7_by_M8[1] == 49.0); + assert(M7_by_M8[2] == 28.0); + assert(M7_by_M8[3] == 64.0); + + /* + [ 1 5 ] * [ 1 5 4 ] = [ 16 15 34 ] + [ 4 3 ] [ 3 2 6 ] [ 13 26 34 ] + [ 2 6 ] [ 20 22 44 ] + */ + dmulma(M7, 3, 2, M8, 2, 3, miscM7_by_M8); + for (i = 0; i < 9; ++i) { + printf("miscM7_by_M8[%d] = %e\n", i, miscM7_by_M8[i]); + } + assert(miscM7_by_M8[0] == 16.0); + assert(miscM7_by_M8[1] == 13.0); + assert(miscM7_by_M8[2] == 20.0); + assert(miscM7_by_M8[3] == 15.0); + assert(miscM7_by_M8[4] == 26.0); + assert(miscM7_by_M8[5] == 22.0); + assert(miscM7_by_M8[6] == 34.0); + assert(miscM7_by_M8[7] == 34.0); + assert(miscM7_by_M8[8] == 44.0); +} + +static int testDoubleMultiplication(void) { + + printf("\n>>>> Matrix Double Multiplication Tests\n"); + dmulmaTest(); + zmulmaTest(); + return 0; +} + + + +int main(void) { + assert(testFloatMultiplication() == 0); + assert(testDoubleMultiplication() == 0); + return 0; +} diff --git a/src/matrixOperations/multiplication/testFloatMatrixMultiplication.c b/src/matrixOperations/multiplication/testFloatMatrixMultiplication.c new file mode 100644 index 00000000..6091fc66 --- /dev/null +++ b/src/matrixOperations/multiplication/testFloatMatrixMultiplication.c @@ -0,0 +1,206 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 +#include +#include +#include +#include "matrixMultiplication.h" + +int testFloatMultiplication(void); + +static void cmulmaTest(void) { + float realM1[4] = {1.0f, 2.0f, 3.0f, 4.0f}; + float imagM1[4] = {1.0f, 2.0f, 3.0f, 4.0f}; + float realM3[6] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; + float imagM3[6] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; + + floatComplex *M1; + floatComplex *M2; + floatComplex M1_mul_M2[4]; + floatComplex *M3; + floatComplex *M4; + floatComplex M3_mul_M4[4]; + floatComplex miscM3_mul_M4[9]; + + int i = 0; + + printf("\n>>>> Matrix Complex Float Multiplication Tests\n"); + + M1 = FloatComplexMatrix(realM1, imagM1, 4); + M2 = FloatComplexMatrix(realM1, imagM1, 4); + + /* + [ 1+1.%i 3+3.%i] * [ 1+1.%i 3+3.%i] = [ 14.%i 30.%i ] + [ 2+2.%i 3+3.%i] [ 2+2.%i 3+3.%i] [ 20.%i 44.%i ] + */ + cmulma(M1, 2, 2, M2, 2, 2, M1_mul_M2); + for (i = 0; i < 4; ++i) + { + printf("M1_mul_M2[%d] = %e + %e i\n", i, creals(M1_mul_M2[i]), cimags(M1_mul_M2[i])); + } + for (i = 0; i < 4; ++i) + { + assert(creals(M1_mul_M2[i]) == 0.0f); + } + assert(cimags(M1_mul_M2[0]) == 14.0f); + assert(cimags(M1_mul_M2[1]) == 20.0f); + assert(cimags(M1_mul_M2[2]) == 30.0f); + assert(cimags(M1_mul_M2[3]) == 44.0f); + + M3 = FloatComplexMatrix(realM3, imagM3, 6); + M4 = FloatComplexMatrix(realM3, imagM3, 6); + + /* + [ 1+1.%i 3+3.%i 5+5.%i ] * [ 1+1.%i 4+4.%i ] = [ 44.%i 98.%i ] + [ 2+2.%i 4+4.%i 6+6.%i ] [ 2+2.%i 5+5.%i ] [ 56.%i 128.%i ] + [ 3+3.%i 6+6.%i ] + */ + cmulma(M3, 2, 3, M4, 3, 2, M3_mul_M4); + for (i = 0; i < 4; ++i) + { + printf("M3_mul_M4[%d] = %e + %e i\n", i, creals(M3_mul_M4[i]), cimags(M3_mul_M4[i])); + } + for (i = 0; i < 4; ++i) + { + assert(creals(M3_mul_M4[i]) == 0.0f); + } + assert(cimags(M3_mul_M4[0]) == 44.0f); + assert(cimags(M3_mul_M4[1]) == 56.0f); + assert(cimags(M3_mul_M4[2]) == 98.0f); + assert(cimags(M3_mul_M4[3]) == 128.0f); + + /* + [ 1+1.%i 4+4.%i ] * [ 1+1.%i 3+3.%i 5+5.%i ] = [ 18.%i 38.%i 58.%i ] + [ 2+2.%i 5+5.%i ] [ 2+2.%i 4+4.%i 6+6.%i ] [ 24.%i 52.%i 80.%i ] + [ 3+3.%i 6+6.%i ] [ 30.%i 66.%i 102.%i ] + */ + cmulma(M3, 3, 2, M4, 2, 3, miscM3_mul_M4); + for (i = 0; i < 9; ++i) + { + printf("miscM3_mul_M4[%d] = %e + %e i\n", i, creals(miscM3_mul_M4[i]), cimags(miscM3_mul_M4[i])); + } + for (i = 0; i < 9; ++i) + { + assert(creals(miscM3_mul_M4[i]) == 0.0); + } + assert(cimags(miscM3_mul_M4[0]) == 18.0); + assert(cimags(miscM3_mul_M4[1]) == 24.0); + assert(cimags(miscM3_mul_M4[2]) == 30.0); + assert(cimags(miscM3_mul_M4[3]) == 38.0); + assert(cimags(miscM3_mul_M4[4]) == 52.0); + assert(cimags(miscM3_mul_M4[5]) == 66.0); + assert(cimags(miscM3_mul_M4[6]) == 58.0); + assert(cimags(miscM3_mul_M4[7]) == 80.0); + assert(cimags(miscM3_mul_M4[8]) == 102.0); + +} + +static void smulmaTest(void) { + float M1[4] = {1.0f, 2.0f, 3.0f, 4.0f}; + float M2[4] = {1.0f, 2.0f, 3.0f, 4.0f}; + float M1_by_M2[4]; + float M3[4] = {1.0f, 0.0f, 1.0f, 0.0f}; + float M4[4] = {0.0f, 1.0f, 0.0f, 1.0f}; + float M3_by_M4[4]; + float M5[4] = {1.0f, 0.0f, 0.0f, 1.0f}; + float M6[4] = {42.0f, 51.0f, 69.0f, 1664.0f}; + float M5_by_M6[4]; + float M7[6] = {1.0f, 4.0f, 2.0f, 5.0f, 3.0f, 6.0f}; + float M8[6] = {1.0f, 3.0f, 5.0f, 2.0f, 4.0f, 6.0f}; + float M7_by_M8[4]; + float miscM7_by_M8[9]; + + int i = 0; + + printf("\n>>>> Matrix Float Multiplication Tests\n"); + /* + [ 1 3 ] * [ 1 3 ] = [ 7 15 ] + [ 2 4 ] [ 2 4 ] [10 22 ] + */ + smulma(M1, 2, 2, M2, 2, 2, M1_by_M2); + for (i = 0; i < 4; ++i) { + printf("M1_by_M2[%d] = %e\n", i, M1_by_M2[i]); + } + assert(M1_by_M2[0] == 7.0f); + assert(M1_by_M2[1] == 10.0f); + assert(M1_by_M2[2] == 15.0f); + assert(M1_by_M2[3] == 22.0f); + /* + [ 1 1 ] * [ 0 0 ] = [ 1 1 ] + [ 0 0 ] [ 1 1 ] [ 0 0 ] + */ + smulma(M3, 2, 2, M4, 2, 2, M3_by_M4); + for (i = 0; i < 4; ++i) { + printf("M3_by_M4[%d] = %e\n", i, M3_by_M4[i]); + } + assert(M3_by_M4[0] == 1.0f); + assert(M3_by_M4[1] == 0.0f); + assert(M3_by_M4[2] == 1.0f); + assert(M3_by_M4[3] == 0.0f); + + /* + [ 1 0 ] * [ 42 69 ] = [ 42 69 ] + [ 0 1 ] [ 51 1664 ] [ 51 1664 ] + */ + smulma(M5, 2, 2, M6, 2, 2, M5_by_M6); + for (i = 0; i < 4; ++i) { + printf("M5_by_M6[%d] = %e\n", i, M5_by_M6[i]); + } + assert(M5_by_M6[0] == 42.0f); + assert(M5_by_M6[1] == 51.0f); + assert(M5_by_M6[2] == 69.0f); + assert(M5_by_M6[3] == 1664.0f); + + /* + [ 1 2 3 ] * [ 1 2 ] = [ 22 28 ] + [ 4 5 6 ] [ 3 4 ] [ 49 64 ] + [ 5 6 ] + */ + smulma(M7, 2, 3, M8, 3, 2, M7_by_M8); + for (i = 0; i < 4; ++i) { + printf("M7_by_M8[%d] = %e\n", i, M7_by_M8[i]); + } + assert(M7_by_M8[0] == 22.0f); + assert(M7_by_M8[1] == 49.0f); + assert(M7_by_M8[2] == 28.0f); + assert(M7_by_M8[3] == 64.0f); + + /* + [ 1 5 ] * [ 1 5 4 ] = [ 16 15 34 ] + [ 4 3 ] [ 3 2 6 ] [ 13 26 34 ] + [ 2 6 ] [ 20 22 44 ] + */ + smulma(M7, 3, 2, M8, 2, 3, miscM7_by_M8); + for (i = 0; i < 9; ++i) { + printf("miscM7_by_M8[%d] = %e\n", i, miscM7_by_M8[i]); + } + assert(miscM7_by_M8[0] == 16.0f); + assert(miscM7_by_M8[1] == 13.0f); + assert(miscM7_by_M8[2] == 20.0f); + assert(miscM7_by_M8[3] == 15.0f); + assert(miscM7_by_M8[4] == 26.0f); + assert(miscM7_by_M8[5] == 22.0f); + assert(miscM7_by_M8[6] == 34.0f); + assert(miscM7_by_M8[7] == 34.0f); + assert(miscM7_by_M8[8] == 44.0f); + +} + +int testFloatMultiplication(void) { + + printf("\n>>>> Matrix Multiplication Tests\n"); + smulmaTest(); + cmulmaTest(); + + return 0; +} diff --git a/src/matrixOperations/subtraction/Makefile.am b/src/matrixOperations/subtraction/Makefile.am new file mode 100644 index 00000000..e57e5703 --- /dev/null +++ b/src/matrixOperations/subtraction/Makefile.am @@ -0,0 +1,35 @@ +## +## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET +## +## 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 +## +## + +libMatrixSubtraction_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib + +pkglib_LTLIBRARIES = libMatrixSubtraction.la + +libMatrixSubtraction_la_SOURCES = matrixSubtraction.c + +check_PROGRAMS = testMatrixSubtraction + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + libMatrixSubtraction.la + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +testMatrixSubtraction_SOURCES = testMatrixSubtraction.c +testMatrixSubtraction_LDADD = $(check_LDADD) +testMatrixSubtraction_CFLAGS = $(check_INCLUDES) + +TESTS = testMatrixSubtraction \ No newline at end of file diff --git a/src/matrixOperations/subtraction/Makefile.in b/src/matrixOperations/subtraction/Makefile.in new file mode 100644 index 00000000..cb6b20a8 --- /dev/null +++ b/src/matrixOperations/subtraction/Makefile.in @@ -0,0 +1,604 @@ +# 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 = testMatrixSubtraction$(EXEEXT) +TESTS = testMatrixSubtraction$(EXEEXT) +subdir = matrixOperations/subtraction +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) +libMatrixSubtraction_la_LIBADD = +am_libMatrixSubtraction_la_OBJECTS = \ + libMatrixSubtraction_la-matrixSubtraction.lo +libMatrixSubtraction_la_OBJECTS = \ + $(am_libMatrixSubtraction_la_OBJECTS) +libMatrixSubtraction_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libMatrixSubtraction_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_testMatrixSubtraction_OBJECTS = \ + testMatrixSubtraction-testMatrixSubtraction.$(OBJEXT) +testMatrixSubtraction_OBJECTS = $(am_testMatrixSubtraction_OBJECTS) +testMatrixSubtraction_DEPENDENCIES = $(check_LDADD) +testMatrixSubtraction_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(testMatrixSubtraction_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 = $(libMatrixSubtraction_la_SOURCES) \ + $(testMatrixSubtraction_SOURCES) +DIST_SOURCES = $(libMatrixSubtraction_la_SOURCES) \ + $(testMatrixSubtraction_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@ +libMatrixSubtraction_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +instdir = $(top_builddir)/lib +pkglib_LTLIBRARIES = libMatrixSubtraction.la +libMatrixSubtraction_la_SOURCES = matrixSubtraction.c +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + libMatrixSubtraction.la + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes + +testMatrixSubtraction_SOURCES = testMatrixSubtraction.c +testMatrixSubtraction_LDADD = $(check_LDADD) +testMatrixSubtraction_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/subtraction/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign matrixOperations/subtraction/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 +libMatrixSubtraction.la: $(libMatrixSubtraction_la_OBJECTS) $(libMatrixSubtraction_la_DEPENDENCIES) + $(libMatrixSubtraction_la_LINK) -rpath $(pkglibdir) $(libMatrixSubtraction_la_OBJECTS) $(libMatrixSubtraction_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 +testMatrixSubtraction$(EXEEXT): $(testMatrixSubtraction_OBJECTS) $(testMatrixSubtraction_DEPENDENCIES) + @rm -f testMatrixSubtraction$(EXEEXT) + $(testMatrixSubtraction_LINK) $(testMatrixSubtraction_OBJECTS) $(testMatrixSubtraction_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libMatrixSubtraction_la-matrixSubtraction.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.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 $@ $< + +libMatrixSubtraction_la-matrixSubtraction.lo: matrixSubtraction.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libMatrixSubtraction_la_CFLAGS) $(CFLAGS) -MT libMatrixSubtraction_la-matrixSubtraction.lo -MD -MP -MF $(DEPDIR)/libMatrixSubtraction_la-matrixSubtraction.Tpo -c -o libMatrixSubtraction_la-matrixSubtraction.lo `test -f 'matrixSubtraction.c' || echo '$(srcdir)/'`matrixSubtraction.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libMatrixSubtraction_la-matrixSubtraction.Tpo $(DEPDIR)/libMatrixSubtraction_la-matrixSubtraction.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='matrixSubtraction.c' object='libMatrixSubtraction_la-matrixSubtraction.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) $(libMatrixSubtraction_la_CFLAGS) $(CFLAGS) -c -o libMatrixSubtraction_la-matrixSubtraction.lo `test -f 'matrixSubtraction.c' || echo '$(srcdir)/'`matrixSubtraction.c + +testMatrixSubtraction-testMatrixSubtraction.o: testMatrixSubtraction.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixSubtraction_CFLAGS) $(CFLAGS) -MT testMatrixSubtraction-testMatrixSubtraction.o -MD -MP -MF $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Tpo -c -o testMatrixSubtraction-testMatrixSubtraction.o `test -f 'testMatrixSubtraction.c' || echo '$(srcdir)/'`testMatrixSubtraction.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Tpo $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixSubtraction.c' object='testMatrixSubtraction-testMatrixSubtraction.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) $(testMatrixSubtraction_CFLAGS) $(CFLAGS) -c -o testMatrixSubtraction-testMatrixSubtraction.o `test -f 'testMatrixSubtraction.c' || echo '$(srcdir)/'`testMatrixSubtraction.c + +testMatrixSubtraction-testMatrixSubtraction.obj: testMatrixSubtraction.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testMatrixSubtraction_CFLAGS) $(CFLAGS) -MT testMatrixSubtraction-testMatrixSubtraction.obj -MD -MP -MF $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Tpo -c -o testMatrixSubtraction-testMatrixSubtraction.obj `if test -f 'testMatrixSubtraction.c'; then $(CYGPATH_W) 'testMatrixSubtraction.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixSubtraction.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Tpo $(DEPDIR)/testMatrixSubtraction-testMatrixSubtraction.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testMatrixSubtraction.c' object='testMatrixSubtraction-testMatrixSubtraction.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) $(testMatrixSubtraction_CFLAGS) $(CFLAGS) -c -o testMatrixSubtraction-testMatrixSubtraction.obj `if test -f 'testMatrixSubtraction.c'; then $(CYGPATH_W) 'testMatrixSubtraction.c'; else $(CYGPATH_W) '$(srcdir)/testMatrixSubtraction.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/subtraction/matrixSubtraction.c b/src/matrixOperations/subtraction/matrixSubtraction.c new file mode 100644 index 00000000..ffd30d7a --- /dev/null +++ b/src/matrixOperations/subtraction/matrixSubtraction.c @@ -0,0 +1,93 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 "matrixSubtraction.h" + +/* +** \brief Compute an substraction element ways for floats. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains in1 - in2. +*/ +void sdiffma(float *in1, int size1, + float *in2, int size2, + float *out) +{ + int i = 0; + + for(i = 0 ; i < size1 && i < size2 ; ++i) + { + out[i] = in1[i] - in2[i]; + } +} + +/* +** \brief Compute an substraction element ways for double. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains in1 - in2. +*/ +void ddiffma(double *in1, int size1, + double *in2, int size2, + double * out) +{ + int i = 0; + + for(i = 0 ; i < size1 && i < size2 ; ++i) + { + out[i] = in1[i] - in2[i]; + } +} + +/* +** \brief Compute an substraction element ways for complex single precision. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains in1 - in2. +*/ +void cdiffma(floatComplex *in1, int size1, + floatComplex *in2, int size2, + floatComplex *out) +{ + int i = 0; + + for(i = 0 ; i < size1 && i < size2 ; ++i) + { + out[i] = cdiffs(in1[i], in2[i]); + } +} + +/* +** \brief Compute an substraction element ways for complex double precision. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains in1 - in2. +*/ +void zdiffma(doubleComplex *in1, int size1, + doubleComplex *in2, int size2, + doubleComplex *out) +{ + int i = 0; + + for(i = 0 ; i < size1 && i < size2 ; ++i) + { + out[i] = zdiffs(in1[i], in2[i]); + } +} diff --git a/src/matrixOperations/subtraction/testMatrixSubtraction.c b/src/matrixOperations/subtraction/testMatrixSubtraction.c new file mode 100644 index 00000000..5c30c4e0 --- /dev/null +++ b/src/matrixOperations/subtraction/testMatrixSubtraction.c @@ -0,0 +1,128 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * 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 +#include +#include +#include +#include "matrixSubtraction.h" + +#define SIZE 10000 + +/* #define LOCAL_DEBUG */ + +static void zdiffmaTest(void) { + doubleComplex M1[SIZE]; + doubleComplex M2[SIZE]; + doubleComplex M1_but_M2[SIZE]; + + int i = 0; + + srand(1); + for (i = 0; i < SIZE; ++i) { + M1[i] = DoubleComplex((double) rand(), (double) rand()); + M2[i] = DoubleComplex((double) rand(), (double) rand()); + } + zdiffma(M1, SIZE, M2, SIZE, M1_but_M2); + for (i = 0; i < SIZE; ++i) { +#ifdef LOCAL_DEBUG + printf("M1_but_M2 = %e + %e i\n", zreals(M1_but_M2[i]), zimags(M1_but_M2[i])); +#endif + assert(zreals(M1_but_M2[i]) - (zreals(M1[i]) - zreals(M2[i])) == 0); + assert(zimags(M1_but_M2[i]) - (zimags(M1[i]) - zimags(M2[i])) == 0); + } +} + +static void cdiffmaTest(void) { + floatComplex M1[SIZE]; + floatComplex M2[SIZE]; + floatComplex M1_but_M2[SIZE]; + + int i = 0; + + srand(1); + for (i = 0; i < SIZE; ++i) { + M1[i] = FloatComplex((float) rand(), (float) rand()); + M2[i] = FloatComplex((float) rand(), (float) rand()); + } + cdiffma(M1, SIZE, M2, SIZE, M1_but_M2); + for (i = 0; i < SIZE; ++i) { +#ifdef LOCAL_DEBUG + printf("M1_but_M2 = %e + %e i\n", creals(M1_but_M2[i]), cimags(M1_but_M2[i])); +#endif + assert(fabsf(creals(M1_but_M2[i]) - (creals(M1[i]) - creals(M2[i]))) / creals(M1_but_M2[i]) < 1e-07); + assert(fabsf(cimags(M1_but_M2[i]) - (cimags(M1[i]) - cimags(M2[i]))) / cimags(M1_but_M2[i]) < 1e-07); + } +} + +static void sdiffmaTest(void) { + float M1[SIZE]; + float M2[SIZE]; + float M1_but_M2[SIZE]; + + int i = 0; + + srand(1); + for (i = 0; i < SIZE; ++i) { + M1[i] = (float) rand(); + M2[i] = (float) rand(); + } + sdiffma(M1, SIZE, M2, SIZE, M1_but_M2); + for (i = 0; i < SIZE; ++i) { +#ifdef LOCAL_DEBUG + printf("M1_but_M2 = %e\n", M1_but_M2[i]); + printf("M1[i] - M2[i] = %e\n", (M1[i] + M2[i])); + printf("Error = %e\n",(float) fabsf(M1_but_M2[i] - (M1[i] - M2[i])) / M1_but_M2[i]); +#endif + assert(fabsf(M1_but_M2[i] - (M1[i] - M2[i])) / M1_but_M2[i] < 1e-07); + } +} + +static void ddiffmaTest(void) { + double M1[SIZE]; + double M2[SIZE]; + double M1_but_M2[SIZE]; + + int i = 0; + + srand(1); + for (i = 0; i < SIZE; ++i) { + M1[i] = (double) rand(); + M2[i] = (double) rand(); + } + ddiffma(M1, SIZE, M2, SIZE, M1_but_M2); + for (i = 0; i < SIZE; ++i) { +#ifdef LOCAL_DEBUG + printf("M1_but_M2 = %e\n", M1_but_M2[i]); +#endif + assert(fabs(M1_but_M2[i] - (M1[i] - M2[i])) == 0); + } + +} + +static int testDiffition(void) { + + printf("\n>>>> Matrix Substraction Tests\n"); + sdiffmaTest(); + ddiffmaTest(); + cdiffmaTest(); + zdiffmaTest(); + + return 0; +} + + + +int main(void) { + assert(testDiffition() == 0); + return 0; +} diff --git a/src/matrixOperations/testDoubleMatrixMultiplication.c b/src/matrixOperations/testDoubleMatrixMultiplication.c deleted file mode 100644 index e9b71a87..00000000 --- a/src/matrixOperations/testDoubleMatrixMultiplication.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 -#include -#include -#include -#include "matrixMultiplication.h" - -int testFloatMultiplication(void); - -static void zmulmaTest(void) { - double realM1[4] = {1.0, 2.0, 3.0, 4.0}; - double imagM1[4] = {1.0, 2.0, 3.0, 4.0}; - double realM3[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; - double imagM3[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; - - doubleComplex *M1; - doubleComplex *M2; - doubleComplex M1_mul_M2[4]; - doubleComplex *M3; - doubleComplex *M4; - doubleComplex M3_mul_M4[4]; - doubleComplex miscM3_mul_M4[9]; - - int i = 0; - - printf("\n>>>> Matrix Complex Double Multiplication Tests\n"); - - M1 = DoubleComplexMatrix(realM1, imagM1, 4); - M2 = DoubleComplexMatrix(realM1, imagM1, 4); - - /* - [ 1+1.%i 3+3.%i] * [ 1+1.%i 3+3.%i] = [ 14.%i 30.%i ] - [ 2+2.%i 4+4.%i] [ 2+2.%i 4+4.%i] [ 20.%i 44.%i ] - */ - zmulma(M1, 2, 2, M2, 2, 2, M1_mul_M2); - for (i = 0; i < 4; ++i) - { - printf("M1_mul_M2[%d] = %e + %e i\n", i, zreals(M1_mul_M2[i]), zimags(M1_mul_M2[i])); - } - for (i = 0; i < 4; ++i) - { - assert(zreals(M1_mul_M2[i]) == 0.0); - } - assert(zimags(M1_mul_M2[0]) == 14.0); - assert(zimags(M1_mul_M2[1]) == 20.0); - assert(zimags(M1_mul_M2[2]) == 30.0); - assert(zimags(M1_mul_M2[3]) == 44.0); - - M3 = DoubleComplexMatrix(realM3, imagM3, 6); - M4 = DoubleComplexMatrix(realM3, imagM3, 6); - - /* - [ 1+1.%i 3+3.%i 5+5.%i ] * [ 1+1.%i 4+4.%i ] = [ 44.%i 98.%i ] - [ 2+2.%i 4+4.%i 6+6.%i ] [ 2+2.%i 5+5.%i ] [ 56.%i 128.%i ] - [ 3+3.%i 6+6.%i ] - */ - zmulma(M3, 2, 3, M4, 3, 2, M3_mul_M4); - for (i = 0; i < 4; ++i) - { - printf("M3_mul_M4[%d] = %e + %e i\n", i, zreals(M3_mul_M4[i]), zimags(M3_mul_M4[i])); - } - for (i = 0; i < 4; ++i) - { - assert(zreals(M3_mul_M4[i]) == 0.0); - } - assert(zimags(M3_mul_M4[0]) == 44.0); - assert(zimags(M3_mul_M4[1]) == 56.0); - assert(zimags(M3_mul_M4[2]) == 98.0); - assert(zimags(M3_mul_M4[3]) == 128.0); - - /* - [ 1+1.%i 4+4.%i ] * [ 1+1.%i 3+3.%i 5+5.%i ] = [ 18.%i 38.%i 58.%i ] - [ 2+2.%i 5+5.%i ] [ 2+2.%i 4+4.%i 6+6.%i ] [ 24.%i 52.%i 80.%i ] - [ 3+3.%i 6+6.%i ] [ 30.%i 66.%i 102.%i ] - */ - zmulma(M3, 3, 2, M4, 2, 3, miscM3_mul_M4); - for (i = 0; i < 9; ++i) - { - printf("miscM3_mul_M4[%d] = %e + %e i\n", i, zreals(miscM3_mul_M4[i]), zimags(miscM3_mul_M4[i])); - } - for (i = 0; i < 9; ++i) - { - assert(zreals(miscM3_mul_M4[i]) == 0.0); - } - assert(zimags(miscM3_mul_M4[0]) == 18.0); - assert(zimags(miscM3_mul_M4[1]) == 24.0); - assert(zimags(miscM3_mul_M4[2]) == 30.0); - assert(zimags(miscM3_mul_M4[3]) == 38.0); - assert(zimags(miscM3_mul_M4[4]) == 52.0); - assert(zimags(miscM3_mul_M4[5]) == 66.0); - assert(zimags(miscM3_mul_M4[6]) == 58.0); - assert(zimags(miscM3_mul_M4[7]) == 80.0); - assert(zimags(miscM3_mul_M4[8]) == 102.0); -} - -static void dmulmaTest(void) { - double M1[4] = {1.0, 2.0, 3.0, 4.0}; - double M2[4] = {1.0, 2.0, 3.0, 4.0}; - double M1_by_M2[4]; - double M3[4] = {1.0, 0.0, 1.0, 0.0}; - double M4[4] = {0.0, 1.0, 0.0, 1.0}; - double M3_by_M4[4]; - double M5[4] = {1.0, 0.0, 0.0, 1.0}; - double M6[4] = {42.0, 51.0, 69.0, 1664.0}; - double M5_by_M6[4]; - double M7[6] = {1.0, 4.0, 2.0, 5.0, 3.0, 6.0}; - double M8[6] = {1.0, 3.0, 5.0, 2.0, 4.0, 6.0}; - double M7_by_M8[4]; - double miscM7_by_M8[9]; - - int i = 0; - - printf("\n>>>> Matrix Real Double Multiplication Tests\n"); - /* - [ 1 3 ] * [ 1 3 ] = [ 7 15 ] - [ 2 4 ] [ 2 4 ] [10 22 ] - */ - dmulma(M1, 2, 2, M2, 2, 2, M1_by_M2); - for (i = 0; i < 4; ++i) { - printf("M1_by_M2[%d] = %e\n", i, M1_by_M2[i]); - } - assert(M1_by_M2[0] == 7.0); - assert(M1_by_M2[1] == 10.0); - assert(M1_by_M2[2] == 15.0); - assert(M1_by_M2[3] == 22.0); - /* - [ 1 1 ] * [ 0 0 ] = [ 1 1 ] - [ 0 0 ] [ 1 1 ] [ 0 0 ] - */ - dmulma(M3, 2, 2, M4, 2, 2, M3_by_M4); - for (i = 0; i < 4; ++i) { - printf("M3_by_M4[%d] = %e\n", i, M3_by_M4[i]); - } - assert(M3_by_M4[0] == 1.0); - assert(M3_by_M4[1] == 0.0); - assert(M3_by_M4[2] == 1.0); - assert(M3_by_M4[3] == 0.0); - - /* - [ 1 0 ] * [ 42 69 ] = [ 42 69 ] - [ 0 1 ] [ 51 1664 ] [ 51 1664 ] - */ - dmulma(M5, 2, 2, M6, 2, 2, M5_by_M6); - for (i = 0; i < 4; ++i) { - printf("M5_by_M6[%d] = %e\n", i, M5_by_M6[i]); - } - assert(M5_by_M6[0] == 42.0); - assert(M5_by_M6[1] == 51.0); - assert(M5_by_M6[2] == 69.0); - assert(M5_by_M6[3] == 1664.0); - - /* - [ 1 2 3 ] * [ 1 2 ] = [ 22 28 ] - [ 4 5 6 ] [ 3 4 ] [ 49 64 ] - [ 5 6 ] - */ - dmulma(M7, 2, 3, M8, 3, 2, M7_by_M8); - for (i = 0; i < 4; ++i) { - printf("M7_by_M8[%d] = %e\n", i, M7_by_M8[i]); - } - assert(M7_by_M8[0] == 22.0); - assert(M7_by_M8[1] == 49.0); - assert(M7_by_M8[2] == 28.0); - assert(M7_by_M8[3] == 64.0); - - /* - [ 1 5 ] * [ 1 5 4 ] = [ 16 15 34 ] - [ 4 3 ] [ 3 2 6 ] [ 13 26 34 ] - [ 2 6 ] [ 20 22 44 ] - */ - dmulma(M7, 3, 2, M8, 2, 3, miscM7_by_M8); - for (i = 0; i < 9; ++i) { - printf("miscM7_by_M8[%d] = %e\n", i, miscM7_by_M8[i]); - } - assert(miscM7_by_M8[0] == 16.0); - assert(miscM7_by_M8[1] == 13.0); - assert(miscM7_by_M8[2] == 20.0); - assert(miscM7_by_M8[3] == 15.0); - assert(miscM7_by_M8[4] == 26.0); - assert(miscM7_by_M8[5] == 22.0); - assert(miscM7_by_M8[6] == 34.0); - assert(miscM7_by_M8[7] == 34.0); - assert(miscM7_by_M8[8] == 44.0); -} - -static int testDoubleMultiplication(void) { - - printf("\n>>>> Matrix Double Multiplication Tests\n"); - dmulmaTest(); - zmulmaTest(); - return 0; -} - - - -int main(void) { - assert(testFloatMultiplication() == 0); - assert(testDoubleMultiplication() == 0); - return 0; -} diff --git a/src/matrixOperations/testFloatMatrixMultiplication.c b/src/matrixOperations/testFloatMatrixMultiplication.c deleted file mode 100644 index 6091fc66..00000000 --- a/src/matrixOperations/testFloatMatrixMultiplication.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 -#include -#include -#include -#include "matrixMultiplication.h" - -int testFloatMultiplication(void); - -static void cmulmaTest(void) { - float realM1[4] = {1.0f, 2.0f, 3.0f, 4.0f}; - float imagM1[4] = {1.0f, 2.0f, 3.0f, 4.0f}; - float realM3[6] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; - float imagM3[6] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; - - floatComplex *M1; - floatComplex *M2; - floatComplex M1_mul_M2[4]; - floatComplex *M3; - floatComplex *M4; - floatComplex M3_mul_M4[4]; - floatComplex miscM3_mul_M4[9]; - - int i = 0; - - printf("\n>>>> Matrix Complex Float Multiplication Tests\n"); - - M1 = FloatComplexMatrix(realM1, imagM1, 4); - M2 = FloatComplexMatrix(realM1, imagM1, 4); - - /* - [ 1+1.%i 3+3.%i] * [ 1+1.%i 3+3.%i] = [ 14.%i 30.%i ] - [ 2+2.%i 3+3.%i] [ 2+2.%i 3+3.%i] [ 20.%i 44.%i ] - */ - cmulma(M1, 2, 2, M2, 2, 2, M1_mul_M2); - for (i = 0; i < 4; ++i) - { - printf("M1_mul_M2[%d] = %e + %e i\n", i, creals(M1_mul_M2[i]), cimags(M1_mul_M2[i])); - } - for (i = 0; i < 4; ++i) - { - assert(creals(M1_mul_M2[i]) == 0.0f); - } - assert(cimags(M1_mul_M2[0]) == 14.0f); - assert(cimags(M1_mul_M2[1]) == 20.0f); - assert(cimags(M1_mul_M2[2]) == 30.0f); - assert(cimags(M1_mul_M2[3]) == 44.0f); - - M3 = FloatComplexMatrix(realM3, imagM3, 6); - M4 = FloatComplexMatrix(realM3, imagM3, 6); - - /* - [ 1+1.%i 3+3.%i 5+5.%i ] * [ 1+1.%i 4+4.%i ] = [ 44.%i 98.%i ] - [ 2+2.%i 4+4.%i 6+6.%i ] [ 2+2.%i 5+5.%i ] [ 56.%i 128.%i ] - [ 3+3.%i 6+6.%i ] - */ - cmulma(M3, 2, 3, M4, 3, 2, M3_mul_M4); - for (i = 0; i < 4; ++i) - { - printf("M3_mul_M4[%d] = %e + %e i\n", i, creals(M3_mul_M4[i]), cimags(M3_mul_M4[i])); - } - for (i = 0; i < 4; ++i) - { - assert(creals(M3_mul_M4[i]) == 0.0f); - } - assert(cimags(M3_mul_M4[0]) == 44.0f); - assert(cimags(M3_mul_M4[1]) == 56.0f); - assert(cimags(M3_mul_M4[2]) == 98.0f); - assert(cimags(M3_mul_M4[3]) == 128.0f); - - /* - [ 1+1.%i 4+4.%i ] * [ 1+1.%i 3+3.%i 5+5.%i ] = [ 18.%i 38.%i 58.%i ] - [ 2+2.%i 5+5.%i ] [ 2+2.%i 4+4.%i 6+6.%i ] [ 24.%i 52.%i 80.%i ] - [ 3+3.%i 6+6.%i ] [ 30.%i 66.%i 102.%i ] - */ - cmulma(M3, 3, 2, M4, 2, 3, miscM3_mul_M4); - for (i = 0; i < 9; ++i) - { - printf("miscM3_mul_M4[%d] = %e + %e i\n", i, creals(miscM3_mul_M4[i]), cimags(miscM3_mul_M4[i])); - } - for (i = 0; i < 9; ++i) - { - assert(creals(miscM3_mul_M4[i]) == 0.0); - } - assert(cimags(miscM3_mul_M4[0]) == 18.0); - assert(cimags(miscM3_mul_M4[1]) == 24.0); - assert(cimags(miscM3_mul_M4[2]) == 30.0); - assert(cimags(miscM3_mul_M4[3]) == 38.0); - assert(cimags(miscM3_mul_M4[4]) == 52.0); - assert(cimags(miscM3_mul_M4[5]) == 66.0); - assert(cimags(miscM3_mul_M4[6]) == 58.0); - assert(cimags(miscM3_mul_M4[7]) == 80.0); - assert(cimags(miscM3_mul_M4[8]) == 102.0); - -} - -static void smulmaTest(void) { - float M1[4] = {1.0f, 2.0f, 3.0f, 4.0f}; - float M2[4] = {1.0f, 2.0f, 3.0f, 4.0f}; - float M1_by_M2[4]; - float M3[4] = {1.0f, 0.0f, 1.0f, 0.0f}; - float M4[4] = {0.0f, 1.0f, 0.0f, 1.0f}; - float M3_by_M4[4]; - float M5[4] = {1.0f, 0.0f, 0.0f, 1.0f}; - float M6[4] = {42.0f, 51.0f, 69.0f, 1664.0f}; - float M5_by_M6[4]; - float M7[6] = {1.0f, 4.0f, 2.0f, 5.0f, 3.0f, 6.0f}; - float M8[6] = {1.0f, 3.0f, 5.0f, 2.0f, 4.0f, 6.0f}; - float M7_by_M8[4]; - float miscM7_by_M8[9]; - - int i = 0; - - printf("\n>>>> Matrix Float Multiplication Tests\n"); - /* - [ 1 3 ] * [ 1 3 ] = [ 7 15 ] - [ 2 4 ] [ 2 4 ] [10 22 ] - */ - smulma(M1, 2, 2, M2, 2, 2, M1_by_M2); - for (i = 0; i < 4; ++i) { - printf("M1_by_M2[%d] = %e\n", i, M1_by_M2[i]); - } - assert(M1_by_M2[0] == 7.0f); - assert(M1_by_M2[1] == 10.0f); - assert(M1_by_M2[2] == 15.0f); - assert(M1_by_M2[3] == 22.0f); - /* - [ 1 1 ] * [ 0 0 ] = [ 1 1 ] - [ 0 0 ] [ 1 1 ] [ 0 0 ] - */ - smulma(M3, 2, 2, M4, 2, 2, M3_by_M4); - for (i = 0; i < 4; ++i) { - printf("M3_by_M4[%d] = %e\n", i, M3_by_M4[i]); - } - assert(M3_by_M4[0] == 1.0f); - assert(M3_by_M4[1] == 0.0f); - assert(M3_by_M4[2] == 1.0f); - assert(M3_by_M4[3] == 0.0f); - - /* - [ 1 0 ] * [ 42 69 ] = [ 42 69 ] - [ 0 1 ] [ 51 1664 ] [ 51 1664 ] - */ - smulma(M5, 2, 2, M6, 2, 2, M5_by_M6); - for (i = 0; i < 4; ++i) { - printf("M5_by_M6[%d] = %e\n", i, M5_by_M6[i]); - } - assert(M5_by_M6[0] == 42.0f); - assert(M5_by_M6[1] == 51.0f); - assert(M5_by_M6[2] == 69.0f); - assert(M5_by_M6[3] == 1664.0f); - - /* - [ 1 2 3 ] * [ 1 2 ] = [ 22 28 ] - [ 4 5 6 ] [ 3 4 ] [ 49 64 ] - [ 5 6 ] - */ - smulma(M7, 2, 3, M8, 3, 2, M7_by_M8); - for (i = 0; i < 4; ++i) { - printf("M7_by_M8[%d] = %e\n", i, M7_by_M8[i]); - } - assert(M7_by_M8[0] == 22.0f); - assert(M7_by_M8[1] == 49.0f); - assert(M7_by_M8[2] == 28.0f); - assert(M7_by_M8[3] == 64.0f); - - /* - [ 1 5 ] * [ 1 5 4 ] = [ 16 15 34 ] - [ 4 3 ] [ 3 2 6 ] [ 13 26 34 ] - [ 2 6 ] [ 20 22 44 ] - */ - smulma(M7, 3, 2, M8, 2, 3, miscM7_by_M8); - for (i = 0; i < 9; ++i) { - printf("miscM7_by_M8[%d] = %e\n", i, miscM7_by_M8[i]); - } - assert(miscM7_by_M8[0] == 16.0f); - assert(miscM7_by_M8[1] == 13.0f); - assert(miscM7_by_M8[2] == 20.0f); - assert(miscM7_by_M8[3] == 15.0f); - assert(miscM7_by_M8[4] == 26.0f); - assert(miscM7_by_M8[5] == 22.0f); - assert(miscM7_by_M8[6] == 34.0f); - assert(miscM7_by_M8[7] == 34.0f); - assert(miscM7_by_M8[8] == 44.0f); - -} - -int testFloatMultiplication(void) { - - printf("\n>>>> Matrix Multiplication Tests\n"); - smulmaTest(); - cmulmaTest(); - - return 0; -} diff --git a/src/matrixOperations/testMatrixAddition.c b/src/matrixOperations/testMatrixAddition.c deleted file mode 100644 index ceb922b9..00000000 --- a/src/matrixOperations/testMatrixAddition.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 -#include -#include -#include -#include "matrixAddition.h" - -#define SIZE 10000 - -/* #define LOCAL_DEBUG */ - -static void zaddmaTest(void) { - doubleComplex M1[SIZE]; - doubleComplex M2[SIZE]; - doubleComplex M1_and_M2[SIZE]; - - int i = 0; - - srand(1); - for (i = 0; i < SIZE; ++i) { - M1[i] = DoubleComplex((double) rand(), (double) rand()); - M2[i] = DoubleComplex((double) rand(), (double) rand()); - } - zaddma(M1, SIZE, M2, SIZE, M1_and_M2); - for (i = 0; i < SIZE; ++i) { -#ifdef LOCAL_DEBUG - printf("M1_and_M2 = %e + %e i\n", zreals(M1_and_M2[i]), zimags(M1_and_M2[i])); -#endif - assert(zreals(M1_and_M2[i]) - (zreals(M1[i]) + zreals(M2[i])) == 0); - assert(zimags(M1_and_M2[i]) - (zimags(M1[i]) + zimags(M2[i])) == 0); - } -} - -static void caddmaTest(void) { - floatComplex M1[SIZE]; - floatComplex M2[SIZE]; - floatComplex M1_and_M2[SIZE]; - - int i = 0; - - srand(1); - for (i = 0; i < SIZE; ++i) { - M1[i] = FloatComplex((float) rand(), (float) rand()); - M2[i] = FloatComplex((float) rand(), (float) rand()); - } - caddma(M1, SIZE, M2, SIZE, M1_and_M2); - for (i = 0; i < SIZE; ++i) { -#ifdef LOCAL_DEBUG - printf("M1_and_M2 = %e + %e i\n", creals(M1_and_M2[i]), cimags(M1_and_M2[i])); -#endif - assert(fabsf(creals(M1_and_M2[i]) - (creals(M1[i]) + creals(M2[i]))) / creals(M1_and_M2[i]) < 1e-07); - assert(fabsf(cimags(M1_and_M2[i]) - (cimags(M1[i]) + cimags(M2[i]))) / cimags(M1_and_M2[i]) < 1e-07); - } -} - -static void saddmaTest(void) { - float M1[SIZE]; - float M2[SIZE]; - float M1_and_M2[SIZE]; - - int i = 0; - - srand(1); - for (i = 0; i < SIZE; ++i) { - M1[i] = (float) rand(); - M2[i] = (float) rand(); - } - saddma(M1, SIZE, M2, SIZE, M1_and_M2); - for (i = 0; i < SIZE; ++i) { -#ifdef LOCAL_DEBUG - printf("M1_and_M2 = %e\n", M1_and_M2[i]); - printf("M1[i] + M2[i] = %e\n", (M1[i] + M2[i])); - printf("Error = %e\n",(float) fabsf(M1_and_M2[i] - (M1[i] + M2[i])) / M1_and_M2[i]); -#endif - assert(fabsf(M1_and_M2[i] - (M1[i] + M2[i])) / M1_and_M2[i] < 1e-07); - } -} - -static void daddmaTest(void) { - double M1[SIZE]; - double M2[SIZE]; - double M1_and_M2[SIZE]; - - int i = 0; - - srand(1); - for (i = 0; i < SIZE; ++i) { - M1[i] = (double) rand(); - M2[i] = (double) rand(); - } - daddma(M1, SIZE, M2, SIZE, M1_and_M2); - for (i = 0; i < SIZE; ++i) { -#ifdef LOCAL_DEBUG - printf("M1_and_M2 = %e\n", M1_and_M2[i]); -#endif - assert(fabs(M1_and_M2[i] - (M1[i] + M2[i])) == 0); - } - -} - -static int testAddition(void) { - - printf("\n>>>> Matrix Addition Tests\n"); - saddmaTest(); - daddmaTest(); - caddmaTest(); - zaddmaTest(); - - return 0; -} - - - -int main(void) { - assert(testAddition() == 0); - return 0; -} diff --git a/src/matrixOperations/testMatrixSubtraction.c b/src/matrixOperations/testMatrixSubtraction.c deleted file mode 100644 index 5c30c4e0..00000000 --- a/src/matrixOperations/testMatrixSubtraction.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * 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 -#include -#include -#include -#include "matrixSubtraction.h" - -#define SIZE 10000 - -/* #define LOCAL_DEBUG */ - -static void zdiffmaTest(void) { - doubleComplex M1[SIZE]; - doubleComplex M2[SIZE]; - doubleComplex M1_but_M2[SIZE]; - - int i = 0; - - srand(1); - for (i = 0; i < SIZE; ++i) { - M1[i] = DoubleComplex((double) rand(), (double) rand()); - M2[i] = DoubleComplex((double) rand(), (double) rand()); - } - zdiffma(M1, SIZE, M2, SIZE, M1_but_M2); - for (i = 0; i < SIZE; ++i) { -#ifdef LOCAL_DEBUG - printf("M1_but_M2 = %e + %e i\n", zreals(M1_but_M2[i]), zimags(M1_but_M2[i])); -#endif - assert(zreals(M1_but_M2[i]) - (zreals(M1[i]) - zreals(M2[i])) == 0); - assert(zimags(M1_but_M2[i]) - (zimags(M1[i]) - zimags(M2[i])) == 0); - } -} - -static void cdiffmaTest(void) { - floatComplex M1[SIZE]; - floatComplex M2[SIZE]; - floatComplex M1_but_M2[SIZE]; - - int i = 0; - - srand(1); - for (i = 0; i < SIZE; ++i) { - M1[i] = FloatComplex((float) rand(), (float) rand()); - M2[i] = FloatComplex((float) rand(), (float) rand()); - } - cdiffma(M1, SIZE, M2, SIZE, M1_but_M2); - for (i = 0; i < SIZE; ++i) { -#ifdef LOCAL_DEBUG - printf("M1_but_M2 = %e + %e i\n", creals(M1_but_M2[i]), cimags(M1_but_M2[i])); -#endif - assert(fabsf(creals(M1_but_M2[i]) - (creals(M1[i]) - creals(M2[i]))) / creals(M1_but_M2[i]) < 1e-07); - assert(fabsf(cimags(M1_but_M2[i]) - (cimags(M1[i]) - cimags(M2[i]))) / cimags(M1_but_M2[i]) < 1e-07); - } -} - -static void sdiffmaTest(void) { - float M1[SIZE]; - float M2[SIZE]; - float M1_but_M2[SIZE]; - - int i = 0; - - srand(1); - for (i = 0; i < SIZE; ++i) { - M1[i] = (float) rand(); - M2[i] = (float) rand(); - } - sdiffma(M1, SIZE, M2, SIZE, M1_but_M2); - for (i = 0; i < SIZE; ++i) { -#ifdef LOCAL_DEBUG - printf("M1_but_M2 = %e\n", M1_but_M2[i]); - printf("M1[i] - M2[i] = %e\n", (M1[i] + M2[i])); - printf("Error = %e\n",(float) fabsf(M1_but_M2[i] - (M1[i] - M2[i])) / M1_but_M2[i]); -#endif - assert(fabsf(M1_but_M2[i] - (M1[i] - M2[i])) / M1_but_M2[i] < 1e-07); - } -} - -static void ddiffmaTest(void) { - double M1[SIZE]; - double M2[SIZE]; - double M1_but_M2[SIZE]; - - int i = 0; - - srand(1); - for (i = 0; i < SIZE; ++i) { - M1[i] = (double) rand(); - M2[i] = (double) rand(); - } - ddiffma(M1, SIZE, M2, SIZE, M1_but_M2); - for (i = 0; i < SIZE; ++i) { -#ifdef LOCAL_DEBUG - printf("M1_but_M2 = %e\n", M1_but_M2[i]); -#endif - assert(fabs(M1_but_M2[i] - (M1[i] - M2[i])) == 0); - } - -} - -static int testDiffition(void) { - - printf("\n>>>> Matrix Substraction Tests\n"); - sdiffmaTest(); - ddiffmaTest(); - cdiffmaTest(); - zdiffmaTest(); - - return 0; -} - - - -int main(void) { - assert(testDiffition() == 0); - return 0; -} -- cgit