From owner-svn-ports-head@freebsd.org Mon Apr 16 18:15:32 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D727F99CC2; Mon, 16 Apr 2018 18:15:32 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEA3A87E49; Mon, 16 Apr 2018 18:15:31 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B97AD20DBC; Mon, 16 Apr 2018 18:15:31 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3GIFVbk058662; Mon, 16 Apr 2018 18:15:31 GMT (envelope-from jwb@FreeBSD.org) Received: (from jwb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GIFVYq058656; Mon, 16 Apr 2018 18:15:31 GMT (envelope-from jwb@FreeBSD.org) Message-Id: <201804161815.w3GIFVYq058656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jwb set sender to jwb@FreeBSD.org using -f From: "Jason W. Bacon" Date: Mon, 16 Apr 2018 18:15:31 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r467501 - in head/science: . fsom fsom/files X-SVN-Group: ports-head X-SVN-Commit-Author: jwb X-SVN-Commit-Paths: in head/science: . fsom fsom/files X-SVN-Commit-Revision: 467501 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 18:15:32 -0000 Author: jwb Date: Mon Apr 16 18:15:30 2018 New Revision: 467501 URL: https://svnweb.freebsd.org/changeset/ports/467501 Log: fsom: Tiny C library for managing SOM (Self-Organizing Maps) neural networks Approved by: jrm (mentor) Differential Revision: https://reviews.freebsd.org/D15103 Added: head/science/fsom/ head/science/fsom/Makefile (contents, props changed) head/science/fsom/distinfo (contents, props changed) head/science/fsom/files/ head/science/fsom/files/Makefile (contents, props changed) head/science/fsom/files/patch-fsom.c (contents, props changed) head/science/fsom/pkg-descr (contents, props changed) Modified: head/science/Makefile Modified: head/science/Makefile ============================================================================== --- head/science/Makefile Mon Apr 16 18:14:54 2018 (r467500) +++ head/science/Makefile Mon Apr 16 18:15:30 2018 (r467501) @@ -53,6 +53,7 @@ SUBDIR += fastcap SUBDIR += fasthenry SUBDIR += fisicalab + SUBDIR += fsom SUBDIR += fvcom SUBDIR += fvcom-mpi SUBDIR += fvm Added: head/science/fsom/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/fsom/Makefile Mon Apr 16 18:15:30 2018 (r467501) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +PORTNAME= fsom +DISTVERSION= g20151117 +CATEGORIES= science + +MAINTAINER= jwb@FreeBSD.org +COMMENT= Tiny C library for managing SOM (Self-Organizing Maps) neural networks + +LICENSE= GPLv3 + +USE_GITHUB= yes +GH_ACCOUNT= ekg +GH_TAGNAME= 56695e1611d824cda97f08e932d25d08419170cd + +INSTALL_TARGET= install-strip + +PLIST_FILES= bin/fsom \ + include/fsom/convert.h \ + include/fsom/fsom.h \ + include/fsom/split.h \ + lib/libfsom.a + +MAKEFILE= ${FILESDIR}/Makefile + +.include Added: head/science/fsom/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/fsom/distinfo Mon Apr 16 18:15:30 2018 (r467501) @@ -0,0 +1,3 @@ +TIMESTAMP = 1523601004 +SHA256 (ekg-fsom-g20151117-56695e1611d824cda97f08e932d25d08419170cd_GH0.tar.gz) = 1ba3360985be781bb9f79d974705c86e7bb0719cb83638955e113b5dd83ec8dd +SIZE (ekg-fsom-g20151117-56695e1611d824cda97f08e932d25d08419170cd_GH0.tar.gz) = 9771 Added: head/science/fsom/files/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/fsom/files/Makefile Mon Apr 16 18:15:30 2018 (r467501) @@ -0,0 +1,52 @@ + +# Use ?= to allow overriding from the env or command-line, e.g. +# +# make CXXFLAGS="-O3 -fPIC" install +# +# Package managers will override many of these variables automatically, so +# this is aimed at making it easy to create packages (Debian packages, +# FreeBSD ports, MacPorts, pkgsrc, etc.) + +CXX ?= g++ +CXXFLAGS ?= -w -O3 -pipe -fomit-frame-pointer -ffast-math +AR ?= ar +MKDIR ?= mkdir +STRIP ?= strip +DESTDIR ?= stage +PREFIX ?= /usr/local + +BIN = fsom +LIB = libfsom.a +OBJS = fsom.o split.o +MAIN = main.o + +all: ${BIN} ${LIB} + +${BIN}: ${OBJS} ${MAIN} + ${CXX} -o fsom ${OBJS} ${MAIN} -lm + +${LIB}: ${OBJS} + ${AR} -rs ${LIB} ${OBJS} + +fsom.o: fsom.c + ${CXX} ${CXXFLAGS} -c fsom.c + +split.o: split.cpp + ${CXX} ${CXXFLAGS} -c split.cpp + +main.o: main.cpp + ${CXX} ${CXXFLAGS} -c main.cpp + +install: all + ${MKDIR} -p ${DESTDIR}${PREFIX}/bin + ${MKDIR} -p ${DESTDIR}${PREFIX}/include/fsom + ${MKDIR} -p ${DESTDIR}${PREFIX}/lib + ${INSTALL} ${BIN} ${DESTDIR}${PREFIX}/bin + ${INSTALL} *.h ${DESTDIR}${PREFIX}/include/fsom + ${INSTALL} ${LIB} ${DESTDIR}${PREFIX}/lib + +install-strip: install + ${STRIP} ${DESTDIR}${PREFIX}/bin/${BIN} + +clean: + rm -rf *.o ${BIN} ${LIB} ${DESTDIR} Added: head/science/fsom/files/patch-fsom.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/fsom/files/patch-fsom.c Mon Apr 16 18:15:30 2018 (r467501) @@ -0,0 +1,26 @@ +--- fsom.c.orig 2015-11-21 16:35:06 UTC ++++ fsom.c +@@ -31,6 +31,10 @@ + #define M_E 2.7182818284590452354 + #endif + ++#ifndef ABS ++#define ABS(x) ((x) < 0 ? -(x) : (x)) ++#endif ++ + /** + * \brief Create a new synapsis between two neurons + * \param input_neuron Input neuron for the synapsis +@@ -591,10 +595,10 @@ som_train_iteration ( som_network_t *net + som_neuron_t *neuron; + for ( i=0; i < net->output_layer->neurons_rows; ++i ) + { +- dist_i = abs( x - i ); ++ dist_i = ABS( x - i ); + for ( j=0; j < net->output_layer->neurons_cols; ++j ) + { +- dist = pow( dist_i + abs ( y - j ), 4 ); ++ dist = pow( dist_i + ABS ( y - j ), 4 ); + inv_dist = (1.0 / ((double) dist + 1)) * l_rate; + neuron = net->output_layer->neurons[i][j]; + for ( k=0; k < net->input_layer->neurons_count; ++k ) Added: head/science/fsom/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/fsom/pkg-descr Mon Apr 16 18:15:30 2018 (r467501) @@ -0,0 +1,6 @@ +FSOM is a tiny C library for managing SOM (Self-Organizing Maps) neural +networks, a type of artificial neural network (ANN) that is trained using +unsupervised learning to produce a low-dimensional (typically two-dimensional), +discretized representation of the input space of the training samples. + +WWW: https://github.com/ekg/fsom