spis.Util.Table
Class FloatScalTable

java.lang.Object
  extended byspis.Util.Table.Table
      extended byspis.Util.Table.ScalTable
          extended byspis.Util.Table.FloatScalTable
All Implemented Interfaces:
java.io.Serializable

public class FloatScalTable
extends ScalTable
implements java.io.Serializable

Class Name : FloatScalTable
Project ref : SPIS project
File name : FloatScalTable.java
File type : class
Copyright : ONERA, 2 Av. E. Belin, 31055 Toulouse cedex, France http://www.onecert.fr
Status : under development
Creation : 25/08/2003
Modification :

Description : Table of float scalars (i.e. 1 column).

Versions and anomalies correction :

Version numberAuthor (name, e-mail) Corrections/Modifications
0.1 JF Roussel, roussel@onecert.frCreation


Version:
0.1
Author:
JF Roussel
See Also:
Serialized Form

Field Summary
protected  float[] val
          table scalar values
 
Fields inherited from class spis.Util.Table.Table
dim, increment
 
Constructor Summary
FloatScalTable()
          Default constructor
FloatScalTable(float[] values)
          Constructor with data
FloatScalTable(float[] values, int tableDimension)
          Constructor with full data
Values must be at least of dimension [length] (checked)
FloatScalTable(float x, int tableDimension)
          Constructor of a constant table with value x and dimension tableDimension
FloatScalTable(FloatScalTable t)
          Copy constructor (the new table is dimensioned to its useful size, it can be a way to reduce the dimension of a table to what is useful)
FloatScalTable(int dim)
          Basic constructor: logical dimension dim
 
