Fixes to Octave examples

- rename example modules from "example" to "swigexample", to avoid a
  warning from shadowing the Octave built-in function "example"
- remove deprecated "static" Makefile targets: there is no longer
  an option to build static Octave modules in the Examples Makefile
- emacs whitespace cleanup run on all files
This commit is contained in:
Karl Wette 2013-05-08 22:43:49 +02:00 • committed by william
commit c28d0c6c80
63 changed files with 211 additions and 345 deletions

View file

@ -1,10 +1,10 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS =
TARGET = example
CXXSRCS =
TARGET = swigexample
INTERFACE = example.i
LIBS = -lm
SWIGOPT =
SWIGOPT =
check: build
$(MAKE) -f $(TOP)/Makefile octave_run
@ -13,9 +13,5 @@ build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myoctave' INTERFACE='$(INTERFACE)' octave_cpp_static
clean:
$(MAKE) -f $(TOP)/Makefile octave_clean

View file

@ -29,4 +29,3 @@ template<class T> class vector {
}
#endif
};

View file

@ -1,5 +1,5 @@
/* File : example.i */
%module example
%module swigexample
%{
#include "example.h"
@ -14,4 +14,3 @@
%template(maxdouble) max<double>;
%template(vecint) vector<int>;
%template(vecdouble) vector<double>;

View file

@ -1,15 +1,15 @@
# file: runme.m
example
swigexample
# Call some templated functions
example.maxint(3,7)
example.maxdouble(3.14,2.18)
swigexample.maxint(3,7)
swigexample.maxdouble(3.14,2.18)
# Create some class
iv = example.vecint(100)
dv = example.vecdouble(1000)
iv = swigexample.vecint(100)
dv = swigexample.vecdouble(1000)
for i=0:99,
iv.setitem(i,2*i);
@ -33,5 +33,3 @@ sum
clear iv
clear dv