diff options
author | jofret | 2007-04-20 08:47:10 +0000 |
---|---|---|
committer | jofret | 2007-04-20 08:47:10 +0000 |
commit | 253684509ac9a972c5211feb256b8d7c5f8b2051 (patch) | |
tree | f86b1af364a96162b082290151f7cdd5d00086ea /src/elementaryFunctions/sqrt | |
parent | 6faf9cc3c16557c5dbfa4f096b6b34f594fe1fd0 (diff) | |
download | scilab2c-253684509ac9a972c5211feb256b8d7c5f8b2051.tar.gz scilab2c-253684509ac9a972c5211feb256b8d7c5f8b2051.tar.bz2 scilab2c-253684509ac9a972c5211feb256b8d7c5f8b2051.zip |
Square Root begin implementation.
Diffstat (limited to 'src/elementaryFunctions/sqrt')
-rw-r--r-- | src/elementaryFunctions/sqrt/Makefile.am | 23 | ||||
-rw-r--r-- | src/elementaryFunctions/sqrt/Makefile.in | 142 | ||||
-rw-r--r-- | src/elementaryFunctions/sqrt/dsqrts.c | 18 | ||||
-rw-r--r-- | src/elementaryFunctions/sqrt/ssqrts.c | 18 |
4 files changed, 190 insertions, 11 deletions
diff --git a/src/elementaryFunctions/sqrt/Makefile.am b/src/elementaryFunctions/sqrt/Makefile.am index 677a7185..fb8bfba0 100644 --- a/src/elementaryFunctions/sqrt/Makefile.am +++ b/src/elementaryFunctions/sqrt/Makefile.am @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Fri Jan 5 10:19:16 2007 jofret -## Last update Sun Mar 25 20:57:17 2007 bruno +## Last update Fri Apr 20 10:54:14 2007 jofret ## ## Copyright INRIA 2007 ## @@ -31,3 +31,24 @@ SRC = ssqrts.c \ zsqrta.c HEAD = ../includes/sqrt.h + +#### +# Checking Part +#### + +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +check_PROGRAMS = testSqrt + +TESTS = testSqrt + +# +# -*- Square Root Tests -*- +# +testSqrt_SOURCES = testSqrt.c +testSqrt_CFLAGS = $(check_INCLUDES) +testSqrt_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSqrt.a \ + @LIBMATH@ diff --git a/src/elementaryFunctions/sqrt/Makefile.in b/src/elementaryFunctions/sqrt/Makefile.in index f3429433..97910ada 100644 --- a/src/elementaryFunctions/sqrt/Makefile.in +++ b/src/elementaryFunctions/sqrt/Makefile.in @@ -36,6 +36,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +check_PROGRAMS = testSqrt$(EXEEXT) subdir = elementaryFunctions/sqrt DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -65,6 +66,11 @@ am__objects_2 = ssqrts.$(OBJEXT) dsqrts.$(OBJEXT) csqrts.$(OBJEXT) \ csqrta.$(OBJEXT) zsqrta.$(OBJEXT) am_libSqrt_a_OBJECTS = $(am__objects_1) $(am__objects_2) libSqrt_a_OBJECTS = $(am_libSqrt_a_OBJECTS) +am_testSqrt_OBJECTS = testSqrt-testSqrt.$(OBJEXT) +testSqrt_OBJECTS = $(am_testSqrt_OBJECTS) +testSqrt_DEPENDENCIES = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSqrt.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/includes depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -72,8 +78,8 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libSqrt_a_SOURCES) -DIST_SOURCES = $(libSqrt_a_SOURCES) +SOURCES = $(libSqrt_a_SOURCES) $(testSqrt_SOURCES) +DIST_SOURCES = $(libSqrt_a_SOURCES) $(testSqrt_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -189,6 +195,25 @@ SRC = ssqrts.c \ zsqrta.c HEAD = ../includes/sqrt.h + +#### +# Checking Part +#### +check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/type + +TESTS = testSqrt + +# +# -*- Square Root Tests -*- +# +testSqrt_SOURCES = testSqrt.c +testSqrt_CFLAGS = $(check_INCLUDES) +testSqrt_LDADD = $(top_builddir)/lib/libDoubleComplex.a \ + $(top_builddir)/lib/libFloatComplex.a \ + $(top_builddir)/lib/libSqrt.a \ + @LIBMATH@ + all: all-am .SUFFIXES: @@ -259,6 +284,12 @@ libSqrt.a: $(libSqrt_a_OBJECTS) $(libSqrt_a_DEPENDENCIES) $(libSqrt_a_AR) libSqrt.a $(libSqrt_a_OBJECTS) $(libSqrt_a_LIBADD) $(RANLIB) libSqrt.a +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +testSqrt$(EXEEXT): $(testSqrt_OBJECTS) $(testSqrt_DEPENDENCIES) + @rm -f testSqrt$(EXEEXT) + $(LINK) $(testSqrt_LDFLAGS) $(testSqrt_OBJECTS) $(testSqrt_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -271,6 +302,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsqrts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssqrta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssqrts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSqrt-testSqrt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zsqrta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zsqrts.Po@am__quote@ @@ -287,6 +319,20 @@ distclean-compile: @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) '$<'` + +testSqrt-testSqrt.o: testSqrt.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testSqrt_CFLAGS) $(CFLAGS) -MT testSqrt-testSqrt.o -MD -MP -MF "$(DEPDIR)/testSqrt-testSqrt.Tpo" -c -o testSqrt-testSqrt.o `test -f 'testSqrt.c' || echo '$(srcdir)/'`testSqrt.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testSqrt-testSqrt.Tpo" "$(DEPDIR)/testSqrt-testSqrt.Po"; else rm -f "$(DEPDIR)/testSqrt-testSqrt.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testSqrt.c' object='testSqrt-testSqrt.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) $(testSqrt_CFLAGS) $(CFLAGS) -c -o testSqrt-testSqrt.o `test -f 'testSqrt.c' || echo '$(srcdir)/'`testSqrt.c + +testSqrt-testSqrt.obj: testSqrt.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testSqrt_CFLAGS) $(CFLAGS) -MT testSqrt-testSqrt.obj -MD -MP -MF "$(DEPDIR)/testSqrt-testSqrt.Tpo" -c -o testSqrt-testSqrt.obj `if test -f 'testSqrt.c'; then $(CYGPATH_W) 'testSqrt.c'; else $(CYGPATH_W) '$(srcdir)/testSqrt.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/testSqrt-testSqrt.Tpo" "$(DEPDIR)/testSqrt-testSqrt.Po"; else rm -f "$(DEPDIR)/testSqrt-testSqrt.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testSqrt.c' object='testSqrt-testSqrt.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) $(testSqrt_CFLAGS) $(CFLAGS) -c -o testSqrt-testSqrt.obj `if test -f 'testSqrt.c'; then $(CYGPATH_W) 'testSqrt.c'; else $(CYGPATH_W) '$(srcdir)/testSqrt.c'; fi` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -337,6 +383,79 @@ 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; \ + 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 \ + *" $$tst "*) \ + 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 \ + *" $$tst "*) \ + 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'`; \ @@ -365,6 +484,8 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) installdirs: @@ -397,8 +518,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-instLIBRARIES clean-noinstLIBRARIES \ - mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -445,12 +566,13 @@ ps-am: uninstall-am: uninstall-info-am uninstall-instLIBRARIES -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-instLIBRARIES clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-instLIBRARIES install-man \ +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-instLIBRARIES \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-instLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ diff --git a/src/elementaryFunctions/sqrt/dsqrts.c b/src/elementaryFunctions/sqrt/dsqrts.c index e69de29b..59a11f53 100644 --- a/src/elementaryFunctions/sqrt/dsqrts.c +++ b/src/elementaryFunctions/sqrt/dsqrts.c @@ -0,0 +1,18 @@ +/* +** -*- C -*- +** +** dsqrts.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Apr 20 10:59:31 2007 jofret +** Last update Fri Apr 20 11:00:09 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include "sqrt.h" + +double dsqrts(double in){ + /* FIXME : Implementation */ + return 0; +} diff --git a/src/elementaryFunctions/sqrt/ssqrts.c b/src/elementaryFunctions/sqrt/ssqrts.c index e69de29b..431269c4 100644 --- a/src/elementaryFunctions/sqrt/ssqrts.c +++ b/src/elementaryFunctions/sqrt/ssqrts.c @@ -0,0 +1,18 @@ +/* +** -*- C -*- +** +** ssqrts.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Apr 20 10:57:05 2007 jofret +** Last update Fri Apr 20 10:58:54 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include "sqrt.h" + +float ssqrts(float in) { + /* FIXME : Implementation */ + return 0; +} |