();
layers.add(Layer.create(2));
layers.add(Layer.create(3, ActivationFunction.FANN_SIGMOID_SYMMETRIC));
layers.add(Layer.create(1, ActivationFunction.FANN_SIGMOID_SYMMETRIC));
Fann fann = new Fann(layers);
Trainer trainer = new Trainer(fann);
float desiredError = .001f;
float mse = trainer.train(trainingFile.getFile(), 500000, 1000, desiredError);
assertTrue("" + mse, mse <= desiredError);
}
}
fannj-0.3/src/test/java/com/googlecode/fannj/FannTest.java 0000644 0001751 0001751 00000003011 11510717501 022752 0 ustar daniel daniel /* FannJ
* Copyright (C) 2009 Kyle Renfro
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. The text of license can be also found
* at http://www.gnu.org/copyleft/lgpl.html
*/
package com.googlecode.fannj;
import static org.junit.Assert.*;
import java.net.URL;
import org.junit.Test;
import com.googlecode.fannj.Fann;
public class FannTest {
@Test
public void testFromFile() {
URL fannFile = this.getClass().getResource("xor_float.net");
Fann fann = new Fann(fannFile.getFile());
assertEquals(2, fann.getNumInputNeurons());
assertEquals(1, fann.getNumOutputNeurons());
assertEquals(-1f, fann.run(new float[] { -1, -1 })[0], .2f);
assertEquals(1f, fann.run(new float[] { -1, 1 })[0], .2f);
assertEquals(1f, fann.run(new float[] { 1, -1 })[0], .2f);
assertEquals(-1f, fann.run(new float[] { 1, 1 })[0], .2f);
fann.close();
}
}
fannj-0.3/src/test/resources/ 0000755 0001751 0001751 00000000000 11510716506 015506 5 ustar daniel daniel fannj-0.3/src/test/resources/com/ 0000755 0001751 0001751 00000000000 11510716506 016264 5 ustar daniel daniel fannj-0.3/src/test/resources/com/googlecode/ 0000755 0001751 0001751 00000000000 11510716506 020373 5 ustar daniel daniel fannj-0.3/src/test/resources/com/googlecode/fannj/ 0000755 0001751 0001751 00000000000 11510716506 021467 5 ustar daniel daniel fannj-0.3/src/test/resources/com/googlecode/fannj/xor_float.net 0000644 0001751 0001751 00000003655 11510716506 024205 0 ustar daniel daniel FANN_FLO_2.1
num_layers=3
learning_rate=0.700000
connection_rate=1.000000
network_type=0
learning_momentum=0.000000
training_algorithm=2
train_error_function=1
train_stop_function=0
cascade_output_change_fraction=0.010000
quickprop_decay=-0.000100
quickprop_mu=1.750000
rprop_increase_factor=1.200000
rprop_decrease_factor=0.500000
rprop_delta_min=0.000000
rprop_delta_max=50.000000
rprop_delta_zero=0.100000
cascade_output_stagnation_epochs=12
cascade_candidate_change_fraction=0.010000
cascade_candidate_stagnation_epochs=12
cascade_max_out_epochs=150
cascade_min_out_epochs=50
cascade_max_cand_epochs=150
cascade_min_cand_epochs=50
cascade_num_candidate_groups=2
bit_fail_limit=3.49999994039535522461e-01
cascade_candidate_limit=1.00000000000000000000e+03
cascade_weight_multiplier=4.00000005960464477539e-01
cascade_activation_functions_count=10
cascade_activation_functions=3 5 7 8 10 11 14 15 16 17
cascade_activation_steepnesses_count=4
cascade_activation_steepnesses=2.50000000000000000000e-01 5.00000000000000000000e-01 7.50000000000000000000e-01 1.00000000000000000000e+00
layer_sizes=3 4 2
scale_included=0
neurons (num_inputs, activation_function, activation_steepness)=(0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (3, 5, 5.00000000000000000000e-01) (3, 5, 5.00000000000000000000e-01) (3, 5, 5.00000000000000000000e-01) (0, 5, 0.00000000000000000000e+00) (4, 5, 5.00000000000000000000e-01) (0, 5, 0.00000000000000000000e+00)
connections (connected_to_neuron, weight)=(0, 1.56679540872573852539e-01) (1, 1.41569795608520507812e+01) (2, -3.47512066364288330078e-01) (0, 3.67083859443664550781e+00) (1, 3.44155287742614746094e+00) (2, -3.74218344688415527344e+00) (0, -3.74604201316833496094e+00) (1, 4.68244743347167968750e+00) (2, 4.03903436660766601562e+00) (3, 6.36722135543823242188e+00) (4, -6.89247274398803710938e+00) (5, -6.92980480194091796875e+00) (6, 5.17488382756710052490e-02)
fannj-0.3/src/test/resources/com/googlecode/fannj/xor.data 0000644 0001751 0001751 00000000044 11510716506 023130 0 ustar daniel daniel 4 2 1
-1 -1
-1
-1 1
1
1 -1
1
1 1
-1
fannj-0.3/src/test/resources/com/googlecode/fannj/jna/ 0000755 0001751 0001751 00000000000 11510716506 022237 5 ustar daniel daniel fannj-0.3/src/test/resources/com/googlecode/fannj/jna/xor.data 0000644 0001751 0001751 00000000044 11510716506 023700 0 ustar daniel daniel 4 2 1
-1 -1
-1
-1 1
1
1 -1
1
1 1
-1
fannj-0.3/src/main/ 0000755 0001751 0001751 00000000000 11510716506 013441 5 ustar daniel daniel fannj-0.3/src/main/java/ 0000755 0001751 0001751 00000000000 11510716506 014362 5 ustar daniel daniel fannj-0.3/src/main/java/com/ 0000755 0001751 0001751 00000000000 11510716506 015140 5 ustar daniel daniel fannj-0.3/src/main/java/com/googlecode/ 0000755 0001751 0001751 00000000000 11510716506 017247 5 ustar daniel daniel fannj-0.3/src/main/java/com/googlecode/fannj/ 0000755 0001751 0001751 00000000000 11510716506 020343 5 ustar daniel daniel fannj-0.3/src/main/java/com/googlecode/fannj/ActivationFunction.java 0000644 0001751 0001751 00000002744 11510717501 025020 0 ustar daniel daniel /* FannJ
* Copyright (C) 2009 Kyle Renfro
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. The text of license can be also found
* at http://www.gnu.org/copyleft/lgpl.html
*/
package com.googlecode.fannj;
public enum ActivationFunction {
/* The order these appear must match the order in the FANN src! */
FANN_LINEAR, FANN_THRESHOLD, FANN_THRESHOLD_SYMMETRIC, FANN_SIGMOID, FANN_SIGMOID_STEPWISE, FANN_SIGMOID_SYMMETRIC, FANN_SIGMOID_SYMMETRIC_STEPWISE, FANN_GAUSSIAN, FANN_GAUSSIAN_SYMMETRIC,
/*
* Stepwise linear approximation to gaussian. Faster than gaussian but a bit
* less precise. NOT implemented yet.
*/
FANN_GAUSSIAN_STEPWISE, FANN_ELLIOT, FANN_ELLIOT_SYMMETRIC, FANN_LINEAR_PIECE, FANN_LINEAR_PIECE_SYMMETRIC, FANN_SIN_SYMMETRIC, FANN_COS_SYMMETRIC, FANN_SIN, FANN_COS
}
fannj-0.3/src/main/java/com/googlecode/fannj/FannShortcut.java 0000644 0001751 0001751 00000003036 11510717502 023623 0 ustar daniel daniel /* FannJ
* Copyright (C) 2009 Kyle Renfro
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. The text of license can be also found
* at http://www.gnu.org/copyleft/lgpl.html
*/
package com.googlecode.fannj;
import java.util.List;
/**
*
* A standard backpropagation neural network, which is not fully connected and
* which also has shortcut connections.
*
*
* @author krenfro
*/
public class FannShortcut extends Fann {
public FannShortcut(List layers) {
super();
if (layers == null)
throw new IllegalArgumentException("layers == null");
if (layers.size() == 0)
throw new IllegalArgumentException("layers is empty");
int[] neurons = new int[layers.size()];
for (int x = 0; x < neurons.length; x++)
neurons[x] = layers.get(x).size();
ann = fann_create_shortcut_array(neurons.length, neurons);
addLayers(layers);
}
}
fannj-0.3/src/main/java/com/googlecode/fannj/FannSparse.java 0000644 0001751 0001751 00000003362 11510717502 023247 0 ustar daniel daniel /* FannJ
* Copyright (C) 2009 Kyle Renfro
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. The text of license can be also found
* at http://www.gnu.org/copyleft/lgpl.html
*/
package com.googlecode.fannj;
import java.util.List;
/**
*
* A standard backpropagation neural network, which is not fully connected.
*
*
* @author krenfro
*/
public class FannSparse extends Fann {
public static final float DEFAULT_CONNECTION_RATE = 1f;
float connectionRate = 1f;
public FannSparse(List layers) {
this(DEFAULT_CONNECTION_RATE, layers);
}
public FannSparse(float connectionRate, List layers) {
super();
if (layers == null)
throw new IllegalArgumentException("layers == null");
if (layers.size() == 0)
throw new IllegalArgumentException("layers is empty");
this.connectionRate = connectionRate;
int[] neurons = new int[layers.size()];
for (int x = 0; x < neurons.length; x++)
neurons[x] = layers.get(x).size();
ann = fann_create_sparse_array(connectionRate, neurons.length, neurons);
addLayers(layers);
}
}
fannj-0.3/src/main/java/com/googlecode/fannj/Fann.java 0000644 0001751 0001751 00000011755 11510717501 022075 0 ustar daniel daniel /* FannJ
* Copyright (C) 2009 Kyle Renfro
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. The text of license can be also found
* at http://www.gnu.org/copyleft/lgpl.html
*/
package com.googlecode.fannj;
import java.util.List;
import com.sun.jna.Native;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
/**
*
* A standard fully connected back-propagation neural network.
*
*
* Not thread safe.
*
* A Java binding to the Fast Artificial Neural Network (FANN) native library.
*
* This class invokes native code. You must call close() to prevent memory
* leakage.
*
*
* @author krenfro
* @see Fast Artificial Neural Network
* @see JNA Direct Maping
*/
public class Fann {
static {
Native.register(Platform.isWindows() ? "fannfloat" : "fann");
}
protected Pointer ann;
protected Fann() {
}
/**
* Load an existing FANN definition from a file
*
* @param file
*/
public Fann(String file) {
ann = fann_create_from_file(file);
}
/**
* Create a new ANN with the provided layers.
*
* @param layers
*/
public Fann(List layers) {
if (layers == null)
throw new IllegalArgumentException("layers == null");
if (layers.size() == 0)
throw new IllegalArgumentException("layers is empty");
int[] neurons = new int[layers.size()];
for (int x = 0; x < neurons.length; x++)
neurons[x] = layers.get(x).size();
ann = fann_create_standard_array(neurons.length, neurons);
addLayers(layers);
}
protected void addLayers(List layers) {
for (int x = 1; x < layers.size(); x++) {
Layer layer = layers.get(x);
for (int n = 0; n < layer.size(); n++) {
fann_set_activation_function(ann, layer.get(n).getActivationFunction().ordinal(),
x, n);
fann_set_activation_steepness(ann, layer.get(n).getSteepness(), x, n);
}
}
}
public int getNumInputNeurons() {
return fann_get_num_input(ann);
}
public int getNumOutputNeurons() {
return fann_get_num_output(ann);
}
public int getTotalNumNeurons() {
return fann_get_total_neurons(ann);
}
/**
* Save this FANN to a file.
*
* @param file
* @return true on success
*/
public boolean save(String file) {
return fann_save(ann, file) == 0;
}
/**
* Run the ANN on a set of inputs.
*
* @param input
* length == numInputNeurons
* @return the output of the ANN. (length = numOutputNeurons)
*/
public float[] run(float[] input) {
Pointer result = fann_run(ann, input);
float[] output = result.getFloatArray(0, 1);
return output;
}
/**
*
* Frees allocated memory.
*
* You must call this method when you are finished to prevent memory leaks.
*/
public void close() {
if (ann != null)
fann_destroy(ann);
}
/*
* A JNA Direct Mapping implementation of the FANN library. This instance
* should be more performant than #com.googlecode.fannj.jna.FannLibrary
*/
protected static native Pointer fann_create_standard_array(int numLayers, int[] layers);
protected static native Pointer fann_create_sparse_array(float connection_rate, int numLayers,
int[] layers);
protected static native Pointer fann_create_shortcut_array(int numLayers, int[] layers);
protected static native float fann_get_MSE(Pointer ann);
protected static native Pointer fann_run(Pointer ann, float[] input);
protected static native void fann_destroy(Pointer ann);
protected static native int fann_get_num_input(Pointer ann);
protected static native int fann_get_num_output(Pointer ann);
protected static native int fann_get_total_neurons(Pointer ann);
protected static native void fann_set_activation_function(Pointer ann, int activation_function,
int layer, int neuron);
protected static native void fann_set_activation_steepness(Pointer ann, float steepness,
int layer, int neuron);
protected static native Pointer fann_get_neuron(Pointer ann, int layer, int neuron);
protected static native Pointer fann_create_from_file(String configuration_file);
protected static native int fann_save(Pointer ann, String file);
}
fannj-0.3/src/main/java/com/googlecode/fannj/Neuron.java 0000644 0001751 0001751 00000005740 11510717502 022457 0 ustar daniel daniel /* FannJ
* Copyright (C) 2009 Kyle Renfro
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. The text of license can be also found
* at http://www.gnu.org/copyleft/lgpl.html
*/
package com.googlecode.fannj;
/**
* @author krenfro
*/
public class Neuron {
public static final ActivationFunction DEFAULT_ACTIVATION_FUNCTION = ActivationFunction.FANN_SIGMOID_STEPWISE;
public static final float DEFAULT_ACTIVATION_STEEPNESS = .5f;
ActivationFunction activationFunction;
float steepness;
/**
* Create a neuron with default activation function: FANN_SIGMOID_STEPWISE
* and activation steepness = .5
*/
public Neuron() {
this(DEFAULT_ACTIVATION_FUNCTION);
}
/**
* Create a neuron with the specified activation function and default
* activation steepness = .5
*
* @param activationFunction
*/
public Neuron(ActivationFunction activationFunction) {
this(DEFAULT_ACTIVATION_FUNCTION, DEFAULT_ACTIVATION_STEEPNESS);
}
/**
* Create a neuron with the specified activation function and steepness.
*
* @param activationFunction
* @param steepness
*/
public Neuron(ActivationFunction activationFunction, float steepness) {
if (activationFunction == null)
throw new IllegalArgumentException("activationFunction is null");
this.activationFunction = activationFunction;
this.steepness = steepness;
}
public float getSteepness() {
return steepness;
}
public ActivationFunction getActivationFunction() {
return activationFunction;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((activationFunction == null) ? 0 : activationFunction.hashCode());
result = prime * result + Float.floatToIntBits(steepness);
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Neuron other = (Neuron) obj;
if (activationFunction == null) {
if (other.activationFunction != null)
return false;
} else if (!activationFunction.equals(other.activationFunction))
return false;
if (Float.floatToIntBits(steepness) != Float.floatToIntBits(other.steepness))
return false;
return true;
}
}
fannj-0.3/src/main/java/com/googlecode/fannj/Trainer.java 0000644 0001751 0001751 00000003372 11510717501 022613 0 ustar daniel daniel /* FannJ
* Copyright (C) 2009 Kyle Renfro
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. The text of license can be also found
* at http://www.gnu.org/copyleft/lgpl.html
*/
package com.googlecode.fannj;
import com.sun.jna.Native;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
/**
* Trains an ANN. Currently only File based training is supported.
*
* @author krenfro
*/
public class Trainer {
static {
Native.register(Platform.isWindows() ? "fann" : "fann");
}
Fann fann;
public Trainer(Fann fann) {
this.fann = fann;
}
public float train(String trainingFile, int maxEpochs, int epochsBetweenReports,
float desiredError) {
fann_train_on_file(fann.ann, trainingFile, maxEpochs, epochsBetweenReports, desiredError);
return fann_get_MSE(fann.ann);
}
/* A JNA Direct Mapping implementation of the FANN library. */
protected static native void fann_train_on_file(Pointer ann, String filename, int max_epochs,
int epochs_between_reports, float desired_error);
protected static native float fann_get_MSE(Pointer ann);
}
fannj-0.3/src/main/java/com/googlecode/fannj/Layer.java 0000644 0001751 0001751 00000004722 11510717501 022263 0 ustar daniel daniel /* FannJ
* Copyright (C) 2009 Kyle Renfro
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. The text of license can be also found
* at http://www.gnu.org/copyleft/lgpl.html
*/
package com.googlecode.fannj;
import java.util.ArrayList;
/**
* A Layer of Neurons in an ANN.
*
* @author krenfro
*/
public class Layer extends ArrayList {
private static final long serialVersionUID = -6467294440860703773L;
/**
* Create a Layer with the specified number of neurons with the default
* Activation Function: {@link Neuron.DEFAULT_ACTIVATION_FUNCTION} with
* steepness: {@link Neuron.DEFAULT_ACTIVATION_STEEPNESS}
*
* @param numNeurons
* @return
*/
public static Layer create(int numNeurons) {
return create(numNeurons, Neuron.DEFAULT_ACTIVATION_FUNCTION,
Neuron.DEFAULT_ACTIVATION_STEEPNESS);
}
/**
* Create a Layer with the specified number of neruons and a particular
* ActivationFunction with the steepness:
* {@link Neuron.DEFAULT_ACTIVATION_STEEPNESS}
*
* @param numNeurons
* @param activationFunction
* @return
*/
public static Layer create(int numNeurons, ActivationFunction activationFunction) {
return create(numNeurons, activationFunction, Neuron.DEFAULT_ACTIVATION_STEEPNESS);
}
/**
* Create a Layer with the specified number of neruons and a particular
* ActivationFunction with specified steepness
*
* @param numNeurons
* @param activationFunction
* @param steepness
* @return
*/
public static Layer create(int numNeurons, ActivationFunction activationFunction,
float steepness) {
Layer layer = new Layer();
for (int i = 0; i < numNeurons; i++)
layer.add(new Neuron(activationFunction, steepness));
return layer;
}
}
fannj-0.3/COPYING.LESSER 0000644 0001751 0001751 00000016743 11510717005 013763 0 ustar daniel daniel GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.