Method Summary
 void add(FloatScalTable t)
          Increments the current table by the passed table.
 void addData(float x)
          adds value x at the end of the table, of which size increase by one (data are preserved)
 void applyFunc(ScalFunctionOfScal f)
          Applies a function to this table (on the spot)
 float computeTableAverage()
          Returns the average of the Table values.
 float computeTableL2Norm()
          Returns the L2 norm of the Table: sqrt(sum values^2).
 float computeTableLInfNorm()
          Returns the L-infinity norm of the Table: max(abs(val[i]).
 float computeTableQuadraticAverage()
          Returns the table quadratic average: sqrt((sum values^2) / numberOfValues).
 float computeTableSum()
          Returns the sum of the Table values.
 void concat(float[] f)
          concatenates this table with the passed array
 void concat(float[] f, int length)
          concatenates this table with the first 'length' values of the passed array (f[0:length-1])
 void concat(FloatScalTable t)
          concatenates this table with the passed table
 void divide(FloatScalTable table)
          Divides this table by another table (on the spot)
 void equalFunc(ScalFunctionOfScal f, FloatScalTable x)
          Applies a function to the argument table and affects the result to this table.
 float getEl(int n)
           
 float[] getValues()
          Returns the table values
 void linComb(float a1, FloatScalTable t, float a2)
          Performs the following linear comination on this table: this = a1 this + a2 t.
 void mult(float factor)
          Multiplies this table by a scalar (on the spot)
 void mult(FloatScalTable table)
          Multiplies this table by another table (on the spot)
 void mult(FloatScalTable table, float factor)
          Multiplies this table by another table and a scalar (on the spot)
 void print()
           
 void randomize(float max)
          Fills the table with random numbers between 0 and max
 void reset()
          Sets this table to zero value (dimension unchanged)
 FloatScalTable returnAdd(FloatScalTable t)
          Adds the current table and the passed table and returns the sum as a new table.
 FloatScalTable returnDivide(FloatScalTable table)
          Divides this table by another table and returns the result as a new table
 FloatScalTable returnLinComb(float a1, FloatScalTable t, float a2)
          Returns the following linear comination as a new table: a1 this + a2 t.
 FloatScalTable returnMult(float factor)
          Multiplies this table by a scalar and returns the result as a new table
 FloatScalTable returnMult(FloatScalTable table)
          Multiplies this table by another table and returns the result as a new table
 FloatScalTable returnMult(FloatScalTable table, float factor)
          Multiplies this table by another table and returns the result as a new table
 FloatScalTable returnSubstract(FloatScalTable t)
          Substract the passed table from the current table and returns the result as a new table.
 void set(float value)
          Sets table value (uniform)
 void set(float value, int dim)
           
 void set(FloatScalTable inTable)
          Copies the values of the passed table onto this table (same dimension requested and checked)
 void set(FloatScalTable inTable1, FloatScalTable inTable2, float x3, ScalFunctionOf3Scal f)
          Applies a function to 3 arguments (2 tables and 1 float) and affects the result to this table (same dimension requested and checked)
 void set(FloatScalTable inTable1, FloatScalTable inTable2, FloatScalTable inTable3, float x4, ScalFunctionOf4Scal f)
          Applies a function to 4 arguments (3 tables and 1 float) and affects the result to this table (same dimension requested and checked)
 void set(FloatScalTable inTable1, FloatScalTable inTable2, FloatScalTable inTable3, FloatScalTable inTable4, float x5, ScalFunctionOf5Scal f)
          Applies a function to 5 arguments (4 tables and 1 float) and affects the result to this table (same dimension requested and checked)
 void set(FloatScalTable inTable1, FloatScalTable inTable2, ScalFunctionOf2Scal f)
          Applies a function to 2 tables and affects the result to this table (same dimension requested and checked)
 void set(FloatScalTable inTable, ScalFunctionOfScal f)
          Applies a function to a table affects the rusult to this table (same dimension requested and checked)
 void setDim(int dim)
          Sets logical dimension to dim and resizes the table if necessary to be large enough (does not preserve data (except if no resizing is needed))
 void setDimPreserve(int dim)
          Sets logical dimension to dim and resizes the table if necessary to be large enough, preserving the data
 void setEl(int n, float v)
           
 void setLengthPreserve(int length)
          Sets allocated array length at least to length, preserving the data (used to force a large resizing of table instead of numerous small resizings when the total needed space can be computed)
 void substract(float scalValue)
          Decrement this table by a scalar (on the spot)
 void substract(FloatScalTable table)
          Decrement this table by another table (on the spot)
 
Methods inherited from class spis.Util.Table.Table
checkSameDim, declareDim, getDim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

val

protected float[] val
table scalar values

Constructor Detail

FloatScalTable

public FloatScalTable()
Default constructor


FloatScalTable

public FloatScalTable(int dim)
Basic constructor: logical dimension dim


FloatScalTable

public FloatScalTable(float[] values)
Constructor with data


FloatScalTable

public FloatScalTable(float[] values,
                      int tableDimension)
Constructor with full data
Values must be at least of dimension [length] (checked)


FloatScalTable

public FloatScalTable(float x,
                      int tableDimension)
Constructor of a constant table with value x and dimension tableDimension


FloatScalTable

public FloatScalTable(FloatScalTable t)
Copy constructor (the new table is dimensioned to its useful size, it can be a way to reduce the dimension of a table to what is useful)

Method Detail

mult

public void mult(FloatScalTable table,
                 float factor)
Multiplies this table by another table and a scalar (on the spot)


mult

public void mult(FloatScalTable table)
Multiplies this table by another table (on the spot)


mult

public void mult(float factor)
Multiplies this table by a scalar (on the spot)


returnMult

public FloatScalTable returnMult(FloatScalTable table)
Multiplies this table by another table and returns the result as a new table


returnMult

public FloatScalTable returnMult(float factor)
Multiplies this table by a scalar and returns the result as a new table


returnMult

public FloatScalTable returnMult(FloatScalTable table,
                                 float factor)
Multiplies this table by another table and returns the result as a new table


divide

public void divide(FloatScalTable table)
Divides this table by another table (on the spot)


returnDivide

public FloatScalTable returnDivide(FloatScalTable table)
Divides this table by another table and returns the result as a new table


add

public void add(FloatScalTable t)
Increments the current table by the passed table. Both tables must be of same dimension (checked).


returnAdd

public FloatScalTable returnAdd(FloatScalTable t)
Adds the current table and the passed table and returns the sum as a new table.


substract

public void substract(FloatScalTable table)
Decrement this table by another table (on the spot)


substract

public void substract(float scalValue)
Decrement this table by a scalar (on the spot)


returnSubstract

public FloatScalTable returnSubstract(FloatScalTable t)
Substract the passed table from the current table and returns the result as a new table.


linComb

public void linComb(float a1,
                    FloatScalTable t,
                    float a2)
Performs the following linear comination on this table: this = a1 this + a2 t. Both tables must be of same dimension (checked).


returnLinComb

public FloatScalTable returnLinComb(float a1,
                                    FloatScalTable t,
                                    float a2)
Returns the following linear comination as a new table: a1 this + a2 t.


applyFunc

public void applyFunc(ScalFunctionOfScal f)
Applies a function to this table (on the spot)


equalFunc

public void equalFunc(ScalFunctionOfScal f,
                      FloatScalTable x)
Applies a function to the argument table and affects the result to this table.


computeTableL2Norm

public float computeTableL2Norm()
Returns the L2 norm of the Table: sqrt(sum values^2).


computeTableLInfNorm

public float computeTableLInfNorm()
Returns the L-infinity norm of the Table: max(abs(val[i]).


computeTableSum

public float computeTableSum()
Returns the sum of the Table values.


computeTableAverage

public float computeTableAverage()
Returns the average of the Table values.


computeTableQuadraticAverage

public float computeTableQuadraticAverage()
Returns the table quadratic average: sqrt((sum values^2) / numberOfValues).


concat

public void concat(FloatScalTable t)
concatenates this table with the passed table


concat

public void concat(float[] f,
                   int length)
concatenates this table with the first 'length' values of the passed array (f[0:length-1])


concat

public void concat(float[] f)
concatenates this table with the passed array


addData

public void addData(float x)
adds value x at the end of the table, of which size increase by one (data are preserved)


getValues

public float[] getValues()
Returns the table values


setDim

public void setDim(int dim)
Sets logical dimension to dim and resizes the table if necessary to be large enough (does not preserve data (except if no resizing is needed))

Specified by:
setDim in class Table

setDimPreserve

public void setDimPreserve(int dim)
Sets logical dimension to dim and resizes the table if necessary to be large enough, preserving the data

Specified by:
setDimPreserve in class Table

setLengthPreserve

public void setLengthPreserve(int length)
Sets allocated array length at least to length, preserving the data (used to force a large resizing of table instead of numerous small resizings when the total needed space can be computed)


reset

public void reset()
Sets this table to zero value (dimension unchanged)

Specified by:
reset in class Table

set

public void set(float value,
                int dim)

set

public void set(float value)
Sets table value (uniform)


set

public void set(FloatScalTable inTable)
Copies the values of the passed table onto this table (same dimension requested and checked)


set

public void set(FloatScalTable inTable,
                ScalFunctionOfScal f)
Applies a function to a table affects the rusult to this table (same dimension requested and checked)

Parameters:
inTable - the argument values
f - the function to apply on inTable values

set

public void set(FloatScalTable inTable1,
                FloatScalTable inTable2,
                ScalFunctionOf2Scal f)
Applies a function to 2 tables and affects the result to this table (same dimension requested and checked)

Parameters:
inTable1 - the 1st argument values
inTable2 - the 2nd argument values
f - the function to apply on inTable values

set

public void set(FloatScalTable inTable1,
                FloatScalTable inTable2,
                FloatScalTable inTable3,
                FloatScalTable inTable4,
                float x5,
                ScalFunctionOf5Scal f)
Applies a function to 5 arguments (4 tables and 1 float) and affects the result to this table (same dimension requested and checked)

Parameters:
inTable1 - the 1st argument values
inTable2 - the 2nd argument values
inTable3 - the 3rd argument values
inTable4 - the 4th argument values
x5 - the (constant) last argument
f - the function to apply on inTable values

set

public void set(FloatScalTable inTable1,
                FloatScalTable inTable2,
                FloatScalTable inTable3,
                float x4,
                ScalFunctionOf4Scal f)
Applies a function to 4 arguments (3 tables and 1 float) and affects the result to this table (same dimension requested and checked)

Parameters:
inTable1 - the 1st argument values
inTable2 - the 2nd argument values
inTable3 - the 3rd argument values
x4 - the (constant) last argument
f - the function to apply on inTable values

set

public void set(FloatScalTable inTable1,
                FloatScalTable inTable2,
                float x3,
                ScalFunctionOf3Scal f)
Applies a function to 3 arguments (2 tables and 1 float) and affects the result to this table (same dimension requested and checked)

Parameters:
inTable1 - the 1st argument values
inTable2 - the 2nd argument values
x3 - the (constant) last argument
f - the function to apply on inTable values

setEl

public void setEl(int n,
                  float v)

getEl

public float getEl(int n)

print

public void print()

randomize

public void randomize(float max)
Fills the table with random numbers between 0 and max